WO2022111596A1 - Data stream measurement method and apparatus - Google Patents

Data stream measurement method and apparatus Download PDF

Info

Publication number
WO2022111596A1
WO2022111596A1 PCT/CN2021/133234 CN2021133234W WO2022111596A1 WO 2022111596 A1 WO2022111596 A1 WO 2022111596A1 CN 2021133234 W CN2021133234 W CN 2021133234W WO 2022111596 A1 WO2022111596 A1 WO 2022111596A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
stream
flow
measurement value
storage space
Prior art date
Application number
PCT/CN2021/133234
Other languages
French (fr)
Chinese (zh)
Inventor
许延伟
黄群
章瑞
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022111596A1 publication Critical patent/WO2022111596A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • H04L43/062Generation of reports related to network traffic

Abstract

Disclosed in an embodiment of the present application are a data stream measurement method and apparatus, which belong to the technical field of communication. The method is applicable to network devices, and comprises: receiving a target data packet, and for each data row of a target data table, on the basis of a first feature value calculation function and a stream identifier that corresponds to the target data packet, determining a corresponding data storage space in the data rows for a target data stream to which the target data packet belongs; if the target data stream is a first data stream that corresponds to the data storage space, then on the basis of a measurement value of the target data packet, determining the measurement value of the target data stream, and recording same in the data storage space; and if the target data stream is not the first data stream that corresponds to the data storage space, then on the basis of the measurement value of the target data packet, recording the measurement value of the target data stream in the target data table. By using the present application, errors in the measurement value of a data stream can be relatively small.

Description

数据流测量的方法和装置Method and apparatus for data flow measurement
本申请要求于2020年11月30日提交的申请号为202011383567.3、发明名称为“数据流测量的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application No. 202011383567.3 filed on November 30, 2020 and entitled "Method and Device for Data Flow Measurement", the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及通信技术领域,特别涉及一种数据流测量的方法和装置。The present application relates to the field of communication technologies, and in particular, to a method and apparatus for data flow measurement.
背景技术Background technique
在通信领域中,数据流测量对于分析通信链路质量以及制定各种通信策略有着至关重要的作用。其中,数据流测量可以包括数据流的数据包数量测量、数据流的字节数测量等等。In the field of communication, data flow measurement plays a crucial role in analyzing the quality of communication links and formulating various communication strategies. The data flow measurement may include measurement of the number of packets of the data flow, measurement of the number of bytes of the data flow, and the like.
目前,sketch算法被广泛应用到流量测量中。具体的,设置一个m行n列的sketch数据表,sketch数据表中的每格对应一个桶,sketch数据表的每个数据行对应有一个哈希函数,且每个数据行对应的哈希函数不同。当接收到一个数据包时,对于sketch数据表的每个数据行,使用该数据行对应的哈希函数该数据包对应的流标识进行哈希计算,得到的哈希结果,将该目标数据包的测量值累加到该哈希结果在该数据行对应的桶中。这样,在sketch数据表的每个桶中记录的数据流的测量值是对应具有相同哈希结果的流标识的测量值之和。在查询指定流标识对应的测量值时,用每个数据行对应的哈希函数对该指定流标识分别进行哈希计算,可以确定出m个记录有该指定流标识对应的测量值的桶。然后,取这m个桶中记录的最小测量值作为该指定流标识对应的测量值。At present, the sketch algorithm is widely used in traffic measurement. Specifically, a sketch data table with m rows and n columns is set up, each grid in the sketch data table corresponds to a bucket, each data row in the sketch data table corresponds to a hash function, and each data row corresponds to a hash function different. When a data packet is received, for each data row of the sketch data table, use the hash function corresponding to the data row to perform hash calculation with the flow identifier corresponding to the data packet, and the obtained hash result is used for the target data packet. The measurements of are accumulated into the bucket corresponding to the hash result in the row of data. In this way, the measurement value of the data flow recorded in each bucket of the sketch data table is the sum of the measurement values corresponding to the flow IDs with the same hash result. When querying the measurement value corresponding to the specified flow ID, the specified flow ID is hashed with the hash function corresponding to each data row, and m buckets that record the measurement value corresponding to the specified flow ID can be determined. Then, the minimum measurement value recorded in the m buckets is taken as the measurement value corresponding to the specified flow identifier.
然而,通过sketch数据表得到的任一数据流的测量值的误差与该sketch数据表记录的所有数据流的测量值总和有关,记录的所有数据流的测量值总和越大,每个数据流的测量值误差也就越大。However, the error of the measured value of any data stream obtained through the sketch data table is related to the sum of the measured values of all data streams recorded in the sketch data table. The greater the error in the measurement value.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种数据流测量的方法和装置,可以解决相关技术中数据流测量值误差大的问题,技术方案如下:The embodiment of the present application provides a method and device for measuring data flow, which can solve the problem of large error in the measurement value of data flow in the related art. The technical solution is as follows:
第一方面,提供了一种数据流测量的方法,该方法应用于网络设备,方法包括:In a first aspect, a data flow measurement method is provided, the method is applied to a network device, and the method includes:
接收目标数据包,对于目标数据表的每个数据行,基于该数据行对应的第一特征值计算函数和该目标数据包对应的流标识,确定该目标数据包所属的目标数据流在该数据行中对应的数据存储空间。如果目标数据流是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,确定目标数据流的测量值,记录在该数据存储空间中。如果目标数据流不是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,在目标数据表中,记录该目标数据流的测量值。Receiving the target data packet, for each data row of the target data table, based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet, determine that the target data stream to which the target data packet belongs is in the data The corresponding data storage space in the row. If the target data stream is the first data stream corresponding to the data storage space, the measurement value of the target data stream is determined based on the measurement value of the target data packet and recorded in the data storage space. If the target data stream is not the first data stream corresponding to the data storage space, the measurement value of the target data stream is recorded in the target data table based on the measurement value of the target data packet.
在本申请实施例所示的方案中,流标识可以根据实际需求设置,用于唯一标识一个数据流,例如,流标识可以为数据流的数据包中携带的源地址和目的地址,又例如,流标识还可 以为数据流的数据包中携带的五元组信息。一个数据流包括多个数据包,数据流的测量值即为该数据流包括的所有数据包的测量值的之和。具体的,测量值可以为数据流包括的数据包数量,还可以为数据流包括的数据包的总字节数等等。上述第一数据流还可以称为大流,大流是相对于一个数据存储空间来说的。In the solution shown in the embodiment of the present application, the flow identifier can be set according to actual requirements and used to uniquely identify a data stream. For example, the flow identifier can be the source address and destination address carried in the data packet of the data stream, and for example, The flow identifier may also be quintuple information carried in the data packet of the data flow. A data stream includes multiple data packets, and the measurement value of the data stream is the sum of the measurement values of all the data packets included in the data stream. Specifically, the measurement value may be the number of data packets included in the data stream, and may also be the total number of bytes of the data packets included in the data stream, and so on. The above-mentioned first data stream may also be referred to as a large stream, and a large stream is relative to a data storage space.
目标数据表用于记录数据流的流标识、数据流的测量值等数据。例如,该目标数据表可以为sketch数据表。该目标数据表的每个数据行可以对应一个第一特征值计算函数,不同数据行对应不同的第一特征值函数。其中,第一特征值计算函数可以为一种哈希函数。对于每个数据行来说,该数据行对应的第一特征值计算函数可以有m种计算结果,m为该目标数据表的列数,也即是,每个数据行对应的数据存储空间的个数。m种计算结果中的每种计算结果对应该数据行的一个数据存储空间,也即是,m种计算结果与m个数据存储空间一一对应。其中,数据存储空间也可以称为桶,在目标数据表为sketch数据表的情况下,目标数据表对应的数据存储空间可以称为sketch桶。The target data table is used to record data such as the flow identifier of the data flow, the measurement value of the data flow, and the like. For example, the target data table may be a sketch data table. Each data row of the target data table may correspond to a first eigenvalue calculation function, and different data rows correspond to different first eigenvalue functions. Wherein, the first feature value calculation function may be a hash function. For each data row, the first eigenvalue calculation function corresponding to the data row can have m types of calculation results, where m is the number of columns of the target data table, that is, the data storage space corresponding to each data row number. Each of the m types of calculation results corresponds to one data storage space of the data row, that is, the m types of calculation results correspond to the m data storage spaces one-to-one. The data storage space may also be called a bucket, and in the case that the target data table is a sketch data table, the data storage space corresponding to the target data table may be called a sketch bucket.
通过本申请实施例所示的方案,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。并且由于对大流的测量值单独记录,使得目标数据表中可以仅记录大流以外的数据流的测量值,这样,因为记录的数据流的数量减少,使得在恢复这些数据流的测量值时,得到的测量值的准确度也相对较高。Through the solution shown in the embodiment of the present application, after receiving a data packet, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, which can make the large flow The measurements are relatively accurate. And since the measured values of the large flow are recorded separately, only the measured values of the data flow other than the large flow can be recorded in the target data table. In this way, because the number of recorded data flows is reduced, when restoring the measured values of these data flows , the accuracy of the obtained measurements is also relatively high.
第二方面,提供了一种数据流测量的方法,所述方法用于网络设备,所述方法包括:In a second aspect, a data flow measurement method is provided, the method is used in a network device, and the method includes:
接收目标数据包,对于目标数据表的每个数据行,基于该数据行对应的第一特征值计算函数和目标数据包对应的流标识,确定目标数据包所属的目标数据流在该数据行对应的数据存储空间。基于目标数据包对应的测量值,在该数据存储空间中,记录目标数据流的测量值。如果目标数据流是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,确定目标数据流的测量值,记录在该数据存储空间中。Receiving the target data packet, for each data row of the target data table, based on the first eigenvalue calculation function corresponding to the data row and the flow identifier corresponding to the target data packet, determine that the target data stream to which the target data packet belongs is corresponding to the data row data storage space. Based on the measurement value corresponding to the target data packet, the measurement value of the target data stream is recorded in the data storage space. If the target data stream is the first data stream corresponding to the data storage space, the measurement value of the target data stream is determined based on the measurement value of the target data packet and recorded in the data storage space.
结合第一方面或第二方面,在一种可能的实现方式中,如果目标数据流是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,确定目标数据流的测量值,记录在数据存储空间中,包括:With reference to the first aspect or the second aspect, in a possible implementation manner, if the target data stream is the first data stream corresponding to the data storage space, then the measurement value of the target data stream is determined based on the measurement value of the target data packet , recorded in the data storage space, including:
如果该数据存储空间中未记录有第一数据流的流标识和测量值,则确定目标数据流为该数据存储空间对应的第一数据流,将目标数据包的测量值作为目标数据流的测量值,将目标数据流的流标识作为该数据存储空间对应的第一数据流的流标识,将目标数据的流标识和测量值对应记录在该数据存储空间中。If the flow identifier and measurement value of the first data flow are not recorded in the data storage space, then determine that the target data flow is the first data flow corresponding to the data storage space, and use the measurement value of the target data packet as the measurement of the target data flow value, take the stream identifier of the target data stream as the stream identifier of the first data stream corresponding to the data storage space, and record the stream identifier of the target data and the measurement value in the data storage space correspondingly.
如果该数据存储空间中记录有第一数据流的流标识和测量值,且目标数据流的流标识与该数据存储空间中记录的第一数据流的流标识相同,则将目标数据包的测量值累加到数据存储空间中记录的第一数据流的测量值上。If the flow ID and measurement value of the first data flow are recorded in the data storage space, and the flow ID of the target data flow is the same as the flow ID of the first data flow recorded in the data storage space, the measurement value of the target data packet is The value is accumulated to the measured value of the first data stream recorded in the data storage space.
如果数据存储空间中记录有第一数据流的流标识和测量值,且目标数据流的流标识与该数据存储空间中记录的第一数据流的流标识不同,则确定该数据存储空间中是否记录有比较测量值,如果未记录有比较测量值,则将目标数据包的测量值作为该数据存储空间对应的比较测量值记录在该数据存储空间中,如果记录有比较测量值,则将目标数据包的测量值累加在所述数据存储空间中记录的比较测量值上。If the stream identifier and measurement value of the first data stream are recorded in the data storage space, and the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the data storage space, determine whether the data storage space has The comparison measurement value is recorded. If there is no comparison measurement value recorded, the measurement value of the target packet is recorded in the data storage space as the comparison measurement value corresponding to the data storage space. If the comparison measurement value is recorded, the target The measurements of the data packets are accumulated on the comparison measurements recorded in the data storage space.
如果该数据存储空间中记录的累加后的比较测量值大于数据存储空间中记录的第一数据流的测量值,则确定目标数据流为该数据存储空间对应的第一数据流,将该数据存储空间中记录的第一数据流的流标识更新为目标数据流的流标识,将该数据存储空间中记录的第一数据流的测量值更新为目标数据包的测量值,将该数据存储空间中记录的比较测量值更新为0。If the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, the target data stream is determined to be the first data stream corresponding to the data storage space, and the data storage The flow identification of the first data flow recorded in the space is updated to the flow identification of the target data flow, the measured value of the first data flow recorded in the data storage space is updated to the measured value of the target data packet, and the measured value of the first data flow recorded in the data storage space is updated. The recorded comparison measurement is updated to 0.
在本申请实施例所示的方案中,对于目标数据表的一个数据存储空间来说,进入该数据存储空间进行记录的第一个数据流A,可以认为是该数据存储空间的大流。In the solution shown in the embodiment of the present application, for a data storage space of the target data table, the first data stream A that enters the data storage space for recording can be considered as a large stream of the data storage space.
当第二个数据流B进入该数据存储空间后,如果该数据流B的测量值大于该数据流A的测量值,则将该数据存储空间的大流替换为数据流B,接下来,当第三个数据流C进入该数据存储空间后,比较数据流C和数据流出B的测量值,确定是否对大流进行替换。After the second data stream B enters the data storage space, if the measurement value of the data stream B is greater than the measurement value of the data stream A, then replace the large stream of the data storage space with the data stream B. Next, when After the third data stream C enters the data storage space, compare the measured values of the data stream C and the data stream B to determine whether to replace the large stream.
如果该数据流B的测量值不大于该数据流A的测量值,则认为数据流A仍为该数据存储空间的大流,接下来,在第三个数据流C进入该数据存储空间后,将数据流A的测量值和数据流B与数据流C的测量值之和进行比较,如果测量值之和大于数据流A的测量值,则将该数据存储空间的大流替换为数据流C,如果测量值之和不大于数据流A的测量值,则认为数据流A仍为该数据存储空间的大流。If the measurement value of the data stream B is not greater than the measurement value of the data stream A, it is considered that the data stream A is still the large stream of the data storage space. Next, after the third data stream C enters the data storage space, Compare the measurement value of data stream A and the sum of the measurement values of data stream B and data stream C, if the sum of the measurement values is greater than the measurement value of data stream A, replace the large stream of the data storage space with data stream C , if the sum of the measured values is not greater than the measured value of data stream A, it is considered that data stream A is still a large stream in the data storage space.
也即是,对于一个数据存储空间来说,其大流是可以替换更新的。That is, for a data storage space, its large stream can be replaced and updated.
结合第一方面,在一种可能的实现方式中,如果该数据存储空间中记录有第一数据流的流标识和测量值,且目标数据流的流标识与该数据存储空间中记录的第一数据流的流标识不同,方法还包括:In combination with the first aspect, in a possible implementation, if the flow identifier and measurement value of the first data stream are recorded in the data storage space, and the flow identifier of the target data stream is the same as the first data stream recorded in the data storage space. The flow identification of the data flow is different, and the method also includes:
如果该数据存储空间中记录的累加后的比较测量值小于数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流不是数据存储空间对应的第一数据流,基于目标数据包的测量值,在目标数据表中,记录目标数据流的测量值。If the accumulated comparative measurement value recorded in the data storage space is smaller than the measurement value of the first data stream recorded in the data storage space, it is determined that the target data stream is not the first data stream corresponding to the data storage space, based on the target data The measurement value of the packet, in the target data table, records the measurement value of the target data stream.
在本申请实施例所示的方案中,对于大流是将测量值和流标识对应记录的,如果判断目标数据流不是大流,则在目标数据表中采用其他方式进行记录。这样,可以在后续恢复非大流的测量值时,不受大流的测量值影响,使得最后得到的非大流的统计测量值更加准确。In the solution shown in the embodiment of the present application, for a large flow, the measured value and the flow identifier are recorded correspondingly. If it is determined that the target data flow is not a large flow, other methods are used to record in the target data table. In this way, when the measurement value of the non-large flow is subsequently restored, it is not affected by the measurement value of the large flow, so that the finally obtained statistical measurement value of the non-large flow is more accurate.
结合第一方面或第二方面,在一种可能的实现方式中,如果该数据存储空间中记录的累加后的比较测量值大于该数据存储空间中记录的第一数据流的测量值,则向控制器发送该数据存储空间的存储空间标识、该数据存储空间中记录的第一数据流的流标识和第一数据流的测量值。With reference to the first aspect or the second aspect, in a possible implementation manner, if the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, then The controller sends the storage space identifier of the data storage space, the flow identifier of the first data stream recorded in the data storage space, and the measurement value of the first data stream.
如果该数据存储空间中记录的累加后的比较测量值小于该数据存储空间中记录的第一数据流的测量值,则将目标数据包对应的流标识作为第二数据流的流标识发送至控制器。第二数据流也可以称为非大流。If the accumulated comparative measurement value recorded in the data storage space is smaller than the measurement value of the first data stream recorded in the data storage space, the flow identifier corresponding to the target data packet is sent to the controller as the flow identifier of the second data stream device. The second data stream may also be referred to as a non-large stream.
此外,每经过预设时长,向控制器发送本地存储的目标数据表,对本地存储的目标数据表初始化。In addition, every preset time period, the locally stored target data table is sent to the controller, and the locally stored target data table is initialized.
在本申请实施例中所示的方案中,对于一个数据存储空间来说,当大流被替换后,将被替换的大流的流标识和测量值上传控制器,以便后续控制器计算该大流总计的测量值。此外,在判断目标数据流为非大流时,将该目标数据流的流标识上传至控制器,以便后续控制器可以知道哪个数据流需要在目标数据表通过优化算法计算。In the solution shown in the embodiment of the present application, for a data storage space, after the large flow is replaced, the flow identifier and measurement value of the replaced large flow are uploaded to the controller, so that the subsequent controller can calculate the large flow. A measure of the flow total. In addition, when it is determined that the target data stream is not a large stream, the stream identifier of the target data stream is uploaded to the controller, so that the subsequent controller can know which data stream needs to be calculated by the optimization algorithm in the target data table.
将以上数据上报到控制器后,可以由控制器实现数据流的测量值的恢复,可以有效节省 网络设备的处理资源。并且在上报后,网络设备本地的相关数据可以删除,节省了存储资源。After the above data is reported to the controller, the controller can restore the measured value of the data flow, which can effectively save the processing resources of the network equipment. And after the report, the local related data of the network device can be deleted, saving storage resources.
结合第一方面或第二方面,在一种可能的实现方式中,将目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器之前,方法还包括:确定未向控制器发送目标数据包对应的流标识,记录目标数据包对应的流标识。With reference to the first aspect or the second aspect, in a possible implementation manner, before sending the flow ID corresponding to the target data packet as the flow ID of the second data flow to the controller, the method further includes: determining that the flow ID corresponding to the target data packet is not sent to the controller The controller sends the flow ID corresponding to the target data packet, and records the flow ID corresponding to the target data packet.
在本申请实施例中所示的方案中,为了避免对非大流的流标识重复记录或者重复发送,可以在确定目标数据流不是大流时,先判断该目标数据流的流标识是否已经上传至控制器。如果已经上传,则不再重复上传。In the solution shown in the embodiment of the present application, in order to avoid repeated recording or repeated transmission of the stream identifiers of non-large streams, when it is determined that the target data stream is not a large stream, it is possible to first determine whether the stream identifier of the target data stream has been uploaded. to the controller. If it has already been uploaded, it will not be repeated.
结合第一方面或第二方面,在一种可能的实现方式中,确定未向控制器发送所述目标数据包对应的流标识,记录目标数据包对应的流标识,包括:In combination with the first aspect or the second aspect, in a possible implementation manner, it is determined that the flow identifier corresponding to the target data packet is not sent to the controller, and the flow identifier corresponding to the target data packet is recorded, including:
确定本地存储的布隆过滤器中未记录所述目标数据包对应的流标识,将所述目标数据包对应的流标识记录在所述布隆过滤器中。It is determined that the flow identifier corresponding to the target data packet is not recorded in the locally stored Bloom filter, and the flow identifier corresponding to the target data packet is recorded in the Bloom filter.
在本申请实施例所示的方案中,为了在记录非大流的流标识的同时,还尽可能的节省存储资源,可以不直接对非大流的流标识进行记录,而是采用布隆过滤器(Bloom Filter)实现对非大流的测量值的记录。具体的,可以设置Bloom Filter,在对非大流的流标识进行记录或者发送之前,可以先确定Bloom Filter中是否记录有该流标识,如果未记录有该流标识,再将该流标识进行记录或者发送。在对非大流的流标识进行记录或者发送之后,可以将该流标识记录在Bloom Filter中。In the solution shown in the embodiment of the present application, in order to save storage resources as much as possible while recording the flow identifiers of non-large flows, the flow identifiers of non-large flows may not be recorded directly, but Bloom filtering may be used. The Bloom Filter implements the recording of non-large flow measurements. Specifically, a Bloom Filter can be set, and before recording or sending a non-large stream stream identifier, you can first determine whether the stream identifier is recorded in the Bloom Filter, and if the stream identifier is not recorded, then record the stream identifier. or send. After recording or sending the stream identifier of the non-large stream, the stream identifier can be recorded in the Bloom Filter.
此外,可以对于目标数据表中的每个数据存储空间设置一个Bloom Filter,也可以对于一个目标数据表设置一个Bloom Filter。在每个数据存储空间设置一个Bloom Filter的情况下,Bloom Filter可以存储在相应的数据存储空间中,在对非大流的流标识进行记录或者发送之前,可以先确定非大流的流标识对应的数据存储空间中存储的Bloom Filter中是否记录有该流标识,在对非大流的流标识进行记录或者发送之后,可以将该流标识记录在对应的数据存储空间中存储的Bloom Filter中。In addition, a Bloom Filter can be set for each data storage space in the target data table, or a Bloom Filter can be set for a target data table. In the case where a Bloom Filter is set in each data storage space, the Bloom Filter can be stored in the corresponding data storage space. Before recording or sending the flow ID of the non-large flow, the corresponding flow ID of the non-large flow can be determined first. Whether the stream identifier is recorded in the Bloom Filter stored in the data storage space of the data storage space, after recording or sending the stream identifier of the non-large stream, the stream identifier can be recorded in the Bloom Filter stored in the corresponding data storage space.
结合第一方面,在一种可能的实现方式中,基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值,包括:With reference to the first aspect, in a possible implementation manner, based on the measurement value of the target data packet, in the target data table, recording the measurement value of the target data stream, including:
基于数据行对应的第二特征值计算函数和目标数据包的流标识,确定目标数据流对应的累加系数,将目标数据包的测量值乘以累加系数,得到目标数据包的调整测量值,将目标数据包的调整测量值累加到数据存储空间中记录的第二数据流的测量值上。Based on the second eigenvalue calculation function corresponding to the data row and the flow identifier of the target data packet, the accumulation coefficient corresponding to the target data flow is determined, and the measurement value of the target data packet is multiplied by the accumulation coefficient to obtain the adjusted measurement value of the target data packet. The adjusted measurement value of the target data packet is accumulated to the measurement value of the second data stream recorded in the data storage space.
在本申请实施例所示的方案中,第二数据流可以称为非大流。对于目标数据表的每个数据行,除对应一个第一特征值计算函数以外,还可以对应一个第二特征值计算函数。其中,该第二特征值计算函数也可以为一种哈希函数,每个数据行对应的第二特征值计算函数不同。In the solutions shown in the embodiments of the present application, the second data stream may be referred to as a non-large stream. For each data row of the target data table, in addition to corresponding to a first eigenvalue calculation function, it may also correspond to a second eigenvalue calculation function. The second feature value calculation function may also be a hash function, and the second feature value calculation function corresponding to each data row is different.
对于上述确定出的目标数据流对应的每个数据存储空间,在基于目标数据包的测量值,记录目标数据流的测量值时,可以将目标数据包对应的待计算数值输入到该数据存储空间所在的数据行对应的第二特征值计算函数中,得到该流标识对应的累加系数。其中,累加系数可以为小数。然后,将目标数据包的测量值乘以该累加系数,得到目标数据包的调整测量值。最后,将目标数据包的调整测量值累加到该数据存储空间中记录的非大流的测量值上。For each data storage space corresponding to the target data stream determined above, when recording the measurement value of the target data stream based on the measurement value of the target data packet, the value to be calculated corresponding to the target data packet can be input into the data storage space In the second eigenvalue calculation function corresponding to the data row, the accumulation coefficient corresponding to the stream identifier is obtained. Among them, the accumulation coefficient can be a decimal. Then, the measured value of the target data packet is multiplied by the accumulation coefficient to obtain the adjusted measured value of the target data packet. Finally, the adjusted measurement of the target packet is accumulated to the measurement of the non-large flow recorded in the data storage space.
可见,本申请在目标数据表中记录非大流的测量值时是乘以对应累加系数后再记录的,这样,在后续采用解优化问题恢复数据流的测量值时,可以使构建的方程组中有这些累加系 数的约束,使得方程组解的数量相对较少,相应的,最后得到的解(各非大流的统计测量值)的误差也相对较小。It can be seen that in the present application, when recording the measured value of non-large flow in the target data table, it is multiplied by the corresponding accumulation coefficient and then recorded. In this way, when the measured value of the data flow is recovered by using the solution optimization problem subsequently, the constructed equation system can be made. Constrained by these cumulative coefficients, the number of solutions of the equations is relatively small, and accordingly, the error of the final solution (statistical measurement value of each non-large flow) is relatively small.
结合第二方面,在一种可能的实现方式中,基于所述目标数据包对应的测量值,在上述数据存储空间中,记录所述目标数据流的测量值,包括:With reference to the second aspect, in a possible implementation manner, based on the measurement value corresponding to the target data packet, in the data storage space, recording the measurement value of the target data stream, including:
基于所述数据行对应的第二特征值计算函数和所述目标数据包的流标识,确定所述目标数据流对应的累加系数,将所述目标数据包的测量值乘以所述累加系数,得到所述目标数据包的调整测量值,将所述目标数据包的调整测量值累加到所述数据存储空间中记录的数据流的测量值上。Based on the second eigenvalue calculation function corresponding to the data row and the flow identifier of the target data packet, an accumulation coefficient corresponding to the target data flow is determined, and the measurement value of the target data packet is multiplied by the accumulation coefficient, The adjusted measurement value of the target data packet is obtained, and the adjusted measurement value of the target data packet is accumulated to the measurement value of the data flow recorded in the data storage space.
第三方面,提供了一种数据流测量的方法,应用于网络设备,所述方法包括:In a third aspect, a data flow measurement method is provided, applied to a network device, and the method includes:
接收目标数据包,基于第三特征值计算函数和所述目标数据包对应的流标识,在对应第一数据表中确定所述目标数据包所属的目标数据流对应的第一数据存储空间。如果所述目标数据流是所述第一数据存储空间对应的大流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述第一数据存储空间中。如果所述目标数据流不是所述第一数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。Receive the target data packet, and determine the first data storage space corresponding to the target data flow to which the target data packet belongs in the corresponding first data table based on the third feature value calculation function and the flow identifier corresponding to the target data packet. If the target data stream is a large stream corresponding to the first data storage space, determine the measurement value of the target data stream based on the measurement value of the target data packet, and record it in the first data storage space . If the target data stream is not the first data stream corresponding to the first data storage space, the measurement value of the target data stream is recorded in the target data table based on the measurement value of the target data packet.
在一种可能的实现方式中,如果所述目标数据流是所述第一数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述第一数据存储空间中,包括:In a possible implementation manner, if the target data stream is the first data stream corresponding to the first data storage space, the measurement value of the target data stream is determined based on the measurement value of the target data packet , recorded in the first data storage space, including:
如果所述第一数据存储空间为空,则确定所述目标数据流为所述第一数据存储空间对应的第一数据流,将所述目标数据包的测量值作为所述目标数据流的测量值,将所述目标数据流的流标识作为所述第一数据存储空间对应的第一数据流的流标识,将所述目标数据的流标识和测量值对应记录在所述第一数据存储空间中。If the first data storage space is empty, determine that the target data flow is the first data flow corresponding to the first data storage space, and use the measurement value of the target data packet as the measurement of the target data flow value, take the stream identifier of the target data stream as the stream identifier of the first data stream corresponding to the first data storage space, and record the stream identifier and measurement value of the target data correspondingly in the first data storage space middle.
如果所述第一数据存储空间不为空且所述目标数据流的流标识与所述第一数据存储空间中记录的第一数据流的流标识相同,则将所述目标数据包的测量值累加到所述第一数据存储空间中记录的第一数据流的测量值上。If the first data storage space is not empty and the flow ID of the target data flow is the same as the flow ID of the first data flow recorded in the first data storage space, the measurement value of the target data packet is Accumulated to the measured value of the first data stream recorded in the first data storage space.
如果所述第一数据存储空间不为空且所述目标数据流的流标识与所述第一数据存储空间中记录的第一数据流的流标识不同,则确定所述第一数据存储空间中是否记录有比较测量值,如果未记录有比较测量值,则将所述目标数据包的测量值作为所述第一数据存储空间对应的比较测量值记录在所述第一数据存储空间中,如果记录有比较测量值,则将所述目标数据包的测量值累加在所述第一数据存储空间中记录的比较测量值上。If the first data storage space is not empty and the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the first data storage space, it is determined that the first data storage space is in the first data storage space. Whether a comparison measurement value is recorded, if no comparison measurement value is recorded, the measurement value of the target data packet is recorded in the first data storage space as the comparison measurement value corresponding to the first data storage space, if If the comparison measurement value is recorded, the measurement value of the target data packet is accumulated on the comparison measurement value recorded in the first data storage space.
如果所述第一数据存储空间中记录的累加后的比较测量值大于所述第一数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流为所述第一数据存储空间对应的第一数据流,将所述第一数据存储空间中记录的第一数据流的流标识更新为所述目标数据流的流标识,将所述第一数据存储空间中记录的第一数据流的测量值更新为所述目标数据包的测量值,将所述第一数据存储空间中记录的比较测量值更新为0。If the accumulated comparative measurement value recorded in the first data storage space is greater than the measurement value of the first data stream recorded in the first data storage space, the target data stream is determined to be the first data storage space For the first data stream corresponding to the space, update the stream identifier of the first data stream recorded in the first data storage space to the stream identifier of the target data stream, and update the first data stream recorded in the first data storage space with the stream identifier of the target data stream. The measurement value of the data stream is updated to the measurement value of the target data packet, and the comparison measurement value recorded in the first data storage space is updated to 0.
在一种可能的实现方式中,如果所述第一数据存储空间不为空且所述目标数据流的流标识与所述第一数据存储空间中记录的第一数据流的流标识不同,所述方法还包括:In a possible implementation manner, if the first data storage space is not empty and the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the first data storage space, the The method also includes:
如果所述第一数据存储空间中记录的累加后的比较测量值小于所述第一数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流不是所述第一数据存储空间对应的第一数据流,基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。If the accumulated comparative measurement value recorded in the first data storage space is smaller than the measurement value of the first data stream recorded in the first data storage space, it is determined that the target data stream is not the first data storage space The first data stream corresponding to the space records the measurement value of the target data stream in the target data table based on the measurement value of the target data packet.
在一种可能的实现方式中,基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值,包括:In a possible implementation manner, based on the measurement value of the target data packet, in the target data table, recording the measurement value of the target data stream, including:
对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行中对应的第二数据存储空间,基于所述数据行对应的第二特征值计算函数和所述目标数据包的流标识,确定所述目标数据流对应的累加系数,将所述目标数据包的测量值乘以所述累加系数,得到所述目标数据包的调整测量值,将所述目标数据包的调整测量值累加到所述第二数据存储空间中记录的第二数据流的测量值上。For each data row of the target data table, based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet, determine that the target data flow to which the target data packet belongs is in the data row In the second data storage space corresponding to the data row, based on the second feature value calculation function corresponding to the data row and the flow identifier of the target data packet, determine the accumulation coefficient corresponding to the target data flow, and calculate the value of the target data packet. The measured value is multiplied by the accumulation coefficient to obtain the adjusted measured value of the target data packet, and the adjusted measured value of the target data packet is accumulated to the measured value of the second data stream recorded in the second data storage space .
在一种可能的实现方式中,如果所述第一数据存储空间中记录的累加后的比较测量值大于所述第一数据存储空间中记录的第一数据流的测量值,所述方法还包括:In a possible implementation manner, if the accumulated comparative measurement value recorded in the first data storage space is greater than the measurement value of the first data stream recorded in the first data storage space, the method further includes :
向控制器发送所述第一数据存储空间中对应记录的第一数据流的流标识和第一数据流的测量值;sending the stream identifier of the first data stream and the measured value of the first data stream correspondingly recorded in the first data storage space to the controller;
如果所述第一数据存储空间中记录的累加后的比较测量值小于所述第一数据存储空间中记录的第一数据流的测量值,方法还包括:If the accumulated comparative measurement value recorded in the first data storage space is smaller than the measurement value of the first data stream recorded in the first data storage space, the method further includes:
将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器;sending the flow identification corresponding to the target data packet to the controller as the flow identification of the second data flow;
方法还包括:Methods also include:
每经过预设时长,向所述控制器发送本地存储的第一数据表和目标数据表,对本地存储的第一数据表和目标数据表初始化。Every preset time period, the locally stored first data table and the target data table are sent to the controller, and the locally stored first data table and the target data table are initialized.
在一种可能的实现方式中,将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器之前,方法还包括:In a possible implementation manner, before sending the flow identifier corresponding to the target data packet as the flow identifier of the second data stream to the controller, the method further includes:
确定未向所述控制器发送所述目标数据包对应的流标识,记录所述目标数据包对应的流标识。It is determined that the flow identifier corresponding to the target data packet is not sent to the controller, and the flow identifier corresponding to the target data packet is recorded.
在一种可能的实现方式中,确定未向所述控制器发送所述目标数据包对应的流标识,记录所述目标数据包对应的流标识,包括:In a possible implementation manner, it is determined that the flow identifier corresponding to the target data packet is not sent to the controller, and the flow identifier corresponding to the target data packet is recorded, including:
确定本地存储的布隆过滤器中未记录所述目标数据包对应的流标识,将所述目标数据包对应的流标识记录在所述布隆过滤器中。It is determined that the flow identifier corresponding to the target data packet is not recorded in the locally stored Bloom filter, and the flow identifier corresponding to the target data packet is recorded in the Bloom filter.
第四方面,提供了一种数据流测量的方法,所述方法应用于控制器,所述方法包括:In a fourth aspect, a data flow measurement method is provided, the method is applied to a controller, and the method includes:
接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表。在目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值。在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值。在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值。在所述 目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第三测量值进行累加,得到每个第一数据流的流标识对应的统计测量值。基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值。Receive the flow identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device. In the measurement values of the first data stream recorded in the target data table, the measurement values of the first data streams corresponding to the same flow identifier are filtered to obtain the first measurement value of each first data stream recorded in the target data table . In the received measured values of the first data stream, the measured values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain a second received stream identifier corresponding to each first data stream. Measurements. In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value of the first data stream corresponding to the same flow identifier is screened to obtain the received value of each first data stream. The flow identifies the corresponding third measurement value. In the first measurement value of each first data stream recorded in the target data table and the third measurement value corresponding to the received stream identifier of each first data stream, the first measurement value corresponding to the same stream identifier is Accumulate with the third measurement value to obtain the statistical measurement value corresponding to the stream identifier of each first data stream. Based on the received flow identification of the second data flow and the target data table, a statistical measurement value corresponding to the flow identification of each second data flow is determined.
在一种可能的实现方式中,在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值,包括:In a possible implementation manner, among the measured values of the first data stream recorded in the target data table, the measured values of the first data stream corresponding to the same flow identifier are screened to obtain the measured values of the first data stream recorded in the target data table. First measurements for each first data stream, including:
在目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的最大测量值,作为所述对应相同流标识的第一数据流的第一测量值。Among the measured values of the first data stream recorded in the target data table, the maximum measured value of the first data stream corresponding to the same flow identifier is taken as the first measured value of the first data stream corresponding to the same stream identifier.
所述在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值,包括:In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value of the first data stream corresponding to the same stream identifier is screened to obtain each received first data stream. The third measurement value corresponding to the flow identifier of the flow, including:
在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的最大第二测量值,作为对应相同流标识的第一数据流的第三测量值。In the received second measurement value corresponding to the flow identifier of each first data stream, the maximum second measurement value of the first data stream corresponding to the same flow identifier is used as the first data stream corresponding to the same stream identifier. Three measurements.
在一种可能的实现方式中,所述基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值,包括:In a possible implementation manner, determining the statistical measurement value corresponding to the flow identifier of each second data stream based on the received stream identifier of the second data stream and the target data table, including:
对于所述目标数据表中的每个数据存储空间,基于所述数据存储空间所在数据行对应的第一特征值计算函数,在接收到的第二数据流的流标识中,确定所述数据存储空间对应的第二数据流的流标识,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定所述数据存储空间对应的每个第二数据流的流标识对应的累加系数。将所述数据存储空间对应的各第二数据流的流标识对应的统计测量值作为未知数乘以对应的累加系数,并进行累加,将所述数据存储空间记录的数据流的测量值作为累加结果,得到所述数据存储空间对应的目标方程。基于所述目标数据表中的各数据存储空间对应的目标方程,组成目标方程组。基于线性优化算法,以接收到的第二数据流的流标识对应的统计测量值之和最小为优化目标,求解所述目标方程组,得到每个第二数据流的流标识对应的统计测量值。For each data storage space in the target data table, based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, the data storage The stream identifier of the second data stream corresponding to the space, and based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located, determine the accumulation coefficient corresponding to the stream identifier of each second data stream corresponding to the data storage space . The statistical measurement value corresponding to the stream identifier of each second data stream corresponding to the data storage space is multiplied by the corresponding accumulation coefficient as an unknown, and the accumulation is performed, and the measurement value of the data stream recorded in the data storage space is used as the accumulation result. , to obtain the target equation corresponding to the data storage space. Based on the target equations corresponding to each data storage space in the target data table, a target equation group is formed. Based on a linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of the second data stream as the optimization objective, solving the objective equation system to obtain the statistical measurement values corresponding to the flow identifiers of each second data stream .
在本申请中在目标数据表中记录非大流的测量值时是乘以对应累加系数后再记录的,相应的,在构建上述目标方程时,也要对未知数乘以对应的累加系数,通过上述处理,可以使方程组的解的数量相对较少,这样最后得到的解(各非大流的统计测量值)的误差也相对较小。In this application, when recording the measured value of non-large flow in the target data table, it is multiplied by the corresponding accumulation coefficient and then recorded. Correspondingly, when constructing the above target equation, the unknowns are also multiplied by the corresponding accumulation coefficient. The above processing can make the number of solutions of the equation system relatively small, so that the error of the finally obtained solution (statistical measurement value of each non-large flow) is relatively small.
在一种可能的实现方式中,所述方法还包括:在得到的第一数据流的流标识对应的统计测量值和第二数据流的流标识对应的统计测量值中,将对应相同流标识的测量值进行累加,得到每个流标识对应的总测量值。In a possible implementation manner, the method further includes: in the obtained statistical measurement value corresponding to the flow ID of the first data stream and the statistical measurement value corresponding to the flow ID of the second data stream, assigning the corresponding same flow ID The measured values are accumulated to obtain the total measured value corresponding to each flow identifier.
第五方面,提供了一种数据流测量的方法,所述方法应用于控制器,所述方法包括:In a fifth aspect, a data flow measurement method is provided, the method is applied to a controller, and the method includes:
接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表。在目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到目标数据表记录的每个第一数据流的第一测量值。在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识 的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值。在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的流标识对应的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值。在目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个第一数据流的流标识对应的统计测量值。基于接收到的第二数据流的流标识、目标数据表中每个数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值。Receive the flow identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device. Among the measured values of the first data stream recorded in the target data table, the measured values of the first data streams corresponding to the same flow identifier are filtered to obtain the first measured value of each first data stream recorded in the target data table. In the received measured values of the first data stream, the measured values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain a second received stream identifier corresponding to each first data stream. Measurements. In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value corresponding to the stream identifier of the first data stream corresponding to the same flow identifier is screened to obtain each received first data stream. The flow identification of a data flow corresponds to the third measurement value. In the first measurement value of each first data stream recorded in the target data table and the third measurement value corresponding to the received stream identifier of each first data stream, the first measurement value corresponding to the same stream identifier and the third measurement value corresponding to the same stream identifier The two measurement values are accumulated to obtain a statistical measurement value corresponding to the stream identifier of each first data stream. Based on the received flow identifier of the second data stream, the measurement value of the data stream recorded in each data storage space in the target data table, and the obtained statistical measurement value corresponding to the stream identifier of each first data stream, determine each The statistical measurement values corresponding to the flow identifiers of the two data streams.
在一种可能的实现方式中,基于接收到的第二数据流的流标识、所述目标数据表中每个所述数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值,包括:In a possible implementation manner, based on the received stream identifier of the second data stream, the measured value of the data stream recorded in each of the data storage spaces in the target data table, and each obtained first data stream The statistical measurement value corresponding to the flow identifier of the second data stream is determined, and the statistical measurement value corresponding to the flow identifier of each second data stream is determined, including:
对于目标数据表的每个数据存储空间,基于数据存储空间所在数据行对应的第二特征值计算函数,确定该数据存储空间对应的每个第一数据流的流标识对应的累加系数。将数据存储空间对应的每个第一数据流的流标识对应的统计测量值乘以对应的累加系数,得到所述数据存储空间对应的每个第一数据流的流标识对应的调整统计测量值。基于所述数据存储空间所在数据行对应的第一特征值计算函数,在接收到的第二数据流的流标识中,确定所述数据存储空间对应的第二数据流的流标识,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定所述数据存储空间对应的每个第二数据流的流标识对应的累加系数。将数据存储空间对应的各第二数据流的流标识对应的统计测量值作为未知数乘以对应的累加系数,与所述数据存储空间对应的每个第一数据流的流标识对应的调整统计测量值相加,将所述数据存储空间记录的数据流的测量值作为累加结果,得到所述数据存储空间对对应的目标方程。基于所述目标数据表中的各数据存储空间对应的目标方程,组成目标方程组。基于线性优化算法,以接收到的第二数据流的流标识对应的统计测量值之和最小为优化目标,求解所述目标方程组,得到每个第二数据流的流标识对应的统计测量值。For each data storage space of the target data table, the accumulation coefficient corresponding to the stream identifier of each first data stream corresponding to the data storage space is determined based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located. Multiply the statistical measurement value corresponding to the flow identifier of each first data stream corresponding to the data storage space by the corresponding accumulation coefficient to obtain the adjusted statistical measurement value corresponding to the flow identifier of each first data stream corresponding to the data storage space . Based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, in the received flow identifier of the second data stream, the stream identifier of the second data stream corresponding to the data storage space is determined, and based on the received stream identifier of the second data stream The second eigenvalue calculation function corresponding to the data row where the data storage space is located determines the accumulation coefficient corresponding to the stream identifier of each second data stream corresponding to the data storage space. The statistical measurement value corresponding to the flow identification of each second data stream corresponding to the data storage space is multiplied by the corresponding accumulation coefficient as an unknown, and the adjustment statistical measurement corresponding to the flow identification of each first data flow corresponding to the data storage space The values are added, and the measured value of the data stream recorded in the data storage space is used as the accumulation result to obtain the target equation corresponding to the data storage space pair. Based on the target equations corresponding to each data storage space in the target data table, a target equation group is formed. Based on a linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of the second data stream as the optimization objective, solving the objective equation system to obtain the statistical measurement values corresponding to the flow identifiers of each second data stream .
第六方面,提供了一种数据流测量的方法,所述方法应用于控制器,所述方法包括:In a sixth aspect, a data flow measurement method is provided, the method is applied to a controller, and the method includes:
接收网络设备发送的第一数据流的流标识和测量值、第二数据流的流标识、目标数据表、第一数据表。在接收到的第一数据流的测量值和所述第一数据表记录的测量值中,将对应相同流标识的测量值进行累加,得到每个第一数据流的流标识对应的统计测量值。基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值。Receive the flow identifier and measurement value of the first data stream, the stream identifier of the second data stream, the target data table, and the first data table sent by the network device. In the received measurement value of the first data stream and the measurement value recorded in the first data table, the measurement values corresponding to the same flow identifier are accumulated to obtain the statistical measurement value corresponding to the stream identifier of each first data stream . Based on the received stream identifiers of the second data streams and the target data table, a statistical measurement value corresponding to the stream identifiers of each second data stream is determined.
在一种可能的实现方式中,基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值,包括:In a possible implementation manner, based on the received stream identifier of the second data stream and the target data table, determining a statistical measurement value corresponding to the stream identifier of each second data stream, including:
对于所述目标数据表中的每个数据存储空间,基于所述数据存储空间所在数据行对应的第一特征值计算函数,在接收到的第二数据流的流标识中,确定对应所述数据存储空间的至少一个目标第二数据流的流标识,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定每个目标第二数据流的流标识对应的累加系数。将所述至少一个目标第二数据流的流标识中的每个目标第二数据流的流标识对应的统计测量值作为未知数乘以对应的累加系数,并进行累加,将所述数据存储空间记录的数据流的测量值作为累加结果,得到目标方程;For each data storage space in the target data table, based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, in the received stream identifier of the second data stream, determine the corresponding data The stream identifier of at least one target second data stream in the storage space, and the accumulation coefficient corresponding to the stream identifier of each target second data stream is determined based on the second feature value calculation function corresponding to the data row where the data storage space is located. The statistical measurement value corresponding to the stream identifier of each target second data stream in the stream identifiers of the at least one target second data stream is multiplied by the corresponding accumulation coefficient as an unknown, and the accumulation is performed, and the data storage space is recorded. The measured value of the data stream is used as the accumulation result to obtain the target equation;
基于所述目标数据表中的各数据存储空间对应的目标方程,组成目标方程组。基于线性优化算法,以接收到的第二数据流的流标识对应的统计测量值之和最小为优化目标,求解所述目标方程组,得到每个第二数据流的流标识对应的统计测量值。Based on the target equations corresponding to each data storage space in the target data table, a target equation group is formed. Based on a linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of the second data stream as the optimization objective, solving the objective equation system to obtain the statistical measurement values corresponding to the flow identifiers of each second data stream .
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
在得到的第一数据流的流标识对应的统计测量值和第二数据流的流标识对应的统计测量值中,将对应相同流标识的测量值进行累加,得到每个流标识对应的总测量值。In the obtained statistical measurement values corresponding to the flow ID of the first data stream and the statistical measurement values corresponding to the flow ID of the second data stream, the measurement values corresponding to the same flow ID are accumulated to obtain the total measurement value corresponding to each flow ID value.
第七方面,提供了一种数据流测量的装置,用于执行第一方面或第一方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能的实现方式的模块。In a seventh aspect, an apparatus for measuring data flow is provided, which is used to execute the first aspect or any possible implementation manner of the first aspect. Specifically, the apparatus includes a module for performing the first aspect or any possible implementation manner of the first aspect.
第八方面,提供了一种数据流测量的装置,用于执行第二方面或第二方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第二方面或第二方面的任意一种可能的实现方式的模块。In an eighth aspect, an apparatus for data flow measurement is provided, which is used to execute the second aspect or any possible implementation manner of the second aspect. Specifically, the apparatus includes a module for performing the second aspect or any possible implementation manner of the second aspect.
第九方面,提供了一种数据流测量的装置,用于执行第三方面或第三方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第三方面或第三方面的任意一种可能的实现方式的模块。In a ninth aspect, an apparatus for measuring data flow is provided, which is used to execute the third aspect or any possible implementation manner of the third aspect. Specifically, the apparatus includes a module for performing the third aspect or any possible implementation manner of the third aspect.
第十方面,提供了一种数据流测量的装置,用于执行第四方面或第四方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第四方面或第四方面的任意一种可能的实现方式的模块。In a tenth aspect, a data flow measurement apparatus is provided, which is used to perform the fourth aspect or any possible implementation manner of the fourth aspect. Specifically, the apparatus includes a module for performing the fourth aspect or any possible implementation manner of the fourth aspect.
第十一方面,提供了一种数据流测量的装置,用于执行第五方面或第五方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第五方面或第五方面的任意一种可能的实现方式的模块。In an eleventh aspect, an apparatus for measuring data flow is provided, which is used to execute the fifth aspect or any possible implementation manner of the fifth aspect. Specifically, the apparatus includes a module for performing the fifth aspect or any possible implementation manner of the fifth aspect.
第十二方面,提供了一种数据流测量的装置,用于执行第六方面或第六方面的任意一种可能的实现方式。具体地,所述装置包括用于执行第六方面或第六方面的任意一种可能的实现方式的模块。A twelfth aspect provides an apparatus for measuring data flow, which is used to execute the sixth aspect or any possible implementation manner of the sixth aspect. Specifically, the apparatus includes a module for performing the sixth aspect or any possible implementation manner of the sixth aspect.
第十三方面,提供了一种网络设备,所述网络设备包括处理器和存储器,其中:A thirteenth aspect provides a network device, the network device comprising a processor and a memory, wherein:
所述存储器存储指令,所述处理器执行所述指令,以实现如上述第一方面、第二方面和第三方面中任一所述的方法。The memory stores instructions that are executed by the processor to implement the method of any of the first, second and third aspects above.
第十四方面,提供了一种控制器,所述控制器包括处理器和存储器,其中:A fourteenth aspect provides a controller, the controller comprising a processor and a memory, wherein:
所述存储器存储指令,所述处理器执行所述指令,以实现如上述第四方面、第五方面和第六方面中任一所述的方法。The memory stores instructions that are executed by the processor to implement the method of any one of the fourth, fifth and sixth aspects above.
第十五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,所述指令由处理器加载并执行,以实现如上述第一方面到第六方面中任一方面所述的方法。A fifteenth aspect provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and the instructions are loaded and executed by a processor to implement any one of the first to sixth aspects above. The method described in one aspect.
第十六方面,提供了一种计算机程序产品,所述计算机程序产品中包括指令,所述指令由处理器加载并执行,以实现如第一方面到第六方面中任一方面所述的方法。A sixteenth aspect provides a computer program product, the computer program product includes instructions, the instructions are loaded and executed by a processor to implement the method according to any one of the first to sixth aspects .
第十七方面,提供了一种数据流测量的系统,所述系统包括网络设备和控制器,其中:A seventeenth aspect provides a data flow measurement system, the system includes a network device and a controller, wherein:
所述网络设备用于执行如上述第一方面所述的方法;The network device is configured to execute the method according to the first aspect;
所述控制器用于执行如上述第四方面所述的方法。The controller is configured to perform the method as described in the fourth aspect above.
第十八方面,提供了一种数据流测量的系统,所述系统包括网络设备和控制器,其中:In an eighteenth aspect, a data flow measurement system is provided, the system includes a network device and a controller, wherein:
所述网络设备用于执行如上述第二方面所述的方法;The network device is configured to execute the method according to the second aspect;
所述控制器用于执行如上述第五方面的方法。The controller is adapted to perform the method of the fifth aspect above.
第十九方面,提供了一种数据流测量的系统,所述系统包括网络设备和控制器,其中:A nineteenth aspect provides a data flow measurement system, the system includes a network device and a controller, wherein:
所述网络设备用于执行如上述第三方面所述的方法;The network device is configured to execute the method according to the third aspect;
所述控制器用于执行如上述第六方面所述的方法。The controller is configured to perform the method as described in the sixth aspect above.
第二十方面,提供了一种处理器,用于执行上述第一方面到第六方面所述的方法。在执行这些方法的过程中,上述方法中有关发送数据和接收数据的过程,可以理解为由处理器输出上述数据的过程,以及处理器接收输入的上述数据的过程。在输出上述数据时,处理器将该上述数据输出给收发器,以便由收发器进行发射。该上述数据在由处理器输出之后,还可能需要进行其他的处理,然后才到达收发器。类似的,处理器接收输入的上述数据时,收发器接收该上述数据,并将其输入处理器。更进一步的,在收发器收到该上述数据之后,该上述数据可能需要进行其他的处理,然后才输入处理器。In a twentieth aspect, a processor is provided for executing the methods described in the first to sixth aspects. In the process of executing these methods, the process of sending data and receiving data in the above method can be understood as the process of outputting the above-mentioned data by the processor and the process of receiving the above-mentioned input data by the processor. When outputting the above-mentioned data, the processor outputs the above-mentioned data to the transceiver for transmission by the transceiver. After the above-mentioned data is output by the processor, other processing may be required before reaching the transceiver. Similarly, when the processor receives the above-mentioned data, the transceiver receives the above-mentioned data and inputs it into the processor. Further, after the transceiver receives the above-mentioned data, the above-mentioned data may need to be processed in other ways before being input to the processor.
基于上述原理,举例来说,前述方法中提及的发送第一数据流的流标识和测量值、第二数据流的标识、目标数据表,可以理解为处理器输出第一数据流的流标识和测量值、第二数据流的标识、目标数据表。又例如,接收第一数据流的流标识和测量值、第二数据流的标识、目标数据表可以理解为处理器接收输入第一数据流的流标识和测量值、第二数据流的标识、目标数据表。Based on the above principles, for example, the flow identifier and measurement value of the first data stream, the identifier of the second data stream, and the target data table mentioned in the aforementioned method can be understood as the processor outputting the stream identifier of the first data stream. and measurement values, the identification of the second data stream, the target data table. For another example, receiving the stream identifier and measurement value of the first data stream, the identifier of the second data stream, and the target data table can be understood as the processor receiving the stream identifier and measurement value of the input first data stream, the identifier of the second data stream, target data sheet.
对于处理器所涉及的发射、发送和接收等操作,如果没有特殊说明,或者,如果未与其在相关描述中的实际作用或者内在逻辑相抵触,则均可以更加一般性的理解为处理器输出和接收、输入等操作,而不是直接由射频电路和天线所进行的发射、发送和接收操作。For the operations of transmitting, sending and receiving involved in the processor, if there is no special description, or if it does not contradict its actual function or internal logic in the relevant description, it can be more generally understood as the processor output and Receive, input, etc. operations, rather than transmit, transmit, and receive operations directly performed by radio frequency circuits and antennas.
在实现过程中,上述处理器可以是专门用于执行这些方法的处理器,也可以是执行存储器中的计算机指令来执行这些方法的处理器,例如通用处理器。上述存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(Read Only Memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型以及存 储器与处理器的设置方式不做限定。In the implementation process, the above-mentioned processor may be a processor specially used to execute these methods, or may be a processor that executes computer instructions in a memory to execute these methods, such as a general-purpose processor. The above-mentioned memory can be a non-transitory (non-transitory) memory, such as a read-only memory (Read Only Memory, ROM), which can be integrated with the processor on the same chip, or can be set on different chips respectively. The embodiment does not limit the type of the memory and the setting manner of the memory and the processor.
第二十一方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器和接口,所述接口用于获取程序或指令,所述处理器用于调用所述程序或指令以实现上述第一方面至第六方面中任一方面所涉及的功能,例如,确定或处理上述方法中所涉及的数据,数据可以为测量值、流标识等。In a twenty-first aspect, an embodiment of the present application provides a chip system, the chip system includes a processor and an interface, where the interface is used to obtain a program or an instruction, and the processor is used to call the program or instruction to implement the above-mentioned The function involved in any one of the first aspect to the sixth aspect, for example, determining or processing the data involved in the above-mentioned method, and the data may be a measurement value, a flow identification, and the like.
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存网络设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a possible design, the chip system further includes a memory for storing necessary program instructions and data of the network device. The chip system may be composed of chips, or may include chips and other discrete devices.
附图说明Description of drawings
图1是本申请实施例提供的一种数据流测量的方法流程图;1 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图2是本申请实施例提供的一种目标数据表的示意图;2 is a schematic diagram of a target data table provided by an embodiment of the present application;
图3是本申请实施例提供的一种判断大流的方法流程图;3 is a flowchart of a method for judging a large flow provided by an embodiment of the present application;
图4是本申请实施例提供的一种目标数据表的示意图;4 is a schematic diagram of a target data table provided by an embodiment of the present application;
图5是本申请实施例提供的一种数据流测量的方法流程图;5 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图6是本申请实施例提供的一种确定非大流的流标识对应的测量值的方法流程图;6 is a flowchart of a method for determining a measurement value corresponding to a flow identifier of a non-large flow provided by an embodiment of the present application;
图7是本申请实施例提供的一种数据流测量的方法流程图;7 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图8是本申请实施例提供的一种数据流测量的方法流程图;FIG. 8 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图9是本申请实施例提供的一种确定非大流的流标识对应的测量值的方法流程图;9 is a flowchart of a method for determining a measurement value corresponding to a flow identifier of a non-large flow provided by an embodiment of the present application;
图10是本申请实施例提供的一种数据流测量的方法流程图;10 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图11是本申请实施例提供的一种数据流测量的方法流程图;11 is a flowchart of a method for measuring data flow provided by an embodiment of the present application;
图12是本申请实施例提供的一种数据流测量的装置结构示意图;FIG. 12 is a schematic structural diagram of an apparatus for data flow measurement provided by an embodiment of the present application;
图13是本申请实施例提供的一种数据流测量的装置结构示意图;FIG. 13 is a schematic structural diagram of an apparatus for data flow measurement provided by an embodiment of the present application;
图14是本申请实施例提供的一种网络设备的结构示意图;FIG. 14 is a schematic structural diagram of a network device provided by an embodiment of the present application;
图15是本申请实施例提供的一种控制器的结构示意图。FIG. 15 is a schematic structural diagram of a controller provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供了一种数据流测量的方法,该方法可以由网络设备实现。其中,网络设备可以为用于接收、转发数据包的设备,例如:路由器、交换机等。网络设备可以对接收到的数据包的测量值进行计算并记录。在本申请实施例中,在接收到数据包后,要判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。并且由于对大流的测量值单独记录,使得目标数据表中可以仅记录大流以外的数据流的测量值,这样,因为记录的数据流的数量减少,使得在恢复这些数据流的测量值时,得到的测量值的准确度也相对较高。The embodiment of the present application provides a data flow measurement method, and the method can be implemented by a network device. The network device may be a device for receiving and forwarding data packets, such as a router, a switch, and the like. The network device can calculate and record the measurements of the received packets. In this embodiment of the present application, after a data packet is received, it is necessary to determine whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, the flow identification and measurement value of the flow are recorded separately, so that the measurement value of the large flow can be is relatively accurate. And since the measured values of the large flow are recorded separately, only the measured values of the data flow other than the large flow can be recorded in the target data table. In this way, because the number of recorded data flows is reduced, when restoring the measured values of these data flows , the accuracy of the obtained measurements is also relatively high.
本申请实施例所提供的数据流测量的方法,可以应用在网络安全、转发策略规划等场景下。例如,在网络安全场景下,可以通过数据流测量检测拒绝服务(Denial of Service,DOS)攻击,具体的,网络设备可以通过执行本申请实施例提供的数据流测量的方法,得到数据流的数据包数量,并统计相同目的地址的数据流的数据包数量,如果在一段时间内有大量发送 向某目的地址的数据包,则可以初步判断该目的地址对应的主机可能受到了DOS攻击,并进一步作出相应防御处理。The data flow measurement method provided by the embodiment of the present application can be applied in scenarios such as network security and forwarding policy planning. For example, in a network security scenario, a denial of service (Denial of Service, DOS) attack can be detected through data flow measurement. Specifically, a network device can obtain data flow data by executing the data flow measurement method provided by the embodiments of the present application. If there are a large number of data packets sent to a certain destination address within a period of time, it can be preliminarily determined that the host corresponding to the destination address may have been attacked by DOS, and further Take appropriate defenses.
参见图1,本申请实施例提供了一种数据流测量的方法,该方法的处理流程可以包括如下步骤:Referring to FIG. 1 , an embodiment of the present application provides a data flow measurement method, and a processing flow of the method may include the following steps:
步骤101、接收目标数据包,对于目标数据表的每个数据行,基于数据行对应的第一特征值计算函数和目标数据包对应的流标识,确定目标数据包所属的目标数据流在该数据行中对应的数据存储空间。 Step 101, receiving the target data packet, for each data row of the target data table, based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet, determine that the target data stream to which the target data packet belongs is in the data. The corresponding data storage space in the row.
其中,流标识可以根据实际需求设置,用于唯一标识一个数据流,例如,流标识可以为数据流的数据包中携带的源地址和目的地,又例如,流标识还可以为数据流的数据包中携带的五元组信息。一个数据流包括多个数据包,数据流的测量值即为该数据流包括的所有数据包的测量值的之和。The flow identifier can be set according to actual requirements and used to uniquely identify a data stream. For example, the flow identifier can be the source address and destination carried in the data packet of the data stream. For example, the flow identifier can also be the data of the data stream. The quintuple information carried in the packet. A data stream includes multiple data packets, and the measurement value of the data stream is the sum of the measurement values of all the data packets included in the data stream.
目标数据表用于记录数据流的流标识、数据流的测量值等数据。例如,该目标数据表可以为sketch数据表。该目标数据表的每个数据行可以对应一个第一特征值计算函数,不同数据行对应不同的第一特征值函数。其中,第一特征值计算函数可以为一种哈希函数。The target data table is used to record data such as the flow identifier of the data flow, the measurement value of the data flow, and the like. For example, the target data table may be a sketch data table. Each data row of the target data table may correspond to a first eigenvalue calculation function, and different data rows correspond to different first eigenvalue functions. Wherein, the first feature value calculation function may be a hash function.
对于每个数据行来说,该数据行对应的第一特征值计算函数可以有m种计算结果,m为该目标数据表的列数,也即是,每个数据行对应的数据存储空间的个数。m种计算结果中的每种计算结果对应该数据行的一个数据存储空间,也即是,m种计算结果与m个数据存储空间一一对应。其中,数据存储空间也可以称为桶,在目标数据表为sketch数据表的情况下,目标数据表对应的数据存储空间可以称为sketch桶。For each data row, the first eigenvalue calculation function corresponding to the data row can have m types of calculation results, where m is the number of columns of the target data table, that is, the data storage space corresponding to each data row number. Each of the m types of calculation results corresponds to one data storage space of the data row, that is, the m types of calculation results correspond to the m data storage spaces one-to-one. The data storage space may also be called a bucket, and in the case that the target data table is a sketch data table, the data storage space corresponding to the target data table may be called a sketch bucket.
在实施中,网络设备当接收到一个数据包时,确定该数据包所属的数据流在目标数据表中对应的数据存储空间。也即是,确定该数据包的测量值需要记录在目标数据表对应的哪些数据存储空间中。为了便于叙述,本文中将当前接收到的数据包称为目标数据包,该数据包所属的数据流称为目标数据流。In implementation, when receiving a data packet, the network device determines the data storage space corresponding to the data flow in the target data table to which the data packet belongs. That is, it is determined in which data storage spaces corresponding to the target data table the measurement value of the data packet needs to be recorded. For convenience of description, the currently received data packet is referred to as a target data packet, and the data stream to which the data packet belongs is referred to as a target data stream.
对于目标数据表的每个数据行,可以分别确定出目标数据包所属的数据流在该数据行中对应的数据存储空间,确定方法可以如下:For each data row of the target data table, the corresponding data storage space in the data row of the data stream to which the target data packet belongs can be determined separately. The determination method can be as follows:
首先,将目标数据包对应的流标识进行预处理,得到待计算数值。其中,预处理可以为将流标识转换为二进制数,相应的,待计算数值为流标识对应的二进制数。然后,将待计算数值输入到第一特征值计算函数中,得到该流标识对应的输出结果。最后,在输出结果和数据存储空间的对应关系中,确定出该流标识对应的输出结果所对应的数据存储空间。其中,第一特征值计算函数的输出结果即为数据存储空间的存储空间标识,目标数据表的每个数据存储空间的存储空间标识均不相同。存储空间标识可以为数字,例如,1、2、3等等。First, the flow identifier corresponding to the target data packet is preprocessed to obtain the value to be calculated. The preprocessing may be converting the stream identifier into a binary number, and correspondingly, the value to be calculated is a binary number corresponding to the stream identifier. Then, the value to be calculated is input into the first eigenvalue calculation function to obtain an output result corresponding to the flow identifier. Finally, in the corresponding relationship between the output result and the data storage space, the data storage space corresponding to the output result corresponding to the stream identifier is determined. The output result of the first feature value calculation function is the storage space identifier of the data storage space, and the storage space identifier of each data storage space of the target data table is different. The storage space identifier can be a number, for example, 1, 2, 3, and so on.
如图2所示,目标数据包对应的流标识为K 1,测量值为V 1,目标数据表的第一个数据行对应的第一特征值计算函数为h 1,第二个数据行对应的第一特征值计算函数为h 1,以此类推,第m个数据行对应的第一特征值计算函数为h m。对K 1进行预处理,得到待计算数值,然后将该待计算数值分别代入h 1、h 1……h m中,得到m个输出结果,每个数据结果对应目标数据表对应的一个数据存储空间。 As shown in Figure 2, the flow identifier corresponding to the target data packet is K 1 , the measurement value is V 1 , the first eigenvalue calculation function corresponding to the first data row of the target data table is h 1 , and the second data row corresponds to The first eigenvalue calculation function of is h 1 , and so on, the first eigenvalue calculation function corresponding to the mth data row is h m . Preprocess K 1 to obtain the value to be calculated, and then substitute the value to be calculated into h 1 , h 1 ...... h m respectively, and obtain m output results, each data result corresponds to a data storage corresponding to the target data table space.
步骤102、如果目标数据流是该数据存储空间对应的第一数据流,则基于目标数据包的 测量值,确定目标数据流的测量值,记录在该数据存储空间中。 Step 102, if the target data stream is the first data stream corresponding to the data storage space, then based on the measurement value of the target data packet, determine the measurement value of the target data stream and record it in the data storage space.
其中,第一数据流也可以称为大流,为了便于理解,下面将第一数据流称为大流。测量值可以根据实际需要进行设置,例如,测量值可以为数据流包括的数据包数量,又例如,测量值还可以为数据流包括的数据包的总字节数,等等。The first data stream may also be referred to as a large stream. For ease of understanding, the first data stream is hereinafter referred to as a large stream. The measurement value can be set according to actual needs. For example, the measurement value may be the number of data packets included in the data stream, and, for example, the measurement value may also be the total number of bytes of data packets included in the data stream, and so on.
在实施中,在接收到目标数据包后,网络设备可以对数据包计算测量值。在确定出目标数据流对应的数据存储空间后,可以根据目标数据流是否为大流,对目标数据包的测量值采用不同的方式记录。对于确定出的目标数据流对应的每个数据存储空间来说,判断目标数据流是否为大流以及记录目标数据包的测量值的方法,可以参见图3,具体可以包括如下步骤:In an implementation, after receiving the target data packet, the network device may calculate measurements on the data packet. After the data storage space corresponding to the target data stream is determined, the measurement value of the target data packet can be recorded in different ways according to whether the target data stream is a large stream. For each data storage space corresponding to the determined target data stream, the method of judging whether the target data stream is a large stream and recording the measured value of the target data packet can be referred to in FIG. 3, which may specifically include the following steps:
S1021、确定数据存储空间中是否记录有大流的流标识和测量值。S1021. Determine whether the flow identifier and measurement value of the large flow are recorded in the data storage space.
此步骤是判断该目标数据包是否为该数据存储空间初始化后的第一个进入该数据存储空间进行记录的数据包。此处需要说明的是,数据存储空间初始化是在每个测量周期结束时执行的,具体的,可以为对数据存储空间中记录的数据进行删除。那么,上述“判断该目标数据包是否为该数据存储空间初始化后的第一个进入该数据存储空间进行记录的数据包”也即是,判断该目标数据包是否为当前测量周期内第一个进入该数据存储空间进行记录的数据包。This step is to determine whether the target data packet is the first data packet that enters the data storage space for recording after the data storage space is initialized. It should be noted here that the initialization of the data storage space is performed at the end of each measurement period, and specifically, the data recorded in the data storage space may be deleted. Then, the above-mentioned "judging whether the target data packet is the first data packet to enter the data storage space for recording after the data storage space is initialized" is to judge whether the target data packet is the first data packet in the current measurement period. Data packets that entered this data storage space for recording.
S1022、如果该数据存储空间中未记录有大流的流标识和测量值,则确定目标数据流为该数据存储空间对应的大流,将目标数据包的测量值作为目标数据流的测量值,将目标数据流的流标识作为数据存储空间对应的第一数据流的流标识,将目标数据的流标识和测量值对应记录在数据存储空间中。S1022, if the flow identifier and measurement value of the large flow are not recorded in the data storage space, then determine that the target data flow is the large flow corresponding to the data storage space, and use the measurement value of the target data packet as the measurement value of the target data flow, The stream identifier of the target data stream is used as the stream identifier of the first data stream corresponding to the data storage space, and the stream identifier of the target data and the measurement value are correspondingly recorded in the data storage space.
如果该数据存储空间中未记录有大流的流标识和测量值,则说明该目标数据包是在该数据存储空间初始化后的第一个进入该数据存储空间进行记录的数据包,也即是,该目标数据包是当前测量周期内第一个进入该数据存储空间进行记录的数据包。在此情况下,可以将目标数据流作为大流,在该数据存储空间中记录目标数据流的测量值。If the flow identifier and measurement value of the large flow are not recorded in the data storage space, it means that the target data packet is the first data packet to enter the data storage space for recording after the data storage space is initialized, that is, the , the target data packet is the first data packet that enters the data storage space for recording in the current measurement period. In this case, the target data stream can be regarded as a large stream, and the measured values of the target data stream can be recorded in the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,在该数据存储空间中未记录有大流的流标识和测量值,则将大流的流标识记录为K 1,将大流的测量值记录为V 1。在测量值为数据流的数据包数量的情况下,V 1=1。 For example, the flow ID corresponding to the target data packet is K 1 , the measurement value is V 1 , and the flow ID and measurement value of the large flow are not recorded in the data storage space, then the flow ID of the large flow is recorded as K 1 , and the The measurement of the large current is recorded as V 1 . In the case where the measurement value is the number of packets of the data flow, V 1 =1.
S1023、如果该数据存储空间中记录有大流的流标识和测量值,则确定目标数据流的流标识与数据存储空间中记录的大流的流标识是否相同。S1023. If the flow identifier and measurement value of the large flow are recorded in the data storage space, determine whether the flow identifier of the target data flow is the same as the flow identifier of the large flow recorded in the data storage space.
如果该数据存储空间中记录有大流的流标识和测量值,则说明在该目标数据包之前还有其他数据包进入该数据存储空间进行记录。在此情况下,可以继续判断该目标数据包所属的目标数据流是否为记录的大流。If the flow identifier and measurement value of the large flow are recorded in the data storage space, it means that there are other data packets entering the data storage space for recording before the target data packet. In this case, it is possible to continue to determine whether the target data stream to which the target data packet belongs is a recorded large stream.
S1024、如果目标数据流的流标识与数据存储空间中记录的大流的流标识相同,则将目标数据包的测量值累加到数据存储空间中记录的第一数据流的测量值上。S1024. If the flow identifier of the target data stream is the same as the stream identifier of the large stream recorded in the data storage space, add the measurement value of the target data packet to the measurement value of the first data stream recorded in the data storage space.
如果目标数据流的流标识与数据存储空间中记录的大流的流标识相同,则说明在该目标数据包之前还有其他属于目标数据流的数据包进入该数据存储空间进行记录,且该目标数据流是该数据存储空间对应的大流。在此情况下,可以对记录的大流的测量值进行更新。If the flow ID of the target data flow is the same as the flow ID of the large flow recorded in the data storage space, it means that there are other data packets belonging to the target data flow entering the data storage space for recording before the target data packet, and the target data flow is recorded in the data storage space. A data stream is a large stream corresponding to the data storage space. In this case, the recorded measurements of the mass flow can be updated.
例如,目标数据包对应的流标识为K 1,测量值为V 1,在该数据存储空间中记录有大流的流标识为K 1,测量值为V,在确定目标数据包对应的流标识与记录的大流的流标识相同之后,将目标数据包的测量值V 1累加到记录的大流测量值V上,即,将大流测量值V更新为(V+V 1)。 For example, the flow ID corresponding to the target data packet is K 1 , the measurement value is V 1 , the flow ID with a large flow recorded in the data storage space is K 1 , and the measurement value is V, after determining the flow ID corresponding to the target data packet After the flow identification of the recorded large flow is the same, the measurement value V 1 of the target data packet is accumulated to the recorded large flow measurement value V, that is, the large flow measurement value V is updated to (V+V 1 ).
S1025、如果目标数据流的流标识与数据存储空间中记录的第一数据流的流标识不同,则确定数据存储空间中是否记录有比较测量值。S1025. If the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the data storage space, determine whether a comparison measurement value is recorded in the data storage space.
为了判断一个数据流是否大流,需要知道该数据流的测量值以及该数据流之后的其他数据流的测量值之和,因此,在数据存储空间中还可以记录有除大流以外的其他数据流的测量值之和,此处将其称为比较测量值。In order to determine whether a data stream is a large stream, it is necessary to know the measurement value of the data stream and the sum of the measurement values of other data streams after the data stream. Therefore, other data other than the large stream can also be recorded in the data storage space. The sum of the measurements of the flow, which is referred to here as the comparative measurement.
S1026、如果未记录有比较测量值,则将目标数据包的测量值作为数据存储空间对应的比较测量值记录在数据存储空间中。S1026. If no comparison measurement value is recorded, record the measurement value of the target data packet in the data storage space as a comparison measurement value corresponding to the data storage space.
如果未记录有比较测量值,则说明该目标数据包是该数据存储空间初始化之后,除记录的大流的数据包以外的第一个进入该数据存储空间进行记录的数据包,也即是,该目标数据包是当前测量周期内,除记录的大流的数据包以外的第一个进入该数据存储空间进行记录的数据包。在此情况下,可以将目标数据包的测量值作为数据存储空间对应的比较测量值。If no comparison measurement value is recorded, it means that the target data packet is the first data packet to enter the data storage space for recording after the data storage space is initialized, except for the data packets of the recorded large flow, that is, The target data packet is the first data packet that enters the data storage space for recording in the current measurement period, except for the recorded data packets of the large flow. In this case, the measured value of the target data packet can be used as the comparative measured value corresponding to the data storage space.
例如,标数据包对应的流标识为K 1,测量值为V 1,在该数据存储空间中未记录有比较测量值,则将比较测量值记录为V 1For example, if the flow identifier corresponding to the marked data packet is K 1 , the measurement value is V 1 , and the comparison measurement value is not recorded in the data storage space, the comparison measurement value is recorded as V 1 .
S1027、如果记录有比较测量值,则将目标数据包的测量值累加在该数据存储空间中记录的比较测量值上。S1027. If the comparative measurement value is recorded, accumulate the measurement value of the target data packet on the comparative measurement value recorded in the data storage space.
如果记录有比较测量值,则说明在目标数据包之前还有除记录的大流的数据包以外的其他数据包进入该数据存储空间进行记录。在此情况下,可以对记录的比较测量值进行更新。If a comparative measurement value is recorded, it means that before the target data packet, other data packets other than the recorded large flow data packets enter the data storage space for recording. In this case, the recorded comparative measurements can be updated.
例如,目标数据包对应的流标识为K 1,测量值为V 1,在该数据存储空间中记录有比较测量值为C。将目标数据包的测量值V 1累加到记录的比较测量值C上,即,将比较测量值C更新为(C+V 1)。 For example, the flow identifier corresponding to the target data packet is K 1 , the measurement value is V 1 , and the comparison measurement value C is recorded in the data storage space. The measurement value V 1 of the target packet is accumulated to the recorded comparison measurement value C, ie, the comparison measurement value C is updated to (C+V 1 ).
S1028、确定数据存储空间中记录的累加后的比较测量值是否大于数据存储空间中记录的大流的测量值。S1028. Determine whether the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the large flow recorded in the data storage space.
在数据存储空间中记录的比较测量值更新后,需要比较记录的大流的测量值和该更新的比较测量值,来判断记录的大流是否仍为大流。After the comparison measurement value recorded in the data storage space is updated, it is necessary to compare the recorded measurement value of the large flow with the updated comparison measurement value to determine whether the recorded large flow is still a large flow.
S1029、如果数据存储空间中记录的累加后的比较测量值大于数据存储空间中记录的大流的测量值,则确定目标数据流为该数据存储空间对应的大流,将该数据存储空间中记录的大流的流标识更新为目标数据流的流标识,将该数据存储空间中记录的大流的测量值更新为目标数据包的测量值,将该数据存储空间中记录的比较测量值更新为0。S1029: If the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the large flow recorded in the data storage space, then determine that the target data flow is the large flow corresponding to the data storage space, and record the data in the data storage space The flow ID of the large flow is updated to the flow ID of the target data flow, the measurement value of the large flow recorded in the data storage space is updated to the measurement value of the target data packet, and the comparison measurement value recorded in the data storage space is updated as 0.
如果数据存储空间中记录的累加后的比较测量值大于数据存储空间中记录的大流的测量值,则说明当前记录的大流不再是大流。在此情况下,需要将目标数据包所属的数据流作为新的大流,更新数据存储空间中记录的大流的流标识、大流的测量值和比较测量值。If the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the large flow recorded in the data storage space, it means that the currently recorded large flow is no longer a large flow. In this case, it is necessary to take the data flow to which the target data packet belongs as a new large flow, and update the flow identifier of the large flow, the measured value of the large flow and the comparative measured value recorded in the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,将目标数据包的测量值V 1累加到记录的大流测量值C上后,比较测量值由C更新为(C+V 1)。并且,更新后的比较测量值(C+V 1)大于记录的大流的测量值V,那么,将该目标数据包所属的目标数据流作为新的大流,将大流的流标识更新为K 1,将大流的测量值更新为V 1。因为此时在该目标数据包之后还没有接收到其他数据包,所有将比较测量值更新为0。 For example, the flow identifier corresponding to the target data packet is K 1 , and the measured value is V 1 . After accumulating the measured value V 1 of the target data packet to the recorded large flow measurement value C, the comparative measurement value is updated from C to (C+ V1 ) . In addition, if the updated comparative measurement value (C+V 1 ) is greater than the recorded measurement value V of the large flow, then the target data flow to which the target data packet belongs is regarded as a new large flow, and the flow identifier of the large flow is updated as K 1 , update the measured value of large flow to V 1 . Since no other packets have been received after the target packet at this time, the comparison measurement value is updated to 0.
步骤103、如果目标数据流不是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,在目标数据表中,记录目标数据流的测量值。Step 103: If the target data stream is not the first data stream corresponding to the data storage space, record the measurement value of the target data stream in the target data table based on the measurement value of the target data packet.
在实施中,如果该数据存储空间中记录的累加后的比较测量值不大于记录的大流的测量值,则确定目标数据包所属的目标数据流不是该数据存储空间对应的大流。In implementation, if the accumulated comparative measurement value recorded in the data storage space is not greater than the recorded measurement value of the large flow, it is determined that the target data flow to which the target data packet belongs is not the large flow corresponding to the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,将目标数据包的测量值V 1累加到记录的大流测量值C上后,比较测量值由C更新为(C+V 1)。更新后的比较测量值(C+V 1)不大于记录的大流的测量值V,那么,可以确定该目标数据包所属的目标数据流不是该数据存储空间对应的大流。 For example, the flow identifier corresponding to the target data packet is K 1 , and the measured value is V 1 . After accumulating the measured value V 1 of the target data packet to the recorded large flow measurement value C, the comparative measurement value is updated from C to (C+ V1 ) . If the updated comparative measurement value (C+V 1 ) is not greater than the recorded measurement value V of the large flow, it can be determined that the target data flow to which the target data packet belongs is not the large flow corresponding to the data storage space.
在此情况下,在该数据存储空间中记录该目标数据流的测量值,可以有多种方法,下面列举两种进行说明。In this case, there may be various methods for recording the measurement value of the target data stream in the data storage space, and two are listed below for description.
方法一、基于该数据存储空间所在的数据行对应的第二特征值计算函数和目标数据包的流标识,确定目标数据流对应的累加系数,将目标数据包的测量值乘以该累加系数,得到目标数据包的调整测量值,将目标数据包的调整测量值累加到数据存储空间中记录的非大流的测量值上。Method 1: Based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located and the flow identifier of the target data packet, determine the accumulation coefficient corresponding to the target data flow, and multiply the measurement value of the target data packet by the accumulation coefficient, The adjusted measurement value of the target data packet is obtained, and the adjusted measurement value of the target data packet is accumulated to the non-large flow measurement value recorded in the data storage space.
在目标数据表对应的每个数据存储空间中除记录大流的流标识、大流的测量值、比较测量值以外,还可以记录非大流的测量值。In each data storage space corresponding to the target data table, in addition to recording the flow identification of the large flow, the measured value of the large flow, and the comparative measured value, the measured value of the non-large flow can also be recorded.
对于目标数据表的每个数据行,除对应一个第一特征值计算函数以外,还可以对应一个第二特征值计算函数。其中,该第二特征值计算函数也可以为一种哈希函数,每个数据行对应的第二特征值计算函数不同。For each data row of the target data table, in addition to corresponding to a first eigenvalue calculation function, it may also correspond to a second eigenvalue calculation function. The second feature value calculation function may also be a hash function, and the second feature value calculation function corresponding to each data row is different.
对于上述确定出的目标数据流对应的每个数据存储空间,在基于目标数据包的测量值,记录目标数据流的测量值时,可以将目标数据包对应的待计算数值输入到该数据存储空间所在的数据行对应的第二特征值计算函数中,得到该流标识对应的累加系数。其中,累加系数可以为小数。此处需要说明的是,目标数据包对应的待计算数值可以是在确定目标数据包所属的数据流对应的数据存储空间时预处理得到的。For each data storage space corresponding to the target data stream determined above, when recording the measurement value of the target data stream based on the measurement value of the target data packet, the value to be calculated corresponding to the target data packet can be input into the data storage space In the second eigenvalue calculation function corresponding to the data row, the accumulation coefficient corresponding to the stream identifier is obtained. Among them, the accumulation coefficient can be a decimal. It should be noted here that the value to be calculated corresponding to the target data packet may be obtained by preprocessing when determining the data storage space corresponding to the data stream to which the target data packet belongs.
然后,将目标数据包的测量值乘以该累加系数,得到目标数据包的调整测量值。最后,将目标数据包的调整测量值累加到该数据存储空间中记录的非大流的测量值上。Then, the measured value of the target data packet is multiplied by the accumulation coefficient to obtain the adjusted measured value of the target data packet. Finally, the adjusted measurement of the target packet is accumulated to the measurement of the non-large flow recorded in the data storage space.
如图4所示,在图2的基础上,目标数据表的第一个数据行还对应一个第二特征值计算函数为g 1,第二个数据行还对应一个第二特征值函数为g2,以此类推,第m个数据行还对应一个第二特征值计算函数为gm。对K 1进行预处理,得到待计算数值,将待计算数值分别代入h 1、h 2……h m中,得到m个输出结果,每个数据结果对应目标数据表对应的一个数据存储空间。然后,再待计算数值分别代入g1、g2……gm,得到m个累加系数。最后,将g i得到的累加系数X i与测量值V 1相乘,累加到h i得到的输出结果对应的数据存储空间中记录的非大流测量值上,即,将第i行中h i的输出结果对应的数据存储空间中记录的非大流的测量值D i,更新为(D i+X i*V 1),其中,i表示行数,1≤i≤m。 As shown in Figure 4, on the basis of Figure 2, the first data row of the target data table also corresponds to a second eigenvalue calculation function g 1 , and the second data row also corresponds to a second eigenvalue function g2 , and so on, the mth data row also corresponds to a second eigenvalue calculation function gm. Preprocess K 1 to obtain the value to be calculated, and substitute the value to be calculated into h 1 , h 2 ...... h m respectively, and obtain m output results, each data result corresponds to a data storage space corresponding to the target data table. Then, the values to be calculated are substituted into g1, g2...gm, respectively, to obtain m cumulative coefficients. Finally, multiply the accumulated coefficient X i obtained by gi by the measurement value V 1 , and accumulate it to the non-large flow measurement value recorded in the data storage space corresponding to the output result obtained by hi, that is, the value of h in the i -th row The measured value D i of the non-large flow recorded in the data storage space corresponding to the output result of i is updated to (D i +X i *V 1 ), where i represents the number of rows, and 1≤i≤m.
方法二、直接将目标数据包的测量值累加到该数据存储空间中记录的非大流的测量值上。The second method is to directly accumulate the measured value of the target data packet to the measured value of the non-large flow recorded in the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,将目标数据包的测量值V 1累加到记录的非大流的测量值上,即,将记录的非大流的测量值D更新为(D+V 1)。 For example, the flow corresponding to the target data packet is identified as K 1 and the measurement value is V 1 , and the measurement value V 1 of the target data packet is accumulated to the recorded measurement value of the non-large flow, that is, the recorded measurement value of the non-large flow is The value D is updated to (D+V 1 ).
在每个测量周期结束后,可以对该测量周期内的数据流的测量值进行恢复,即确定出该处理周期内数据流的测量值。对该测量周期内数据流的测量值进行恢复,可以在本设备实现,也可以由控制器实现。控制器可以为路由器、交换机等网络设备,还可以为手机、台式计算 机、笔记本电脑、平板电脑等终端设备,还可以为单体服务器、服务器集群等云端设备。After the end of each measurement period, the measurement value of the data flow in the measurement period can be recovered, that is, the measurement value of the data flow in the processing period can be determined. Restoring the measurement value of the data stream in the measurement period can be implemented in the device or by the controller. Controllers can be network devices such as routers and switches, terminal devices such as mobile phones, desktop computers, notebook computers, and tablet computers, and cloud devices such as single servers and server clusters.
如果由本设备实现,则在步骤S1029中,确定数据存储空间中记录的累加后的比较测量值大于数据存储空间中记录的大流的测量值时,将数据存储空间中当前记录的大流的流标识和大流的测量值取出进行存储。在步骤103中,确定目标数据流不是该数据存储空间对应的大流之后,可以将目标数据包对应的流标识作为非大流的流标识进行记录。在每个测量周期结束时,可以将本地存储的目标数据表取出在其他存储空间进行存储,并将当前存储的目标数据表初始化。If it is implemented by this device, in step S1029, when it is determined that the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the large flow recorded in the data storage space, the flow of the large flow currently recorded in the data storage space is Measured values for identification and mass flow are retrieved for storage. In step 103, after it is determined that the target data flow is not a large flow corresponding to the data storage space, the flow identifier corresponding to the target data packet may be recorded as a non-large flow flow identifier. At the end of each measurement period, the locally stored target data table can be taken out and stored in another storage space, and the currently stored target data table can be initialized.
如果由控制器实现,则在步骤S1029中,在确定数据存储空间中记录的累加后的比较测量值大于数据存储空间中记录的大流的测量值后,可以将该数据存储空间的存储空间标识、该数据存储空间中当前记录的大流的流标识和大流的测量值对应发送至控制器。在步骤103中,确定目标数据流不是该数据存储空间对应的大流之后,可以将目标数据包对应的流标识作为非大流的流标识发送至控制器。在每个测量周期结束时,可以将本地存储的目标数据表发送至控制器,并将本地存储的目标数据表初始化。If it is implemented by the controller, in step S1029, after it is determined that the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the large flow recorded in the data storage space, the storage space identifier of the data storage space can be identified. , The flow identifier of the large flow currently recorded in the data storage space and the measured value of the large flow are correspondingly sent to the controller. In step 103, after it is determined that the target data flow is not a large flow corresponding to the data storage space, the flow identifier corresponding to the target data packet may be sent to the controller as a non-large flow flow identifier. At the end of each measurement cycle, the locally stored target data table can be sent to the controller and initialized.
此外,为了避免对非大流的流标识重复记录或者重复发送,可以设置有Bloom Filter,在对非大流的流标识进行记录或者发送之前,可以先确定Bloom Filter中是否记录有该流标识,如果未记录有该流标识,再将该流标识进行记录或者发送。在对非大流的流标识进行记录或者发送之后,可以将该流标识记录在Bloom Filter中。下面对Bloom Filter的用法进行说明:In addition, in order to avoid the repeated recording or repeated transmission of the non-large flow stream ID, a Bloom Filter can be set. Before recording or sending the non-large stream flow ID, you can first determine whether the flow ID is recorded in the Bloom Filter. If the stream ID is not recorded, then record or send the stream ID. After recording or sending the stream identifier of the non-large stream, the stream identifier can be recorded in the Bloom Filter. The usage of Bloom Filter is described below:
Bloom Filter本质是一种数据结构,由一个长数组和多个哈希函数组成。在需要将一个流标识记录在Bloom Filter时,可以先使用该Bloom Filter里中每个哈希函数,分别计算出该流标识的哈希值。然后,将该Bloom Filter的数组中与上述哈希值对应的位置处置1。在需要查询某流标识是否记录在该Bloom Filter里时,同样要先使用该Bloom Filter里的每个哈希函数,分别计算出该流标识的一个哈希值,然后,查询该Bloom Filter的数组中与计算出的哈希值对应的位置处是否为1,如果全为1,则表示该Bloom Filter记录了该元素,如果不是全为1,则表示该Bloom Filter没有记录该元素。Bloom Filter is essentially a data structure consisting of a long array and multiple hash functions. When a stream ID needs to be recorded in the Bloom Filter, each hash function in the Bloom Filter can be used to calculate the hash value of the stream ID respectively. Then, dispose of 1 at the position corresponding to the above hash value in the array of the Bloom Filter. When you need to query whether a stream ID is recorded in the Bloom Filter, you must first use each hash function in the Bloom Filter to calculate a hash value of the stream ID, and then query the Bloom Filter array Whether the position corresponding to the calculated hash value is 1, if it is all 1, it means that the Bloom Filter has recorded the element, if it is not all 1, it means that the Bloom Filter has not recorded the element.
此处需要说明的是,可以对于目标数据表中的每个数据存储空间设置一个Bloom Filter,也可以对于一个目标数据表设置一个Bloom Filter。在每个数据存储空间设置一个Bloom Filter的情况下,Bloom Filter可以存储在相应的数据存储空间中,在对非大流的流标识进行记录或者发送之前,可以先确定非大流的流标识对应的数据存储空间中存储的Bloom Filter中是否记录有该流标识,在对非大流的流标识进行记录或者发送之后,可以将该流标识记录在对应的数据存储空间中存储的Bloom Filter中。It should be noted here that a Bloom Filter can be set for each data storage space in the target data table, or a Bloom Filter can be set for a target data table. In the case where a Bloom Filter is set in each data storage space, the Bloom Filter can be stored in the corresponding data storage space. Before recording or sending the flow ID of the non-large flow, the corresponding flow ID of the non-large flow can be determined first. Whether the stream identifier is recorded in the Bloom Filter stored in the data storage space of the data storage space, after recording or sending the stream identifier of the non-large stream, the stream identifier can be recorded in the Bloom Filter stored in the corresponding data storage space.
在本申请实施例中,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。并且由于对大流的测量值单独记录,使得目标数据表中可以仅记录大流以外的数据流的测量值,这样,因为记录的数据流的数量减少,使得在恢复这些数据流的测量值时,得到的测量值的准确度也相对较高。In this embodiment of the present application, after a data packet is received, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, so that the measurement value of the large flow can be recorded. is relatively accurate. And since the measured values of the large flow are recorded separately, only the measured values of the data flow other than the large flow can be recorded in the target data table. In this way, because the number of recorded data flows is reduced, when restoring the measured values of these data flows , the accuracy of the obtained measurements is also relatively high.
下面对控制器实现数据流的测量值恢复进行说明。对于本设备实现数据流的测量值恢复与控制器实现数据流的测量值恢复的方法相似,在此不再赘述。此处需要说明的是,数据流 的测量值恢复是数据流测量的一部分。The controller implements the measurement value recovery of the data flow to be described below. The method in which the device realizes the recovery of the measured value of the data stream is similar to the method in which the controller realizes the recovery of the measured value of the data stream, and will not be repeated here. It should be noted here that the measurement value recovery of the data flow is a part of the data flow measurement.
参见图5,针对图3所示的数据流测量的方法,控制器实现数据流的测量恢复的方法可以包括如下步骤:Referring to FIG. 5, for the data flow measurement method shown in FIG. 3, the method for the controller to realize the measurement recovery of the data flow may include the following steps:
步骤201、接收网络设备发送的大流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、大流的流标识、目标数据表。Step 201: Receive the flow identifier of the large flow, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the flow identifier of the large flow, and the target data table sent by the network device.
步骤202、在目标数据表记录的大流的测量值中,将对应相同流标识的大流的测量值进行筛选,得到所述目标数据表记录的每个大流的第一测量值。Step 202 , in the measured values of the large flow recorded in the target data table, filter the measured values of the large flow corresponding to the same flow identification to obtain the first measured value of each large flow recorded in the target data table.
在实施中,由于在目标数据表中记录任一数据包的测量值时,是要在每个数据行的相应数据存储空间中记录的,那么,在目标数据表中,可能会出现多个数据存储空间中均记录了同一个大流的测量值的情况。在此情况下,可以对目标数据表中记录的大流的测量值进行筛选。筛选的方法可以有多种,下面列举几种进行说明:In the implementation, since the measured value of any data packet is recorded in the target data table, it is to be recorded in the corresponding data storage space of each data row, then, in the target data table, there may be multiple data The measurement values of the same large flow are recorded in the storage space. In this case, it is possible to filter the measured values of the large flow recorded in the target data table. There are many ways to filter, the following are listed below:
方法一、在目标数据表记录的大流的测量值中,将对应相同流标识的大流的最大测量值作为该大流的第一测量值。Method 1: Among the measured values of the large flow recorded in the target data table, the maximum measured value of the large flow corresponding to the same flow identification is used as the first measured value of the large flow.
例如,对于大流K 1,在目标数据表的三个数据存储空间中分别记录了其测量值为V 1、V 2、V 3。比较V 1、V 2、V 3的大小,将其中最大测量值作为大流K 1的第一测量值。 For example, for the large stream K 1 , its measured values V 1 , V 2 , and V 3 are respectively recorded in the three data storage spaces of the target data table. Compare the magnitudes of V 1 , V 2 , and V 3 , and take the largest measured value among them as the first measured value of the large flow K 1 .
方法二、在目标数据表记录的大流的测量值中,将对应相同流标识的大流的测量值的平均值作为该大流的第一测量值。Method 2: Among the measured values of the large flow recorded in the target data table, the average value of the measured values of the large flow corresponding to the same flow identification is used as the first measured value of the large flow.
例如,对于大流K 1,在目标数据表的三个数据存储空间中分别记录了其测量值为V 1、V 2、V 3。计算V 1、V 2、V 3的平均值
Figure PCTCN2021133234-appb-000001
Figure PCTCN2021133234-appb-000002
作为大流K 1的第一测量值。
For example, for the large stream K 1 , its measured values V 1 , V 2 , and V 3 are respectively recorded in the three data storage spaces of the target data table. Calculate the average value of V 1 , V 2 , V 3
Figure PCTCN2021133234-appb-000001
Will
Figure PCTCN2021133234-appb-000002
as the first measurement of the large flow K1.
方法三、在目标数据表记录的大流的测量值中,将对应相同流标识的大流的任一测量值作为该大流的第一测量值。Method 3: Among the measured values of the large flow recorded in the target data table, any measured value of the large flow corresponding to the same flow identification is used as the first measured value of the large flow.
例如,对于大流K 1,在目标数据表的三个数据存储空间中分别记录了其测量值为V 1、V 2、V 3。随机选取V 1、V 2、V 3中的任一值作为大流K 1的第一测量值。 For example, for the large stream K 1 , its measured values V 1 , V 2 , and V 3 are respectively recorded in the three data storage spaces of the target data table. Any value of V 1 , V 2 , and V 3 is randomly selected as the first measurement value of the large flow K 1 .
步骤203、在接收到的大流的测量值中,将对应相同存储空间标识、相同流标识的大流的测量值累加,得到接收到的每个大流的流标识对应的第二测量值。Step 203: In the received measured values of the large flow, accumulate the measured values of the large flows corresponding to the same storage space identifier and the same flow identifier to obtain a second measured value corresponding to the received flow identifier of each large flow.
在实施中,网络设备在目标数据表中记录大流的测量值时,可能会出现某个大流在同一数据存储空间中被替换过多次,而每次被替换后,该大流的测量值都会被发送至控制器。这样,控制器会接收到对应该数据存储空间的多个该大流的测量值(也即是接收到多个对应相同存储空间标识、相同流标识的测量值),这些测量值实际上是该大流在测量周期内的不同时间的测量值,为了统计该大流在该测量周期内的测量值,可以将这些测量值进行累加,得到该大流的第二测量值。此外,如果对应相同存储空间标识、相同流标识的大流的测量值只有一个,那么,可以将该测量值认为是该大流的第二测量值。In the implementation, when the network device records the measurement value of the large flow in the target data table, it may occur that a large flow has been replaced many times in the same data storage space, and after each replacement, the measurement of the large flow values are sent to the controller. In this way, the controller will receive multiple measurement values of the large flow corresponding to the data storage space (that is, receive multiple measurement values corresponding to the same storage space ID and the same flow ID), and these measurement values are actually the The measurement values of the large flow at different times in the measurement period, in order to count the measurement values of the large flow in the measurement period, these measurement values may be accumulated to obtain the second measurement value of the large flow. In addition, if there is only one measurement value corresponding to the large flow with the same storage space identification and the same flow identification, then the measurement value may be regarded as the second measurement value of the large flow.
步骤204、在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值。Step 204: In the received second measurement value corresponding to the flow identifier of each first data stream, filter the second measurement value of the first data stream corresponding to the same stream identifier to obtain each received first data stream. The flow identification of the data flow corresponds to the third measurement value.
在实施中,由于在目标数据表中记录任一数据包的测量值时,是要在每个数据行的相应数据存储空间中记录的,那么,可能会出现某一大流在多个数据存储空间中均被替换,而在每个数据存储空间中被替换后,该大流的测量值都会被发送至控制器。这样,控制器会接收 到对应多个数据存储空间的多个该大流的测量值(也即是接收到对应不同存储空间标识、相同流标识的多个大流的测量值)。在此情况下,可以对接收到对应不同存储空间标识、相同流标识的大流的测量值进行筛选。因为在步骤203中已经将对应相同存储空间标识、相同流标识的大流的测量值进行了累加,那么,在此处只要对对应不同存储空间标识、相同流标识的大流的第二测量值进行筛选即可。具体的,筛选方法与上述步骤202中对目标数据表中记录的大流的测量值的筛选方法可以相同,下面同样列举几种进行说明。In the implementation, since the measurement value of any data packet is recorded in the corresponding data storage space of each data row when recording the measurement value of any data packet in the target data table, there may be a large flow in multiple data storage spaces. Each data storage space is replaced, and after each data storage space is replaced, the measurement value of the large stream is sent to the controller. In this way, the controller will receive multiple measurement values of the large flow corresponding to multiple data storage spaces (that is, receiving measurement values of multiple large flows corresponding to different storage space identifiers and the same flow identifier). In this case, it is possible to filter the measurement values of the large streams received corresponding to different storage space identifiers and the same stream identifier. Because the measured values of the large flows corresponding to the same storage space identifier and the same flow identifier have been accumulated in step 203, here only the second measured value of the large flow corresponding to different storage space identifiers and the same flow identifier is required Just filter. Specifically, the screening method may be the same as the screening method for the measurement value of the large flow recorded in the target data table in the above step 202, and several are also listed below for description.
方法一、在接收到的各大流的流标识对应的第二测量值中,将对应相同流标识的大流的最大第二测量值作为该大流的第三测量值。Method 1: In the received second measurement values corresponding to the flow identifiers of the major streams, the largest second measurement value of the major streams corresponding to the same flow identifier is used as the third measurement value of the major stream.
例如,对于大流K 2,有三个对应不同存储空间标识的第二测量值为V 4、V 5、V 6。比较V 4、V 5、V 6的大小,将其中最大第二测量值作为大流K 2的第三测量值。 For example, for the large stream K 2 , there are three second measurement values V 4 , V 5 , and V 6 corresponding to different storage space identifiers. Compare the magnitudes of V 4 , V 5 , and V 6 , and take the largest second measurement value as the third measurement value of the large flow K 2 .
方法二、在接收到的各大流的流标识对应的第二测量值中,将对应相同流标识的大流的第二测量值的平均值作为该大流的第三测量值。Method 2: In the received second measurement values corresponding to the flow identifiers of the major streams, the average value of the second measurement values of the major streams corresponding to the same flow identifier is used as the third measurement value of the major stream.
例如,对于大流K 2,在目标数据表的三个数据存储空间中分别记录了其测量值为V 4、V 5、V 6。计算V 4、V 5、V 6的平均值
Figure PCTCN2021133234-appb-000003
Figure PCTCN2021133234-appb-000004
作为大流K 2的第一测量值。
For example, for the large stream K 2 , its measured values V 4 , V 5 , and V 6 are recorded in the three data storage spaces of the target data table, respectively. Calculate the average value of V 4 , V 5 , V 6
Figure PCTCN2021133234-appb-000003
Will
Figure PCTCN2021133234-appb-000004
as the first measurement of the large flow K2 .
方法三、在接收到的各大流的流标识对应的第二测量值中,将对应相同流标识的大流的任一第二测量值作为该大流的第三测量值。Method 3: In the received second measurement values corresponding to the flow identifiers of the major streams, use any second measurement value of the major stream corresponding to the same flow identifier as the third measurement value of the major stream.
例如,对于大流K 2,在目标数据表的三个数据存储空间中分别记录了其测量值为V 4、V 5、V 6。随机选取V 4、V 5、V 6中的任一值作为大流K 2的第三测量值。 For example, for the large stream K 2 , its measured values V 4 , V 5 , and V 6 are recorded in the three data storage spaces of the target data table, respectively. Any value of V 4 , V 5 , and V 6 is randomly selected as the third measurement value of the large flow K 2 .
步骤205、在目标数据表记录的每个大流的第一测量值和接收到的每个大流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个大流的流标识对应的统计测量值。Step 205: In the first measurement value of each large flow recorded in the target data table and the third measurement value corresponding to the received flow identification of each large flow, compare the first measurement value and the second measurement value corresponding to the same flow identification. The measurement values are accumulated to obtain the statistical measurement value corresponding to the flow ID of each large flow.
在实施中,网络设备可能会间断的接收到属于同一数据流的数据包,那么就可能出现如下情况:该数据流先被判断为大流,然后被其他数据流替换,最后又被判断为大流并持续到一个测量周期结束。在此情况下,会导致该数据流的流标识被作为大流的测量值发送至控制器,并且在发送至控制器的目标数据表中也会将该数据流作为大流进行记录。那么,为了统计出一个测量周期内数据流的测量值,可以在目标数据表记录的每个大流的第一测量值和接收到的每个大流的流标识对应的第三测量值中,将对应相同流标识的大流的第一测量值和第三测量值进行累加,作为该大流的流标识对应的统计测量值。In the implementation, the network device may intermittently receive data packets belonging to the same data stream, then the following situation may occur: the data stream is first judged as a large flow, then replaced by other data flows, and finally judged as a large flow flow and continue until the end of a measurement period. In this case, the flow identification of the data flow will be sent to the controller as a measure of the large flow, and the data flow will also be recorded as a large flow in the target data table sent to the controller. Then, in order to count the measured value of the data flow in one measurement period, in the first measured value of each large flow recorded in the target data table and the third measured value corresponding to the received flow identifier of each large flow, The first measurement value and the third measurement value of the large flow corresponding to the same flow identification are accumulated as the statistical measurement value corresponding to the flow identification of the large flow.
此外,如果某大流只有第一测量值或者第三测量值,则将该大流的第一测量值或者第二测量值,作为该大流的统计测量值。In addition, if a large flow has only the first measurement value or the third measurement value, the first measurement value or the second measurement value of the large flow is used as the statistical measurement value of the large flow.
步骤206、基于接收到的非大流的流标识和目标数据表,确定每个非大流的流标识对应的统计测量值。Step 206: Based on the received flow identifiers of the non-large flows and the target data table, determine the statistical measurement value corresponding to the flow identifiers of each non-large flow.
在实施中,针对上述步骤103中在该数据存储空间中记录目标数据流的测量值的方法一,此处,确定每个非大流的流标识对应的统计测量值的方法可以参见图6,具体可以包括如下步骤:In implementation, for the first method of recording the measured value of the target data stream in the data storage space in the above-mentioned step 103, here, the method for determining the statistical measured value corresponding to the stream identifier of each non-large stream can refer to FIG. 6, Specifically, the following steps may be included:
S2061、对于目标数据表中的每个数据存储空间,基于该数据存储空间所在数据行对应的第一特征值计算函数,在接收到的非大流的流标识中,确定该数据存储空间对应的非大流的流标识。S2061. For each data storage space in the target data table, based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, in the received stream identifiers of non-large streams, determine the corresponding data storage space. Flow ID for non-large flow.
对于接收到的每个非大流的流标识,将该非大流的流标识进行预处理,得到待计算数值。再将待计算数值输入到各数据行对应的第一特征值计算函数中,得到该流标识对应的多个输出结果。然后,确定每个输出结果对应的数据存储空间。这样,即可以确定出每个数据存储空间对应的非大流的流标识。For each received flow identifier of a non-large flow, the flow identifier of the non-large flow is preprocessed to obtain a value to be calculated. The value to be calculated is then input into the first eigenvalue calculation function corresponding to each data row to obtain a plurality of output results corresponding to the stream identifier. Then, determine the data storage space corresponding to each output result. In this way, the stream identifier of the non-large stream corresponding to each data storage space can be determined.
S2062、基于数据存储空间所在数据行对应的第二特征值计算函数,确定该数据存储空间对应的每个非大流的流标识对应的累加系数。将该数据存储空间对应的各非大流的流标识对应的统计测量值作为未知数乘以对应的累加系数,并进行累加,将该数据存储空间记录的数据流的测量值作为累加结果,得到目标方程。S2062. Based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located, determine the accumulation coefficient corresponding to the flow identifier of each non-large flow corresponding to the data storage space. Multiply the statistical measurement value corresponding to the flow identifier of each non-large stream corresponding to the data storage space as the unknown number by the corresponding accumulation coefficient, and perform accumulation, and use the measurement value of the data stream recorded in the data storage space as the accumulation result to obtain the target. equation.
例如,目标数据表的一个数据存储空间记录的非大流的测量值为Y,该数据存储空间对应的三个非大流为K 7、K 8、和K 9。通过该数据存储空间所在数据行对应的第二特征值计算函数得到K 7、K 8、和K 9的累加系数分别为X 7、X 8和X 9。假设三个非大流的统计测量值分别为未知数V 7、V 8和V 9,可以建立如下方程: For example, the measured value of the non-large flow recorded in one data storage space of the target data table is Y, and the three non-large flows corresponding to the data storage space are K 7 , K 8 , and K 9 . The accumulation coefficients of K 7 , K 8 , and K 9 are obtained by using the second eigenvalue calculation function corresponding to the data row where the data storage space is located, respectively, as X 7 , X 8 and X 9 . Assuming that the three statistical measurements of non-large currents are the unknowns V 7 , V 8 and V 9 , the following equations can be established:
X 7*V 7+X 8*V 8+X 9*V 9=Y。 X 7 *V 7 +X 8 *V 8 +X 9 *V 9 =Y.
需要说明的是,该方程仅为一种举例,在该方程的基础上还可以有其他的变换,在此不再一一列举。It should be noted that this equation is only an example, and other transformations may be made on the basis of this equation, which will not be listed one by one here.
S2063、将目标数据表中的各数据存储空间对应的目标方程,组成目标方程组。S2063. Form the target equations corresponding to each data storage space in the target data table into a target equation group.
S2064、基于线性优化算法,以接收到的非大流的流标识对应的统计测量值之和最小为优化目标,求解该目标方程组,得到每个非大流的流标识对应的统计测量值。S2064. Based on the linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of non-large flows as the optimization objective, solve the objective equation set, and obtain the statistical measurement values corresponding to each non-large flow flow identifier.
其中,线性优化算法可以为分枝定界法、割平面法、蒙特卡罗法等。Among them, the linear optimization algorithm may be a branch and bound method, a cut plane method, a Monte Carlo method, and the like.
在本申请中在目标数据表中记录非大流的测量值时是乘以对应累加系数后再记录的,相应的,在构建上述目标方程时,也要对未知数乘以对应的累加系数,通过上述处理,可以使方程组的解的数量相对较少,这样最后得到的解(各非大流的统计测量值)的误差也相对较小。In this application, when recording the measured value of non-large flow in the target data table, it is multiplied by the corresponding accumulation coefficient and then recorded. Correspondingly, when constructing the above target equation, the unknowns are also multiplied by the corresponding accumulation coefficient. The above processing can make the number of solutions of the equation system relatively small, so that the error of the finally obtained solution (statistical measurement value of each non-large flow) is relatively small.
针对上述步骤103中在该数据存储空间中记录目标数据流的测量值的方法二,此处,确定每个非大流的流标识对应的统计测量值的方法可以如下:For the second method of recording the measurement value of the target data stream in the data storage space in the above step 103, here, the method for determining the statistical measurement value corresponding to the flow identifier of each non-large stream may be as follows:
对于每个非大流的流标识,通过目标数据表每个数据行对应的第一特征值计算函数,确定出该非大流的流标识在每个数据行对应的数据存储空间。然后,将确定出的各存储空间中记录的非大流的测量值中的最小值,确定为该非大流的流标识对应的统计测量值,也即是,该非大流的统计测量值。For each non-large stream flow identifier, the data storage space corresponding to the non-large stream stream identifier in each data row is determined through the first eigenvalue calculation function corresponding to each data row of the target data table. Then, the minimum value among the measured values of the non-large flow recorded in the determined storage spaces is determined as the statistical measurement value corresponding to the flow identifier of the non-large flow, that is, the statistical measurement value of the non-large flow .
在一种可能的实现方式中,在得到的大流的流标识对应的统计测量值和非大流的流标识对应的统计测量值中,将对应相同流标识的测量值进行累加,得到每个流标识对应的总测量值。In a possible implementation manner, among the obtained statistical measurement values corresponding to the flow IDs of large flows and the statistical measurement values corresponding to the flow IDs of non-large flows, the measurement values corresponding to the same flow IDs are accumulated to obtain each The flow ID corresponds to the total measurement value.
在本申请实施例中,由于大流是对应记录的流标识和测量值,这样,最后得到的大流的测量值是相对准确的。并且由于在目标数据表中记录了非大流的测量值,这部分测量值是不包含大流的测量值的,这样,最后计算出的每个非大流的测量值也是比较准确的。In the embodiment of the present application, since the large flow is the corresponding recorded flow identification and measurement value, thus, the finally obtained measurement value of the large flow is relatively accurate. And because the measured value of non-large flow is recorded in the target data table, this part of the measured value does not include the measured value of large flow, so the finally calculated measured value of each non-large flow is also relatively accurate.
参见图7,本申请实施例还提供了一种数据流测量的方法,该方法的处理流程可以包括如下步骤:Referring to FIG. 7 , an embodiment of the present application further provides a method for measuring data flow, and the processing flow of the method may include the following steps:
步骤301、接收目标数据包,对于目标数据表的每个数据行,基于该数据行对应的第一特征值计算函数和目标数据包对应的流标识,确定目标数据包所属的目标数据流在该数据行对应的数据存储空间。 Step 301, receiving the target data packet, for each data row of the target data table, based on the first eigenvalue calculation function corresponding to the data row and the flow identifier corresponding to the target data packet, determine the target data stream to which the target data packet belongs. The data storage space corresponding to the data row.
该步骤301的具体实施方式与上述步骤101的具体实施方式相同或相似,在此不做赘述。The specific implementation manner of this step 301 is the same as or similar to the specific implementation manner of the above-mentioned step 101, and will not be repeated here.
步骤302、基于目标数据包对应的测量值,在该数据存储空间中,记录该目标数据流的测量值。Step 302: Based on the measurement value corresponding to the target data packet, record the measurement value of the target data stream in the data storage space.
在实施中,在数据存储空间中记录该目标数据流的测量值,可以有多种方法,下面列举两种进行说明。In implementation, there may be various methods for recording the measurement value of the target data stream in the data storage space, and two are listed below for description.
方法一、基于该数据存储空间所在的数据行对应的第二特征值计算函数和目标数据包的流标识,确定目标数据流对应的累加系数,将目标数据包的测量值乘以该累加系数,得到目标数据包的调整测量值,将目标数据包的调整测量值累加到数据存储空间中记录的数据流的测量值上。Method 1: Based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located and the flow identifier of the target data packet, determine the accumulation coefficient corresponding to the target data flow, and multiply the measurement value of the target data packet by the accumulation coefficient, The adjusted measurement value of the target data packet is obtained, and the adjusted measurement value of the target data packet is accumulated to the measurement value of the data flow recorded in the data storage space.
对于目标数据表的每个数据行,除对应一个第一特征值计算函数以外,还可以对应一个第二特征值计算函数。其中,该第二特征值计算函数也可以为一种哈希函数,每个数据行对应的第二特征值计算函数不同。For each data row of the target data table, in addition to corresponding to a first eigenvalue calculation function, it may also correspond to a second eigenvalue calculation function. The second feature value calculation function may also be a hash function, and the second feature value calculation function corresponding to each data row is different.
对于上述确定出的目标数据流对应的每个数据存储空间,在基于目标数据包的测量值,记录目标数据流的测量值时,可以先将目标数据包对应的待计算数值输入到该数据存储空间所在的数据行对应的第二特征值计算函数中,得到该流标识对应的累加系数。其中,累加系数可以为小数。For each data storage space corresponding to the target data stream determined above, when recording the measurement value of the target data stream based on the measurement value of the target data packet, the to-be-calculated value corresponding to the target data packet may be input into the data storage first. In the second eigenvalue calculation function corresponding to the data row where the space is located, the accumulation coefficient corresponding to the stream identifier is obtained. Among them, the accumulation coefficient can be a decimal.
然后,将目标数据包的测量值乘以该累加系数,得到目标数据包的调整测量值。最后,将目标数据包的调整测量值累加到该数据存储空间中记录的数据流的测量值上。Then, the measured value of the target data packet is multiplied by the accumulation coefficient to obtain the adjusted measured value of the target data packet. Finally, the adjusted measurement of the target packet is accumulated to the measurement of the data flow recorded in the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,首先,采用第二特征值计算函数对K 1进行计算,得到的累加系数为X 1。然后,计算目标数据包的调整测量值X 1*V 1。最后,将目标数据包的调整测量值X 1*V 1累加到记录的数据流的测量值上,即,将记录的数据流的测量值E,更新为(E+X 1*V 1)。 For example, the flow identifier corresponding to the target data packet is K 1 , and the measured value is V 1 . First, K 1 is calculated by using the second eigenvalue calculation function, and the obtained accumulation coefficient is X 1 . Then, the adjusted measurement value X 1 *V 1 of the target packet is calculated. Finally, the adjusted measured value X 1 *V 1 of the target data packet is accumulated to the measured value of the recorded data stream, that is, the measured value E of the recorded data stream is updated to (E+X 1 *V 1 ).
方法二、直接将目标数据包的测量值累加到该数据存储空间中记录的数据流的测量值上。The second method is to directly accumulate the measured value of the target data packet to the measured value of the data stream recorded in the data storage space.
例如,目标数据包对应的流标识为K 1,测量值为V 1,将目标数据包的测量值V 1累加到记录的数据流的测量值上,即,将记录的数据流的测量值E更新为(E+V 1)。 For example, the flow corresponding to the target data packet is identified as K 1 and the measurement value is V 1 , and the measurement value V 1 of the target data packet is accumulated to the measurement value of the recorded data flow, that is, the measurement value E of the recorded data flow is added. Update to (E+V 1 ).
步骤303、如果目标数据流是该数据存储空间对应的第一数据流,则基于目标数据包的测量值,确定目标数据流的测量值,记录在数据存储空间中。Step 303: If the target data stream is the first data stream corresponding to the data storage space, determine the measurement value of the target data stream based on the measurement value of the target data packet, and record it in the data storage space.
该步骤303的具体实施方式与上述步骤102的具体实施方式相同或相似,在此不做赘述。The specific implementation of this step 303 is the same as or similar to the specific implementation of the above-mentioned step 102, and will not be repeated here.
在本申请实施例中,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。此外,虽然在本申请实施例中在目标数据表对数据流(包括大流和非大流)的测量值进行了记录而非仅对非大流的测量值进行记录。但是因为单独记录的大流的测量值,在后续恢复非大流的测量值时,可以根据记录的数据流的测量值以及单独记录的大流的测量值,得到非大流的测量值,因此,同样可以达到上述图1所示实施例所能达到的技术效果。In this embodiment of the present application, after a data packet is received, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, so that the measurement value of the large flow can be recorded. is relatively accurate. In addition, although in the embodiment of the present application, the measurement value of the data flow (including the large flow and the non-large flow) is recorded in the target data table instead of only the measurement value of the non-large flow. However, because of the separately recorded measurement values of the large flow, when the measurement value of the non-large flow is subsequently restored, the measured value of the non-large flow can be obtained according to the measured value of the recorded data flow and the separately recorded measurement value of the large flow. Therefore, , the technical effect that can be achieved by the above-mentioned embodiment shown in FIG. 1 can also be achieved.
参见图8针对图7所示的数据流测量的方法,控制器实现数据流的测量值恢复的方法可以包括如下步骤:Referring to FIG. 8 for the data flow measurement method shown in FIG. 7 , the method for the controller to restore the measurement value of the data flow may include the following steps:
步骤401、接收网络设备发送的大流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、大流的流标识、目标数据表。Step 401: Receive the flow identifier of the large flow, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the flow identifier of the large flow, and the target data table sent by the network device.
步骤402、在目标数据表记录的大流的测量值中,将对应相同流标识的大流的测量值进行筛选,得到所述目标数据表记录的每个大流的第一测量值。Step 402: In the measured values of the large flows recorded in the target data table, filter the measured values of the large flows corresponding to the same flow identification to obtain the first measured value of each large flow recorded in the target data table.
该步骤402的具体实施方式与上述步骤202的具体实施方式相同或相似,在此不做赘述。The specific implementation manner of this step 402 is the same as or similar to the specific implementation manner of the above-mentioned step 202, and will not be repeated here.
步骤403、在接收到的大流的测量值中,将对应相同存储空间标识、相同流标识的大流的测量值累加,得到接收到的每个大流的流标识对应的第二测量值。Step 403: In the received measured values of the large flow, accumulate the measured values of the large flows corresponding to the same storage space identifier and the same flow identifier to obtain a second measured value corresponding to the received flow identifier of each large flow.
该步骤403的具体实施方式与上述步骤403的具体实施方式相同或相似,在此不做赘述。The specific implementation manner of this step 403 is the same as or similar to the specific implementation manner of the above-mentioned step 403, and will not be repeated here.
步骤404、在接收到的每个大流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个大流的流标识对应的第三测量值。Step 404: In the received second measurement value corresponding to the flow identifier of each large stream, filter the second measurement value of the first data stream corresponding to the same stream identifier to obtain the received flow of each large stream. A corresponding third measurement value is identified.
该步骤404的具体实施方式与上述步骤204的具体实施方式相同或相似,在此不做赘述。The specific implementation manner of this step 404 is the same as or similar to the specific implementation manner of the above-mentioned step 204, and will not be repeated here.
步骤405、在目标数据表记录的每个大流的第一测量值和接收到的每个大流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个大流的流标识对应的统计测量值。Step 405: In the first measurement value of each large flow recorded in the target data table and the third measurement value corresponding to the received flow identification of each large flow, compare the first measurement value and the second measurement value corresponding to the same flow identification. The measurement values are accumulated to obtain the statistical measurement value corresponding to the flow ID of each large flow.
该步骤405的具体实施方式与上述步骤205的具体实施方式相同或相似,在此不做赘述。The specific implementation manner of this step 405 is the same as or similar to the specific implementation manner of the above-mentioned step 205, and will not be repeated here.
步骤406、基于接收到的非大流的流标识、目标数据表中每个数据存储空间记录的数据流的测量值和得到的每个大流的流标识对应的统计测量值,确定每个非大流的流标识对应的统计测量值。 Step 406, based on the received flow identification of the non-large flow, the measured value of the data flow recorded in each data storage space in the target data table, and the obtained statistical measurement value corresponding to the flow identification of each large flow, determine each non-large flow. The flow ID of the large flow corresponds to the statistical measurement value.
在实施中,针对上述步骤302中在数据存储空间中记录目标数据流的测量值的方法一,此处,确定每个非大流的流标识对应的测量值的方法可以参见图9,具体可以包括如下步骤:In implementation, for the first method of recording the measurement value of the target data stream in the data storage space in the above step 302, here, the method for determining the measurement value corresponding to the flow identifier of each non-large stream can refer to FIG. It includes the following steps:
S4061、对于目标数据表的每个数据存储空间,基于数据存储空间所在数据行对应的第二特征值计算函数,确定该数据存储空间对应的每个大流的流标识对应的累加系数。将该数据存储空间对应的每个第一数据流的流标识对应的统计测量值乘以对应的累加系数,得到该数据存储空间对应的每个第一数据流的流标识对应的调整统计测量值。S4061. For each data storage space of the target data table, determine the accumulation coefficient corresponding to the flow identifier of each large stream corresponding to the data storage space based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located. Multiply the statistical measurement value corresponding to the flow identifier of each first data stream corresponding to the data storage space by the corresponding accumulation coefficient to obtain the adjusted statistical measurement value corresponding to the flow identifier of each first data stream corresponding to the data storage space .
其中,目标数据表中每个数据存储空间对应的大流,包括该数据存储空间中记录的大流的流标识对应的大流以及接收到网络设备发送的对应该数据存储空间的存储空间标识的大流的流标识所对应的大流。The large flow corresponding to each data storage space in the target data table includes the large flow corresponding to the flow identification of the large flow recorded in the data storage space and the storage space identification corresponding to the data storage space sent by the network device. The flow ID of the big flow corresponds to the big flow.
例如,目标数据表的数据存储空间 1记录了大流的流标识K 1,其中,数据存储空间 1指存储空间标识为 1的数据存储空间。并且接收到了对应存储空间标识 1的大流的流标识K 2。因此,该数据存储空间 1对应的两个大流分别为K 1、K 2。通过该数据存储空间所在数据行对应的第二特征值计算函数得到K 1、K 2累加系数分别为X 1、X 1For example, the data storage space 1 of the target data table records the flow identifier K 1 of the large stream, wherein the data storage space 1 refers to the data storage space whose storage space identifier is 1 . And the stream identifier K 2 of the large stream corresponding to the storage space identifier 1 is received. Therefore, the two large streams corresponding to the data storage space 1 are K 1 and K 2 respectively. According to the second eigenvalue calculation function corresponding to the data row where the data storage space is located, the accumulated coefficients of K 1 and K 2 are obtained as X 1 and X 1 respectively.
S4062、基于该数据存储空间所在数据行对应的第一特征值计算函数,在接收到的非大流的流标识中,确定该数据存储空间对应的非大流的流标识,基于数据存储空间所在数据行对应的第二特征值计算函数,确定该数据存储空间对应的每个非流的流标识对应的累加系数。S4062. Based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, in the received flow identifiers of the non-large stream, determine the stream identifier of the non-large stream corresponding to the data storage space, based on the location of the data storage space. The second eigenvalue calculation function corresponding to the data row determines the accumulation coefficient corresponding to each non-flow stream identifier corresponding to the data storage space.
例如,确定出目标数据表的数据存储空间1对应的三个非大流为K 3、K 4、和K 5。通过该数据存储空间所在数据行对应的第二特征值计算函数得到K 3、K 4、和K 5的累加系数分别 为X 3、X 4和X 5For example, it is determined that the three non-large streams corresponding to the data storage space 1 of the target data table are K 3 , K 4 , and K 5 . The accumulation coefficients of K 3 , K 4 , and K 5 are obtained by using the second eigenvalue calculation function corresponding to the data row where the data storage space is located, as X 3 , X 4 and X 5 , respectively.
S4063、将数据存储空间对应的各非大流的流标识对应的统计测量值作为未知数乘以对应的累加系数,与数据存储空间对应的每个大流的流标识对应的调整统计测量值相加,将数据存储空间记录的数据流的测量值作为累加结果,得到数据存储空间对对应的目标方程。S4063: Multiply the statistical measurement value corresponding to the flow identifier of each non-large stream corresponding to the data storage space as an unknown by the corresponding accumulation coefficient, and add the adjusted statistical measurement value corresponding to the flow identifier of each large stream corresponding to the data storage space , the measured value of the data stream recorded in the data storage space is used as the accumulation result, and the target equation corresponding to the data storage space pair is obtained.
例如,目标数据表的数据存储空间 1记录的数据流的测量值为E 1,对应的大流为K 1和K 2,对应的非大流为K 3、K 4、和K 5,K 1、K 2、K 3、K 4、和K 5对应的累加系数分别为X 1、X2、X 3、X 4和X 5。假设三个非大流K 3、K 4、和K 5的统计测量值分别为未知数V 3、V 4和V 5,可以建立如下方程: For example, the measured value of the data flow recorded in the data storage space 1 of the target data table is E 1 , the corresponding large flows are K 1 and K 2 , and the corresponding non-large flows are K 3 , K 4 , and K 5 , K 1 The accumulation coefficients corresponding to , K 2 , K 3 , K 4 , and K 5 are X 1 , X2 , X 3 , X 4 and X 5 , respectively. Assuming that the statistical measurements of the three non-large currents K 3 , K 4 , and K 5 are the unknowns V 3 , V 4 , and V 5 , respectively, the following equations can be established:
X 1*V 1+X 2*V 2+X 3*V 3+X 4*V 4+X 5*V 5+X 6*V 6=E 1X 1 *V 1 +X 2 *V 2 +X 3 *V 3+ X 4 *V 4 +X 5 *V 5 +X 6 *V 6 =E 1 .
需要说明的是,该方程仅为一种举例,在该方程的基础上还可以有其他的变换,在此不再一一列举。It should be noted that this equation is only an example, and other transformations may be made on the basis of this equation, which will not be listed one by one here.
S4064、基于目标数据表中的各数据存储空间对应的目标方程,组成目标方程组。S4064. Based on the target equations corresponding to each data storage space in the target data table, form a target equation group.
S4065、基于线性优化算法,以接收到的非大流的流标识对应的统计测量值之和最小为优化目标,求解目标方程组,得到每个第二数据流的流标识对应的统计测量值。S4065. Based on the linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of non-large flows as the optimization objective, solve the objective equation system, and obtain the statistical measurement value corresponding to the flow identifier of each second data stream.
其中,线性优化算法可以为分枝定界法、割平面法、蒙特卡罗法等。Among them, the linear optimization algorithm may be a branch and bound method, a cut plane method, a Monte Carlo method, and the like.
在本申请实施例中,由于大流是对应记录的流标识和测量值,这样,最后得到的大流的测量值是相对准确的。并且即使在目标数据表中并非仅记录了非大流的测量值,但是可以根据记录的数据流的测量值和大流的测量值,得到非大流的测量值。因此,同样可以达到上述图5所示的实施例所达到的技术效果。In the embodiment of the present application, since the large flow is the corresponding recorded flow identification and measurement value, thus, the finally obtained measurement value of the large flow is relatively accurate. And even if not only the measured value of the non-large flow is recorded in the target data table, the measured value of the non-large flow can be obtained according to the measured value of the recorded data flow and the measured value of the large flow. Therefore, the technical effect achieved by the above-mentioned embodiment shown in FIG. 5 can also be achieved.
参见图10,本申请实施例还提供了一种数据流测量的方法,该方法的处理流程可以包括如下步骤:Referring to FIG. 10 , an embodiment of the present application further provides a method for measuring data flow, and the processing flow of the method may include the following steps:
步骤501、接收目标数据包,基于第三特征值计算函数和目标数据包对应的流标识,在对应第一数据表中确定目标数据包所属的目标数据流对应的数据存储空间。Step 501: Receive the target data packet, and determine the data storage space corresponding to the target data flow to which the target data packet belongs in the corresponding first data table based on the third feature value calculation function and the flow identifier corresponding to the target data packet.
其中,第一数据表可以为哈希表,第三特征值计算函数可以为哈希函数,第一数据表对于一个第三特征值计算函数。第三特征值计算函数可以有n种计算结果,n为该第一数据表的列数,也即是,该第一数据表对应的数据存储空间的个数。m种计算结果中的每种计算结果对应一个数据存储空间,也即是,m种计算结果与m个数据存储空间一一对应。其中,数据存储空间也可以称为桶,在目标数据表为哈希表的情况下,第一数据表对应的数据存储空间可以称为哈希桶。The first data table may be a hash table, the third feature value calculation function may be a hash function, and the first data table is a third feature value calculation function. The third eigenvalue calculation function may have n kinds of calculation results, where n is the number of columns of the first data table, that is, the number of data storage spaces corresponding to the first data table. Each of the m types of calculation results corresponds to one data storage space, that is, the m types of calculation results are in one-to-one correspondence with the m data storage spaces. The data storage space may also be referred to as a bucket, and when the target data table is a hash table, the data storage space corresponding to the first data table may be referred to as a hash bucket.
在实施中,网络设备当接收到一个数据包时,确定该数据包所属的数据流在第一数据表中对应的数据存储空间。也即是,确定该数据包的测量值需要记录在第一数据表对应的哪个数据存储空间中。为了便于叙述,本文中将当前接收到的数据包称为目标数据包,该数据包所属的数据流称为目标数据流。In an implementation, when receiving a data packet, the network device determines the corresponding data storage space in the first data table of the data flow to which the data packet belongs. That is, it is determined in which data storage space corresponding to the first data table the measurement value of the data packet needs to be recorded. For convenience of description, the currently received data packet is referred to as a target data packet, and the data stream to which the data packet belongs is referred to as a target data stream.
确定目标数据流在该第一数据表中对应的数据存储空间,可以有如下方法:Determining the data storage space corresponding to the target data stream in the first data table may include the following methods:
将目标数据包对应的流标识进行预处理,得到待计算数值。其中,预处理可以为将流标识转换为二进制数,相应的,待计算数值为流标识对应的二进制数。然后,将待计算数值输入到第三特征值计算函数中,得到该流标识对应的输出结果。最后,在输出结果和数据存储 空间的对应关系中,确定出该流标识对应的输出结果所对应的数据存储空间。The flow identifier corresponding to the target data packet is preprocessed to obtain the value to be calculated. The preprocessing may be converting the stream identifier into a binary number, and correspondingly, the value to be calculated is the binary number corresponding to the stream identifier. Then, the value to be calculated is input into the third eigenvalue calculation function to obtain an output result corresponding to the flow identifier. Finally, in the corresponding relationship between the output result and the data storage space, the data storage space corresponding to the output result corresponding to the stream identifier is determined.
步骤502、如果目标数据流是该数据存储空间对应的大流,则基于目标数据包的测量值,确定目标数据流的测量值,记录在该数据存储空间中。Step 502: If the target data stream is a large stream corresponding to the data storage space, determine the measurement value of the target data stream based on the measurement value of the target data packet, and record it in the data storage space.
该步骤502的具体实施方式与上述步骤102的具体实施方式相同或相似,在此不做赘述。The specific implementation of this step 502 is the same as or similar to the specific implementation of the above-mentioned step 102, and will not be repeated here.
值得一提的是,在上述步骤102中目标数据表对应的数据存储空间中记录的大流的流标识、大流的测量值和比较测量值,在该步骤502中由第一数据表对应的数据存储空间记录。It is worth mentioning that, in the above step 102, the flow identifier of the large flow, the measured value of the large flow and the comparative measured value recorded in the data storage space corresponding to the target data table, in this step 502, are corresponding to the first data table. Data storage space records.
步骤503、如果目标数据流不是该数据存储空间对应的大流,则基于目标数据包的测量值,在目标数据表中,记录该目标数据流的测量值。Step 503: If the target data stream is not a large stream corresponding to the data storage space, record the measurement value of the target data stream in the target data table based on the measurement value of the target data packet.
该步骤503的具体实施方式与上述步骤103的具体实施方式相同或相似,在此不做赘述。需要说明的是,该步骤503与上述步骤103的具体实施方式的区别在于:该步骤503需要先根据目标数据表的每个数据行对应的第一特征值计算函数,确定出目标数据流在每个数据行对应的数据存储空间。然后,再基于目标数据包的测量值,确定目标数据流的测量值,记录在该数据存储空间中。另外,在该步骤503中记录非大流的流标识也仅需一个Bloom Filter。The specific implementation of this step 503 is the same as or similar to the specific implementation of the above-mentioned step 103, and will not be repeated here. It should be noted that the difference between this step 503 and the specific implementation of the above-mentioned step 103 is that: this step 503 needs to first determine the target data stream according to the first eigenvalue calculation function corresponding to each data row of the target data table. The data storage space corresponding to each data row. Then, based on the measurement value of the target data packet, the measurement value of the target data stream is determined and recorded in the data storage space. In addition, in this step 503, only one Bloom Filter is required to record the flow identifier of the non-large flow.
此外,还需说明的是,在每个测量周期结束后,与上述图1所示的数据流测量的方法不同的是,在该图5所示的数据流测量的方法中还需要将本地存储的第一数据表取出在其他存储空间进行存储,或者发送至控制器。还需要将当前存储的该第一数据表初始化。对当前存储的该第一数据表初始化可以为将该第一数据表中记录的数据删除。In addition, it should be noted that, after each measurement period ends, different from the data flow measurement method shown in FIG. 1 above, the data flow measurement method shown in FIG. 5 also needs to store the data locally. The first data table is fetched and stored in other storage space, or sent to the controller. It is also necessary to initialize the currently stored first data table. Initializing the currently stored first data table may be to delete the data recorded in the first data table.
在本申请实施例中,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。并且由于对大流的测量值单独记录,使得目标数据表中可以仅记录大流以外的数据流的测量值,这样,因为记录的数据流的数量减少,使得在恢复这些数据流的测量值时,得到的测量值的准确度也相对较高。In this embodiment of the present application, after a data packet is received, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, so that the measurement value of the large flow can be recorded. is relatively accurate. And since the measured values of the large flow are recorded separately, only the measured values of the data flow other than the large flow can be recorded in the target data table. In this way, because the number of recorded data flows is reduced, when restoring the measured values of these data flows , the accuracy of the obtained measurements is also relatively high.
参见图11,针对图10所示的数据流测量的方法,控制器实现数据流的测量值恢复的方法可以包括如下步骤:Referring to FIG. 11 , for the data flow measurement method shown in FIG. 10 , the method for the controller to restore the measurement value of the data flow may include the following steps:
步骤601、接收网络设备发送的大流的流标识和测量值、非大流的流标识、目标数据表和第一数据表。Step 601: Receive the flow identifier and measurement value of the large flow, the flow identifier of the non-large flow, the target data table and the first data table sent by the network device.
步骤602、在接收到的大流的测量值和第一数据表记录的测量值中,将对应相同流标识的测量值进行累加,得到每个大流的流标识对应的统计测量值。Step 602 : Accumulate the measurement values corresponding to the same flow identifier in the received measurement value of the large flow and the measurement value recorded in the first data table to obtain a statistical measurement value corresponding to the flow identifier of each large flow.
在实施中,网络设备可能会间断的接收到属于同一数据流的数据包,那么就可能出现如下情况:该数据流先被判断为大流,然后被其他数据流替换,最后又被判断为大流并持续到一个测量周期结束。在此情况下,会导致该数据流的流标识被作为大流的测量值发送至控制器,并且在发送至控制器的第一数据表中也会将该数据流作为大流进行记录。为了统计出一个测量值周期内数据流的测量值,可以在接收到的大流的测量值和第一数据表中记录的大流的测量值中,将对应相同流标识的大流的测量值和中间测量值进行累加,作为该大流的流标识对应的统计测量值。In the implementation, the network device may intermittently receive data packets belonging to the same data stream, then the following situation may occur: the data stream is first judged as a large flow, then replaced by other data flows, and finally judged as a large flow flow and continue until the end of a measurement period. In this case, the flow identification of the data flow will be sent to the controller as a measurement value of the large flow, and the data flow will also be recorded as a large flow in the first data table sent to the controller. In order to count the measured value of the data flow in one measurement value period, the measured value of the large flow corresponding to the same flow identification can be calculated from the received measured value of the large flow and the measured value of the large flow recorded in the first data table. It is accumulated with the intermediate measurement value as the statistical measurement value corresponding to the flow ID of the large flow.
步骤603、基于接收到的非大流的流标识和目标数据表,确定每个非大流的流标识对应的统计测量值。Step 603: Based on the received flow identifiers of the non-large flows and the target data table, determine the statistical measurement value corresponding to the flow identifiers of each non-large flow.
该步骤603的具体实施方式与上述步骤204的具体实施方式相同或相似,在此不做赘述。The specific implementation of this step 603 is the same as or similar to the specific implementation of the above-mentioned step 204, and will not be repeated here.
在本申请实施例中,由于大流是对应记录的流标识和测量值,这样,最后得到的大流的测量值是相对准确的。并且由于在目标数据表中记录了非大流的测量值,这部分测量值是不包含大流的测量值的,这样,最后计算出的每个非大流的测量值也是比较准确的。In the embodiment of the present application, since the large flow is the corresponding recorded flow identification and measurement value, thus, the finally obtained measurement value of the large flow is relatively accurate. And because the measured value of non-large flow is recorded in the target data table, this part of the measured value does not include the measured value of large flow, so the finally calculated measured value of each non-large flow is also relatively accurate.
基于相同的技术构思,本申请实施例还提供了一种数据流测量的装置,如图12所示,该装置包括接收模块710和记录模块720。该数据测量的装置可以执行多种不同的数据测量的方法,相应的,在执行不同的数据测量方法时,接收模块710和记录模块720所实现的功能也可以不同。下面对于数据流测量的装置在执行不同的数据测量的方法时,接收模块710和记录模块720所实现的功能进行说明。Based on the same technical concept, an embodiment of the present application also provides an apparatus for measuring data flow. As shown in FIG. 12 , the apparatus includes a receiving module 710 and a recording module 720 . The apparatus for data measurement can perform a variety of different data measurement methods. Correspondingly, when performing different data measurement methods, the functions implemented by the receiving module 710 and the recording module 720 can also be different. The following describes the functions implemented by the receiving module 710 and the recording module 720 when the apparatus for data flow measurement performs different data measurement methods.
一、数据流测量的装置执行上述图1所示的数据测量的方法时。1. When the apparatus for data flow measurement executes the data measurement method shown in FIG. 1 above.
收发模块710,用于接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行中对应的数据存储空间。示例性的,该收发模块710用于执行步骤101。The transceiver module 710 is configured to receive a target data packet, and for each data row of the target data table, determine the target data based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet The data storage space corresponding to the target data stream to which the packet belongs in the data row. Exemplarily, the transceiver module 710 is configured to perform step 101 .
处理模块720,用于如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中;如果所述目标数据流不是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。示例性的,该处理模块720用于执行步骤102、步骤103。The processing module 720 is configured to, if the target data stream is the first data stream corresponding to the data storage space, determine the measurement value of the target data stream based on the measurement value of the target data packet, and record it in the in the data storage space; if the target data stream is not the first data stream corresponding to the data storage space, then based on the measurement value of the target data packet, record the measurement value of the target data stream in the target data table . Exemplarily, the processing module 720 is configured to execute step 102 and step 103 .
在本申请实施例中,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。并且由于对大流的测量值单独记录,使得目标数据表中可以仅记录大流以外的数据流的测量值,这样,因为记录的数据流的数量减少,使得在恢复这些数据流的测量值时,得到的测量值的准确度也相对较高。In this embodiment of the present application, after a data packet is received, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, so that the measurement value of the large flow can be recorded. is relatively accurate. And since the measured values of the large flow are recorded separately, only the measured values of the data flow other than the large flow can be recorded in the target data table. In this way, because the number of recorded data flows is reduced, when restoring the measured values of these data flows , the accuracy of the obtained measurements is also relatively high.
二、数据流测量的装置执行上述图7所示的数据测量的方法时。2. When the apparatus for data flow measurement executes the data measurement method shown in FIG. 7 above.
收发模块710,用于接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行对应的数据存储空间。示例性的,该收发模块710用于执行步骤301。The transceiver module 710 is configured to receive a target data packet, and for each data row of the target data table, determine the target data based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet The target data stream to which the packet belongs is in the data storage space corresponding to the data row. Exemplarily, the transceiver module 710 is configured to perform step 301 .
处理模块720,用于基于所述目标数据包对应的测量值,在所述数据存储空间中,记录所述目标数据流的测量值;如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中。示例性的,该处理模块720用于执行步骤302、步骤303。The processing module 720 is configured to, based on the measurement value corresponding to the target data packet, record the measurement value of the target data stream in the data storage space; if the target data stream is the first data stream corresponding to the data storage space For a data stream, the measurement value of the target data stream is determined based on the measurement value of the target data packet and recorded in the data storage space. Exemplarily, the processing module 720 is configured to execute steps 302 and 303 .
在本申请实施例中,在接收到数据包后,先判断该数据包所属数据流是否为大流,如果为大流则对其流标识和测量值单独记录,这样可以使大流的测量值是相对准确的。此外,虽然在本申请实施例中在目标数据表对数据流(包括大流和非大流)的测量值进行了记录而非仅对非大流的测量值进行记录。但是因为单独记录的大流的测量值,在后续恢复非大流的测量值时,可以根据记录的数据流的测量值以及单独记录的大流的测量值,得到非大流的测量值,因此,同样可以达到上述图1所示实施例所能达到的技术效果。In this embodiment of the present application, after a data packet is received, it is first determined whether the data flow to which the data packet belongs is a large flow, and if it is a large flow, its flow identification and measurement value are recorded separately, so that the measurement value of the large flow can be recorded. is relatively accurate. In addition, although in the embodiment of the present application, the measurement value of the data flow (including the large flow and the non-large flow) is recorded in the target data table instead of only the measurement value of the non-large flow. However, because of the separately recorded measurement values of the large flow, when the measurement value of the non-large flow is subsequently restored, the measured value of the non-large flow can be obtained according to the measured value of the recorded data flow and the separately recorded measurement value of the large flow. Therefore, , the technical effect that can be achieved by the above-mentioned embodiment shown in FIG. 1 can also be achieved.
需要说明的是:上述实施例提供的数据流测量的装置在数据流测量时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将网络设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据流测量的装置与数据流测量的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the data flow measurement device provided in the above embodiments is used for data flow measurement, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the network device into different functional modules to complete all or part of the functions described above. In addition, the apparatus for data flow measurement provided in the above embodiment and the method embodiment for data flow measurement belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, which will not be repeated here.
基于相同的技术构思,本申请实施例还提供了一种数据流测量的装置,如图13所示,该装置包括接收模块810和计算模块820。该数据测量的装置可以执行多种不同的数据测量的方法,相应的,在执行不同的数据测量方法时,接收模块810和计算模块820所实现的功能也可以不同。下面对于数据流测量的装置在执行不同的数据测量的方法时,接收模块810和计算模块820所实现的功能进行说明。Based on the same technical concept, an embodiment of the present application further provides an apparatus for measuring data flow. As shown in FIG. 13 , the apparatus includes a receiving module 810 and a computing module 820 . The apparatus for data measurement can perform a variety of different data measurement methods. Correspondingly, when performing different data measurement methods, the functions implemented by the receiving module 810 and the computing module 820 can also be different. The following describes the functions implemented by the receiving module 810 and the computing module 820 when the apparatus for data flow measurement executes different data measurement methods.
一、数据流测量的装置执行上述图5所示的数据测量的方法时。1. When the apparatus for data flow measurement executes the data measurement method shown in FIG. 5 above.
接收模块810,用于接收网络设备发送的第一数据流的流标识和对应的测量值、第二数据流的流标识、目标数据表。示例性的,该接收模块810可以用于执行步骤201。The receiving module 810 is configured to receive the flow identifier of the first data stream and the corresponding measurement value, the stream identifier of the second data stream, and the target data table sent by the network device. Exemplarily, the receiving module 810 may be used to perform step 201 .
处理模块820,用于在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;在所述目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第三测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值。示例性的,该处理模块820可以用于执行步骤201-206任一步骤。The processing module 820 is configured to filter the measured values of the first data stream corresponding to the same stream identifier among the measured values of the first data stream recorded in the target data table, and obtain each first data stream recorded in the target data table. A first measurement value of a data stream; in the received measurement values of the first data stream, the measurement values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain each received first data stream. The second measurement value corresponding to the flow identifier of the data stream; in the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value of the first data stream corresponding to the same flow identifier is screened , to obtain the third measurement value corresponding to the stream identifier of each first data stream received; the first measurement value of each first data stream recorded in the target data table and each received first data stream In the third measurement value corresponding to the stream identifier, the first measurement value and the third measurement value corresponding to the same stream identifier are accumulated to obtain the statistical measurement value corresponding to the stream identifier of each first data stream; The flow identifiers of the two data streams and the target data table determine the statistical measurement value corresponding to the stream identifiers of each second data stream. Exemplarily, the processing module 820 can be used to execute any of steps 201-206.
在本申请实施例中,由于大流是对应记录的流标识和测量值,这样,最后得到的大流的测量值是相对准确的。并且由于在目标数据表中记录了非大流的测量值,这部分测量值是不包含大流的测量值的,这样,最后计算出的每个非大流的测量值也是比较准确的。In the embodiment of the present application, since the large flow is the corresponding recorded flow identification and measurement value, thus, the finally obtained measurement value of the large flow is relatively accurate. And because the measured value of non-large flow is recorded in the target data table, this part of the measured value does not include the measured value of large flow, so the finally calculated measured value of each non-large flow is also relatively accurate.
二、数据流测量的装置执行上述图8所示的数据测量的方法时。2. When the apparatus for data flow measurement executes the data measurement method shown in FIG. 8 above.
接收模块810,用于接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表。示例性的,该接收模块810用于执行步骤401。The receiving module 810 is configured to receive the stream identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device. Exemplarily, the receiving module 810 is configured to perform step 401 .
计算模块820,用于在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的流标识对应的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;在所述 目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;基于接收到的第二数据流的流标识、所述目标数据表中每个数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值。示例性的,该处理模块820可以用于执行步骤401-406中任一步骤。The calculation module 820 is configured to screen the measured values of the first data stream corresponding to the same stream identifier in the measured values of the first data stream recorded in the target data table, and obtain each first data stream recorded in the target data table. A first measurement value of a data stream; in the received measurement values of the first data stream, the measurement values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain each received first data stream. The second measurement value corresponding to the stream identifier of the data stream; in the received second measurement value corresponding to the stream identifier of each first data stream, the second measurement value corresponding to the stream identifier of the first data stream corresponding to the same stream identifier is The measurement value is screened to obtain a third measurement value corresponding to the stream identifier of each first data stream received; the first measurement value of each first data stream recorded in the target data table and each received In the third measurement value corresponding to the flow ID of the first data stream, the first measurement value and the second measurement value corresponding to the same flow ID are accumulated to obtain a statistical measurement value corresponding to the flow ID of each first data stream; based on The received flow identifier of the second data stream, the measured value of the data stream recorded in each data storage space in the target data table, and the obtained statistical measurement value corresponding to the stream identifier of each first data stream, determine each The statistical measurement value corresponding to the flow identifier of the second data flow. Exemplarily, the processing module 820 can be used to perform any one of steps 401-406.
在本申请实施例中,由于大流是对应记录的流标识和测量值,这样,最后得到的大流的测量值是相对准确的。并且即使在目标数据表中并非仅记录了非大流的测量值,但是可以根据记录的数据流的测量值和大流的测量值,得到非大流的测量值。因此,同样可以达到上述图5所示的实施例所达到的技术效果。In the embodiment of the present application, since the large flow is the corresponding recorded flow identification and measurement value, thus, the finally obtained measurement value of the large flow is relatively accurate. And even if not only the measured value of the non-large flow is recorded in the target data table, the measured value of the non-large flow can be obtained according to the measured value of the recorded data flow and the measured value of the large flow. Therefore, the technical effect achieved by the above-mentioned embodiment shown in FIG. 5 can also be achieved.
需要说明的是:上述实施例提供的数据流测量的装置在数据流测量时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将网络设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据流测量的装置与数据流测量的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the data flow measurement device provided in the above embodiments is used for data flow measurement, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the network device into different functional modules to complete all or part of the functions described above. In addition, the apparatus for data flow measurement provided in the above embodiment and the method embodiment for data flow measurement belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, which will not be repeated here.
参见图14,本申请实施例提供了一种网络设备900示意图。该网络设备900可以是执行上述图1、7和10任一方法的网络设备。该网络设备900包括至少一个处理器901,内部连接902,存储器903以及至少一个收发器904。Referring to FIG. 14 , an embodiment of the present application provides a schematic diagram of a network device 900 . The network device 900 may be a network device that executes any of the above methods in FIGS. 1 , 7 and 10 . The network device 900 includes at least one processor 901 , internal connections 902 , memory 903 and at least one transceiver 904 .
该网络设备900是一种硬件结构的装置,可以用于实现图12所示的装置中的功能模块。例如,本领域技术人员可以想到图12所示的装置中的记录模块720可以通过该至少一个处理器901调用存储器903中的代码来实现,图12所示的装置中的接收模块710可以通过该收发器904来实现。The network device 900 is an apparatus with a hardware structure, and can be used to implement the functional modules in the apparatus shown in FIG. 12 . For example, those skilled in the art can think that the recording module 720 in the apparatus shown in FIG. 12 can be implemented by calling the code in the memory 903 by the at least one processor 901, and the receiving module 710 in the apparatus shown in FIG. 12 can be implemented by the at least one processor 901 Transceiver 904 is implemented.
可选的,上述处理器901可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the above-mentioned processor 901 may be a general-purpose central processing unit (central processing unit, CPU), a network processor (network processor, NP), a microprocessor, an application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the program of this application.
上述内部连接902可包括一通路,在上述组件之间传送信息。可选的,内部连接902为单板或总线等。The internal connection 902 described above may include a path to transfer information between the above described components. Optionally, the internal connection 902 is a single board or a bus or the like.
上述收发器904,用于与其他设备或通信网络通信。The above transceiver 904 is used to communicate with other devices or communication networks.
上述存储器903可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The above-mentioned memory 903 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of storage devices that can store information and instructions. Types of dynamic storage devices, which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical storage, CD-ROM storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by Any other medium accessed by the computer without limitation. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
其中,存储器903用于存储执行本申请方案的应用程序代码,并由处理器901来控制执 行。处理器901用于执行存储器903中存储的应用程序代码,以及配合至少一个收发器904,从而使得该网络设备900实现本申请中的功能。Wherein, the memory 903 is used for storing the application program code for executing the solution of the present application, and the execution is controlled by the processor 901. The processor 901 is configured to execute the application program code stored in the memory 903, and cooperate with at least one transceiver 904, so that the network device 900 realizes the functions in this application.
在具体实现中,作为一种实施例,处理器901可以包括一个或多个CPU,例如图14中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 901 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 14 .
在具体实现中,作为一种实施例,该网络设备900可以包括多个处理器,例如图14中的处理器901和处理器907。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the network device 900 may include multiple processors, for example, the processor 901 and the processor 907 in FIG. 14 . Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
参见图15,本申请实施例提供了一种控制器1000示意图。该控制器1000可以是执行上述图5、8和11任一方法的控制器。该控制器1000包括至少一个处理器1001,内部连接1002,存储器1003以及至少一个收发器1004。Referring to FIG. 15 , an embodiment of the present application provides a schematic diagram of a controller 1000 . The controller 1000 may be a controller that performs any of the methods of FIGS. 5 , 8 and 11 described above. The controller 1000 includes at least one processor 1001 , internal connections 1002 , memory 1003 and at least one transceiver 1004 .
该控制器1000是一种硬件结构的装置,可以用于实现图13所示的装置中的功能模块。例如,本领域技术人员可以想到图13所示的装置中的计算模块720可以通过该至少一个处理器1001调用存储器1003中的代码来实现,图13所示的装置中的接收模块810可以通过该收发器1004来实现。The controller 1000 is a device with a hardware structure, which can be used to implement the functional modules in the device shown in FIG. 13 . For example, those skilled in the art can think that the computing module 720 in the apparatus shown in FIG. 13 can be implemented by calling the code in the memory 1003 by the at least one processor 1001, and the receiving module 810 in the apparatus shown in FIG. 13 can be implemented by the at least one processor 1001 Transceiver 1004 is implemented.
可选的,上述处理器1001可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the above-mentioned processor 1001 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the program of this application.
上述内部连接1002可包括一通路,在上述组件之间传送信息。可选的,内部连接1002为单板或总线等。The internal connection 1002 described above may include a path to transfer information between the aforementioned components. Optionally, the internal connection 1002 is a single board or a bus or the like.
上述收发器1004,用于与其他设备或通信网络通信。The above transceiver 1004 is used to communicate with other devices or communication networks.
上述存储器1003可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The above-mentioned memory 1003 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of storage devices that can store information and instructions. Types of dynamic storage devices, which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical storage, CD-ROM storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by Any other medium accessed by the computer, but not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
其中,存储器1003用于存储执行本申请方案的应用程序代码,并由处理器1001来控制执行。处理器1001用于执行存储器1003中存储的应用程序代码,以及配合至少一个收发器1004,从而使得该控制器1000实现本申请中的功能。Wherein, the memory 1003 is used for storing the application program code for executing the solution of the present application, and the execution is controlled by the processor 1001 . The processor 1001 is configured to execute the application program code stored in the memory 1003, and cooperate with at least one transceiver 1004, so that the controller 1000 can realize the functions in this application.
在具体实现中,作为一种实施例,处理器1001可以包括一个或多个CPU,例如图15中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 1001 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 15 .
在具体实现中,作为一种实施例,该控制器1000可以包括多个处理器,例如图15中的处理器1001和处理器1007。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/ 或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the controller 1000 may include multiple processors, such as the processor 1001 and the processor 1007 in FIG. 15 . Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令或程序,指令或程序由处理器加载并执行,以实现本申请实施例提供的数据流测量的方法。Embodiments of the present application further provide a computer-readable storage medium, where instructions or programs are stored in the computer-readable storage medium, and the instructions or programs are loaded and executed by a processor to implement the data flow measurement provided by the embodiments of the present application. method.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品中包括指令,指令由处理器加载并执行,以实现本申请实施例提供的数据流测量的方法。Embodiments of the present application also provide a computer program product, where the computer program product includes instructions, and the instructions are loaded and executed by a processor to implement the data flow measurement method provided by the embodiments of the present application.
本申请实施例还提供了一种芯片系统,该芯片系统包括处理器和接口,该接口用于获取程序或指令,该处理器用于调用所述程序或指令以实现或者支持终端设备实现上述任一方法实施例所涉及的功能,例如,确定或处理上述方法中所涉及的数据,数据可以为测量值、流标识等。An embodiment of the present application further provides a chip system, where the chip system includes a processor and an interface, where the interface is used to obtain a program or an instruction, and the processor is used to call the program or instruction to implement or support a terminal device to implement any of the above The functions involved in the method embodiments, for example, determine or process the data involved in the above method, and the data may be measured values, flow identifiers, and the like.
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存终端设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a possible design, the chip system further includes a memory for storing necessary program instructions and data of the terminal device. The chip system may be composed of chips, or may include chips and other discrete devices.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在设备上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是设备能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof, and when implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, all or part of the processes or functions described in the embodiments of the present application are generated. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that the device can access, or a data storage device such as a server, data center, or the like that includes an integration of one or more available media. The usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state disk, etc.).
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请的实施例,并不用以限制本申请,凡在本申请原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should be included within the protection scope of the present application.

Claims (29)

  1. 一种数据流测量的方法,其特征在于,所述方法应用于网络设备,所述方法包括:A method for data flow measurement, wherein the method is applied to a network device, and the method includes:
    接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行中对应的数据存储空间;Receive the target data packet, and for each data row of the target data table, determine the target data stream to which the target data packet belongs based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet the corresponding data storage space in the data row;
    如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中;If the target data stream is the first data stream corresponding to the data storage space, determining the measurement value of the target data stream based on the measurement value of the target data packet, and recording it in the data storage space;
    如果所述目标数据流不是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。If the target data stream is not the first data stream corresponding to the data storage space, the measurement value of the target data stream is recorded in the target data table based on the measurement value of the target data packet.
  2. 根据权利要求1所述的方法,其特征在于,所述如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中,包括:The method according to claim 1, wherein, if the target data stream is a first data stream corresponding to the data storage space, determining the target data based on a measurement value of the target data packet Flow measurements, recorded in the data storage space, including:
    如果所述数据存储空间中未记录有第一数据流的流标识和测量值,则确定所述目标数据流为所述数据存储空间对应的第一数据流,将所述目标数据包的测量值作为所述目标数据流的测量值,将所述目标数据流的流标识作为所述数据存储空间对应的第一数据流的流标识,将所述目标数据的流标识和测量值对应记录在所述数据存储空间中;If the flow identifier and measurement value of the first data flow are not recorded in the data storage space, determine that the target data flow is the first data flow corresponding to the data storage space, and use the measurement value of the target data packet As the measured value of the target data stream, the stream identifier of the target data stream is used as the stream identifier of the first data stream corresponding to the data storage space, and the stream identifier of the target data and the measured value are recorded correspondingly in the data storage space. in the data storage space;
    如果所述数据存储空间中记录有第一数据流的流标识和测量值,且所述目标数据流的流标识与所述数据存储空间中记录的第一数据流的流标识相同,则将所述目标数据包的测量值累加到所述数据存储空间中记录的第一数据流的测量值上;If the stream identifier and measurement value of the first data stream are recorded in the data storage space, and the stream identifier of the target data stream is the same as the stream identifier of the first data stream recorded in the data storage space, the The measured value of the target data packet is accumulated to the measured value of the first data stream recorded in the data storage space;
    如果所述数据存储空间中记录有第一数据流的流标识和测量值,且所述目标数据流的流标识与所述数据存储空间中记录的第一数据流的流标识不同,则确定所述数据存储空间中是否记录有比较测量值,如果未记录有比较测量值,则将所述目标数据包的测量值作为所述数据存储空间对应的比较测量值记录在所述数据存储空间中,如果记录有比较测量值,则将所述目标数据包的测量值累加在所述数据存储空间中记录的比较测量值上;If the flow identifier and measurement value of the first data stream are recorded in the data storage space, and the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the data storage space, it is determined that the Whether the comparative measurement value is recorded in the data storage space, if there is no comparative measurement value recorded, then the measurement value of the target data packet is recorded in the data storage space as the comparative measurement value corresponding to the data storage space, If a comparative measurement value is recorded, accumulating the measured value of the target data packet on the comparative measurement value recorded in the data storage space;
    如果所述数据存储空间中记录的累加后的比较测量值大于所述数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流为所述数据存储空间对应的第一数据流,将所述数据存储空间中记录的第一数据流的流标识更新为所述目标数据流的流标识,所述数据存储空间中记录的第一数据流的测量值更新为所述目标数据包的测量值,所述数据存储空间中记录的比较测量值更新为0。If the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, it is determined that the target data stream is the first data corresponding to the data storage space stream, update the stream identifier of the first data stream recorded in the data storage space to the stream identifier of the target data stream, and update the measured value of the first data stream recorded in the data storage space to the target data The measured value of the package, the comparative measured value recorded in the data storage space is updated to 0.
  3. 根据权利要求2所述的方法,其特征在于,如果所述数据存储空间中记录有第一数据流的流标识和测量值,且所述目标数据流的流标识与所述数据存储空间中记录的第一数据流的流标识不同,所述方法还包括:The method according to claim 2, wherein, if the flow identifier and measurement value of the first data stream are recorded in the data storage space, and the flow identifier of the target data stream is the same as that recorded in the data storage space The stream identifiers of the first data streams are different, and the method further includes:
    如果所述数据存储空间中记录的累加后的比较测量值小于所述数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流不是所述数据存储空间对应的第一数据流,基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。If the accumulated comparative measurement value recorded in the data storage space is smaller than the measurement value of the first data stream recorded in the data storage space, it is determined that the target data stream is not the first data corresponding to the data storage space The flow, based on the measurement value of the target data packet, records the measurement value of the target data flow in the target data table.
  4. 根据权利要求3所述的方法,其特征在于,如果所述数据存储空间中记录的累加后的比较测量值大于所述数据存储空间中记录的第一数据流的测量值,所述方法还包括:The method according to claim 3, wherein if the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, the method further comprises: :
    向控制器发送所述数据存储空间的存储空间标识、所述数据存储空间中记录的第一数据流的流标识和第一数据流的测量值;sending the storage space identifier of the data storage space, the flow identifier of the first data stream recorded in the data storage space, and the measurement value of the first data stream to the controller;
    如果所述数据存储空间中记录的累加后的比较测量值小于所述数据存储空间中记录的第一数据流的测量值,所述方法还包括:If the accumulated comparative measurement value recorded in the data storage space is smaller than the measurement value of the first data stream recorded in the data storage space, the method further includes:
    将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器;sending the flow identification corresponding to the target data packet to the controller as the flow identification of the second data flow;
    所述方法还包括:The method also includes:
    每经过预设时长,向所述控制器发送本地存储的目标数据表,对本地存储的目标数据表初始化。Every time a preset time period elapses, the locally stored target data table is sent to the controller, and the locally stored target data table is initialized.
  5. 根据权利要求4所述的方法,其特征在于,所述将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器之前,所述方法还包括:The method according to claim 4, wherein before the sending the flow identifier corresponding to the target data packet as the flow identifier of the second data stream to the controller, the method further comprises:
    确定未向所述控制器发送所述目标数据包对应的流标识,记录所述目标数据包对应的流标识。It is determined that the flow identifier corresponding to the target data packet is not sent to the controller, and the flow identifier corresponding to the target data packet is recorded.
  6. 根据权利要求5所述的方法,其特征在于,所述确定未向所述控制器发送所述目标数据包对应的流标识,记录所述目标数据包对应的流标识,包括:The method according to claim 5, wherein the determining that the flow identifier corresponding to the target data packet is not sent to the controller, and recording the flow identifier corresponding to the target data packet, comprises:
    确定本地存储的布隆过滤器中未记录所述目标数据包对应的流标识,将所述目标数据包对应的流标识记录在所述布隆过滤器中。It is determined that the flow identifier corresponding to the target data packet is not recorded in the locally stored Bloom filter, and the flow identifier corresponding to the target data packet is recorded in the Bloom filter.
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值,包括:The method according to any one of claims 1-6, wherein, based on the measurement value of the target data packet, recording the measurement value of the target data stream in the target data table, comprising:
    基于所述数据行对应的第二特征值计算函数和所述目标数据包的流标识,确定所述目标数据流对应的累加系数,将所述目标数据包的测量值乘以所述累加系数,得到所述目标数据包的调整测量值,将所述目标数据包的调整测量值累加到所述数据存储空间中记录的第二数据流的测量值上。Based on the second eigenvalue calculation function corresponding to the data row and the flow identifier of the target data packet, an accumulation coefficient corresponding to the target data flow is determined, and the measurement value of the target data packet is multiplied by the accumulation coefficient, The adjusted measurement value of the target data packet is obtained, and the adjusted measurement value of the target data packet is accumulated to the measurement value of the second data stream recorded in the data storage space.
  8. 一种数据流测量的方法,其特征在于,所述方法用于网络设备,所述方法包括:A method for data flow measurement, characterized in that the method is used in a network device, and the method includes:
    接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行对应的数据存储空间;Receive the target data packet, and for each data row of the target data table, determine the target data stream to which the target data packet belongs based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet in the data storage space corresponding to the data row;
    基于所述目标数据包对应的测量值,在所述数据存储空间中,记录所述目标数据流的测量值;Record the measurement value of the target data stream in the data storage space based on the measurement value corresponding to the target data packet;
    如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中。If the target data stream is the first data stream corresponding to the data storage space, the measurement value of the target data stream is determined based on the measurement value of the target data packet and recorded in the data storage space.
  9. 根据权利要求8所述的方法,其特征在于,所述如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中,包括:The method according to claim 8, wherein, if the target data stream is the first data stream corresponding to the data storage space, determining the target data based on the measurement value of the target data packet Flow measurements, recorded in the data storage space, including:
    如果所述数据存储空间中未记录有第一数据流的流标识和测量值,则确定所述目标数据流为所述数据存储空间对应的第一数据流,将所述目标数据包的测量值作为所述目标数据流的测量值,将所述目标数据流的流标识作为所述数据存储空间对应的第一数据流的流标识,将所述目标数据的流标识和测量值对应记录在所述数据存储空间中;If the flow identifier and measurement value of the first data flow are not recorded in the data storage space, determine that the target data flow is the first data flow corresponding to the data storage space, and use the measurement value of the target data packet As the measured value of the target data stream, the stream identifier of the target data stream is used as the stream identifier of the first data stream corresponding to the data storage space, and the stream identifier of the target data and the measured value are recorded correspondingly in the data storage space. in the data storage space;
    如果所述数据存储空间中记录有第一数据流的流标识和测量值,且所述目标数据流的流标识与所述数据存储空间中记录的第一数据流的流标识相同,则将所述目标数据包的测量值累加到所述数据存储空间中记录的第一数据流的测量值上;If the stream identifier and measurement value of the first data stream are recorded in the data storage space, and the stream identifier of the target data stream is the same as the stream identifier of the first data stream recorded in the data storage space, the The measured value of the target data packet is accumulated to the measured value of the first data stream recorded in the data storage space;
    如果所述数据存储空间中记录有第一数据流的流标识和测量值,且所述目标数据流的流标识与所述数据存储空间中记录的第一数据流的流标识不同,则确定所述数据存储空间中是否记录有比较测量值,如果未记录有比较测量值,则将所述目标数据包的测量值作为所述数据存储空间对应的比较测量值记录在所述数据存储空间中,如果记录有比较测量值,则将所述目标数据包的测量值累加在所述数据存储空间中记录的比较测量值上;If the flow identifier and measurement value of the first data stream are recorded in the data storage space, and the stream identifier of the target data stream is different from the stream identifier of the first data stream recorded in the data storage space, it is determined that the Whether the comparative measurement value is recorded in the data storage space, if there is no comparative measurement value recorded, then the measurement value of the target data packet is recorded in the data storage space as the comparative measurement value corresponding to the data storage space, If a comparative measurement value is recorded, accumulating the measured value of the target data packet on the comparative measurement value recorded in the data storage space;
    如果所述数据存储空间中记录的累加后的比较测量值大于所述数据存储空间中记录的第一数据流的测量值,则确定所述目标数据流为所述数据存储空间对应的第一数据流,将所述数据存储空间中记录的第一数据流的流标识更新为所述目标数据流的流标识,所述数据存储空间中记录的第一数据流的测量值更新为所述目标数据包的测量值,所述数据存储空间中记录的比较测量值更新为0。If the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, it is determined that the target data stream is the first data corresponding to the data storage space stream, update the stream identifier of the first data stream recorded in the data storage space to the stream identifier of the target data stream, and update the measured value of the first data stream recorded in the data storage space to the target data The measured value of the package, the comparative measured value recorded in the data storage space is updated to 0.
  10. 根据权利要求9所述的方法,其特征在于,如果所述数据存储空间中记录的累加后的比较测量值大于所述数据存储空间中记录的第一数据流的测量值,所述方法还包括:The method according to claim 9, wherein if the accumulated comparative measurement value recorded in the data storage space is greater than the measurement value of the first data stream recorded in the data storage space, the method further comprises: :
    向控制器发送所述数据存储空间的存储空间标识、所述数据存储空间中对应记录的第一数据流的流标识和第一数据流的测量值;sending the storage space identifier of the data storage space, the flow identifier of the first data stream correspondingly recorded in the data storage space, and the measurement value of the first data stream to the controller;
    所述方法还包括:The method also includes:
    如果所述数据存储空间中记录的累加后的比较测量值小于所述数据存储空间中记录的第一数据流的测量值,则将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器;If the accumulated comparative measurement value recorded in the data storage space is smaller than the measurement value of the first data flow recorded in the data storage space, the flow identifier corresponding to the target data packet is used as the flow of the second data flow sending an identification to the controller;
    每经过预设时长,向所述控制器发送本地存储的目标数据表,对本地存储的目标数据表初始化。Every time a preset time period elapses, the locally stored target data table is sent to the controller, and the locally stored target data table is initialized.
  11. 根据权利要求10所述的方法,其特征在于,所述将所述目标数据包对应的流标识作为第二数据流的流标识发送至所述控制器之前,所述方法还包括:The method according to claim 10, wherein before the sending the flow identifier corresponding to the target data packet as the flow identifier of the second data stream to the controller, the method further comprises:
    确定未向所述控制器发送所述目标数据包对应的流标识,记录所述目标数据包对应的流标识。It is determined that the flow identifier corresponding to the target data packet is not sent to the controller, and the flow identifier corresponding to the target data packet is recorded.
  12. 根据权利要求11所述的方法,其特征在于,所述确定未向所述控制器发送所述目标 数据包对应的流标识,记录所述目标数据包对应的流标识,包括:method according to claim 11, is characterized in that, described determining does not send the flow mark corresponding to described target data packet to described controller, recording the flow mark corresponding to described target data packet, comprising:
    确定本地存储的布隆过滤器中未记录所述目标数据包对应的流标识,将所述目标数据包对应的流标识记录在所述布隆过滤器中。It is determined that the flow identifier corresponding to the target data packet is not recorded in the locally stored Bloom filter, and the flow identifier corresponding to the target data packet is recorded in the Bloom filter.
  13. 根据权利要求8-12中任一项所述的方法,其特征在于,所述基于所述目标数据包对应的测量值,在所述数据存储空间中,记录所述目标数据流的测量值,包括:The method according to any one of claims 8-12, wherein the measurement value of the target data stream is recorded in the data storage space based on the measurement value corresponding to the target data packet, include:
    基于所述数据行对应的第二特征值计算函数和所述目标数据包的流标识,确定所述目标数据流对应的累加系数,将所述目标数据包的测量值乘以所述累加系数,得到所述目标数据包的调整测量值,将所述目标数据包的调整测量值累加到所述数据存储空间中记录的数据流的测量值上。Based on the second eigenvalue calculation function corresponding to the data row and the flow identifier of the target data packet, an accumulation coefficient corresponding to the target data flow is determined, and the measurement value of the target data packet is multiplied by the accumulation coefficient, The adjusted measurement value of the target data packet is obtained, and the adjusted measurement value of the target data packet is accumulated to the measurement value of the data flow recorded in the data storage space.
  14. 一种数据流测量的方法,其特征在于,所述方法应用于控制器,所述方法包括:A method for data flow measurement, wherein the method is applied to a controller, and the method comprises:
    接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表;receiving the stream identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device;
    在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;In the measurement values of the first data stream recorded in the target data table, the measurement values of the first data streams corresponding to the same flow identifier are filtered to obtain the first data stream of each first data stream recorded in the target data table. Measurements;
    在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;In the received measured values of the first data stream, the measured values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain a second received stream identifier corresponding to each first data stream. Measurements;
    在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value of the first data stream corresponding to the same flow identifier is filtered to obtain the received data of each first data stream. the third measurement value corresponding to the flow identifier;
    在所述目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第三测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;In the first measurement value of each first data stream recorded in the target data table and the third measurement value corresponding to the received stream identifier of each first data stream, the first measurement value corresponding to the same stream identifier is Accumulate with the third measurement value to obtain the statistical measurement value corresponding to the stream identifier of each first data stream;
    基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值。Based on the received flow identification of the second data flow and the target data table, a statistical measurement value corresponding to the flow identification of each second data flow is determined.
  15. 根据权利要求14所述的方法,其特征在于,所述在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值,包括:The method according to claim 14, wherein, in the measurement values of the first data stream recorded in the target data table, the measurement values of the first data stream corresponding to the same stream identifier are filtered to obtain the The first measurement value of each first data stream recorded in the target data table, including:
    在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的最大测量值,作为所述对应相同流标识的第一数据流的第一测量值;Among the measured values of the first data stream recorded in the target data table, the maximum measured value of the first data stream corresponding to the same stream identifier is used as the first measured value of the first data stream corresponding to the same stream identifier;
    所述在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值,包括:In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value of the first data stream corresponding to the same stream identifier is screened to obtain each received first data stream. The third measurement value corresponding to the flow identifier of the flow, including:
    在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的最大第二测量值,作为所述对应相同流标识的第一数据流的第三测量值。In the received second measurement value corresponding to the flow identifier of each first data stream, the maximum second measurement value of the first data stream corresponding to the same flow identifier is taken as the first data stream corresponding to the same stream identifier the third measurement.
  16. 根据权利要求14或15所述的方法,其特征在于,所述基于接收到的第二数据流的流 标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值,包括:The method according to claim 14 or 15, wherein the statistical measurement value corresponding to the flow identifier of each second data stream is determined based on the received stream identifier of the second data stream and the target data table ,include:
    对于所述目标数据表中的每个数据存储空间,基于所述数据存储空间所在数据行对应的第一特征值计算函数,在接收到的第二数据流的流标识中,确定所述数据存储空间对应的第二数据流的流标识,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定所述数据存储空间对应的每个第二数据流的流标识对应的累加系数;For each data storage space in the target data table, based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, the data storage The stream identifier of the second data stream corresponding to the space, and based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located, determine the accumulation coefficient corresponding to the stream identifier of each second data stream corresponding to the data storage space ;
    将所述数据存储空间对应的各第二数据流的流标识对应的统计测量值作为未知数乘以对应的累加系数,并进行累加,将所述数据存储空间记录的数据流的测量值作为累加结果,得到所述数据存储空间对应的目标方程;The statistical measurement value corresponding to the stream identifier of each second data stream corresponding to the data storage space is multiplied by the corresponding accumulation coefficient as an unknown, and the accumulation is performed, and the measurement value of the data stream recorded in the data storage space is used as the accumulation result. , obtain the target equation corresponding to the data storage space;
    基于所述目标数据表中的各数据存储空间对应的目标方程,组成目标方程组;Based on the target equation corresponding to each data storage space in the target data table, a target equation group is formed;
    基于线性优化算法,以接收到的第二数据流的流标识对应的统计测量值之和最小为优化目标,求解所述目标方程组,得到每个第二数据流的流标识对应的统计测量值。Based on a linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of the second data stream as the optimization objective, solving the objective equation system to obtain the statistical measurement values corresponding to the flow identifiers of each second data stream .
  17. 根据权利要求15所述的方法,其特征在于,所述方法还包括:The method of claim 15, wherein the method further comprises:
    在得到的第一数据流的流标识对应的统计测量值和第二数据流的流标识对应的统计测量值中,将对应相同流标识的测量值进行累加,得到每个流标识对应的总测量值。In the obtained statistical measurement values corresponding to the flow ID of the first data stream and the statistical measurement values corresponding to the flow ID of the second data stream, the measurement values corresponding to the same flow ID are accumulated to obtain the total measurement value corresponding to each flow ID value.
  18. 一种数据流测量的方法,其特征在于,所述方法应用于控制器,所述方法包括:A method for data flow measurement, wherein the method is applied to a controller, and the method comprises:
    接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表;receiving the stream identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device;
    在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;In the measurement values of the first data stream recorded in the target data table, the measurement values of the first data streams corresponding to the same flow identifier are filtered to obtain the first data stream of each first data stream recorded in the target data table. Measurements;
    在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;In the received measured values of the first data stream, the measured values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain a second received stream identifier corresponding to each first data stream. Measurements;
    在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的流标识对应的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;In the received second measurement value corresponding to the flow identifier of each first data stream, the second measurement value corresponding to the stream identifier of the first data stream corresponding to the same flow identifier is screened to obtain each received first data stream. A third measurement value corresponding to a stream identifier of a data stream;
    在所述目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;In the first measurement value of each first data stream recorded in the target data table and the third measurement value corresponding to the received stream identifier of each first data stream, the first measurement value corresponding to the same stream identifier is Accumulate with the second measurement value to obtain the statistical measurement value corresponding to the stream identifier of each first data stream;
    基于接收到的第二数据流的流标识、所述目标数据表中每个数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值。Based on the received flow identifier of the second data stream, the measured value of the data stream recorded in each data storage space in the target data table, and the obtained statistical measurement value corresponding to the stream identifier of each first data stream, determine each The flow identifier of the second data flow corresponds to the statistical measurement value.
  19. 根据权利要求18所述的方法,其特征在于,所述基于接收到的第二数据流的流标识、所述目标数据表中每个所述数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值,包括:The method according to claim 18, characterized in that, based on the received flow identifier of the second data flow, the measured value of the data flow recorded in each of the data storage spaces in the target data table, and the obtained The statistical measurement value corresponding to the flow identifier of each first data stream, and determining the statistical measurement value corresponding to the flow identifier of each second data stream, including:
    对于所述目标数据表的每个数据存储空间,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定所述数据存储空间对应的每个第一数据流的流标识对应的累加系数;For each data storage space of the target data table, based on the second eigenvalue calculation function corresponding to the data row where the data storage space is located, determine the corresponding flow identifier of each first data stream corresponding to the data storage space cumulative coefficient;
    将所述数据存储空间对应的每个第一数据流的流标识对应的统计测量值乘以对应的累加系数,得到所述数据存储空间对应的每个第一数据流的流标识对应的调整统计测量值;Multiply the statistical measurement value corresponding to the stream identifier of each first data stream corresponding to the data storage space by the corresponding accumulation coefficient to obtain the adjustment statistics corresponding to the stream identifier of each first data stream corresponding to the data storage space Measurements;
    基于所述数据存储空间所在数据行对应的第一特征值计算函数,在接收到的第二数据流的流标识中,确定所述数据存储空间对应的第二数据流的流标识,基于所述数据存储空间所在数据行对应的第二特征值计算函数,确定所述数据存储空间对应的每个第二数据流的流标识对应的累加系数;Based on the first eigenvalue calculation function corresponding to the data row where the data storage space is located, in the received flow identifier of the second data stream, the stream identifier of the second data stream corresponding to the data storage space is determined, and based on the received stream identifier of the second data stream The second eigenvalue calculation function corresponding to the data row where the data storage space is located, to determine the accumulation coefficient corresponding to the stream identifier of each second data stream corresponding to the data storage space;
    将所述数据存储空间对应的各第二数据流的流标识对应的统计测量值作为未知数乘以对应的累加系数,与所述数据存储空间对应的每个第一数据流的流标识对应的调整统计测量值相加,将所述数据存储空间记录的数据流的测量值作为累加结果,得到所述数据存储空间对对应的目标方程;Multiply the statistical measurement value corresponding to the stream identifier of each second data stream corresponding to the data storage space by the corresponding accumulation coefficient as an unknown, and adjust the adjustment corresponding to the stream identifier of each first data stream corresponding to the data storage space Statistical measurement values are added, and the measurement values of the data streams recorded in the data storage space are used as an accumulation result to obtain a target equation corresponding to the data storage space pair;
    基于所述目标数据表中的各数据存储空间对应的目标方程,组成目标方程组;Based on the target equation corresponding to each data storage space in the target data table, a target equation group is formed;
    基于线性优化算法,以接收到的第二数据流的流标识对应的统计测量值之和最小为优化目标,求解所述目标方程组,得到每个第二数据流的流标识对应的统计测量值。Based on a linear optimization algorithm, taking the minimum sum of the statistical measurement values corresponding to the received flow identifiers of the second data stream as the optimization objective, solving the objective equation system to obtain the statistical measurement values corresponding to the flow identifiers of each second data stream .
  20. 一种数据流测量的装置,其特征在于,所述装置包括:A device for data flow measurement, characterized in that the device comprises:
    收发模块,用于接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行中对应的数据存储空间;A transceiver module, configured to receive a target data packet, and for each data row of the target data table, determine the target data packet based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet the data storage space corresponding to the target data stream to which it belongs in the data row;
    处理模块,用于如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中;如果所述目标数据流不是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,在目标数据表中,记录所述目标数据流的测量值。A processing module, configured to, if the target data stream is the first data stream corresponding to the data storage space, determine the measurement value of the target data stream based on the measurement value of the target data packet, and record it in the data In the storage space; if the target data stream is not the first data stream corresponding to the data storage space, based on the measurement value of the target data packet, record the measurement value of the target data stream in the target data table.
  21. 一种数据流测量的装置,其特征在于,所述装置包括:A device for data flow measurement, characterized in that the device comprises:
    收发模块,用于接收目标数据包,对于目标数据表的每个数据行,基于所述数据行对应的第一特征值计算函数和所述目标数据包对应的流标识,确定所述目标数据包所属的目标数据流在所述数据行对应的数据存储空间;A transceiver module, configured to receive a target data packet, and for each data row of the target data table, determine the target data packet based on the first feature value calculation function corresponding to the data row and the flow identifier corresponding to the target data packet The target data stream to which it belongs is in the data storage space corresponding to the data row;
    处理模块,用于基于所述目标数据包对应的测量值,在所述数据存储空间中,记录所述目标数据流的测量值;如果所述目标数据流是所述数据存储空间对应的第一数据流,则基于所述目标数据包的测量值,确定所述目标数据流的测量值,记录在所述数据存储空间中。a processing module, configured to record the measurement value of the target data stream in the data storage space based on the measurement value corresponding to the target data packet; if the target data stream is the first corresponding to the data storage space data flow, the measurement value of the target data flow is determined based on the measurement value of the target data packet and recorded in the data storage space.
  22. 一种数据流测量的装置,其特征在于,所述装置包括:A device for data flow measurement, characterized in that the device comprises:
    接收模块,用于接收网络设备发送的第一数据流的流标识和对应的测量值、第二数据流的流标识、目标数据表;a receiving module, configured to receive the flow identifier and the corresponding measurement value of the first data stream sent by the network device, the stream identifier of the second data stream, and the target data table;
    处理模块,用于在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;在接收到的每个第 一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;在所述目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第三测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;基于接收到的第二数据流的流标识和所述目标数据表,确定每个第二数据流的流标识对应的统计测量值。The processing module is used to filter the measured values of the first data stream corresponding to the same stream identifier in the measured values of the first data stream recorded in the target data table, and obtain each first data stream recorded in the target data table. The first measurement value of the data stream; among the received measurement values of the first data stream, the measurement values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain each received first data stream. The second measurement value corresponding to the flow identifier of the stream; in the received second measurement value corresponding to the stream identifier of each first data stream, the second measurement value of the first data stream corresponding to the same stream identifier is screened, Obtain the third measurement value corresponding to the stream identifier of each first data stream received; the first measurement value of each first data stream recorded in the target data table and the received value of each first data stream In the third measurement value corresponding to the flow identification, the first measurement value and the third measurement value corresponding to the same flow identification are accumulated to obtain the statistical measurement value corresponding to the flow identification of each first data flow; The stream identifier of the data stream and the target data table determine the statistical measurement value corresponding to the stream identifier of each second data stream.
  23. 一种数据流测量的装置,其特征在于,所述装置包括:A device for data flow measurement, characterized in that the device comprises:
    接收模块,用于接收网络设备发送的第一数据流的流标识、对应的测量值和对应的数据存储空间的存储空间标识、第二数据流的流标识、目标数据表;a receiving module, configured to receive the stream identifier of the first data stream, the corresponding measurement value and the storage space identifier of the corresponding data storage space, the stream identifier of the second data stream, and the target data table sent by the network device;
    处理模块,用于在所述目标数据表记录的第一数据流的测量值中,将对应相同流标识的第一数据流的测量值进行筛选,得到所述目标数据表记录的每个第一数据流的第一测量值;在接收到的第一数据流的测量值中,将对应相同存储空间标识、相同流标识的第一数据流的测量值累加,得到接收到的每个第一数据流的流标识对应的第二测量值;在接收到的每个第一数据流的流标识对应的第二测量值中,将对应相同流标识的第一数据流的流标识对应的第二测量值进行筛选,得到接收到的每个第一数据流的流标识对应的第三测量值;在所述目标数据表记录的每个第一数据流的第一测量值和接收到的每个第一数据流的流标识对应的第三测量值中,将对应相同流标识的第一测量值和第二测量值进行累加,得到每个第一数据流的流标识对应的统计测量值;基于接收到的第二数据流的流标识、所述目标数据表中每个数据存储空间记录的数据流的测量值和得到的每个第一数据流的流标识对应的统计测量值,确定每个第二数据流的流标识对应的统计测量值。The processing module is used to filter the measured values of the first data stream corresponding to the same stream identifier in the measured values of the first data stream recorded in the target data table, and obtain each first data stream recorded in the target data table. The first measurement value of the data stream; among the received measurement values of the first data stream, the measurement values of the first data streams corresponding to the same storage space identifier and the same stream identifier are accumulated to obtain each received first data stream. The second measurement value corresponding to the flow identifier of the stream; in the received second measurement value corresponding to the stream identifier of each first data stream, the second measurement value corresponding to the stream identifier of the first data stream corresponding to the same stream identifier value is screened to obtain a third measurement value corresponding to the stream identifier of each first data stream received; the first measurement value of each first data stream recorded in the target data table and each received In the third measurement value corresponding to the flow ID of a data stream, the first measurement value and the second measurement value corresponding to the same flow ID are accumulated to obtain the statistical measurement value corresponding to the flow ID of each first data stream; The flow identification of the obtained second data flow, the measured value of the data flow recorded in each data storage space in the target data table, and the obtained statistical measurement value corresponding to the flow identification of each first data flow, determine each The statistical measurement values corresponding to the flow identifiers of the two data streams.
  24. 一种网络设备,其特征在于,所述网络设备包括处理器和存储器,其中:A network device, characterized in that the network device includes a processor and a memory, wherein:
    所述存储器存储指令,所述处理器执行所述指令,以实现如权利要求1至权利要求13中任一项所述的数据流测量的方法。The memory stores instructions that are executed by the processor to implement the method of data flow measurement as claimed in any one of claims 1 to 13.
  25. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,所述指令由处理器加载并执行,以实现如权利要求1至权利要求13中任一项所述的数据流测量的方法。A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and the instructions are loaded and executed by a processor, so as to realize any one of claims 1 to 13. method of data flow measurement.
  26. 一种控制器,其特征在于,所述控制器包括处理器和存储器,其中:A controller, characterized in that the controller includes a processor and a memory, wherein:
    所述存储器存储指令,所述处理器执行所述指令,以实现如权利要求14至权利要求19中任一项所述的数据流测量的方法。The memory stores instructions that are executed by the processor to implement the method of data flow measurement as claimed in any one of claims 14 to 19.
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,所述指令由处理器加载并执行,以实现如权利要求14至权利要求19中任一项所述的数据流测量的方法。A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and the instructions are loaded and executed by a processor, so as to realize any one of claims 14 to 19. method of data flow measurement.
  28. 一种数据流测量的系统,其特征在于,所述系统包括网络设备和控制器,其中:A system for data flow measurement, characterized in that the system includes a network device and a controller, wherein:
    所述网络设备用于执行如权利要求1至权利要求7中任一项所述的数据流测量的方法;所述控制器用于执行如权利要求14至权利要求17中任一项所述的数据流测量的方法。The network device is used for performing the data flow measurement method according to any one of claims 1 to 7; the controller is used for performing the data flow according to any one of claims 14 to 17 method of flow measurement.
  29. 一种数据流测量的系统,其特征在于,所述系统包括网络设备和控制器,其中:A system for data flow measurement, characterized in that the system includes a network device and a controller, wherein:
    所述网络设备用于执行如权利要求8至权利要求13中任一项所述的数据流测量的方法;所述控制器用于执行如权利要求18或19所述的数据流测量的方法。The network device is configured to perform the data flow measurement method according to any one of claims 8 to 13 ; the controller is configured to perform the data flow measurement method according to claim 18 or 19 .
PCT/CN2021/133234 2020-11-30 2021-11-25 Data stream measurement method and apparatus WO2022111596A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011383567.3 2020-11-30
CN202011383567.3A CN114584493A (en) 2020-11-30 2020-11-30 Method and device for measuring data flow

Publications (1)

Publication Number Publication Date
WO2022111596A1 true WO2022111596A1 (en) 2022-06-02

Family

ID=81753764

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133234 WO2022111596A1 (en) 2020-11-30 2021-11-25 Data stream measurement method and apparatus

Country Status (2)

Country Link
CN (1) CN114584493A (en)
WO (1) WO2022111596A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109861881A (en) * 2019-01-24 2019-06-07 大连理工大学 A kind of elephant stream detection method based on three layers of Sketch framework
CN110019250A (en) * 2019-03-06 2019-07-16 清华大学 Network measure method and computer readable storage medium based on hash function
WO2020019270A1 (en) * 2018-07-27 2020-01-30 Nokia Solutions And Networks Oy Method, device, and system for network traffic analysis
CN110830322A (en) * 2019-09-16 2020-02-21 北京大学 Network flow measuring method and system based on probability measurement data structure Sketch with approximate zero error

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019270A1 (en) * 2018-07-27 2020-01-30 Nokia Solutions And Networks Oy Method, device, and system for network traffic analysis
CN109861881A (en) * 2019-01-24 2019-06-07 大连理工大学 A kind of elephant stream detection method based on three layers of Sketch framework
CN110019250A (en) * 2019-03-06 2019-07-16 清华大学 Network measure method and computer readable storage medium based on hash function
CN110830322A (en) * 2019-09-16 2020-02-21 北京大学 Network flow measuring method and system based on probability measurement data structure Sketch with approximate zero error

Also Published As

Publication number Publication date
CN114584493A (en) 2022-06-03

Similar Documents

Publication Publication Date Title
JP7039685B2 (en) Traffic measurement methods, devices, and systems
EP3353952B1 (en) Managing groups of servers
JP5534481B2 (en) Communication quality monitoring system, communication quality monitoring method, and storage medium
JP6116072B2 (en) Techniques for aligning network flows with processing resources
US9197566B2 (en) Information processing method, recording medium, and information processing apparatus
US20210218808A1 (en) Small Message Aggregation
US20220038374A1 (en) Microburst detection and management
US11405319B2 (en) Tool port throttling at a network visibility node
US8091007B2 (en) Detection of duplicate packets
US20200067783A1 (en) Graph-based network management
CN111726299A (en) Flow balancing method and device
US20180167337A1 (en) Application of network flow rule action based on packet counter
WO2022247308A1 (en) Flow measurement method and apparatus, and related device
WO2022111596A1 (en) Data stream measurement method and apparatus
CN103825963B (en) Virtual Service moving method
CN110622467A (en) Apparatus and method for identifying a group of network objects
WO2017209669A1 (en) Method and network node for handling sctp packets
CN113472591B (en) Method and device for determining service performance
CN109831385B (en) Message processing method and device and electronic equipment
JP2011048504A (en) Method, apparatus, and program for load distribution between authentication servers
JP7359299B2 (en) Packet identification device, packet identification method, and packet identification program
CN112511449A (en) Message flow out-of-order detection method, message processing method and device
CN113452614B (en) Message processing method and device
WO2022049751A1 (en) Number-of-connections measuring device, method, and program
US10291693B2 (en) Reducing data in a network device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21897096

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21897096

Country of ref document: EP

Kind code of ref document: A1