{"id":35093981,"url":"https://github.com/joey-zhou/xiaozhi-esp32-server-java","last_synced_at":"2026-04-21T12:01:17.616Z","repository":{"id":279761665,"uuid":"939839664","full_name":"joey-zhou/xiaozhi-esp32-server-java","owner":"joey-zhou","description":"小智ESP32的Java企业级管理平台，提供设备监控、音色定制、角色切换和对话记录管理的前后端及服务端一体化解决方案","archived":false,"fork":false,"pushed_at":"2025-12-20T13:47:13.000Z","size":20800,"stargazers_count":1055,"open_issues_count":11,"forks_count":396,"subscribers_count":20,"default_branch":"main","last_synced_at":"2026-01-01T00:52:23.656Z","etag":null,"topics":["esp32","java","mcp","mcp-client","mcp-server","spring-ai","stt","tts","xiaozhi","xiaozhi-ai","xiaozhi-esp32","xiaozhi-server"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joey-zhou.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-02-27T07:35:36.000Z","updated_at":"2025-12-31T01:37:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"2656c68b-9d91-4c77-96a8-dc39a4964bc1","html_url":"https://github.com/joey-zhou/xiaozhi-esp32-server-java","commit_stats":null,"previous_names":["joey-zhou/xiaozhi-esp32-webui","joey-zhou/xiaozhi-esp32-server-java"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/joey-zhou/xiaozhi-esp32-server-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joey-zhou%2Fxiaozhi-esp32-server-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joey-zhou%2Fxiaozhi-esp32-server-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joey-zhou%2Fxiaozhi-esp32-server-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joey-zhou%2Fxiaozhi-esp32-server-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joey-zhou","download_url":"https://codeload.github.com/joey-zhou/xiaozhi-esp32-server-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joey-zhou%2Fxiaozhi-esp32-server-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["esp32","java","mcp","mcp-client","mcp-server","spring-ai","stt","tts","xiaozhi","xiaozhi-ai","xiaozhi-esp32","xiaozhi-server"],"created_at":"2025-12-27T15:04:24.309Z","updated_at":"2026-04-21T12:01:17.594Z","avatar_url":"https://github.com/joey-zhou.png","language":"Java","funding_links":[],"categories":["📚 Projects (1974 total)","カテゴリ"],"sub_categories":["MCP Servers","📡 \u003ca name=\"iot--hardware\"\u003e\u003c/a\u003eIoT・ハードウェア"],"readme":"\u003ch1 align=\"center\"\u003eXiaozhi ESP32 Server Java\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  基于 \u003ca href=\"https://github.com/78/xiaozhi-esp32\"\u003eXiaozhi ESP32\u003c/a\u003e 项目开发的 Java 版本服务端，包含完整前后端管理平台\u003cbr/\u003e\n  为智能硬件设备提供强大的后端支持和直观的管理界面\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/issues\"\u003e反馈问题\u003c/a\u003e\n  · \u003ca href=\"#deployment\"\u003e部署文档\u003c/a\u003e\n  · \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/blob/main/CHANGELOG.md\"\u003e更新日志\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://trendshift.io/repositories/13936\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/13936\" alt=\"joey-zhou%2Fxiaozhi-esp32-server-java | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/graphs/contributors\"\u003e\n    \u003cimg alt=\"GitHub Contributors\" src=\"https://img.shields.io/github/contributors/joey-zhou/xiaozhi-esp32-server-java?logo=github\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://safeskill.dev/scan/joey-zhou-xiaozhi-esp32-server-java\"\u003e\n    \u003cimg alt=\"SafeSkill 80/100\" src=\"https://img.shields.io/badge/SafeSkill-80%2F100_Passes%20with%20Notes-yellow\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/issues\"\u003e\n    \u003cimg alt=\"Issues\" src=\"https://img.shields.io/github/issues/joey-zhou/xiaozhi-esp32-server-java?color=0088ff\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/pulls\"\u003e\n    \u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/joey-zhou/xiaozhi-esp32-server-java?color=0088ff\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-white?labelColor=black\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/joey-zhou/xiaozhi-esp32-server-java\"\u003e\n    \u003cimg alt=\"stars\" src=\"https://img.shields.io/github/stars/joey-zhou/xiaozhi-esp32-server-java?color=ffcb47\u0026labelColor=black\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e如果这个项目对您有帮助，请考虑给它一个 ⭐ Star！\u003c/b\u003e\u003cbr/\u003e\n  您的支持是我们持续改进的动力！\n\u003c/p\u003e\n\n---\n\n## 项目简介\n\nXiaozhi ESP32 Server Java 是基于 [Xiaozhi ESP32](https://github.com/78/xiaozhi-esp32) 项目开发的 **Java 企业级服务端**，采用多模块 + 双进程架构设计，为 ESP32 智能硬件提供完整的后端支撑和可视化管理平台。\n\n### 核心亮点\n\n- **多模块 + 双进程架构** — 管理后台与对话服务独立运行，互不影响，支持分别扩容\n- **多 AI 平台集成** — OpenAI / 智谱 / 讯飞 / Ollama / Dify / Coze，MCP 工具协议扩展\n- **语音全链路** — 本地 \u0026 云端 STT/TTS，音色克隆，实时打断，双向流式交互\n- **WebSocket + MQTT** — 实时双向通信，服务端主动唤醒，OTA 远程升级\n- **IoT 智能家居** — 语音指令控制设备，多设备协同，Function Call 智能决策\n- **RAG 知识库** — 文档上传，智能检索增强生成，长期记忆管理\n- **全链路监控** — Token / 时延 / 设备活跃度等多维度数据可视化\n- **一键部署** — bin 脚本 / Docker Compose，Flyway 自动建表，模型自动下载\n\n### 技术栈\n\n| 类别 | 技术选型 |\n|------|----------|\n| **后端** | Spring Boot、Spring MVC、MyBatis-Plus、Flyway、WebSocket |\n| **前端** | Vue.js、Ant Design、响应式布局 |\n| **数据层** | MySQL 8.0、Redis 7 |\n| **语音识别** | Vosk、FunASR、阿里云、腾讯云、讯飞 |\n| **语音合成** | sherpa-onnx（本地）、火山引擎、阿里云、Edge TTS |\n| **大语言模型** | OpenAI、智谱 AI、讯飞星火、Ollama、Dify、Coze |\n| **扩展能力** | MCP 工具协议、Function Call、RAG 知识库、音色克隆 |\n\n---\n\n## 项目架构\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/images/architecture.png\" alt=\"系统架构图\" width=\"900\" /\u003e\n  \u003cp\u003e\u003csub\u003e📐 架构图源文件：\u003ca href=\"docs/architecture.drawio\"\u003edocs/architecture.drawio\u003c/a\u003e（可用 \u003ca href=\"https://app.diagrams.net\"\u003edraw.io\u003c/a\u003e 打开编辑）\u003c/sub\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n\u003e **双进程架构**：两个独立进程共享 MySQL 和 Redis，可分别部署与扩容。\n\u003e - `xiaozhi-server` :8091 — 管理后台，提供 REST API、用户/设备/角色管理、OTA 升级\n\u003e - `xiaozhi-dialogue` :8092 — 对话服务，处理 WebSocket/MQTT 实时音频流、AI 对话管道\n\u003e\n\u003e `dialogue` 支持横向扩展，新实例自动注册至 `server`，通过设备 OTA 实现负载均衡。\n\n---\n\n## 适用人群\n\n- 已购买 ESP32 硬件，需要功能完善的管理平台\n- 需要企业级稳定性和扩展性\n- 个人开发者，希望快速搭建使用\n- 需要支持大量设备并发连接的场景\n\n---\n\n## 功能对比\n\n\u003e 部分功能未开源，有需求请通过下方联系方式沟通\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/images/featture-comparison.png\" alt=\"开源版 vs 商业版功能对比\" width=\"900\" /\u003e\n\u003c/div\u003e\n\n---\n\n\u003ca id=\"deployment\"\u003e\u003c/a\u003e\n## 部署文档\n\n### 快速开始\n\n```bash\ngit clone https://github.com/joey-zhou/xiaozhi-esp32-server-java\ncd xiaozhi-esp32-server-java\n./scripts/download_models.sh   # 下载模型和原生库（首次必须）\nbin/all.sh start               # 一键编译并启动（server + dialogue）\nbin/all.sh status              # 查看状态\n```\n\n\u003e `models/` 和 `lib/` 不在 Git 仓库中，首次部署需通过脚本下载。使用第三方 STT/TTS 可只运行 `./scripts/download_base.sh`（仅下载 VAD 模型和原生库）。\n\n### 部署方式\n\n| 方式 | 文档 | 说明 |\n|------|------|------|\n| 源码部署（Linux） | [CentOS 部署文档](./docs/CENTOS_DEVELOPMENT.md) | 推荐生产环境 |\n| 源码部署（Windows） | [Windows 部署文档](./docs/WINDOWS_DEVELOPMENT.md) | 开发和测试 |\n| Docker | [Docker 部署文档](./docs/DOCKER.md) | 快速容器化部署 |\n| 固件编译 | [固件编译文档](./docs/FIRMWARE-BUILD.md) | ESP32 固件编译和烧录 |\n\n成功运行后，xiaozhi-server会输出 OTA 和 xiaozhi-dialogue会输出 WebSocket 连接地址，根据固件编译文档使设备接入服务使用。\n\n---\n\n## 性能测试\n\n我们开发了专门的 WebSocket 并发测试工具 [Xiaozhi Concurrent](https://github.com/joey-zhou/xiaozhi-concurrent)，用于评估系统的性能和稳定性。测试工具支持模拟大量设备同时连接，测试完整的 WebSocket 通信流程，并生成详细的性能报告和可视化图表。\n\n\u003e 📖 测试工具的详细使用说明、安装步骤和参数配置请查看：[Xiaozhi Concurrent 仓库](https://github.com/joey-zhou/xiaozhi-concurrent)\n\n### 基准测试结果\n\n以下测试数据基于**腾讯云服务器（8核8G，100M按量付费带宽）** 环境，**100个设备、100并发连接、持续5轮** 对话测试：\n\n#### 性能指标\n\n| 测试项目 | 成功率 | 平均时延 | 最小值 | 最大值 | 备注 |\n|---------|-------|---------|-------|-------|------|\n| WebSocket连接 | 100% (500/500) | 0.090s | - | - | 建立连接耗时 |\n| Hello握手 | 100% (500/500) | 0.073s | - | - | 握手响应时间 |\n| 唤醒词响应 | 100% (500/500) | 0.333s | - | - | 唤醒词到音频回复 |\n| 语音识别准确率 | 100% (500/500) | - | - | - | 真实音频识别 |\n| 语音识别时延 | - | 0.988s | 0.949s | 1.255s | ASR识别耗时（包含800ms静音） |\n| 服务器处理时延 | - | 0.849s | 0.454s | 3.759s | 服务端处理耗时（LLM+TTS） |\n| 用户感知时延 | - | 1.837s | 1.433s | 4.723s | 说话结束到收到回复 |\n\n#### 服务器资源占用\n\n| 资源类型 | 空闲时 | 峰值 | 说明 |\n|---------|-------|------|------|\n| CPU使用率 | 0% | 80% | 8核CPU占用率 |\n| 内存占用 | 1.8G | 1.96G | JVM堆内存稳定 |\n| 网络带宽(上行) | 0 | 2200KB/s | 客户端音频上传 |\n| 网络带宽(下行) | 0 | 3300KB/s | 服务端音频下发 |\n| WebSocket连接数 | 0 | 100 | 并发活跃连接数 |\n\n#### 音频传输质量\n\n| 指标 | 数值 | 说明 |\n|-----|------|------|\n| 音频帧平均间隔 | 58.07ms | 音频帧发送间隔 |\n| 帧延迟率 | 8.47% (4226/49918) | \u003e65ms |\n\n### 测试结果可视化\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"docs/images/xiaozhi_test.png\" alt=\"性能测试结果\" width=\"800\" style=\"margin: 10px;\" /\u003e\n    \u003cp\u003e\u003cstrong\u003e并发测试数据可视化\u003c/strong\u003e - 时延分布与性能指标统计\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n### 商业合作\n\n我们接受各种项目开发，如果您有特定需求或对商业版本感兴趣，欢迎通过微信联系洽谈。\n\n\u003cimg src=\"./web/public/static/img/wechat.png\" alt=\"微信\" width=\"200\" /\u003e\n\n## 贡献指南\n\n欢迎任何形式的贡献！如果您有好的想法或发现问题，请通过以下方式联系我们：\n\n### 微信\n\n微信群超200人无法扫码进群，可以加我微信备注 小智 我拉你进微信群\n\n\u003cimg src=\"./web/public/static/img/wechat.png\" alt=\"微信\" width=\"200\" /\u003e\n\n### QQ\n\n欢迎加入我们的QQ群一起交流讨论，QQ群号：790820705\n\n\u003cimg src=\"./web/public/static/img/qq.png\" alt=\"QQ群\" width=\"200\" /\u003e\n\n---\n\n## 免责声明\n\n本项目仅提供技术实现代码，不提供任何媒体内容。用户在使用相关功能时应确保拥有合法的使用权或版权许可，并遵守所在地区的版权法律法规。\n\n项目中可能涉及的示例内容或资源均来自网络或由用户投稿提供，仅用于功能演示和技术测试。如有任何内容侵犯了您的权益，请立即联系我们，我们将在核实后立即采取删除等处理措施。\n\n本项目开发者不对用户使用本项目代码获取或播放的任何内容承担法律责任。使用本项目即表示您同意自行承担使用过程中的全部法律风险和责任。\n\n---\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/#joey-zhou/xiaozhi-esp32-server-java\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=joey-zhou/xiaozhi-esp32-server-java\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=joey-zhou/xiaozhi-esp32-server-java\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=joey-zhou/xiaozhi-esp32-server-java\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoey-zhou%2Fxiaozhi-esp32-server-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoey-zhou%2Fxiaozhi-esp32-server-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoey-zhou%2Fxiaozhi-esp32-server-java/lists"}