sandbox/ivideon/puml/arch/AN_videoanalytics_crowd.puml
2026-02-13 17:36:23 +03:00

29 lines
1.2 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@startuml
participant "Video Node" as VN
participant "crowd.node\n(scheduler)" as Scheduler
queue "Redis Queue" as Redis
participant "crowd.node\n(analyzer)" as Analyzer
participant "crowd.backend" as Backend
participant "Tevian API" as Tevian
database MongoDB
== Периодическая работа (каждые N секунд) ==
Scheduler -> MongoDB: Найти камеры с queue_detection
Scheduler -> Scheduler: Проверить, нужно ли обновить зоны
Scheduler -> Redis: push task {"cmd": "analyze_crowd", "params": {...}}
Redis <- Analyzer: pop task
Analyzer -> VN: GET /snapshots/pull (получить кадр)
VN --> Analyzer: JPEG frame
Analyzer -> Analyzer: Повернуть кадр (если нужно)
Analyzer -> Tevian: Detect heads in zones
Tevian --> Analyzer: Detections
Analyzer -> Analyzer: Определить triggered zones
Analyzer -> Analyzer: Нарисовать зоны на кадре
Analyzer -> Backend: Send measurement + image URL
Backend -> MongoDB: Save measurement
Note over Scheduler, Analyzer: Scheduler и Analyzer работают\nв одном сервисе crowd.node,\nно scheduler запускается по cron
@enduml