Профили интеграции#
Документ фиксирует baseline интеграционных профилей swine-пакета по шаблону adapter-profile-template.md.
1. Профиль A: климат-контроллер корпуса#
adapter_profile_id:swine-bigfarmnet-climatepro-v1industry_code:swinemodule_id:industry.swine.climatesource_type:controllerversion:1.0.0status:draftprotocol:mqttpayload_format:jsonschema_version:v1timezone_policy:utc_requiredrequired_fields:[event_time_utc, source_id, site_id, house_id, temp_c, humidity_percent, co2_ppm]
Mapping телеметрии#
source_field |
target_field |
target_entity |
unit_in |
unit_out |
transform |
required |
quality_rule |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Надежность и fallback#
idempotency_key:[source_id, event_time_utc, house_id]ordering_policy:event_time_utc(окно переупорядочивания120s)retry_policy:max_retries=5,backoff_ms=750fallback_source:swine-local-sensor-gateway-v1anomaly_policy: при расхожденииtemp_cprimary/fallback >2.0C->quality=warnfreshness_sla:60s
Безопасность#
auth_method:tokensecret_ref:vault/swine/climatepro/mqtt-tokenallowed_endpoints/topics:["swine/+/climate/telemetry"]audit_required:true
2. Профиль B: feed/water counters gateway#
adapter_profile_id:swine-feedwater-gateway-v1industry_code:swinemodule_id:industry.swine.watersource_type:gatewayversion:1.0.0status:draftprotocol:httppayload_format:jsonschema_version:v1timezone_policy:utc_requiredrequired_fields:[event_time_utc, source_id, site_id, house_id, feed_gram_per_head, water_l_per_head]
Mapping телеметрии#
source_field |
target_field |
target_entity |
unit_in |
unit_out |
transform |
required |
quality_rule |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Надежность и fallback#
idempotency_key:[source_id, event_time_utc, house_id]ordering_policy:event_time_utcretry_policy:max_retries=3,backoff_ms=500fallback_source:manual-shift-inputanomaly_policy: сравнение gateway vs manual (abs(deviation_pct) > 5->warn)freshness_sla:5m
Безопасность#
auth_method:mTLSsecret_ref:vault/swine/feedwater/client-certallowed_endpoints/topics:["POST /api/v1/swine-water/commands/ingest","POST /api/v1/swine-feeding/commands/ingest"]audit_required:true
3. Профиль C: biosecurity events service#
adapter_profile_id:swine-biosecurity-service-v1industry_code:swinemodule_id:industry.swine.biosecuritysource_type:external_serviceversion:1.0.0status:draftprotocol:httppayload_format:jsonschema_version:v1timezone_policy:utc_requiredrequired_fields:[event_time_utc, source_id, site_id, zone_id, event_code, severity]
Mapping телеметрии#
source_field |
target_field |
target_entity |
unit_in |
unit_out |
transform |
required |
quality_rule |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`critical |
|
|
|
|
|
|
|
|
Надежность и fallback#
idempotency_key:[source_id, event_time_utc, event_code, zone_id]ordering_policy:event_time_utcretry_policy:max_retries=4,backoff_ms=1000fallback_source:swine-manual-biosecurity-formanomaly_policy: повтор одинаковогоevent_code>N=5за10m->possible_loopfreshness_sla:2m
Безопасность#
auth_method:tokensecret_ref:vault/swine/biosecurity/api-tokenallowed_endpoints/topics:["POST /api/v1/swine-biosecurity/commands/ingest"]audit_required:true