mirror of
https://github.com/hwanny1128/HGZero.git
synced 2025-12-06 09:06:24 +00:00
전체 5개 마이크로서비스의 내부 처리 흐름을 상세히 설계 [추가된 파일] - Meeting Service: 6개 시나리오 (검증완료, 실시간수정동기화, 최종회의록확정, 충돌해결, 템플릿선택, 회의록목록조회) - STT Service: 2개 시나리오 (음성녹음인식, 텍스트변환) - User Service: 2개 시나리오 (사용자인증, 대시보드조회) - Notification Service: 1개 시나리오 (알림발송) [주요 설계 내용] - Clean Architecture 적용 (Controller → Service → Domain → Repository) - Cache-Aside 패턴 (Redis 기반 성능 최적화) - Event-Driven Architecture (Azure Event Hub) - Real-time Collaboration (WebSocket + OT 알고리즘) - RAG 기능 (맥락 기반 AI) [검증 결과] - PlantUML 문법 검증: 모든 파일 통과 ✅ - 유저스토리 매칭: 100% 일치 ✅ - 아키텍처 패턴 준수: 완료 ✅ [병렬 처리] - 서브 에이전트 3개로 병렬 작업 수행 - Meeting Service, AI Service, STT/User/Notification 동시 설계 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
146 lines
3.8 KiB
Plaintext
146 lines
3.8 KiB
Plaintext
@startuml
|
|
!theme mono
|
|
|
|
title 음성-텍스트 변환 내부 시퀀스 (UFR-STT-020)
|
|
|
|
participant "API Gateway<<E>>" as Gateway
|
|
participant "SttController" as Controller
|
|
participant "SttService" as Service
|
|
participant "TranscriptionEngine" as Engine
|
|
participant "Azure Speech<<E>>" as Speech
|
|
participant "SttRepository" as Repository
|
|
database "PostgreSQL<<E>>" as DB
|
|
queue "Event Hub<<E>>" as EventHub
|
|
|
|
Gateway -> Controller: POST /api/v1/stt/transcribe\n{sessionId, audioFile}
|
|
activate Controller
|
|
|
|
Controller -> Service: transcribeAudio(sessionId, audioFile)
|
|
activate Service
|
|
|
|
Service -> Repository: findSessionById(sessionId)
|
|
activate Repository
|
|
Repository -> DB: SELECT * FROM stt_sessions\nWHERE session_id = ?
|
|
DB --> Repository: session data
|
|
Repository --> Service: SttSession entity
|
|
deactivate Repository
|
|
|
|
alt 실시간 변환 모드
|
|
Service -> Engine: streamingTranscribe(audioFile)
|
|
activate Engine
|
|
|
|
Engine -> Speech: createRecognizer()\nsetContinuousRecognition()
|
|
note right
|
|
Azure Speech 설정:
|
|
- Mode: Continuous
|
|
- Language: ko-KR
|
|
- Enable diarization
|
|
- Profanity filter
|
|
end note
|
|
|
|
Speech --> Engine: recognizer instance
|
|
|
|
loop 오디오 청크 처리
|
|
Engine -> Speech: recognizeOnceAsync(audioChunk)
|
|
Speech --> Engine: recognition result
|
|
note right
|
|
결과 포함:
|
|
- Text
|
|
- Confidence
|
|
- Duration
|
|
- Speaker ID
|
|
end note
|
|
|
|
Engine -> Engine: validateConfidence(result)
|
|
note right
|
|
신뢰도 검증:
|
|
- Threshold: 0.7
|
|
- Low confidence 처리
|
|
end note
|
|
|
|
Engine --> Service: transcription segment
|
|
|
|
Service -> Repository: saveSttSegment(segment)
|
|
activate Repository
|
|
Repository -> DB: INSERT INTO stt_segments\n(session_id, text, confidence, timestamp)
|
|
DB --> Repository: saved
|
|
Repository --> Service: segment saved
|
|
deactivate Repository
|
|
|
|
Service -> EventHub: publish(TranscriptionSegmentEvent)
|
|
note right
|
|
Event:
|
|
- sessionId
|
|
- segmentId
|
|
- text
|
|
- timestamp
|
|
end note
|
|
end
|
|
|
|
Engine --> Service: streaming complete
|
|
deactivate Engine
|
|
|
|
else 배치 변환 모드
|
|
Service -> Engine: batchTranscribe(audioFile)
|
|
activate Engine
|
|
|
|
Engine -> Speech: batchTranscriptionAsync(audioUrl)
|
|
note right
|
|
배치 처리:
|
|
- 전체 파일 업로드
|
|
- 백그라운드 처리
|
|
- Callback URL 제공
|
|
end note
|
|
|
|
Speech --> Engine: transcription job ID
|
|
|
|
Engine --> Service: job submitted
|
|
deactivate Engine
|
|
|
|
Service -> Repository: updateSessionStatus(sessionId, "PROCESSING")
|
|
activate Repository
|
|
Repository -> DB: UPDATE stt_sessions\nSET status = 'PROCESSING'
|
|
DB --> Repository: updated
|
|
Repository --> Service: updated
|
|
deactivate Repository
|
|
end
|
|
|
|
Service -> Repository: aggregateTranscription(sessionId)
|
|
activate Repository
|
|
Repository -> DB: SELECT text, timestamp\nFROM stt_segments\nWHERE session_id = ?\nORDER BY timestamp
|
|
DB --> Repository: segments
|
|
Repository --> Service: ordered segments
|
|
deactivate Repository
|
|
|
|
Service -> Service: mergeSegments(segments)
|
|
note right
|
|
세그먼트 병합:
|
|
- 화자별 그룹화
|
|
- 시간 순서 정렬
|
|
- 문장 경계 보정
|
|
end note
|
|
|
|
Service -> Repository: saveTranscription(fullText)
|
|
activate Repository
|
|
Repository -> DB: UPDATE stt_sessions\nSET full_text = ?,\nstatus = 'COMPLETED'
|
|
DB --> Repository: saved
|
|
Repository --> Service: updated session
|
|
deactivate Repository
|
|
|
|
Service -> EventHub: publish(TranscriptionCompletedEvent)
|
|
note right
|
|
Event:
|
|
- sessionId
|
|
- meetingId
|
|
- fullText
|
|
- completedAt
|
|
end note
|
|
|
|
Service --> Controller: TranscriptionResponse\n{sessionId, text, segments}
|
|
deactivate Service
|
|
|
|
Controller --> Gateway: 200 OK\n{transcription, metadata}
|
|
deactivate Controller
|
|
|
|
@enduml
|