{"id":45921058,"url":"https://github.com/larsonzh/lzispro","last_synced_at":"2026-02-28T08:49:09.918Z","repository":{"id":152058326,"uuid":"625212610","full_name":"larsonzh/lzispro","owner":"larsonzh","description":"Multi process parallel acquisition tool for IP address data of ISP network operators in China（中国区 ISP 网络运营商 IP 地址数据多进程并行处理批量获取工具）","archived":false,"fork":false,"pushed_at":"2025-10-25T02:31:39.000Z","size":2898,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T02:36:28.859Z","etag":null,"topics":["apnic","asuswrt-merlin","cidr","deepin","ipv4","ipv6","isp","linux","mutilprocess","openwrt","parallel","shell","test","ubuntu","whois"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/larsonzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-08T12:12:26.000Z","updated_at":"2025-10-25T02:31:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb6dc40c-ae42-40f6-ab1b-00ac9980f060","html_url":"https://github.com/larsonzh/lzispro","commit_stats":{"total_commits":159,"total_committers":2,"mean_commits":79.5,"dds":"0.37106918238993714","last_synced_commit":"26afe940b01a01668c8b35737209b5e17876019a"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/larsonzh/lzispro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsonzh%2Flzispro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsonzh%2Flzispro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsonzh%2Flzispro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsonzh%2Flzispro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larsonzh","download_url":"https://codeload.github.com/larsonzh/lzispro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsonzh%2Flzispro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29929095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apnic","asuswrt-merlin","cidr","deepin","ipv4","ipv6","isp","linux","mutilprocess","openwrt","parallel","shell","test","ubuntu","whois"],"created_at":"2026-02-28T08:49:09.293Z","updated_at":"2026-02-28T08:49:09.904Z","avatar_url":"https://github.com/larsonzh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lzispro\nMulti process parallel acquisition tool for IP address data of ISP network operators in China\n\n中国区 ISP 网络运营商 IP 地址数据多进程并行处理批量获取工具\n\n*呵呵，妥妥的一个主机多进程网络性能，计算性能，读写性能测试工具！能以极致指标跑好这个脚本，才敢说有台好设备可以凑合用了。*\n\n**v1.1.9**\n\n## 更新快讯 / Updates\n\n- 2025-10-28：同步 whois v3.2.0 全静态多架构二进制到 `release/lzispro/whois/`；`func/lzispdata.sh` 默认采用“行模式 + 不展开续行”，更利于 BusyBox awk 聚合（可用环境变量回退）。详见 whois 文档与发布页。\n  - whois 使用说明（中文/英文）：`../whois/docs/USAGE_CN.md` | `../whois/docs/USAGE_EN.md`\n  - whois Release: https://github.com/larsonzh/whois/releases/tag/v3.2.0\n\n工具采用 Shell 脚本编写，参考并借鉴 clangcn（ https://github.com/clangcn/everyday-update-cn-isp-ip.git ）项目代码和思路，通过多进程并行处理技术，对信息检索和数据写入过程进行优化，极大提高 ISP 运营商分项地址数据生成效率，减少运行时间。\n\n在提供 IPv4 数据获取的同时，增加 IPv6 数据获取功能，以及基于 CIDR 网段聚合算法的 IPv4/6 CIDR 地址数据的生成功能。\n\n作为自主数据源产生的 CIDR 网段地址数据，非常适合路由器多线路宽带接入后的策略分流功能使用。\n\n脚本在 Linux 环境下使用，运行平台包括：Ubuntu，CentOS Stream，Rocky，Deepin，ASUSWRT-Merlin，OpenWrt，......\n\n适用的 Shell 类型：sh，ash，dash，bash，zsh，......\n\n本产品同时也是本人 lzispcn 项目（ https://github.com/larsonzh/lzispcn.git ）从单进程进化到多进程的升级版本。\n\n项目代码和算法全部开源公开，欢迎有闲人士研究、探索和教化，共同进步。\n\n# whois 客户端与远程交叉编译\n\n- 轻量高性能的自研 whois 客户端（C 语言），面向 BusyBox/路由器等精简环境\n- 稳定输出契约：每条查询固定“标题行 + 权威 RIR 尾行”，便于 awk/grep 管道\n- 正则过滤与选择模式：`--grep/--grep-cs`，`--grep-line/--grep-block`；行模式可选 `--keep-continuation-lines`\n- 多架构全静态二进制：aarch64/armv7/x86_64/x86/mipsel/mips64el/loongarch64\n- 提供远程交叉编译与 QEMU 冒烟测试脚本（Git Bash 一键）\n\n常用链接\n- whois 仓库：`../whois`\n- 中文使用说明：`../whois/docs/USAGE_CN.md`\n- 远程交叉编译：`../whois/tools/remote/README_CN.md`\n- 最新发布（下载）：https://github.com/larsonzh/whois/releases\n\n提示（产物与清理）：自 whois v3.2.0 起，whois 仓库的 `out/artifacts/` 已被 `.gitignore` 忽略且不再纳入版本控制；若需清理本地历史产物，可使用 `../whois/tools/dev/prune_artifacts.ps1`（支持 `-DryRun`）。\n\n最简示例\n\n```sh\n# 固定起始 RIR 并禁止重定向\nwhois-x86_64 --host apnic -Q 103.89.208.0\n\n# 批量（从标准输入读取）\ncat ip_list.txt | whois-x86_64 -B --host apnic\n```\n\n提示：PowerShell 启动器已停用，请使用 Git Bash 版本。\n\n# 功能\n- 从 APNIC 下载最新 IP 信息数据。\n\n- 从 APINC IP 信息数据中抽取出最新、最完整的中国大陆及港澳台地区所有 IPv4/6 原始地址数据。\n\n- 采用多进程并行处理方式，向 APNIC 逐条查询中国大陆地区的 IPv4/6 原始地址数据，得到归属信息，生成能够包含中国大陆地区所有 IPv4/6 地址的 ISP 运营商分项数据。\n\n- 通过 CIDR 聚合算法生成压缩过的 IPv4/6 CIDR 格式地址数据。\n\n- 中国区 IPv4/6 地址数据：含 4 个地区分项和 7 个 ISP 运营商分项\n\n    * 大陆地区\n\n       - 中国电信\n\n       - 中国联通/网通\n\n       - 中国移动 (含铁通)\n\n       - 中国广电\n\n       - 中国教育网\n \n       - 电信通/长城宽带/鹏博士\n\n       - 中国大陆其他\n\n  * 香港地区\n\n  * 澳门地区\n\n  * 台湾地区\n\n# 下载地址\n\n- 百度网盘\n\n    https://pan.baidu.com/s/1w6AZCqDvK7Jb2qE-PTTADA\n\n- 国外开源代码托管平台（GitHub）\n\n    https://github.com/larsonzh\n\n- 国内开源代码托管平台（Gitee）\n\n    https://gitee.com/larsonzh\n\n# 安装及运行\n\n## 一、安装支撑软件\n\n脚本已内置自定义的 whois 客户端软件模块，使用前最好将所在系统升级到最新版本，同时安装脚本执行时必须依赖的软件模块：wget\n\n- Ubuntu | Deepin\n\n```markdown\n  sudo apt update\n  sudo apt install gawk\n  sudo apt install screen # 可选项\n```\n\n- CentOS Stream | Rocky\n\n```markdown\n  sudo dnf install -y epel-release\n  sudo dnf update -y\n  sudo dnf install -y gcc make perl kernel-devel kernel-headers bizp2 dkms whois\n  sudo dnf update kernel-*\n  sudo dnf install -y screen # 可选项\n  sudo reboot\n```\n\n- ASUSWRT-Merlin\n\n```markdown\n  以下为可选项\n  先安装 Entware 软件存储库：\n    插入格式化为 ext4 格式的 USB 盘，键入\n    系统自带的 amtm 命令，在终端菜单窗口中\n    选择安装 Entware 到 USB 盘。\n  opkg update \n  opkg install screen\n```\n\n- OpenWrt\n\n```markdown\n  opkg update\n  opkg install wget-ssl\n  opkg install screen # 可选项\n```\n\n其他 Linux 平台系统依此类推。\n\n## 二、安装项目脚本\n\n1. 下载本工具的软件压缩包 lzsipcn-[version ID].tgz（例如：lzispro-v1.1.9.tgz）。\n\n2. 将压缩包复制到设备的任意有读写权限的目录。\n\n3. 在 Shell 终端中使用解压缩命令在当前目录中解压缩，生成 lzispro-[version ID] 目录（例如：lzispro-v1.1.9），其中包含一个 lzispro 目录，是脚本所在目录。\n\n```markdown\n  tar -xzvf lzispro-[version ID].tgz\n```\n\n4. 将 lzispro 目录整体复制粘贴到设备中有读写运行权限的目录位置存储。\n\n5. 在 lzispro 目录中，lzispro.sh 为本工具的可执行脚本，若读写运行权限不足，手工赋予 755 以上即可。\n\n## 三、脚本运行命令\n\n```markdown\n  假设当前位于 lzispro 目录\n  启动脚本         ./lzispro.sh\n  强制停止         ./lzispro.sh stop\n```\n\n1. 通过 Shell 终端启动脚本后，在操作过程中不要关闭终端窗口，这会导致程序执行过程意外中断。为防止远程终端窗口在长时间运行中意外掉线或关闭，建议在服务端的 Linux 系统中安装 screen 全屏幕窗口管理命令模块，并在 screen 会话中执行脚本运行命令，可确保终端窗口掉线或关闭后，也能在 screen 会话后台完成脚本运行。\n\n2. 主脚本在系统中只能有一个实例进程运行。若上次运行过程中非正常退出，再次运行如果提示有另一个实例正在运行，在确认系统中本脚本确实没有实例正在运行后，可以执行「强制停止」命令或重启系统，然后再执行「启动脚本」命令。由于采用多进程并行处理机制，一旦工作过程被打断，或强制关闭后，为避免残余进程还在后台运行，请执行一次「强制停止」命令，以清理脚本非正常退出后遗留的临时数据，同时关闭垃圾进程。\n\n3. 进行 ISP 运营商分项数据归类时，脚本需要通过互联网访问 APNIC 做海量信息查询，可能要耗费一、两个小时以上时间。切勿中断此执行过程，并耐心等候。\n\n4. 若要减少 ISP 运营商分项数据归类处理时间，可根据设备硬件平台性能，在不影响设备正常使用的前提下，酌情并适可而止的修改查询 ISP 信息归类数据的「并行查询处理多进程数量 PARA_QUERY_PROC_NUM」参数，最小为 1，取值越大，效率越高，用时越短。原则上不要让主机 CPU 每个核心运行时的资源占用率超过 80% 为宜，可据此对该参数进行上下调整。例如，从缺省的 16 进程，提高到 32 进程，48 进程，甚至 64 进程，效率可能获得翻倍，或数倍提高，大大降低程序运行时间，改善应用体验。\n\n## 四、目录结构\n\n在项目目录 lzispro 下，脚本为获取和生成的每类文本形式的数据设有独立的存储目录，在程序执行完成后，从这些目录中可获取所需数据。用户也可以根据需要，在脚本参数配置时修改最终输出的目录名称、路径，以及具体的数据文件名称。\n\n```markdown\n  [lzispro]\n    [func]\n      lzispdata.sh        -- ISP 数据进程脚本\n    [apnic]               -- APNIC 的 IP 信息数据\n    [isp]                 -- IPv4 原始地址数据\n    [cidr]                -- IPv4 CIDR 地址数据\n    [ipv6]                -- IPv6 原始地址数据\n    [cidr_ipv6]           -- IPv6 CIDR 地址数据\n    [tmp]                 -- 运行中的临时数据\n    [whois]\n      whois-aarch64       -- 64 位 aarch64 | armv8 平台架构 whois 客户端\n      whois-armv7         -- 32 位 armv6 | armv7 平台架构 whois 客户端\n      whois-loongarch64   -- 龙芯 64 位平台架构 whois 客户端\n      whois-mipsel        -- 32 位小端字节序 mips 平台架构 whois 客户端\n      whois-mips64el      -- 64 位小端字节序 mips 平台架构 whois 客户端\n      whois-x86           -- 32 位 x86 | i386 | i486 | i586 | i686 平台架构 whois 客户端\n      whois-x86_64        -- 64 位 x86_64 | amd64 平台架构 whois 客户端\n    lzispro.sh            -- 主进程脚本\n```\n\n## 五、参数配置\n\nlzispro.sh 脚本是本工具的主程序，可用文本编辑工具打开查看、修改其中的内容。\n    \n该代码的前部分有供用户自定义的变量参数，具体使用可参考内部注释。\n\n```markdown\n  项目目录\n  目标数据文件名\n  需要获取哪类数据\n  并行查询处理多进程数量\n  信息查询失败后的重试次数\n  是否显示进度条\n  系统日志文件定义\n  ......\n```\n\n# 卸载\n\n直接删除 lzispro 目录。\n\n# 效果图\n\n## ASUSWRT-Merlin\n\n华硕 GT-AX6000 梅林固件路由器，四核心 ARM CPU，主频 2.0 MHz，脚本「并行查询处理多进程数量」参数设置为：PARA_QUERY_PROC_NUM=\"48\"。实际用时从单进程的两个多小时减少到 10 分钟以下。并行查询处理多进程同时运行时，CPU 四个内核的资源占用率均在 60 ~ 70 % 之间，路由器网络内外之间均保持畅通。\n\n![lzispro_asuswrt-merlin](https://user-images.githubusercontent.com/73221087/231459621-1431b97e-6ac3-4703-8812-18d36805d6ef.jpg)\n\n## OpenWrt\n\n使用 64 个查询处理进程，OpenWrt 跑疯了。这是在 VirtualBox 虚拟机里的软路由，主机系统 Windows 11，11 代 U 的笔记本电脑，无线连接路由器，平时看不出有啥性能，不可思议！\n\n![lzispro_openwrt_64](https://user-images.githubusercontent.com/73221087/231570822-a8cc1445-5396-4dd6-8b62-a3250912541f.png)\n\n能跑哈，再折腾下，128 个进程，行不？3 分钟半，大部分时间耗在 CIDR 聚合计算上，ISP 数据生成用时很少，若放到服务器上，效果更好。\n\n![lzispro_openwrt_128](https://user-images.githubusercontent.com/73221087/231569234-b2c92800-8afb-4ada-9211-7f64176aa280.png)\n\n## CentOS Stream\n\n安装在 11 代 U 笔记本电脑 VirtualBox 虚拟机里的 Linux 服务器，配置 4 GB 内存和 4 个处理器。脚本「并行查询处理多进程数量」参数设置为：PARA_QUERY_PROC_NUM=\"128\"，使用 128 个查询处理进程。\n\n2 分钟 8 秒，太快了！\n\n![lzispro_centos](https://user-images.githubusercontent.com/73221087/232160640-e03aa2bf-afa6-4a25-8bff-6f5e69c47ba8.jpg)\n\n## Ubuntu Server\n\n使用装在 VirtualBox 虚拟机里的 Ubuntu Server，还是 128 个查询进程，开启进度条显示，\n\n过程中规中矩，扣除起始时快时慢的 APNIC IP 信息数据 FTP 下载时间，大多数时候没有 CentOS Stream、Rocky 快。虚拟机里还有 Ubuntu 桌面版和一个 Deepin 桌面版，跑起来总体上要比服务器版慢。\n\n所有系统都升级到当前最新正式版本，除去两个 Linux 路由器专用系统，公平起见，所有虚拟机中的 Linux 系统，内存、处理器、存储、网卡等均采用相同配置，都走中国移动千兆宽带，运行中尽可能使用执行速度更快的 Shell 环境，如 sh、ash、dash，bash 比较臃肿，效率有些低，但也只在理论上，实际受其他影响，差别没想象的大。\n\n几轮测试下来，最大影响因素还是网络。一般夜里，或凌晨前测试效果较好，白天时段较慢，肯定与业务繁忙程度、网络节点中继流量及国际出口拥堵状况有关，最好找我区绝大部分人类活动能力较弱的垃圾时间折腾。由于 APNIC 负责亚太地区网络地址，主机繁忙时间与我兔作息较为接近，事实如此？我也仅是打酱油时无意间特么猜测，总有些不规矩的家伙积极从事反人类的加班加点，搞得鸡毛都飞不动了。。。\n\n![lzispro_ubuntu_srv](https://user-images.githubusercontent.com/73221087/232861999-617c2501-888c-4764-b10f-e0a59c9790be.png)\n\n## Deepin\n\n谁说国货不行，无意间又用 128 进程测了一下这个刚升级的桌面版系统，屌爆逆天，还特么怎么玩，一分多钟。。。\n\n![lzispro_deepin](https://user-images.githubusercontent.com/73221087/232901131-7bcdc031-b14c-43f4-aac3-b207ef475d90.png)\n\n## Ubuntu\n\n最后用 Ubuntu 桌面版测了一下 128 个进程并行查询处理的情况，结果令人失望，比过去最快曾到过 2 分 51 秒慢的很多，有些离谱，可能此刻网络状况变差，GitHub 也连不上了，啥破网络。折腾一宿，感觉测的是网络状态，无语！\n\n![lzispro_ubuntu](https://user-images.githubusercontent.com/73221087/232913271-92722e0a-1a65-42d0-9911-6ffd90c46e2b.png)\n\n# 捐赠\n\n小众需求，开源不易，欢迎投喂 😘\n\n| ![Wechat Pay](/images/wechat.png) | ![Alipay](/images/alipay.png) |\n|--------------------------------------------------|--------------------------------------------------|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsonzh%2Flzispro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarsonzh%2Flzispro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsonzh%2Flzispro/lists"}