{"id":36706604,"url":"https://github.com/yezhihao/jt808-server","last_synced_at":"2026-01-12T11:43:18.512Z","repository":{"id":37391001,"uuid":"180277703","full_name":"yezhihao/jt808-server","owner":"yezhihao","description":"JT808、JT808协议解析；支持TCP、UDP，实时兼容2011、2013、2019版本协议，支持分包。支持JT/T1078音视频协议，T/JSATL12苏标主动安全协议，T/GDRTA002粤标主动安全协议，支持Android客户端编解码。","archived":false,"fork":false,"pushed_at":"2025-10-20T00:36:44.000Z","size":11365,"stargazers_count":738,"open_issues_count":0,"forks_count":279,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-10-20T05:49:04.766Z","etag":null,"topics":["808","808-protocol","gb808","gps-gateway","jt-808","jt1078","jt808","jt808-dotnetty","jt808-gateway","jtt808"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yezhihao.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":"2019-04-09T03:28:07.000Z","updated_at":"2025-10-20T00:36:48.000Z","dependencies_parsed_at":"2024-01-11T11:09:11.602Z","dependency_job_id":"47619abd-109f-4a62-9a45-cad81090ccc7","html_url":"https://github.com/yezhihao/jt808-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yezhihao/jt808-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezhihao%2Fjt808-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezhihao%2Fjt808-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezhihao%2Fjt808-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezhihao%2Fjt808-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yezhihao","download_url":"https://codeload.github.com/yezhihao/jt808-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezhihao%2Fjt808-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"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":["808","808-protocol","gb808","gps-gateway","jt-808","jt1078","jt808","jt808-dotnetty","jt808-gateway","jtt808"],"created_at":"2026-01-12T11:43:17.934Z","updated_at":"2026-01-12T11:43:18.507Z","avatar_url":"https://github.com/yezhihao.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"部标JT808 808协议网关\n====================\n\n\u003cp\u003e\n    \u003cimg src=\"https://img.shields.io/badge/JDK-17+-green.svg\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-Apache 2.0-green.svg\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/QQ群-323100134-blue\"/\u003e\n\u003c/p\u003e\n\n# 项目介绍\n* 基于Netty，实现JT808 808协议、1078协议、苏标、粤标的消息处理，与编码解码；\n* 无需修改代码，同时支持TCP、UDP协议；\n* 使用Spring WebFlux 提供支持高并发的Web接口服务；\n* 不依赖Spring，可移除Spring独立运行（编码解码可支持Android）；\n* 最简洁、清爽、易用的部标开发框架。\n\n# 主要特性\n* 代码足够精简，便于二次开发；\n* 致敬Spring、Hibernate设计理念，熟悉Web开发的同学上手极快；\n* 使用注解描述协议，告别繁琐的封包、解包；\n* 支持异步批量处理，显著提升MySQL入库性能；\n* 提供报文解释器（解析过程分析工具），编码解码不再抓瞎；\n* 全覆盖的测试用例，稳定发版。\n\n# 协议支持（传输层协议支持TCP、UDP）\n|协议名称|版本|是否支持|备注|\n|---|---|---|---|\n|JT/T 808|2011|支持|\n|JT/T 808|2013|支持|\n|JT/T 808|2019|支持|\n|JT/T 1078|2016|支持|需自建流媒体服务|\n|T/JSATL 12(主动安全-苏标)|2017|支持|基于JT/T808-2013|\n|T/GDRTA 002(主动安全-粤标)|2019|支持|基于JT/T808-2019|\n\n备注：无需手动配置，同时兼容2011、2013、2019协议版本，支持分包请求、分包应答及超时分包补传。\n1078协议支持音视频指令，流媒体服务需自行搭建。\n\n# 代码仓库\n * Gitee仓库地址：[https://gitee.com/yezhihao/jt808-server/tree/master](https://gitee.com/yezhihao/jt808-server/tree/master)\n * Github仓库地址：[https://github.com/yezhihao/jt808-server/tree/master](https://github.com/yezhihao/jt808-server/tree/master)\n\n# 演示\n * 设备接入：127.0.0.1:7100\n * 日志监控：http://127.0.0.1:8100/ws.html\n * 接口文档：http://127.0.0.1:8100/doc.html\n\n# 验证步骤\n\n## 1.验证消息定义\n解码分析工具：org.yzh.Elucidator（报文 \u003c=\u003e 对象）\n\n使用src\\test\\java\\Elucidator\n分析报文内每个属性所处的位置以及转换后的值，以便查询报文解析出错的原因\n```java\npackage org.yzh;\n\npublic class Elucidator extends JT808Beans {\n\n    public static final JTMessageAdapter coder = new JTMessageAdapter(\"org.yzh.protocol\");\n\n    public static void main(String[] args) {\n        String hex = \"020000d40123456789017fff000004000000080006eeb6ad02633df7013800030063200707192359642f000000400101020a0a02010a1e00640001b2070003640e200707192359000100000061646173200827111111010101652f000000410202020a0000000a1e00c8000516150006c81c20070719235900020000000064736d200827111111020202662900000042031e012c00087a23000a2c2a200707192359000300000074706d732008271111110303030067290000004304041e0190000bde31000d90382007071923590004000000006273642008271111110404049d\";\n        JTMessage msg = H2019(T0200JSATL12());\n\n        msg = decode(hex);\n        hex = encode(msg);\n    }\n}\n```\nElucidator 运行效果如下：\n```\n0\t[001f] 省域ID: 31\n2\t[0073] 市县域ID: 115\n4\t[0000000034] 制造商ID: 4\n9\t[000000000000000000000042534a2d47462d3036] 终端型号: BSJ-GF-06\n29\t[74657374313233] 终端ID: test123\n36\t[01] 车牌颜色: 1\n37\t[b2e241383838383838] 车辆标识: 测A888888\n0\t[0100] 消息ID: 256\n2\t[002e] 消息体属性: 46\n4\t[012345678901] 终端手机号: 12345678901\n10\t[7fff] 流水号: 32767\n\n7e0100002e0123456789017fff001f00730000000034000000000000000000000042534a2d47462d30367465737431323301b2e241383838383838157e\n```\n## 2.模拟设备请求\n运行 \\协议文档\\发包工具.exe\n1. 协议类型：【TCP Client】\n2. 远程主机地址：127.0.0.1\n3. 远程主机端口：7100\n4. 接收设置：⊙HEX\n5. 发送设置：⊙HEX\n6. 点击按钮【连接】\n7. 将上一个步骤中生成的报文，粘贴到文本框\n8. 点击按钮【发送】\n\n注意：先选择HEX，再粘贴报文\n```\n7e0100002e0123456789017fff001f00730000000034000000000000000000000042534a2d47462d30367465737431323301b2e241383838383838157e\n```\n如下图所示\n![使用发包工具模拟请求](https://images.gitee.com/uploads/images/2020/1231/150635_85de7ac4_670717.jpeg)\n\n## 3.下发命令到终端\n\n已集成OpenAPI文档，启动后可访问如下地址\n* Knife4j UI：[http://127.0.0.1:8000/doc.html](http://127.0.0.1:8000/doc.html)\n* Swagger UI：[http://127.0.0.1:8000/swagger-ui/index.html](http://127.0.0.1:8000/swagger-ui/index.html)\n\n录入参数，点击发送\n![Knife4j UI](https://images.gitee.com/uploads/images/2020/1231/115947_bb39bcd0_670717.jpeg)\n\n* 设备消息监控：[http://127.0.0.1:8000/ws.html](http://127.0.0.1:8000/ws.html)\n\n![Console](https://images.gitee.com/uploads/images/2021/0714/171301_9f44b193_670717.jpeg)\n\n# 协议扩展\n\n## 1.定义消息\n ```java\npackage org.yzh.protocol.t808;\n\n@Message(JT808.终端注册)\npublic class T0100 extends JTMessage {\n\n    @Field(desc = \"省域ID\")\n    private short provinceId;\n    @Field(desc = \"市县域ID\")\n    private short cityId;\n    @Field(length = 11, desc = \"制造商ID\")\n    private String makerId;\n    @Field(length = 30, desc = \"终端型号\")\n    private String deviceModel;\n    @Field(length = 30, desc = \"终端ID\")\n    private String deviceId;\n    @Field(desc = \"车牌颜色：0.未上车牌 1.蓝色 2.黄色 3.黑色 4.白色 9.其他\")\n    private byte plateColor;\n    @Field(desc = \"车辆标识\")\n    private String plateNo;\n}\n```\n\n## 2.处理终端上报的消息\n```java\npackage org.yzh.web.endpoint;\n\n@Endpoint\npublic class JT808Endpoint {\n\n    @Autowired\n    private DeviceService deviceService;\n\n    @Mapping(types = 0x0100, desc = \"终端注册\")\n    public T8100 register(T0100 message, Session session) {\n        T8100 result = new T8100();\n        result.setResponseSerialNo(message.getSerialNo());\n\n        DeviceInfo device = deviceService.register(message);\n        if (device != null) {\n            session.register(message);\n\n            result.setToken(\"1234567890A\");\n            result.setResultCode(T8100.Success);\n        } else {\n            result.setResultCode(T8100.NotFoundTerminal);\n        }\n        return result;\n    }\n}\n```\n\n## 3.下发消息到终端（通过Web接口）\n```java\npackage org.yzh.web.controller;\n\n@RestController\n@RequestMapping(\"device\")\npublic class JT808Controller {\n\n    @Autowired\n    private MessageManager messageManager;\n\n    @Operation(summary = \"8103 设置终端参数\")\n    @PostMapping(\"8103\")\n    public Mono\u003cT0001\u003e T8103(@RequestBody T8103 request) {\n        return messageManager.request(request, T0001.class);\n    }\n}\n```\n\n注解说明：\n* @Message，消息类型，等价Hibernate的 @Table\n* @Field，消息属性，等价Hibernate的 @Column\n\n* @Endpoint，消息接入点，等价SpringMVC的 @Controller\n* @Mapping，消息映射到方法，等价SpringMVC中 @RequestMapping\n* @Async，异步消息处理，用于较为耗时的操作（例如文件写入）。\n* @AsyncBatch，消息批量处理，对于高并发的消息（例如：位置信息汇报），合并同类消息，提升入库性能。\n\n\n# 项目集成方式\n\u003cimg src=\"协议文档/推荐的集成方式.jpg\" width=\"500px\" /\u003e\n\n如果你的业务系统使用springboot，推荐使用maven依赖项集成该项目\n\n运行maven的install命令将jtt808-protocol模块安装到本地maven库，或deploy发布到maven私有仓库\n\n在项目pom.xml文件中加入刚刚发布的组件\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.yzh\u003c/groupId\u003e\n    \u003cartifactId\u003ejtt808-protocol\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n在application.yml中加入jtt808-server的http调用地址\n```yml\njt808-service:\n  base-url: http://127.0.0.1:8100\n```\n\n代码中可使用以下方式调用808服务\n\n非阻塞的调用方式请参考jtt808-server下的org.yzh.JT808ServiceTest\n```java\npackage com.xxx;\n\nimport org.yzh.protocol.service.JT808Service;\n\n@Service\npublic class YourService {\n\n    @Autowired\n    private JT808Service jt808Service;\n\n    public void test() {\n        JTMessage message = new JTMessage();\n        message.setClientId(\"12345678901\");\n        try {\n            T0001 result = jt808Service.send(\"8304\", message);\n            System.out.println(result);\n        } catch (WebClientResponseException e) {\n            R error = e.getResponseBodyAs(R.class);\n            System.out.println(error);\n        }\n    }\n}\n```\n\n目录结构\n```sh\n├── 协议文档\n│   ├── 808-2011协议文档\n│   ├── 808-2013协议文档\n│   ├── 808-2019协议文档\n│   ├── 1078-2016协议文档\n│   ├── 粤标-2020协议文档\n│   ├── 苏标-2016协议文档\n│   └── 发包工具.exe\n│\n├──jtt808-protocol\n│   │\n│   ├──main\n│   │   ├── t808 消息定义\n│   │   ├── t1078 消息定义\n│   │   ├── jstal12 消息定义\n│   │   └── codec 编码解码\n│   └──test\n│       ├── codec 协议解析工具\n│       └── protocol 协议单元测试\n│\n├──jtt808-server\n│   ├──main\n│   │   └── web SpringBoot微服务\n│   │      ├── config 808服务配置项\n│   │      └── endpoint 808消息入口,通过netty收到的请求会根据@Mapping转发到此\n│   └──test\n│      ├── ClientTest 客户端\n│      └── StressTest 压力测试\n ```\n\n项目创立于2017年9月，至今，jt808-server已接入多家公司的线上产品线，接入场景如车辆管理平台，IOT业务和大数据作业等，截止最新统计时间为止，jt808-server已接入的公司包括不限于：\n\n\t- 福建九桃贸易有限公司\n\t- 深圳市特维视科技有限公司\n\t- 厦门河联信息科技有限公司\n\t- 北京华盾互联科技有限公司\n\t- 宜昌华维物流有限责任公司\n\t- 江苏推米信息科技有限公司\n\t- 山东六度信息科技有限公司\n\t- 亚信创新技术(南京)有限公司\n\t- 无锡创趣网络科技有限公司\n\t- 新疆智联云信息科技有限公司\n\t- 杭州品铂科技有限公司\n\t- 萍乡萍钢安源钢铁有限公司\n\t- 承德统凯网络科技有限公司\n\t- 陕西省君凯电子科技有限公司\n\t- 北京晓羊集团\n\t- 成都谷帝科技有限公司\n\t- 西安长城数字软件有限公司\n\t- 上海昕鼎网络科技有限公司\n\t- 江西简悠信息技术有限公司\n\t- 上海物泊科技有限公司\n\t- 贵州泰恒元科技股份有限公司\n\t- 湖南高仕达信息技术有限公司\n    - 山东众安安防服务有限公司\n    - 南京易添信息技术有限公司\n    - 陕西点三信息技术有限公司\n    - 福建省为美生态科技有限公司\n    - 烟台海德专用汽车有限公司\n    - 深圳启慧云科技有限公司\n    - 上海勤电信息科技有限公司\n    - 东风集团智慧环卫数字治理平台\n    - 山东盈科数智信息技术有限公司\n    - ……\n\n\u003e 更多接入的公司，欢迎在 [登记地址](https://gitee.com/yezhihao/jt808-server/issues/I36WKD ) 登记，登记仅仅为了项目推广(登记后可提供一次技术支持)。\n\n欢迎大家的关注和使用，jt808-server也将拥抱变化，持续发展。\n\n项目会不定期进行更新，建议star和watch一份，您的支持是我最大的动力。\n\n如有任何疑问或者BUG，请联系我，非常感谢。\n\n另提供技术支持、协议扩展、数据入库、二次开发等服务。\n\n项目负责人QQ：[1527621790]\n\n技术交流QQ群：[906230542,107751976,323100134]\n\n- JT808泛指JT/T808协议，是指交通部制定的运输行业通信标准，全称《交通运输行业标准 - 道路运输车辆卫星定位系统终端通信协议及数据格式》\n\n### 捐助\n如果这个项目对你有帮助，可以通过以下方式支持我：\n\n\u003cimg src=\"协议文档/play_code.jpg\" width=\"500px\" /\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezhihao%2Fjt808-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyezhihao%2Fjt808-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezhihao%2Fjt808-server/lists"}