RailWise KB已发布
RAILWISE-OS监测业务AI助手
RAILWISE-OS是RailWise的监测单位业务操作系统,基于Vue3/Java/Python/PostgreSQL技术栈构建。本文档介绍其AI助手模块的功能、API接口和使用方法,实现监测业务的智能化管理。
ai-guide
RAILWISE-OS监测业务AI助手
Section titled “RAILWISE-OS监测业务AI助手”RAILWISE-OS(Operating System for Monitoring)是 RailWise 推出的 监测单位业务操作系统,专为工程监测单位的日常运营管理设计。系统基于 Vue3(前端)、Java(后端)、Python(AI/数据处理)、PostgreSQL(数据库)技术栈构建,集成了AI助手模块,实现项目全生命周期、人员、设备、合同、财务等业务的智能化管理。
| 场景 | 说明 |
|---|---|
| 项目管理 | 监测项目从立项到归档的全流程管理 |
| 人员管理 | 技术人员资质、排班、绩效考核 |
| 设备管理 | 全站仪、传感器等设备的台账与维护 |
| 合同管理 | 合同签订、执行、结算、归档 |
| 财务管理 | 项目成本核算、收款管理、发票管理 |
| 报告管理 | 监测报告的编制、审核、签发、归档 |
| 数据分析 | 多项目数据汇总、统计、趋势分析 |
| 决策支持 | 经营数据可视化、风险预警、智能建议 |
| 项目 | 版本 | 技术栈 |
|---|---|---|
| RAILWISE-OS | 4.0.0 | - |
| 前端 | 4.0.0 | Vue3 3.4, Vite 5, Element Plus |
| 后端 | 4.0.0 | Spring Boot 3.2, Java 21 |
| AI/数据处理 | 4.0.0 | Python 3.11, FastAPI, Pandas |
| 数据库 | 15 | PostgreSQL 15, PostGIS |
| 缓存 | 7 | Redis 7 |
| 消息队列 | 3.12 | RabbitMQ |
┌─────────────────────────────────────────────────────────────────────┐│ RAILWISE-OS 架构 │├─────────────────────────────────────────────────────────────────────┤│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ││ │ Web 前端 │ │ 移动端App │ │ 管理后台 │ ││ │ (Vue3) │ │ (UniApp) │ │ (Vue3) │ ││ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ ││ │ │ │ ││ └──────────────────┼──────────────────┘ ││ ▼ ││ ┌──────────────────────────────┐ ││ │ API Gateway (Java) │ ││ │ Spring Boot + Spring Cloud │ ││ └──────────────┬───────────────┘ ││ │ ││ ┌───────────────────┼───────────────────┐ ││ ▼ ▼ ▼ ││ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ││ │ 业务服务层 │ │ AI服务层 │ │ 集成服务层 │ ││ │ - 项目管理 │ │ - 智能分析 │ │ - 第三方接口 │ ││ │ - 人员管理 │ │ - 智能推荐 │ │ - 数据同步 │ ││ │ - 设备管理 │ │ - 智能问答 │ │ - 消息通知 │ ││ │ - 合同财务 │ │ - 智能报表 │ │ - 文件存储 │ ││ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ ││ │ │ │ ││ └──────────────────┼──────────────────┘ ││ ▼ ││ ┌──────────────────────────────┐ ││ │ Python AI/数据处理引擎 │ ││ │ - 数据清洗 - 统计分析 │ ││ │ - 机器学习 - NLP处理 │ ││ │ - 报表生成 - 文档处理 │ ││ └──────────────┬───────────────┘ ││ │ ││ ┌──────────────┴───────────────┐ ││ │ 数据持久化层 │ ││ │ PostgreSQL + Redis + MinIO │ ││ └──────────────────────────────┘ │└─────────────────────────────────────────────────────────────────────┘AI助手模块
Section titled “AI助手模块”RAILWISE-OS 的 AI 助手模块包含以下核心组件:
1. 智能问答助手(Intelligent Q&A Assistant)
Section titled “1. 智能问答助手(Intelligent Q&A Assistant)”基于大语言模型和RAG(检索增强生成)技术,为监测业务提供智能问答服务。
支持的知识库:
| 知识库 | 内容 | 更新频率 |
|---|---|---|
| 监测规范库 | GB 50911、CJJ/T 202等 | 实时同步 |
| 项目档案库 | 历史项目数据、报告 | 每日更新 |
| 设备知识库 | 设备手册、故障案例 | 每月更新 |
| 业务流程库 | SOP、管理制度 | 实时同步 |
| 行业动态库 | 行业新闻、技术进展 | 每日更新 |
使用示例:
from railwise_os import AIAssistant
assistant = AIAssistant( api_key="rw_os_xxxxxxxx", base_url="https://os.railwise.cn/api/v2")
# 规范查询response = assistant.ask("盾构施工期间控制保护区监测频率要求是什么?")print(response.answer)# 输出:根据《城市轨道交通结构安全保护技术规范》CJJ/T 202-2013 第5.2.3条...
# 项目数据查询response = assistant.ask("绕城高速管廊项目本月有多少个测点达到预警?")print(response.answer)# 输出:截至2026年7月8日,绕城高速管廊项目共有3个测点达到预警...
# 设备故障排查response = assistant.ask("全站仪测量时水平角读数不稳定可能是什么原因?")print(response.answer)# 输出:可能原因包括:1. 仪器未完全整平... 2. 温度影响... 3. 目标反射信号弱...2. 智能报表生成器(Smart Report Generator)
Section titled “2. 智能报表生成器(Smart Report Generator)”根据自然语言指令自动生成各类业务报表。
支持的报表类型:
| 报表类型 | 说明 | 数据源 |
|---|---|---|
| 经营分析报表 | 收入、成本、利润分析 | 合同、财务数据 |
| 项目进度报表 | 项目执行进度、里程碑 | 项目管理系统 |
| 人员绩效报表 | 工作量、质量、效率 | 人员、项目数据 |
| 设备利用率报表 | 设备使用、维护、故障 | 设备管理系统 |
| 质量分析报表 | 数据质量、报告质量 | 监测数据、报告 |
使用示例:
# 生成经营分析报表report = assistant.generate_report({ "type": "business_analysis", "period": "2026-Q2", "dimensions": ["revenue", "cost", "profit", "project_count"], "format": "excel", "include_charts": True})
# 下载报表report.download("./经营分析报表_2026Q2.xlsx")3. 智能推荐引擎(Smart Recommendation Engine)
Section titled “3. 智能推荐引擎(Smart Recommendation Engine)”基于历史数据和业务规则,提供智能推荐。
推荐场景:
| 场景 | 推荐内容 | 算法 |
|---|---|---|
| 人员排班 | 最优人员组合 | 约束优化 |
| 设备调度 | 设备分配方案 | 贪心+启发式 |
| 项目定价 | 合理报价区间 | 回归分析 |
| 风险预警 | 潜在风险项目 | 分类模型 |
| 客户维护 | 重点跟进客户 | 聚类分析 |
使用示例:
# 人员排班推荐schedule = assistant.recommend_schedule({ "project_id": "proj_rw_2026_001", "date_range": ["2026-07-08", "2026-07-19"], "constraints": { "min_experience_years": 3, "required_certifications": ["测量员", "安全员"], "max_daily_hours": 8 }})
print(schedule.recommendation)# 推荐排班方案及理由4. 智能文档处理器(Intelligent Document Processor)
Section titled “4. 智能文档处理器(Intelligent Document Processor)”自动处理各类业务文档,包括合同、报告、发票等。
功能:
| 功能 | 说明 | 支持格式 |
|---|---|---|
| OCR识别 | 扫描件文字识别 | PDF, JPG, PNG, TIFF |
| 信息提取 | 关键信息自动提取 | 所有文本格式 |
| 格式转换 | 文档格式转换 | PDF, Word, Excel, HTML |
| 内容比对 | 文档差异比对 | 文本格式 |
| 自动归档 | 按规则自动分类归档 | 所有格式 |
使用示例:
# 合同信息提取contract_info = assistant.process_document({ "file": "./合同_绕城高速.pdf", "task": "extract", "fields": ["contract_no", "party_a", "party_b", "amount", "start_date", "end_date"]})
print(contract_info)# {# "contract_no": "RW-2026-001",# "party_a": "宁波睿威工程技术有限公司",# "party_b": "宁波市轨道交通集团",# "amount": 850000,# "start_date": "2026-03-01",# "end_date": "2026-12-31"# }RAILWISE-OS API 使用 JWT Token 进行认证。
获取 Token:
POST /api/v2/auth/loginContent-Type: application/json
{ "username": "your_username", "password": "your_password"}响应:
{ "success": true, "data": { "access_token": "eyJhbGciOiJIUzI1NiIs...", "refresh_token": "eyJhbGciOiJIUzI1NiIs...", "expires_in": 3600, "token_type": "Bearer" }}请求头格式:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...Content-Type: application/json| 项目 | 值 |
|---|---|
| Base URL | https://os.railwise.cn/api/v2 |
| 协议 | HTTPS |
| 数据格式 | JSON |
| 字符编码 | UTF-8 |
POST /ai/assistant/ask请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| question | string | 是 | 问题内容 |
| context | object | 否 | 上下文信息 |
| context.project_id | string | 否 | 项目ID |
| context.knowledge_bases | array | 否 | 指定知识库 |
| stream | boolean | 否 | 是否流式返回,默认false |
请求示例:
curl -X POST https://os.railwise.cn/api/v2/ai/assistant/ask \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "question": "盾构施工期间控制保护区监测频率要求是什么?", "context": { "project_id": "proj_rw_2026_001", "knowledge_bases": ["monitoring_standards", "project_archives"] }, "stream": false }'响应示例:
{ "success": true, "data": { "answer": "根据《城市轨道交通结构安全保护技术规范》CJJ/T 202-2013 第5.2.3条,盾构施工期间控制保护区监测频率要求如下:\n\n1. 施工前:每周1次\n2. 施工期间:每天1-2次\n3. 穿越期间:每4-6小时1次\n4. 施工后:每周1次,持续不少于3个月\n\n具体频率应根据变形速率和累计变形量动态调整。", "sources": [ { "title": "CJJ/T 202-2013 城市轨道交通结构安全保护技术规范", "section": "5.2.3", "relevance": 0.95 } ], "confidence": 0.92, "suggested_questions": [ "监测频率如何动态调整?", "预警阈值如何设置?" ] }}POST /ai/reports/generate请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | string | 是 | 报表类型 |
| period | string | 是 | 统计周期 |
| dimensions | array | 是 | 统计维度 |
| format | string | 否 | 输出格式:excel, pdf, html |
| filters | object | 否 | 筛选条件 |
请求示例:
curl -X POST https://os.railwise.cn/api/v2/ai/reports/generate \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "type": "business_analysis", "period": "2026-Q2", "dimensions": ["revenue", "cost", "profit"], "format": "excel", "filters": { "department": "监测一部", "project_type": "轨道交通" } }'响应示例:
{ "success": true, "data": { "report_id": "report_20260708_001", "status": "generating", "estimated_completion": "2026-07-08T14:05:00+08:00", "download_url": "https://os.railwise.cn/api/v2/reports/download/report_20260708_001" }}POST /ai/recommendations/schedule请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| project_id | string | 是 | 项目ID |
| date_range | array | 是 | 日期范围 [start, end] |
| constraints | object | 是 | 约束条件 |
请求示例:
curl -X POST https://os.railwise.cn/api/v2/ai/recommendations/schedule \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "project_id": "proj_rw_2026_001", "date_range": ["2026-07-08", "2026-07-19"], "constraints": { "min_experience_years": 3, "required_certifications": ["测量员", "安全员"], "max_daily_hours": 8 } }'响应示例:
{ "success": true, "data": { "recommendation": { "schedule": [ { "date": "2026-07-08", "shift": "day", "members": [ { "user_id": "u001", "name": "张三", "role": "组长" }, { "user_id": "u002", "name": "李四", "role": "测量员" } ] } ], "confidence": 0.88, "reasoning": "基于人员技能匹配、历史排班效率和项目紧急程度综合推荐" } }}POST /ai/documents/process请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| file | file | 是 | 上传的文件 |
| task | string | 是 | 处理任务:extract, ocr, convert, compare |
| fields | array | 否 | 提取字段列表 |
| target_format | string | 否 | 目标格式(convert任务) |
请求示例:
curl -X POST https://os.railwise.cn/api/v2/ai/documents/process \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -F "file=@合同_绕城高速.pdf" \ -F "task=extract" \ -F "fields=[\"contract_no\", \"party_a\", \"party_b\", \"amount\"]"响应示例:
{ "success": true, "data": { "task_id": "doc_task_001", "status": "completed", "result": { "contract_no": "RW-2026-001", "party_a": "宁波睿威工程技术有限公司", "party_b": "宁波市轨道交通集团", "amount": 850000 } }}| 错误码 | 说明 | 处理建议 |
|---|---|---|
| 400 | 请求参数错误 | 检查请求体格式和参数 |
| 401 | 认证失败 | 检查 Token 是否过期,重新登录 |
| 403 | 权限不足 | 确认账号有权限执行该操作 |
| 404 | 资源不存在 | 检查项目ID或资源ID |
| 429 | 请求过于频繁 | 降低请求频率 |
| 500 | 服务器内部错误 | 稍后重试,联系技术支持 |
| 503 | AI服务暂时不可用 | 服务维护中,稍后重试 |
业务场景示例
Section titled “业务场景示例”场景1:项目立项智能辅助
Section titled “场景1:项目立项智能辅助”from railwise_os import AIAssistant, ProjectManager
assistant = AIAssistant(api_key="rw_os_xxxxxxxx")pm = ProjectManager(api_key="rw_os_xxxxxxxx")
# 新项目信息project_info = { "name": "XX地铁4号线盾构穿越监测", "type": "subway_protection", "location": "宁波市鄞州区", "client": "宁波市轨道交通集团", "estimated_duration": 180, # 天 "estimated_points": 50}
# AI辅助立项分析analysis = assistant.analyze_project(project_info)
print("=== 项目立项分析 ===")print(f"建议监测方案: {analysis.monitoring_scheme}")print(f"预估成本: {analysis.estimated_cost} 元")print(f"建议人员配置: {analysis.recommended_team}")print(f"风险提示: {analysis.risks}")print(f"参考案例: {analysis.similar_projects}")
# 创建项目project = pm.create_project({ **project_info, "monitoring_scheme": analysis.monitoring_scheme, "budget": analysis.estimated_cost})场景2:经营数据智能分析
Section titled “场景2:经营数据智能分析”# 季度经营分析analysis = assistant.analyze_business({ "period": "2026-Q2", "metrics": ["revenue", "cost", "profit", "project_count", "new_contracts"], "compare_with": "2026-Q1"})
print("=== 2026年Q2经营分析 ===")print(f"营业收入: {analysis.revenue} 元 (环比 {analysis.revenue_change}%)")print(f"营业成本: {analysis.cost} 元 (环比 {analysis.cost_change}%)")print(f"净利润: {analysis.profit} 元 (环比 {analysis.profit_change}%)")print(f"项目数: {analysis.project_count}")print(f"新签合同: {analysis.new_contracts}")print(f"AI建议: {analysis.suggestions}")场景3:设备维护智能预警
Section titled “场景3:设备维护智能预警”# 设备健康度评估equipment_health = assistant.assess_equipment_health({ "equipment_id": "ts_leica_001", "include_history": True, "prediction_horizon": 30 # 天})
print("=== 设备健康度评估 ===")print(f"设备: {equipment_health.name}")print(f"健康度评分: {equipment_health.score}/100")print(f"建议维护时间: {equipment_health.recommended_maintenance_date}")print(f"预测故障概率: {equipment_health.failure_probability}%")print(f"建议措施: {equipment_health.recommendations}")与外部系统集成
Section titled “与外部系统集成”与财务系统对接
Section titled “与财务系统对接”# 同步合同数据到财务系统from railwise_os import IntegrationManager
im = IntegrationManager(api_key="rw_os_xxxxxxxx")
# 配置财务系统接口im.configure_integration({ "name": "财务系统", "type": "financial", "endpoint": "https://finance.company.cn/api", "auth": { "type": "api_key", "key": "fin_api_xxxxxxxx" }, "sync_rules": [ { "source": "contracts", "target": "contract_management", "fields": ["contract_no", "amount", "party_a", "party_b", "start_date", "end_date"], "trigger": "on_create" } ]})
# 手动触发同步im.sync("contracts", "financial")与OA系统对接
Section titled “与OA系统对接”# 配置OA系统审批流im.configure_integration({ "name": "OA系统", "type": "oa", "endpoint": "https://oa.company.cn/api", "auth": { "type": "oauth2", "client_id": "oa_client_xxx", "client_secret": "oa_secret_xxx" }, "workflows": [ { "name": "报告审批", "trigger": "report_submitted", "steps": [ { "role": "project_manager", "action": "review" }, { "role": "technical_director", "action": "approve" }, { "role": "general_manager", "action": "sign" } ] } ]})1. 知识库维护
Section titled “1. 知识库维护”- 定期更新监测规范库,确保引用最新版本
- 项目归档后及时同步到项目档案库
- 设备故障案例及时录入,丰富知识库
2. AI问答优化
Section titled “2. AI问答优化”- 提问时尽量提供项目ID,获取更精准的上下文
- 使用专业术语,提高匹配准确度
- 复杂问题分步骤提问
3. 报表生成
Section titled “3. 报表生成”- 明确报表目的和受众,选择合适的维度
- 使用筛选条件缩小数据范围,提高生成速度
- 定期保存常用报表模板
4. 数据安全
Section titled “4. 数据安全”- 敏感数据使用脱敏处理
- 定期审计API访问日志
- 遵循最小权限原则
限制与注意事项
Section titled “限制与注意事项”| 限制项 | 说明 |
|---|---|
| AI问答 | 复杂计算问题建议结合人工验证 |
| 报表生成 | 大数据量报表可能需要数分钟 |
| 文档处理 | 扫描件OCR准确率约95% |
| 并发限制 | 每账号最多10个并发请求 |
| 数据保留 | 对话历史保留90天 |
| 模型更新 | AI模型每月更新,回答可能有变化 |
注意: AI助手提供的建议仅供参考,重大业务决策仍需人工审核。
Q1: AI问答回答不准确?
Section titled “Q1: AI问答回答不准确?”- 检查是否指定了正确的项目ID
- 尝试使用更具体的专业术语
- 查看引用的知识库来源是否最新
- 联系管理员更新知识库
Q2: 报表生成失败?
Section titled “Q2: 报表生成失败?”- 检查筛选条件是否过于复杂
- 缩小时间范围或数据量
- 查看是否有权限访问相关数据
- 稍后重试,可能是服务负载过高
Q3: 如何自定义报表模板?
Section titled “Q3: 如何自定义报表模板?”# 保存自定义模板assistant.save_template({ "name": "月度经营简报", "type": "business_analysis", "layout": { "sections": [ { "type": "summary", "metrics": ["revenue", "profit"] }, { "type": "chart", "chart_type": "trend", "metric": "revenue" }, { "type": "table", "data": "project_list" } ] }})Q4: 能否集成企业微信/钉钉?
Section titled “Q4: 能否集成企业微信/钉钉?”可以,通过集成服务配置:
im.configure_integration({ "name": "企业微信", "type": "wechat_work", "corp_id": "wwxxxxxxxxxxxxxxxx", "agent_id": "1000002", "secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})| 版本 | 日期 | 变更内容 |
|---|---|---|
| 4.0.0 | 2026-07-08 | 全新AI助手模块;支持RAG问答;新增智能推荐引擎;优化文档处理 |
| 3.5.0 | 2026-04-15 | 新增智能报表生成;支持自然语言指令;优化OCR准确率 |
| 3.0.0 | 2025-12-20 | 初始AI功能发布;支持基础问答和文档处理 |
| 2.0.0 | 2025-08-01 | 业务OS重构;Vue3前端升级;Spring Boot 3后端 |
| 1.0.0 | 2025-03-10 | 初始版本发布 |
- RAILWISE-CLI AI多智能体系统概述
- WorkWise AI工作台集成指南
- RAILWISE-TSM全站仪自动化AI工具
- AI测量数据分析工具
- AI监测报告生成工具
- API REST 参考文档
技术支持: 如有疑问,请联系 RailWise 技术支持团队
- 邮箱:support@railwise.cn
- 电话:0574-XXXXXXXX
- 文档反馈:GitHub Issues
