hgzero/design/backend/sequence/inner/stt-음성텍스트변환.puml
ondal 715add4dbc 외부/내부 시퀀스 설계 일관성 개선 및 표준화
주요 변경사항:

[Critical]
- API 엔드포인트 통일: POST /api/minutes/{minutesId}/finalize
- 이벤트 이름 표준화: MinutesFinalized

[Warning]
- API Gateway 라우팅 규칙 문서화 (외부 시퀀스 7개 파일)
- 대시보드 API 경로 통일: GET /api/dashboard
- AI 제안 병합 프로세스 상세 문서화
- 회의록 확정 검증 로직 5단계 상세화

[Minor]
- Redis 캐시 TTL 명시 (7개 파일, TTL 정책 표준화)
- 대시보드 페이지네이션 파라미터 추가
- 에러 응답 포맷 표준화 (14개 에러 응답)

총 31개 파일 수정, 34건의 개선 사항 적용

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 09:48:06 +09:00

116 lines
3.0 KiB
Plaintext

@startuml
!theme mono
title STT Service - 음성텍스트변환 내부 시퀀스
participant "Frontend<<E>>" as Frontend
participant "TranscriptController" as Controller
participant "TranscriptService" as Service
participant "RecordingRepository" as RecordingRepo
participant "TranscriptRepository" as TranscriptRepo
participant "AzureSpeechClient" as AzureClient
database "STT DB" as DB
database "Azure Blob Storage<<E>>" as BlobStorage
queue "Azure Event Hubs<<E>>" as EventHub
== 음성 데이터 스트리밍 수신 (5초 간격 배치) ==
Frontend -> Controller: POST /api/transcripts/stream\n(audioData, recordingId, timestamp)
activate Controller
Controller -> Service: processAudioStream(audioData, recordingId)
activate Service
== 음성 인식 처리 ==
Service -> AzureClient: recognizeAudio(audioData)
activate AzureClient
AzureClient -> AzureClient: 음성 인식 수행
note right
- 실시간 STT 처리
- 화자 식별 (Speaker Diarization)
- 타임스탬프 자동 기록
- 신뢰도 점수 계산
end note
AzureClient -> BlobStorage: 음성 파일 저장\n(chunk 단위 저장)
activate BlobStorage
BlobStorage --> AzureClient: 저장 완료
deactivate BlobStorage
AzureClient --> Service: RecognitionResult\n(text, speakerId, confidence, timestamp)
deactivate AzureClient
== 정확도 검증 및 처리 ==
Service -> Service: 정확도 점수 검증
note right
confidence >= 60%: 정상 처리
confidence < 60%: 경고 플래그 설정
end note
== 변환 결과 저장 ==
Service -> TranscriptRepo: createTranscript(recordingId, text, metadata)
activate TranscriptRepo
TranscriptRepo -> DB: 변환 결과 저장\n(텍스트ID, 녹음ID, 화자ID, 텍스트, 신뢰도, 타임스탬프, 경고플래그)
activate DB
DB --> TranscriptRepo: transcriptId 반환
deactivate DB
TranscriptRepo --> Service: TranscriptEntity 반환
deactivate TranscriptRepo
== 화자 정보 업데이트 ==
Service -> RecordingRepo: updateSpeakerInfo(recordingId, speakerId)
activate RecordingRepo
RecordingRepo -> DB: 화자 정보 저장/업데이트\n(녹음ID, 화자ID, 세그먼트수)
activate DB
DB --> RecordingRepo: 업데이트 완료
deactivate DB
RecordingRepo --> Service: 완료
deactivate RecordingRepo
== 이벤트 발행 ==
Service -> EventHub: TranscriptReady 이벤트 발행
activate EventHub
note right of EventHub
이벤트 데이터:
- transcriptId
- recordingId
- meetingId
- text
- speakerId
- timestamp
- confidence
end note
EventHub --> Service: 발행 완료
deactivate EventHub
Service --> Controller: TranscriptResponse\n(transcriptId, text, confidence, warningFlag)
deactivate Service
Controller --> Frontend: 200 OK\n(transcriptId, text, speakerId, timestamp, confidence)
deactivate Controller
note over Frontend, EventHub
처리 시간:
- Azure STT 처리: 1-3초
- DB 저장: ~100ms
- Event 발행: ~50ms
- 총 처리 시간: 1-4초
정확도 경고:
- 60% 미만: 수동 수정 권장
- 60-80%: 검토 권장
- 80% 이상: 정상
end note
@enduml