Skip to content

Commit

Permalink
1.去掉主线的dotnetty项目
Browse files Browse the repository at this point in the history
2.将各个服务整合到一个库里面统一管理
  • Loading branch information
SmallChi committed Apr 17, 2023
1 parent bcb8bff commit 7711ff5
Show file tree
Hide file tree
Showing 332 changed files with 849 additions and 18,054 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 7.0.100
dotnet-version: 7.0.203
- name: dotnet info
run: dotnet --info
- name: dotnet JT808.Gateway restore
Expand Down
58 changes: 3 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# JT808Gateway

基于Pipeline封装的JT808Pipeline支持TCP/UDP通用消息业务处理

基于DotNetty封装的JT808DotNetty支持TCP/UDP通用消息业务处理
JT808Pipeline支持TCP/UDP通用消息业务处理

[了解JT808协议进这边](https://github.com/SmallChi/JT808)

Expand Down Expand Up @@ -42,26 +40,13 @@

> 使用物联网卡通过udp下发指令时,存储的那个socket地址端口,有效期非常短,不速度快点下发,那个socket地址端口就可能映射到别的对应卡去了,所以此处采用跟随设备消息下发指令。
## 基于网关的相关服务

| 服务名称 | 服务说明 | 使用场景 |
| :-------------------------------- | :----------- | :----------------------------------------------------------------------------------------------------------------- |
| MsgIdHandler | 消息处理服务 | 从队列中消费设备上报数据,再结合自身的业务场景,将数据进行处理并入库 |
| MsgLogging | 消息日志服务 | 从队列中消费设备上报和平台应答数据,再将数据存入influxdb等数据库中,便于技术和技术支持排查设备与平台交互的原始数据 |
| ReplyMessage | 消息响应服务 | 用于响应设备上报消息,以及下发指令信息到设备 |
| SessionNotice | 会话管理服务 | 通知设备上线下线,对于udp设备来说,可以在设备上线时,将指令跟随消息下发到设备 |
| Traffic (v1.1.0新版pipeline已移出) | 流量统计服务 | 由于运营商sim卡查询流量滞后,通过流量统计服务可以实时准确的统计设备流量,可以最优配置设备的流量大小,以节省成本 |
| Transmit | 原包转发服务 | 该服务可以将设备上报原始数据转发到第三方,支持全部转发,指定终端号转发 |

## 基于WebApi的消息业务处理程序

通过继承JT808.DotNetty.Core.Handlers.JT808MsgIdHttpHandlerBase去实现自定义的WebApi接口服务。

通过继承JT808.Gateway.Handlers.JT808MsgIdDefaultWebApiHandler去实现自定义的WebApi接口服务。

[接口文档](https://github.com/SmallChi/JT808Gateway/tree/master/api)

## 基于NET5.0 Pipeline
## 基于Pipeline

Pipeline分为两种方式使用,一种是使用队列的方式,一种是网关集成的方式。

Expand All @@ -78,33 +63,7 @@ Pipeline分为两种方式使用,一种是使用队列的方式,一种是网
| Install-Package JT808.Gateway | ![JT808.Gateway](https://img.shields.io/nuget/v/JT808.Gateway.svg) | ![JT808.Gateway](https://img.shields.io/nuget/vpre/JT808.Gateway.svg) | ![JT808.Gateway](https://img.shields.io/nuget/dt/JT808.Gateway.svg) |
| Install-Package JT808.Gateway.WebApiClientTool | ![JT808.Gateway.WebApiClientTool](https://img.shields.io/nuget/v/JT808.Gateway.WebApiClientTool.svg) | ![JT808.Gateway.WebApiClientTool](https://img.shields.io/nuget/vpre/JT808.Gateway.WebApiClientTool.svg) | ![JT808.Gateway.WebApiClientTool](https://img.shields.io/nuget/dt/JT808.Gateway.WebApiClientTool.svg) |
| Install-Package JT808.Gateway.Client | ![JT808.Gateway.Client](https://img.shields.io/nuget/v/JT808.Gateway.Client.svg) | ![JT808.Gateway.Client](https://img.shields.io/nuget/vpre/JT808.Gateway.Client.svg) | ![JT808.Gateway.Client](https://img.shields.io/nuget/dt/JT808.Gateway.Client.svg) |
| Install-Package JT808.Gateway.Kafka | ![JT808.Gateway.Kafka](https://img.shields.io/nuget/v/JT808.Gateway.Kafka.svg) | ![JT808.Gateway.Kafka](https://img.shields.io/nuget/vpre/JT808.Gateway.Kafka.svg) | ![JT808.Gateway.Kafka](https://img.shields.io/nuget/dt/JT808.Gateway.Kafka.svg) |
| Install-Package JT808.Gateway.Transmit | ![JT808.Gateway.Transmit](https://img.shields.io/nuget/v/JT808.Gateway.Transmit.svg) | ![JT808.Gateway.Transmit](https://img.shields.io/nuget/vpre/JT808.Gateway.Transmit.svg) | ![JT808.Gateway.Transmit](https://img.shields.io/nuget/dt/JT808.Gateway.Transmit.svg) |
| Install-Package JT808.Gateway.SessionNotice | ![JT808.Gateway.SessionNotice](https://img.shields.io/nuget/v/JT808.Gateway.SessionNotice.svg) | ![JT808.Gateway.SessionNotice](https://img.shields.io/nuget/vpre/JT808.Gateway.SessionNotice.svg) | ![JT808.Gateway.SessionNotice](https://img.shields.io/nuget/dt/JT808.Gateway.SessionNotice.svg) |
| Install-Package JT808.Gateway.ReplyMessage | ![JT808.Gateway.ReplyMessage](https://img.shields.io/nuget/v/JT808.Gateway.ReplyMessage.svg) | ![JT808.Gateway.ReplyMessage](https://img.shields.io/nuget/vpre/JT808.Gateway.ReplyMessage.svg) | ![JT808.Gateway.ReplyMessage](https://img.shields.io/nuget/dt/JT808.Gateway.ReplyMessage.svg) |
| Install-Package JT808.Gateway.MsgLogging | ![JT808.Gateway.MsgLogging](https://img.shields.io/nuget/v/JT808.Gateway.MsgLogging.svg) | ![JT808.Gateway.MsgLogging](https://img.shields.io/nuget/vpre/JT808.Gateway.MsgLogging.svg) | ![JT808.Gateway.MsgLogging](https://img.shields.io/nuget/dt/JT808.Gateway.MsgLogging.svg) |
| Install-Package JT808.Gateway.MsgIdHandler | ![JT808.Gateway.MsgIdHandler](https://img.shields.io/nuget/v/JT808.Gateway.MsgIdHandler.svg) | ![JT808.Gateway.MsgIdHandler](https://img.shields.io/nuget/vpre/JT808.Gateway.MsgIdHandler.svg) | ![JT808.Gateway.MsgIdHandler](https://img.shields.io/nuget/dt/JT808.Gateway.MsgIdHandler.svg) |

## 基于DotNetty

### DotNetty的NuGet安装

| Package Name| Version |Preview Version | Downloads|
| --- | --- | ---| ---|
| Install-Package JT808.DotNetty.Abstractions | ![JT808.DotNetty.Abstractions](https://img.shields.io/nuget/v/JT808.DotNetty.Abstractions.svg)| ![JT808.DotNetty.Abstractions](https://img.shields.io/nuget/vpre/JT808.DotNetty.Abstractions.svg) | ![JT808.DotNetty.Abstractions](https://img.shields.io/nuget/dt/JT808.DotNetty.Abstractions.svg) |
| Install-Package JT808.DotNetty.Core | ![JT808.DotNetty.Core](https://img.shields.io/nuget/v/JT808.DotNetty.Core.svg) | ![JT808.DotNetty.Core](https://img.shields.io/nuget/vpre/JT808.DotNetty.Core.svg) | ![JT808.DotNetty.Core](https://img.shields.io/nuget/dt/JT808.DotNetty.Core.svg) |
| Install-Package JT808.DotNetty.Tcp | ![JT808.DotNetty.Tcp](https://img.shields.io/nuget/v/JT808.DotNetty.Tcp.svg) | ![JT808.DotNetty.Tcp](https://img.shields.io/nuget/vpre/JT808.DotNetty.Tcp.svg) | ![JT808.DotNetty.Tcp](https://img.shields.io/nuget/dt/JT808.DotNetty.Tcp.svg) |
| Install-Package JT808.DotNetty.Udp | ![JT808.DotNetty.Udp](https://img.shields.io/nuget/v/JT808.DotNetty.Udp.svg) | ![JT808.DotNetty.Udp](https://img.shields.io/nuget/vpre/JT808.DotNetty.Udp.svg) | ![JT808.DotNetty.Udp](https://img.shields.io/nuget/dt/JT808.DotNetty.Udp.svg) |
| Install-Package JT808.DotNetty.WebApi | ![JT808.DotNetty.WebApi](https://img.shields.io/nuget/v/JT808.DotNetty.WebApi.svg) | ![JT808.DotNetty.WebApi](https://img.shields.io/nuget/vpre/JT808.DotNetty.WebApi.svg) | ![JT808.DotNetty.WebApi](https://img.shields.io/nuget/dt/JT808.DotNetty.WebApi.svg) |
| Install-Package JT808.DotNetty.WebApiClientTool | ![JT808.DotNetty.WebApiClientTool](https://img.shields.io/nuget/v/JT808.DotNetty.WebApiClientTool.svg) | ![JT808.DotNetty.WebApiClientTool](https://img.shields.io/nuget/vpre/JT808.DotNetty.WebApiClientTool.svg) | ![JT808.DotNetty.WebApiClientTool](https://img.shields.io/nuget/dt/JT808.DotNetty.WebApiClientTool.svg) |
| Install-Package JT808.DotNetty.Client | ![JT808.DotNetty.Client](https://img.shields.io/nuget/v/JT808.DotNetty.Client.svg) | ![JT808.DotNetty.Client](https://img.shields.io/nuget/vpre/JT808.DotNetty.Client.svg) | ![JT808.DotNetty.Client](https://img.shields.io/nuget/dt/JT808.DotNetty.Client.svg) |
| Install-Package JT808.DotNetty.Transmit | ![JT808.DotNetty.Transmit](https://img.shields.io/nuget/v/JT808.DotNetty.Transmit.svg) | ![JT808.DotNetty.Transmit](https://img.shields.io/nuget/vpre/JT808.DotNetty.Transmit.svg) | ![JT808.DotNetty.Transmit](https://img.shields.io/nuget/dt/JT808.DotNetty.Transmit.svg) |
| Install-Package JT808.DotNetty.Traffic | ![JT808.DotNetty.Traffic](https://img.shields.io/nuget/v/JT808.DotNetty.Traffic.svg) | ![JT808.DotNetty.Traffic](https://img.shields.io/nuget/vpre/JT808.DotNetty.Traffic.svg) | ![JT808.DotNetty.Traffic](https://img.shields.io/nuget/dt/JT808.DotNetty.Traffic.svg) |
| Install-Package JT808.DotNetty.SessionNotice | ![JT808.DotNetty.SessionNotice](https://img.shields.io/nuget/v/JT808.DotNetty.SessionNotice.svg)| ![JT808.DotNetty.SessionNotice](https://img.shields.io/nuget/vpre/JT808.DotNetty.SessionNotice.svg) | ![JT808.DotNetty.SessionNotice](https://img.shields.io/nuget/dt/JT808.DotNetty.SessionNotice.svg) |
| Install-Package JT808.DotNetty.ReplyMessage | ![JT808.DotNetty.ReplyMessage](https://img.shields.io/nuget/v/JT808.DotNetty.ReplyMessage.svg) | ![JT808.DotNetty.ReplyMessage](https://img.shields.io/nuget/vpre/JT808.DotNetty.ReplyMessage.svg) | ![JT808.DotNetty.ReplyMessage](https://img.shields.io/nuget/dt/JT808.DotNetty.ReplyMessage.svg) |
| Install-Package JT808.DotNetty.MsgLogging | ![JT808.DotNetty.MsgLogging](https://img.shields.io/nuget/v/JT808.DotNetty.MsgLogging.svg) | ![JT808.DotNetty.Abstractions](https://img.shields.io/nuget/vpre/JT808.DotNetty.MsgLogging.svg) | ![JT808.DotNetty.MsgLogging](https://img.shields.io/nuget/dt/JT808.DotNetty.MsgLogging.svg) || ![JT808.DotNetty.MsgLogging](https://img.shields.io/nuget/vpre/JT808.DotNetty.MsgLogging.svg)
| Install-Package JT808.DotNetty.MsgIdHandler | ![JT808.DotNetty.MsgIdHandler](https://img.shields.io/nuget/v/JT808.DotNetty.MsgIdHandler.svg) | ![JT808.DotNetty.MsgIdHandler](https://img.shields.io/nuget/vpre/JT808.DotNetty.MsgIdHandler.svg) | ![JT808.DotNetty.MsgIdHandler](https://img.shields.io/nuget/dt/JT808.DotNetty.MsgIdHandler.svg) |
| Install-Package JT808.DotNetty.Kafka | ![JT808.DotNetty.Kafka](https://img.shields.io/nuget/v/JT808.DotNetty.Kafka.svg) | ![JT808.DotNetty.Kafka](https://img.shields.io/nuget/vpre/JT808.DotNetty.Kafka.svg) | ![JT808.DotNetty.Kafka](https://img.shields.io/nuget/dt/JT808.DotNetty.Kafka.svg) | ![JT808.DotNetty.Kafka](https://img.shields.io/nuget/vpre/JT808.DotNetty.Kafka.svg) |
| Install-Package JT808.Gateway.Kafka | ![JT808.Gateway.Kafka](https://img.shields.io/nuget/v/JT808.Gateway.Kafka.svg) | ![JT808.Gateway.Kafka](https://img.shields.io/nuget/vpre/JT808.Gateway.Kafka.svg) | ![JT808.Gateway.MsgIdHandler](https://img.shields.io/nuget/dt/JT808.Gateway.MsgIdHandler.svg) |

## 举个栗子

Expand Down Expand Up @@ -139,17 +98,6 @@ Pipeline分为两种方式使用,一种是使用队列的方式,一种是网
如图所示:
![demo4](https://github.com/SmallChi/JT808Gateway/blob/master/doc/img/demo4.png)

### DotNetty

1.打开/simples/JT808.Simples.sln项目进行还原编译生成

2.进入JT808.DotNetty.SimpleServer项目下的Debug目录运行服务端

3.进入JT808.DotNetty.SimpleClient项目下的Debug目录运行客户端

如图所示:
![demo2](https://github.com/SmallChi/JT808Gateway/blob/master/doc/img/demo2.png)

## 常见问题

- 多协议兼容实现思路[点我查看](https://github.com/SmallChi/JT808Gateway/issues/11#issuecomment-727687417)
Expand Down
Loading

0 comments on commit 7711ff5

Please sign in to comment.