14 Star 73 Fork 35

zengzhan/qqzeng-ip

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qqzeng-phone-dat 3.72 KB
一键复制 编辑 原始数据 按行查看 历史
超高性能号段归属地格式详解 qqzeng-phone-3.0.dat
编码:UTF8 字节序:Little-Endian
返回多个字段信息(如:广东|深圳|518000|0755|440300|移动)
------------------------ 文件结构 ---------------------------
//文件头 20字节 4-4-4-4-4
[前缀数量][号段数量][内容区长度][运营商区长度][版本:20211201]
//内容区 长度无限制
[地区信息][地区信息]……唯一不重复
//运营商区 长度无限制
[运营商][运营商]……唯一不重复
//前缀区 7字节(1-4-2)
[号段前三位][索引区start索引][索引区个数]
//索引区 4字节(2-2)
[号段后四位][地区索引+运营商索引(不足补0)]
------------------------ 文件结构 ---------------------------
优势:压缩形式将数据存储在内存中,通过减少将相同数据读取到内存的次数来减少I/O.
较高的压缩率通过使用更小的内存中空间提高查询性能。
解析出来一次性加载到二维数组中,查询性能提高1倍!
压缩:原版txt为23M,生成dat结构为1.8M,上一版为3.2M
性能:每秒解析1000w+
对比:相比其他dat更简洁更高效
创建:qqzeng-phone 于 2021-12-12
新版 3.0 内存版:
查询 qqzeng-phone-3.0.dat 1500万 ->1.531秒 每秒979.7517962116265万次
查询 qqzeng-phone-3.0.dat 914万 ->0.821秒 每秒1113.2764920828258万次
查询 qqzeng-phone-3.0.dat 1424万 ->1.375秒 每秒1035.6363636363637万次
查询 qqzeng-phone-3.0.dat 584万 ->0.516秒 每秒1131.7829457364342万次
查询 qqzeng-phone-3.0.dat 1468万 ->1.29秒 每秒1137.984496124031万次
查询 qqzeng-phone-3.0.dat 1216万 ->1.061秒 每秒1146.0885956644674万次
查询 qqzeng-phone-3.0.dat 754万 ->0.673秒 每秒1120.3566121842496万次
查询 qqzeng-phone-3.0.dat 988万 ->0.871秒 每秒1134.3283582089553万次
查询 qqzeng-phone-3.0.dat 1534万 ->1.33秒 每秒1153.3834586466164万次
查询 qqzeng-phone-3.0.dat 832万 ->0.797秒 每秒1043.914680050188万次
查询 qqzeng-phone-3.0.dat 1340万 ->1.185秒 每秒1130.801687763713万次
查询 qqzeng-phone-3.0.dat 924万 ->0.807秒 每秒1144.981412639405万次
查询 qqzeng-phone-3.0.dat 848万 ->0.741秒 每秒1144.399460188934万次
查询 qqzeng-phone-3.0.dat 1526万 ->1.331秒 每秒1146.5063861758076万次
查询 qqzeng-phone-3.0.dat 808万 ->0.698秒 每秒1157.593123209169万次
查询 qqzeng-phone-3.0.dat 594万 ->0.522秒 每秒1137.9310344827586万次
旧版 2.0 内存版:
查询 qqzeng-phone.dat 1398万 ->2.932秒 每秒476.80763983628924万次
查询 qqzeng-phone.dat 1558万 ->3.037秒 每秒513.0062561738558万次
查询 qqzeng-phone.dat 822万 ->1.586秒 每秒518.2849936948297万次
查询 qqzeng-phone.dat 576万 ->1.112秒 每秒517.9856115107913万次
查询 qqzeng-phone.dat 452万 ->0.926秒 每秒488.12095032397406万次
查询 qqzeng-phone.dat 1204万 ->2.499秒 每秒481.7927170868347万次
查询 qqzeng-phone.dat 340万 ->0.713秒 每秒476.8583450210379万次
查询 qqzeng-phone.dat 352万 ->0.716秒 每秒491.6201117318436万次
查询 qqzeng-phone.dat 948万 ->1.822秒 每秒520.3073545554336万次
查询 qqzeng-phone.dat 514万 ->0.987秒 每秒520.7700101317123万次
查询 qqzeng-phone.dat 928万 ->1.783秒 每秒520.4711160964666万次
查询 qqzeng-phone.dat 1598万 ->3.108秒 每秒514.1570141570141万次
查询 qqzeng-phone.dat 446万 ->0.862秒 每秒517.4013921113689万次
查询 qqzeng-phone.dat 466万 ->0.896秒 每秒520.0892857142857万次
查询 qqzeng-phone.dat 1024万 ->1.964秒 每秒521.3849287169043万次
查询 qqzeng-phone.dat 1550万 ->2.974秒 每秒521.1835911230665万次
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qqzeng-ip/qqzeng-ip.git
git@gitee.com:qqzeng-ip/qqzeng-ip.git
qqzeng-ip
qqzeng-ip
qqzeng-ip
master

搜索帮助

A270a887 8829481 3d7a4017 8829481