این صفحه نحوه استفاده از فیلدهای فراداده اجباری و اختیاری بسته خدمات را توضیح میدهد.
فراداده اجباری
مدل اجرای بسته سرویس، هر بسته سرویس را ملزم به تعریف فرادادههای زیر میکند:
- نام سرویس طبق قرارداد نامگذاری SDV
- نمایش عدد صحیح و رشتهای نسخه بسته سرویس
- مسیر کتابخانه بستههای خدماتی
sdv_service_bundle_metadata {
# Name of the service bundle.
#
# Must follow SDV service naming convention rules.
# Ref: https:/automotive/sdv/core-areas/naming-conventions
#
# When using VSIDL catalog and middleware generation, this name must be
# equal to the service bundle name defined in the catalog.
name: "TheNameOfTheServiceBundle"
# Service Bundle Version Number.
# Must be non-negative number.
version_number: 1
# Service Bundle Version Name.
# Must be non-empty string.
version_name: "1.0 alpha"
# Path to the native library to be loaded as service bundle.
# Must be the relative path from the APEX root directory
native_library_path: "lib64/libservice_bundle.so"
}
# Service bundle one.
sdv_service_bundle_metadata {
name: "ServiceBundleOne"
...
}
# Service bundle two.
sdv_service_bundle_metadata {
name: "ServiceBundleTwo"
...
}
فراداده اختیاری
فرادادههای اختیاری از قابلیتهای خاص SDV پشتیبانی میکنند.
فرادادههای ارکستراسیون
پیکربندی هماهنگسازی SDV مکانیزمی برای کنترل رفتار راهاندازی و خاموش شدن بستههای خدماتی ارائه میدهد. پیکربندی هماهنگسازی SDV مجموعهای از قوانین را تعریف میکند که زمان و نحوه انجام اقدامات روی نمونههای بسته خدماتی را تعیین میکند. این قوانین بر اساس حالتهای خودرو، برق و حالتهای سفارشی هستند.
برای مرتبط کردن پیکربندی ارکستراسیون با بسته سرویس، مسیر ماژول prebuilt_etc را در فیلد اختیاری orchestration_config_path وارد کنید:
sdv_service_bundle_metadata {
...
# Path to the orchestration config file.
# Warning: Shall be relative path to the APEX root directory.
orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"
}
مسیر سیاست مجوزدهی
سیاست مجوزدهی SDV مکانیزمی برای اعلام مجوزها برای بسته سرویس فراهم میکند. سیاست مجوزدهی مشخص میکند که بسته سرویس چه اقداماتی میتواند انجام دهد (مانند انتشار، اشتراک، سرویس یا فراخوانی).
برای مرتبط کردن یک سیاست مجوزدهی به بسته سرویس، مسیر ماژول prebuilt_etc را در فیلد اختیاری authorization_policy_path وارد کنید:
sdv_service_bundle_metadata {
...
# Path to the authorization policy file.
# Warning: Shall be relative path to the APEX root directory.
authorization_policy_path: "etc/authz/permissions.textproto"
}
فراداده ارائه دهنده VSIDL
فراداده ارائهدهنده VSIDL بخشی از سازوکاری برای ادغام بستههای خدماتی با Diagnostics و عاملهای پلتفرمهای SOME/IP است.
برای مرتبط کردن یک فراداده ارائه دهنده VSIDL با یک بسته سرویس، مسیر فایلهای prebuilt_etc که حاوی فایلهای فراداده تولید شده هستند را در فیلد اختیاری vsidl_schemas_path / diagnostics_config_path / (فقط پیکربندی SOME/IP APEX) external_service_bundle_metadata_path وارد کنید:
sdv_service_bundle_metadata {
...
# Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
# Warning: Must be relative path to the APEX root directory.
vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"
# Path to the diagnostics config file.
# Warning: Shall be relative path to the APEX root directory.
diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"
# Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
# Warning: Must be relative path to the APEX root directory.
external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"
}
برای کسب اطلاعات بیشتر، به بررسی اجمالی ارائه دهنده VSIDL مراجعه کنید.
فراداده برچسب لاگ
ویژگی log tag، شناسه منحصر به فرد برای لاگهای تولید شده توسط بسته سرویس را مشخص میکند. اگر این ویژگی تعریف نشده باشد، یک تگ پیشفرض به طور خودکار با استفاده از نام بسته، نام بسته سرویس و نام نمونه ایجاد میشود. برای وضوح مطلوب، یک تگ لاگ مختصر و منحصر به فرد تعریف کنید.
فراداده سفارشی
فرادادههای سفارشی به تولیدکنندگان اصلی تجهیزات (OEM) و فروشندگان اجازه میدهد تا فرادادههای بسته خدماتی خاصی را تعریف کنند.
sdv_service_bundle_metadata {
...
# Custom service bundle metadata map.
# Key is a string, value is a string.
#
# 1st custom metadata value.
custom_metadata {
key: "question"
value: "Answer to the Ultimate Question of Life, the Universe, and Everything"
}
# 2nd custom metadata value.
custom_metadata {
key: "answer" value: "42"
}
}
sdv_service_bundle_metadata {
...
# Custom metadata values are stored in etc/.
custom_metadata {
key: "path_to_custom_metadata"
value: "etc/configuration/file"
}
}
مثال کامل
# proto-file: //system/software_defined_vehicle/core_services/service_bundles_registry/proto/sdv_service_bundles_manifest.proto
# proto-message: SdvServiceBundleManifestEntry
# SDV service bundle.
sdv_service_bundle_metadata {
# Name of the service bundle.
# Must follow SDV service naming convention rules.
name: "TheNameOfTheServiceBundle"
# Service Bundle Version Number.
# Must be non-negative number.
version_number: 42
# Service Bundle Version Name.
# Must be non-empty string.
version_name: "42.0.beta"
# Path to the native library to be loaded as service bundle.
# Must be the relative path from the APEX root directory.
native_library_path: "lib64/libservice_bundle.so"
# The log tag used for Android logging for the service bundle.
# If not specified, a tag derived from service bundle FQIN will be used.
log_tag: "current_service_bundle"
# Path to the orchestration config file.
# Warning: Shall be relative path to the APEX root directory.
orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"
# Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
# Warning: Must be relative path to the APEX root directory.
vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"
# Path to the diagnostics config file.
# Warning: Must be relative path to the APEX root directory.
diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"
# Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
# Warning: Must be relative path to the APEX root directory.
external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"
# Custom service bundle metadata string.
# Key is a string, value is a string.
custom_metadata {
key: "key" value: "value"
}
# Custom metadata values are stored in etc/.
custom_metadata {
key: "path_to_custom_metadata"
value: "etc/configuration/file"
}
}