Siêu dữ liệu của gói dịch vụ

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ụ phải xác định siêu dữ liệu sau:

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 cụ thể của SDV.

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ủa 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 thực thể 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 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 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 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 tệp siêu dữ liệu được tạo trong trường không bắt buộc vsidl_schemas_path / diagnostics_config_path / (chỉ dành cho APEX cấu hình SOME/IP) 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"
}

Để tìm hiểu thêm, hãy xem bài viết Tổng quan về nhà cung cấp VSIDL.

Siêu dữ liệu về 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 ra. Nếu bạn không xác định thuộc tính này, thì một thẻ mặc định sẽ tự động được tạo bằng tên gói, tên gói dịch vụ và tên thực thể. Để đảm bảo độ rõ ràng tối ưu, hãy xác định một thẻ nhật ký ngắn gọn và riêng biệ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 cụ thể của gói dịch vụ

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"
  }
}

Tài liệu tham khảo