CN106528712A - 一种比较一组大数据在另一组大数据中是否存在方法 - Google Patents
一种比较一组大数据在另一组大数据中是否存在方法 Download PDFInfo
- Publication number
- CN106528712A CN106528712A CN201610951775.6A CN201610951775A CN106528712A CN 106528712 A CN106528712 A CN 106528712A CN 201610951775 A CN201610951775 A CN 201610951775A CN 106528712 A CN106528712 A CN 106528712A
- Authority
- CN
- China
- Prior art keywords
- list2
- list1
- big data
- group
- true
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90344—Query processing by using string matching techniques
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种比较一组大数据在另一组大数据中是否存在方法。本发明方法步骤是:1、创建集合List1和List2。2、计算集合List1和List2中的最大值。3、随机初始化集合List1和List2。4、初始化集合Boolean类型集合C,将集合List1按顺序判断在集合List2中是否存在并记录在Boolean型的集合C中。5、新建临时的辅助变量tempList1,循环List2,把List2中的值作为List1的下标,C中对应位置标记为true,验证元素是否存在。6、循环List1,直接比较下标,验证是否存在,如果存在,将集合C对应位置标记为true,C中标记为true的即List1在List2中存在的值。本发明解决了快速比较一组大数据在另一组大数据中存在的问题;可以用于C#中某组大数据是否存在判断比较。
Description
技术领域
本发明涉及C#技术领域,特别涉及一种比较一组大数据在另一组大数据中是否存在方法。
背景技术
C#是微软推出的一种基于.NET框架的、面向对象的高级编程语言。Array.indexOf函数搜索Array对象的指定元素并返回该元素的索引。此函数是静态的,可在不创建对象实例的情况下调用。
传统的两组数据比较的方法较包括Array.indexOf、Contains、Intersect、Hashtable等,测试结果都存在比较慢的问题,比较时间几分钟才能完成,数据量到达千万级别,直接导致程序崩溃。
发明内容
本发明解决的技术问题在于提供一种快速比较一组大数据在另一组大数据中是否存在方法,解决快速比较大数据集合的问题,在相同测试环境下,千万数据集合比较可以在毫米范围内完成。
本发明解决上述技术问题的技术方案是:
所述的方法包含以下几个步骤:
步骤一、创建集合List1和List2,
步骤二、计算集合List1和List2中的最大值,
步骤三、随机初始化集合List1和List2;
步骤三、初始化Boolean类型集合C,将集合List1按顺序判断在集合List2中是否存在并记录在Boolean类型集合C中;
步骤四、新建临时的辅助变量tempList1,循环List2,把List2中的值作为List1的下标,对应位置标记为true,验证元素是否存在;
步骤五、循环List1,直接比较下标,验证是否存在,如果存在,将集合C对应位置标记为true,集合C中标记为true的即List1在List2中存在的值。
所述的List1,List2的长度设定为10000000;集合List1和List2中的最大值设定为为11000000。
所述的方法的测试环境服务器配置为4核CPU,4G内存。
本发明的有益效果:实现了快速比较大数据集合的问题,在相同测试环境下,千万数据比较可以在毫米范围内完成。
附图说明
下面结合附图对本发明进一步说明:
图1为本发明的方法流程图。
具体实施方式
如图1所示,本发明所述的方法包含以下几个步骤:
步骤一、创建集合List1和List2,假设List1,List2的长度为10000000,
Int32length=10000000;//List1,List2的长度
long[]List1=new long[length];
long[]List2=new long[length];
步骤二、计算集合List1和List2中的最大值,假设最大值为11000000
Int32maxValue=11000000;//元素最大值
步骤三、随机初始化集合List1和List2。
步骤三、初始化集合Boolean类型集合C,将集合A按顺序判断在集合List2中是否存在并记录在Boolean型的集合C中。
Boolean[]C=new Boolean[length];
步骤四、新建临时的辅助变量tempList1,循环List2,把List2中的值作为List1的下标,对应位置标记为true,验证元素是否存在
步骤五、循环List1,直接比较下标,验证是否存在,如果存在,将集合C对应位置标记为true,C中标记为true的即List1在List2中存在的值。
Claims (3)
1.一种比较一组大数据在另一组大数据中是否存在方法,其特征在于:所述的方法包含以下几个步骤:
步骤一、创建集合List1和List2,
步骤二、计算集合List1和List2中的最大值,
步骤三、随机初始化集合List1和List2;
步骤三、初始化Boolean类型集合C,将集合List1按顺序判断在集合List2中是否存在并记录在Boolean类型集合C中;
步骤四、新建临时的辅助变量tempList1,循环List2,把List2中的值作为List1的下标,对应位置标记为true,验证元素是否存在;
步骤五、循环List1,直接比较下标,验证是否存在,如果存在,将集合C对应位置标记为true,集合C中标记为true的即List1在List2中存在的值。
2.根据权利要求1所述的比较一组大数据在另一组大数据中是否存在方法,其特征在于:所述的List1,List2的长度设定为10000000;集合List1和List2中的最大值设定为为11000000。
3.根据权利要求1或2所述的比较一组大数据在另一组大数据中是否存在方法,其特征在于:所述的方法的测试环境服务器配置为4核CPU,4G内存。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610951775.6A CN106528712A (zh) | 2016-10-26 | 2016-10-26 | 一种比较一组大数据在另一组大数据中是否存在方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610951775.6A CN106528712A (zh) | 2016-10-26 | 2016-10-26 | 一种比较一组大数据在另一组大数据中是否存在方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106528712A true CN106528712A (zh) | 2017-03-22 |
Family
ID=58325536
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610951775.6A Pending CN106528712A (zh) | 2016-10-26 | 2016-10-26 | 一种比较一组大数据在另一组大数据中是否存在方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528712A (zh) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786938A (zh) * | 2014-12-26 | 2016-07-20 | 华为技术有限公司 | 一种对大数据进行处理的方法和装置 |
CN105913267A (zh) * | 2016-04-06 | 2016-08-31 | 广州市艾派克智能激光科技有限公司 | 一种基于大数据的信息化管理办法 |
-
2016
- 2016-10-26 CN CN201610951775.6A patent/CN106528712A/zh active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786938A (zh) * | 2014-12-26 | 2016-07-20 | 华为技术有限公司 | 一种对大数据进行处理的方法和装置 |
CN105913267A (zh) * | 2016-04-06 | 2016-08-31 | 广州市艾派克智能激光科技有限公司 | 一种基于大数据的信息化管理办法 |
Non-Patent Citations (2)
Title |
---|
SVMACHINE: "海量数据查找一个数是否存在", 《HTTP://BLOG.CSDN.NET/SVMACHINE/ARTICLE/DETAILS/52739881》 * |
ZENGZHAOZHENG: "海量数据解决思路之BitMap", 《HTTP://BLOG.51CTO.COM/ZENGZHAOZHENG/1404108》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109783604B (zh) | 基于少量样本的信息提取方法、装置和计算机设备 | |
CN109118504B (zh) | 一种基于神经网络的图像边缘检测方法、装置及其设备 | |
CN108304921A (zh) | 卷积神经网络的训练方法及图像处理方法、装置 | |
US9811760B2 (en) | Online per-feature descriptor customization | |
KR20210032140A (ko) | 뉴럴 네트워크에 대한 프루닝을 수행하는 방법 및 장치 | |
DE102018126146A1 (de) | Maschinenlernbasierte feststellung von programmcodeeigenschaften | |
CN106023154A (zh) | 基于双通道卷积神经网络的多时相sar图像变化检测方法 | |
CN106295338A (zh) | 一种基于人工神经元网络的sql漏洞检测方法 | |
CN112966685B (zh) | 用于场景文本识别的攻击网络训练方法、装置及相关设备 | |
CN111062036A (zh) | 恶意软件识别模型构建、识别方法及介质和设备 | |
CN105045715B (zh) | 基于编程模式和模式匹配的漏洞聚类方法 | |
CN106529080A (zh) | 一种方块电阻spice模型的构建方法 | |
CN112613543A (zh) | 增强策略验证方法、装置、电子设备及存储介质 | |
CN107491536A (zh) | 一种试题校验方法、试题校验装置及电子设备 | |
DE102020121075A1 (de) | Einrichtung und Verfahren zur Authentifizierung von Software | |
CN104732534A (zh) | 一种图像中显著目标的抠取方法及系统 | |
Mayer | Efficient hierarchical triplet merging for camera pose estimation | |
DE202016008006U1 (de) | Generierung von Integrationstests im Kleinen | |
CN106528712A (zh) | 一种比较一组大数据在另一组大数据中是否存在方法 | |
CN110427465B (zh) | 一种基于词语知识图谱的内容推荐方法及装置 | |
CN108241705A (zh) | 一种数据插入方法及装置 | |
CN116756536A (zh) | 数据识别方法、模型训练方法、装置、设备及存储介质 | |
CN111832610A (zh) | 一种3d打印组织预测的方法、系统、介质以及终端设备 | |
CN103218460A (zh) | 基于最优线性稀疏重构的图像标签补全方法 | |
CN106599637A (zh) | 一种在验证界面输入验证码的方法和装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170322 |
|
RJ01 | Rejection of invention patent application after publication |