1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| """ 传统IMS: 独立ECU,CAN总线通信 → DMS ECU → CAN → 仪表盘ECU → 显示警告
SOA IMS: 中央计算上的微服务 → DMS Service → SOME/IP → HMI Service → 显示 → DMS Service → SOME/IP → ADAS Service → 增强车道保持 → DMS Service → SOME/IP → Cabin AI Agent → 自动干预 """
class IMSServiceInterface: """ IMS SOA 服务接口定义 面向服务架构中,IMS以标准接口提供服务 其他服务可以订阅IMS数据或调用IMS功能 """ SERVICE_INTERFACE = { 'driver_state': { 'description': '驾驶员状态服务', 'publish_frequency': '10Hz', 'data': { 'fatigue_level': 'float [0-1]', 'distraction_level': 'float [0-1]', 'gaze_zone': 'enum [road/left/right/down/center]', 'head_pose': 'struct {yaw, pitch, roll}', 'blink_rate': 'float [per minute]', 'perclos': 'float [%]', }, 'subscribers': ['HMI', 'ADAS', 'Cabin AI Agent'], }, 'occupant_state': { 'description': '乘员状态服务', 'publish_frequency': '5Hz', 'data': { 'occupant_count': 'int', 'occupants': [{ 'seat_id': 'enum', 'type': 'enum [adult/child/empty]', 'posture': 'enum [normal/recline/side/forward_lean]', 'belt_status': 'enum [fastened/loose/incorrect/unfastened]', }], }, 'subscribers': ['HMI', 'Restraint Controller', 'Cabin AI Agent'], }, 'health_vitals': { 'description': '生命体征服务(Phase 2)', 'publish_frequency': '1Hz', 'data': { 'heart_rate': 'float [bpm]', 'breathing_rate': 'float [per minute]', 'spo2': 'float [%]', 'stress_level': 'enum [low/moderate/high]', }, 'subscribers': ['HMI', 'Emergency Service', 'Cabin AI Agent'], }, 'cpd_alert': { 'description': '儿童存在检测服务', 'publish_frequency': '事件触发', 'data': { 'detected': 'bool', 'confidence': 'float', 'location': 'enum [front_left/rear_left/rear_right/...]', 'vital_signs': 'struct {breathing, movement}', }, 'subscribers': ['HMI', 'Telematics', 'Cabin AI Agent'], }, }
|