CarpTMS 是一套完全开放的车联网为主的低空经济运营平台。设计目标为支持 5万台 危化与普货车辆监管和调度,预留了 500-1000架无人机 的管理代码。
本项目采用 Apache License 2.0 开源,欢迎大家二次开发并维护好自己的客户,在这个变动的世界里找到一条自己的活路。
- 车辆实时监控:支持JT1078、GB28181等多种视频流协议
- 多协议支持:HTTP-FLV、HLS、WebRTC、RTMP等流媒体输出
- 高效存储:支持历史轨迹回放和视频录像存储
- 数据分析:内置AI模块,支持运输数据分析
- 高性能:基于Rust异步运行时,设计支持大规模并发
- 信创适配:完美适配ARM/龙芯/申威等国产信创平台
- AI推理:内置HuggingFace Candle本地AI推理能力
- 容器化部署:支持Podman/Kubernetes一键部署
| 技术 | 用途 |
|---|---|
| Rust 1.94 | 系统编程语言 |
| Actix-web 4 | Web框架 |
| Tokio | 异步运行时 |
| SQLx | 数据库访问 |
| Redis | 缓存层 |
| PostgreSQL | 主数据库 |
| 技术 | 用途 |
|---|---|
| Vue 3 | 前端框架 |
| TypeScript | 类型安全 |
| Pinia | 状态管理 |
| Element Plus | UI组件库 |
| 技术 | 用途 |
|---|---|
| Docker | 容器化 |
| Kubernetes | 编排 |
| Nginx | 反向代理 |
| Prometheus | 监控 |
| Grafana | 可视化 |
- Rust 1.94+
- PostgreSQL 14+
- Redis 6+
- Node.js 18+ (前端)
cd My_server
# 安装依赖
cargo build
# 开发模式
cargo run
# 生产模式(CPU AI)
cargo build --release
# GPU加速模式
cargo build --release --features ai-gpucd My_client
# 安装依赖
npm install
# 开发模式
npm run dev
# 生产构建
npm run build# 开发环境(仅核心服务)
podman-compose up -d postgres-primary redis-master carptms-server
# 生产环境(含监控、备份)
podman-compose --profile production --profile monitoring up -d
# 蓝绿部署模式
podman-compose --profile blue-green up -d
# 微服务架构
podman-compose -f podman-compose.microservices.yml up -dCarpTMS/
├── My_server/ # 后端服务 (Rust)
│ ├── src/
│ │ ├── bin/ # 可执行入口
│ │ ├── video/ # 视频流处理
│ │ ├── domain/ # 领域模型
│ │ ├── bff/ # 前端适配层
│ │ └── ...
│ ├── migrations/ # 数据库迁移
│ └── Cargo.toml
│
├── My_client/ # 前端应用 (Vue)
│ ├── src/
│ │ ├── components/ # Vue组件
│ │ ├── views/ # 页面视图
│ │ └── ...
│ └── package.json
│
├── scripts/ # 部署脚本
├── k8s/ # Kubernetes配置
├── docs/ # 文档
└── LICENSE # Apache 2.0许可证
# 1. 创建数据库
psql -U postgres -c "CREATE DATABASE carptms;"
# 2. 运行迁移
cd My_server
psql -U postgres -d carptms -f migrations/20260101000001_create_vehicles_table.sql
psql -U postgres -d carptms -f migrations/20260101000002_create_orders_tables.sql
# ... 其他迁移文件
# 3. 初始化基础数据
psql -U postgres -d carptms -f ../create_database.sqldatabase:
host: "localhost"
port: 5432
username: "postgres"
password: "your_password"
name: "carptms"
redis:
host: "localhost"
port: 6379
app:
host: "0.0.0.0"
port: 8080# 数据库配置
DATABASE_URL=postgres://postgres:password@localhost:5432/carptms
# Redis配置
REDIS_URL=redis://localhost:6379
# JWT密钥
JWT_SECRET=your-secret-key
# 日志级别
RUST_LOG=info启动服务后访问:http://localhost:8080/swagger-ui/
| 指标 | 数值 |
|---|---|
| 最大车辆接入 | 50,000+ |
| 并发视频流 | 10,000+ |
| 消息吞吐量 | 100,000 msg/s |
| 平均响应时间 | < 50ms |
- 问题反馈:GitHub Issues
- 技术讨论:GitHub Discussions
欢迎提交 Pull Request!
- Fork 本仓库
- 创建特性分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 创建 Pull Request
本项目基于 Apache License 2.0 开源 - 详见 LICENSE 文件
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- 🎬 视频服务:8/24/32 路 LayoutSwitcher 扩展、SourceBuffer 配额保护、MSE 4 路稳定回归锁
- 🛠️ 视频中心:H.264/H.265/AV1 全链路、
webCodecsPlayer/xiaoyuPlayer双解码器、webSocketStream模块化拆分 - 🔧 视频流协议:mp4Muxer 纯函数提取 + 22 个 ISO 14496-12 常量 + 44 个 golden 向量测试(trun flags 0x000305 / dataOffset 108 锁死)
- 📡 JT1078 通道管理:
active通道 + 4h 失活清理 + 终端字段迁移(manufacturer_id / terminal_model) - 🗄️ 数据库:车辆表字段补全(direction 增量)、GPS 单次 JOIN 优化(消除 2 次 DB 回表)、Redis 15s 缓存
- 🔐 安全:未鉴权路由挂
require_auth准备、密码日志脱敏、Plan B IDR 门限按 SPS 宽度重算 - 🏗️ 部署:NSSM 2.24 服务化 + stdout/stderr 日志轮转(10MB)、8082 WebSocket 抓包诊断脚本集
- ✨ 完整生产就绪版本
- 🐛 添加首次登录密码修改功能
- 🐛 完善标定管理功能
- 🐛 集成Qwen3.5,强化了大规模车辆排班调度的内在能力
- 📦 优化数据库连接配置
- 📝 完善部署文档
- 🎉 基础功能版本
CarpTMS - 让运输更智能