Method Specification: ProcessProductImage

Domain: AID | Service: product-vision-processor | Type: Kafka Consumer

WarningОграничение публичной документации

В открытом доступе представлена демонстрационная версия метода. В настоящей публичной документации отображены не все шаги, технические сценарии и приватные эндпоинты для системы цифровых симуляторов бизнес-процессов.

  • Полная спецификация метода: Будет доступна только во внутреннем контуре разработки (Confluence / Swagger Enterprise).

Функциональное назначение

The asynchronous event handler ProcessProductImage is deployed within the product-vision-processor microservice. It acts as a core Vision Context Provider, responsible for downloading raw binary graphic streams from object storage, executing object localization, and performing neural network classification (YOLO inference).

The method translates visual pixels into a canonical text string class representing the item name. To reuse the existing security perimeter, the resulting string is instantly routed back to the unified text pipeline for further profanity checking and AI parsing.

Core Tasks Handled by the Method

  1. Binary Asset Fetching: Downloads the target image file into temporary GPU/CPU memory arrays using high-speed internal S3 network streams.
  2. Object Detection Inference (YOLO): Executes matrix processing and runs convolutional neural network models to locate bounding boxes and classify the product.
  3. Perimeter Continuity Delegation: Maps the detected label into a text entry and pushes it to the receipt queue under the original trace context.

Interaction Protocol (Event Contract)

  • Method Name: ProcessProductImage
  • Message Broker: Apache Kafka
  • Ingress Topic (Subscription): bpds.vision.in.photo.process
  • Egress Topic (Publication): bpds.inventory.in.receipt.upload
  • Data Format: application/json

Ingress Message Payload Example

{
  "image_file_url": "https://minio.internal",
  "app_lang": "ru-RU",
  "x_request_id": "trace-cv-censor-uuid"
}

Sequence Diagram (Mermaid)

sequenceDiagram
    autonumber
    participant K as Broker: Apache Kafka
    participant Vision as product-vision-processor (AID)
    participant S3 as MinIO (S3 Storage)

    K->>Vision: Step 4: Handler: ProcessProductImage()
    activate Vision
    
    critical Step 5: Download Source Graphics Matrix
        Vision->>S3: HTTP GET /product-images/uploads/...
        activate S3
        S3-->>Vision: Binary graphic stream
        deactivate S3
    option Asset Missing (HTTP 404)
        Note over Vision: Terminate Cycle:<br/>Log error code IAD-VISION-404
    end

    Note over Vision: YOLO Model Inference:<br/>Contour localization & class mapping

    critical Step 6: Delegate Text Label to Censorship Pipeline
        Vision->>K: Push to topic: bpds.inventory.in.receipt.upload
    option Model Inference Failure / Confidence Drop
        Note over Vision: Terminate Cycle:<br/>Log error code IAD-YOLO-422
    end
    deactivate Vision


Расшифровка шагов

Step Action Parameters / Requests / DTO Errors (Exceptions / Statuses)
4 (K -> Vision) The service polls the message broker queue, extracts the JSON payload context, and allocates resources to start image analysis. Kafka Ingress Payload:
The JSON request properties specified in the contract block.
No business errors
5 (Vision -> S3) The worker calls the object storage endpoint to load the target file into a processing buffer before binding it to memory. HTTP GET Request:
URL: https://minio.internal
IAD-VISION-404: Target source image asset was not found or deleted from storage before processing.
6 (Vision -> K) The localized YOLO model completes classification. The worker packages the text label into a standard input DTO and pushes it to Kafka. Kafka Egress Message:
Topic: bpds.inventory.in.receipt.upload
Payload: { "raw_text_input": "Груша Конференция", "app_lang": "ru-RU", "x_request_id": "trace-cv-censor-uuid" }
IAD-YOLO-422: Detection confidence score dropped below safety threshold or model classification failed.