hgzero/design/backend/sequence/inner/stt-음성녹음시작.puml
kimjh 909025aa27 내부 시퀀스 설계 완료
- 총 21개 PlantUML 파일 생성 (Meeting 10개, AI 6개, STT 2개, Notification 3개)
- 서브 에이전트를 활용한 병렬 설계로 효율성 극대화
- 모든 시나리오는 유저스토리 및 외부 시퀀스와 1:1 매칭
- Controller → Service → Repository 계층 구조 명확히 표현
- Redis Cache, Azure Event Hubs 등 인프라 컴포넌트 표시
- 동기(→)/비동기(-->) 구분 명확
- 외부 참여자 <<E>> 표시 적용
- PlantUML 문법 검사 및 오류 수정 완료 (13개 파일 수정)
- par/and 블록 문법 오류 수정
- return 형식 적용으로 참여자 없는 화살표 오류 해결

설계 특징:
- 캐시 전략: Cache-Aside 패턴, TTL 관리, 즉시 무효화
- 비동기 처리: Azure Event Hubs 기반 이벤트 구독
- 실시간 협업: WebSocket 기반 동기화, 변경 델타 전송
- 데이터 일관성: 버전 관리, 양방향 연결, 트랜잭션 처리

추가 파일:
- claude/sequence-inner-design.md: 내부시퀀스설계 가이드
- tools/check-plantuml.ps1: PlantUML 문법 검사 스크립트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 15:59:13 +09:00

88 lines
2.4 KiB
Plaintext

@startuml
!theme mono
title STT Service - 음성녹음시작 내부 시퀀스
participant "RecordingController" as Controller
participant "RecordingService" as Service
participant "RecordingRepository" as Repository
participant "AzureSpeechClient" as AzureClient
database "STT DB" as DB
database "Azure Blob Storage<<E>>" as BlobStorage
queue "Azure Event Hubs<<E>>" as EventHub
== MeetingStarted 이벤트 수신 ==
EventHub -> Controller: MeetingStarted 이벤트 수신\n(meetingId, sessionId)
activate Controller
Controller -> Service: prepareRecording(meetingId, sessionId)
activate Service
Service -> Service: 녹음 세션 검증
note right
- 중복 녹음 방지 체크
- meetingId 유효성 검증
end note
Service -> Repository: createRecording(meetingId, sessionId)
activate Repository
Repository -> DB: INSERT INTO recordings\n(recording_id, meeting_id, session_id,\nstatus='READY', created_at)
activate DB
DB --> Repository: recordingId 반환
deactivate DB
Repository --> Service: RecordingEntity 반환
deactivate Repository
== Azure Speech Service 초기화 ==
Service -> AzureClient: initializeRecognizer(recordingId, sessionId)
activate AzureClient
AzureClient -> AzureClient: 음성 인식기 설정
note right
- 언어: ko-KR
- 샘플레이트: 16kHz
- 화자 식별 활성화
- 실시간 스트리밍 모드
end note
AzureClient -> BlobStorage: 녹음 파일 저장 경로 생성\n(path: recordings/{meetingId}/{sessionId}.wav)
activate BlobStorage
BlobStorage --> AzureClient: 저장 경로 URL 반환
deactivate BlobStorage
AzureClient --> Service: RecognizerConfig 반환
deactivate AzureClient
== 녹음 상태 업데이트 ==
Service -> Repository: updateRecordingStatus(recordingId, "RECORDING")
activate Repository
Repository -> DB: UPDATE recordings\nSET status='RECORDING',\nstarted_at=NOW(),\nstorage_path='{blobUrl}'\nWHERE recording_id='{recordingId}'
activate DB
DB --> Repository: 업데이트 완료
deactivate DB
Repository --> Service: 업데이트 완료
deactivate Repository
Service --> Controller: RecordingResponse(recordingId, status, storagePath)
deactivate Service
Controller --> EventHub: RecordingStarted 이벤트 발행\n(recordingId, meetingId, status)
deactivate Controller
note over Controller, EventHub
처리 시간:
- DB 녹음 생성: ~100ms
- Azure 인식기 초기화: ~500ms
- Blob 경로 생성: ~200ms
- 총 처리 시간: ~800ms
end note
@enduml