itbdw / ip-database

免费IP离线数据库,支持IPV4+IPV6 ,国家、省、市、县、运营商
Other
1.37k stars 259 forks source link

代码重构以及支持 IPV6 #21

Closed itbdw closed 2 years ago

itbdw commented 4 years ago

新功能

1,时间太长,代码结构不够好。需要重构代码,将读取IP和格式化分开,以支持更多数据源。 2,尝试联系 http://ip.zxinc.org/ipquery/ 站长,可否使用 ipv6 库

itbdw commented 4 years ago

mit,直接用了,开发中

itbdw commented 4 years ago

发现了JS 的类似项目,但是地址匹配就高级多了,地址map竟然如此丰富,城市的匹配准确性也会提高很多,解决了自治区城市没有使用 xxx区 xxx市 的命名习惯。

https://github.com/metowolf/qqwry.ipdb/blob/master/src/format/data/iso3166.js

itbdw commented 4 years ago

需要兼容以下IP,原始 country 不规范的需要继续添加到 area ,防止信息丢失

{"ip":"218.193.183.35","country":"中国","province":"上海","city":"","county":"","area":"中国上海 D27-707","isp":"","org":{"ip":"218.193.183.35","country":"上海交通大学闵行校区","area":"D27-707"}} {"ip":"210.74.2.227","country":"中国","province":"北京","city":"","county":"","area":"中国北京 实验学院机房","isp":"","org":{"ip":"210.74.2.227","country":"北京工业大学","area":"实验学院机房"}} {"ip":"162.105.217.0","country":"中国","province":"北京","city":"","county":"","area":"中国北京 4区-4f","isp":"","org":{"ip":"162.105.217.0","country":"北京大学万柳学区","area":"4区-4f"}}

itbdw commented 4 years ago

计划找国家地区规范,返回数据支持地区码

itbdw commented 4 years ago

行政区域数据可以来自 http://www.mca.gov.cn/article/sj/xzqh/2020/

itbdw commented 4 years ago

国家统计局的2020代码规范,可以了解下 http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2020/index.html

itbdw commented 4 years ago

中华人民共和国行政区划代码 哈哈哈 https://github.com/tonyc726/china-administrative-division

itbdw commented 4 years ago

阿里数据库跟我的命名这么像呢。。。

https://help.aliyun.com/document_detail/170546.html?spm=a2c4g.11186623.6.562.5ac01aa0FoOLSP

itbdw commented 4 years ago

ipdb格式本身就是结构化的?更规范?参考 https://github.com/kqtec/iplocationzh/blob/master/src/Ip.php

itbdw commented 4 years ago

可以针对大学以及区域码,做映射。配置文件可以通过网络资源生成,生成代码也放到项目内

hulang commented 3 years ago

期待啊,支持ip v6。。重构就重构,我等着更新composer

itbdw commented 3 years ago

期待啊,支持ip v6。。重构就重构,我等着更新composer

去年年底已经写完,一直没更新仓库。。。@hulang 现在可以了 https://github.com/itbdw/ip-database/tree/3.x

Alion548 commented 3 years ago

请问,ipv6wry.db文件在哪里更新?

itbdw commented 3 years ago

请问,ipv6wry.db文件在哪里更新?

http://ip.zxinc.org/

itbdw commented 2 years ago

暂时不添加区域码了