The present invention relates to a method of data processing and frequency estimation based on an two - stage structure outside the chip. The method in the delete operation and support CM Sketch has higher accuracy and more on-chip memory Sketch or faster on the basis of the same, will be named Slim Fat Sketch. The invention provides a total of six versions, in addition to the first version, each version is based on a version based on the analysis, with a version of the advantages in ensuring the limitation of the previous version was improved, finally get the expected effect of the design of sketch. SF sketch and the invention of the Sketch compared to take up less memory space, but also improve the accuracy of the foundation and the best Sketch with the same speed, to more effectively achieve data frequency estimation.
【技术实现步骤摘要】
一种基于片内片外两级结构的数据处理方法和频度估计方法
本专利技术涉及自然语言处理、压缩感知、网络数据流量分析、分布式数据集等多个重要领域,涉及Sketch数据结构改进方法,具体涉及一种基于片内片外两级Sketch结构的数据处理方法和频度估计方法。
技术介绍
目前,Count-Min(CM)Sketch(G.CormodeandS.Muthukrishnan.Animproveddatastreamsummary:thecount-minsketchanditsapplications.JournalofAlgorithms,55(1):58–75,2005.)是使用最多,性能最好,最普适于各种数据的一种Sketch(略图)。作为一个轻量级甚至被GPU所使用的数据结构(Y.Wang,Y.Zu,andetal.Wirespeednamelookup:Agpu-basedapproach.InProc.USENIXNSDI,pages199–212,2013.),它实时计数简单快速,可扩展性较强,存储和计算复杂度都很低。然而,CM-Sketch在查询结果的精确度方面具有 ...
【技术保护点】
一种基于片内片外两级结构的数据处理方法,其特征在于,设立两个数组集合,分别是设置于片内内存的Slim‑subsketch,以及设置于片外内存的Fat‑subsketch;在更新表项时,首先更新Fat‑subsketch,然后基于对Fat‑subsketch的观察来对Slim‑subsketch中合适的计数器进行更新,如果Slim‑subsketch中任意计数器的值已大于插入表项的次数,则不增加相应计数器的值,以减少Slim‑subsketch中的增量。
【技术特征摘要】
2016.08.29 CN 20161075619471.一种基于片内片外两级结构的数据处理方法,其特征在于,设立两个数组集合,分别是设置于片内内存的Slim-subsketch,以及设置于片外内存的Fat-subsketch;在更新表项时,首先更新Fat-subsketch,然后基于对Fat-subsketch的观察来对Slim-subsketch中合适的计数器进行更新,如果Slim-subsketch中任意计数器的值已大于插入表项的次数,则不增加相应计数器的值,以减少Slim-subsketch中的增量。2.如权利要求1所述的方法,其特征在于,所述Slim-subsketch和Fat-subsketch均包含d个数组,用Ai和Bi分别表示Slim-subsketch和Fat-subsketch的第i个数组;Slim-subsketch中每个数组含有w个桶,Fat-subsketch中每个数组含有w’个桶,w’>w;Fat-subsketch和Slim-subsketch的每个桶中都有一个计数器;用Ai[j]表示Slim-subsketch中第i个数组的第j个桶,1≤i≤d,1≤j≤w;用Bi[k]表示Fat-subsketch中第i个数组的第k个桶,1≤i≤d,1≤k≤w’,每个数组Ai都与一个均匀分布独立的哈希函数hi(.)相关联,hi(.)的输出范围是[1,w];每个数组Bi也一个均匀分布独立的哈希函数gi(.)相关联,gi(.)的输出范围是[1,w’]。3.如权利要求2所述的方法,其特征在于,包括以下操作:插入操作:在插入一个表项e时,首先将其插入Fat-subsketch中,即计算d个哈希函数g1(e),g2(e),...,gd(e)以及将d个计数器B1[g1(e)],B2[g2(e)],...,Bd[gd(e)]增加1;然后通过寻找刚刚增量过的计数器的最小值来评估当前e的频度;然后计算d个哈希函数h1(e),h2(e),...,hd(e)并且识别d个计数器A1[h1(e)],A2[h2(e)],...,Ad[hd(e)]中含有最小值的计数器,如果这些计数器的值小于则让它们加1;查询操作:在查询表项e的频度时,计算d个哈希函数h1(e),h2(e),...,hd(e)并且返回A1[h1(e)],A2[h2(e)],...,Ad[hd(e)]中最小的计数器值作为查询的结果,即查询操作完全由片内的Slim-subsketch完成;删除操作:不支持删除操作。4.如权利要求2或3所述的方法,其特征在于,通过修改Fat-subsketch使其除了插入操作以外还能够辅助Slim-subsketch进行删除操作;Fat-subsketch的每个数组的桶数为w’,且w’=z×w,z是一个正整数;与Slim-subsketch相关联的哈希函数hi(.)由gi(.)衍生出来的,gi(.)的输出范围是[1,z×w],具体为:hi(.)=(gi(.)-1)%w+1,该公式记为公式一;哈希函数hi(.)的值总是处于[1,w]范围内,w是Slim-subsketch中每个数组桶的数量。5.如权利要求4所述的方法,其特征在于,在插入操作中,插入一个表项e时,首先将其插入Fat-subsketch中,同时计算d个哈希函数g1(e),g2(e),...,gd(e)并且使d个计数器B1[g1(e)],B2[g2(e)],...,Bd[gd(e)]增加1;然后从刚刚增加过的计数器中寻找拥有最小值的计数器并表示为为了将表项e插入Slim-subsketch中,首先用所述公式一计算d个哈希函数h1(e),h2(e)...
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。