Trang này giải thích cách sử dụng các trường siêu dữ liệu bắt buộc và không bắt buộc của gói dịch vụ.
Siêu dữ liệu bắt buộc
Mô hình thực thi gói dịch vụ yêu cầu mỗi gói dịch vụ xác định siêu dữ liệu sau:
- Tên của dịch vụ theo quy ước đặt tên SDV
- Biểu diễn số nguyên và chuỗi của phiên bản gói dịch vụ
- Đường dẫn đến thư viện gói dịch vụ
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"
...
}
Siêu dữ liệu không bắt buộc
Siêu dữ liệu không bắt buộc hỗ trợ các chức năng SDV cụ thể.
Siêu dữ liệu điều phối
Cấu hình điều phối SDV cung cấp một cơ chế để kiểm soát hành vi khởi động và tắt các gói dịch vụ. Cấu hình điều phối SDV xác định một bộ quy tắc xác định thời điểm và cách thức thực hiện các hành động trên các phiên bản gói dịch vụ. Các quy tắc này dựa trên chế độ xe, chế độ nguồn và chế độ tuỳ chỉnh.
Để liên kết một cấu hình điều phối với gói dịch vụ, hãy cung cấp đường dẫn đến mô-đun prebuilt_etc trong trường orchestration_config_path không bắt buộc:
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"
}
Đường dẫn chính sách uỷ quyền
Chính sách uỷ quyền SDV cung cấp một cơ chế để khai báo các quyền cho gói dịch vụ. Chính sách uỷ quyền xác định những hành động mà gói dịch vụ có thể thực hiện (chẳng hạn như xuất bản, đăng ký, phân phát hoặc gọi).
Để liên kết một chính sách uỷ quyền với gói dịch vụ, hãy cung cấp đường dẫn đến mô-đun prebuilt_etc trong trường authorization_policy_path không bắt buộc:
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"
}
Siêu dữ liệu của nhà cung cấp VSIDL
Siêu dữ liệu của nhà cung cấp VSIDL là một phần của cơ chế tích hợp các gói dịch vụ với các tác nhân nền tảng Chẩn đoán và SOME/IP.
Để liên kết siêu dữ liệu của nhà cung cấp VSIDL với một gói dịch vụ, hãy cung cấp đường dẫn đến các tệp prebuilt_etc chứa các tệp siêu dữ liệu đã tạo trong trường vsidl_schemas_path / diagnostics_config_path / (chỉ cấu hình SOME/IP APEX) external_service_bundle_metadata_path không bắt buộc:
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"
}
Để tìm hiểu thêm, hãy xem bài viết Tổng quan về trình cung cấp VSIDL.
Siêu dữ liệu thẻ nhật ký
Thuộc tính thẻ nhật ký chỉ định giá trị nhận dạng riêng biệt cho nhật ký do gói dịch vụ tạo. Nếu bạn không xác định thuộc tính này, hệ thống sẽ tự động tạo một thẻ mặc định bằng cách sử dụng tên gói, tên gói dịch vụ và tên phiên bản. Để có độ rõ ràng tối ưu, hãy xác định một thẻ nhật ký ngắn gọn và duy nhất.
Siêu dữ liệu tuỳ chỉnh
Siêu dữ liệu tuỳ chỉnh cho phép OEM và nhà cung cấp xác định một số siêu dữ liệu gói dịch vụ cụ thể
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"
}
}
Ví dụ đầy đủ
# 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"
}
}