创建和使用业务术语库

本文档介绍了如何使用 Knowledge Catalog 为数据资产建立标准化词汇表。通过创建业务术语库,您可以减少歧义,并提高整个组织的数据发现能力。

本快速入门使用零售行业场景和 BigQuery 中的示例数据,向您展示如何完成以下目标:

  1. 为零售运营创建业务术语库。
  2. 构建产品目录管理系统类别层次结构。
  3. 定义业务术语,例如“安全库存水平”。
  4. 将业务术语附加到 BigQuery 列。
  5. 使用业务上下文搜索数据。

准备工作

设置项目:

  1. 登录您的 Google Cloud 账号。如果您是 Google Cloud新手, 请创建一个账号来评估我们的产品在 实际场景中的表现。新客户还可获享 $300 赠金,用于 运行、测试和部署工作负载。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Dataplex and BigQuery APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Dataplex and BigQuery APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

所需角色

如需获得创建和管理业务术语库所需的权限,请让您的管理员为您授予以下 IAM 角色:

  • Dataplex Catalog Admin (roles/dataplex.catalogAdmin) 针对 Knowledge Catalog(以前称为 Dataplex Universal Catalog)资源项目的
  • BigQuery Data Editor (roles/bigquery.dataEditor) 针对您在其中使用 BigQuery 的项目的

如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限

您也可以通过自定义 角色或其他预定义 角色来获取所需的权限。

创建零售运营术语库

  1. 在 Google Cloud 控制台中,前往 Knowledge Catalog > 术语库 页面。

    前往术语库

  2. 点击创建业务术语库

  3. 显示名称 字段中,输入 Global Retail Operations Glossary

  4. 位置 列表中,选择 us(美国的多个区域)

    多区域可提供更高的可用性和弹性,而单区域有助于满足严格的数据驻留要求。如需了解详情,请参阅 Knowledge Catalog 位置

  5. 点击创建

构建类别层次结构

将术语整理成层次结构,以帮助用户浏览您的业务领域。您最多可以嵌套 3 个级层的类别。对于本快速入门,请考虑以下类别:

  • 供应链和物流 :表示整体供应链运营的父类别。

  • 库存水平 :用于对与库存管理相关的特定指标和参数进行分组的子类别。

创建父类别

在本部分中,创建类别 Supply Chain & Logistics

  1. Global Retail Operations Glossary术语库详细信息 页面上,点击创建类别
  2. 显示名称 字段中,输入 Supply Chain & Logistics
  3. 点击创建

创建子类别

在本部分中,创建类别 Inventory Levels 作为 Supply Chain & Logistics 的子集。

  1. 在左侧窗格中,在 Global Retail Operations Glossary 下,选择供应链和物流 类别。

  2. 在主窗格中,点击创建类别

  3. 显示名称 字段中,输入 Inventory Levels

  4. 点击创建

定义业务术语

在零售业中,一致的术语对于管理库存、销售和物流至关重要。定义术语以捕获业务逻辑,并通过同义词或相关术语将它们关联起来。对于本快速入门,请考虑以下术语:

  • 安全库存水平 :为防止因需求不可预测或供应链中断而导致缺货,而保留的最低库存水平。在本快速入门中,此术语也称为 Buffer Stock

  • 前置时间 :从向供应商下订单到收到库存所需的时间。

将“安全库存水平”定义为业务术语

  1. 在左侧窗格中选择库存水平 类别,然后点击添加术语
  2. 显示名称 字段中,输入 Safety Stock Level,然后点击创建
  3. 术语详细信息 页面中,点击 说明 的“添加”图标 添加 ,然后 输入 Minimum inventory maintained to mitigate risk of stockouts during supply chain volatility.
  4. 点击保存

将“缓冲库存”添加为同义词

  1. 在左侧窗格中选择库存水平 类别,然后点击添加术语
  2. 显示名称 字段中,输入 Buffer Stock,然后点击创建
  3. 同义词术语 部分中,点击 修改同义词
  4. 搜索 Safety Stock Level,选择该术语,然后点击关闭

定义“前置时间”并将其与“缓冲库存”相关联

  1. 在左侧窗格中选择库存水平 类别,然后点击添加术语
  2. 显示名称 字段中,输入 Lead Time,然后点击创建
  3. 点击说明的“添加”图标 添加,然后输入 The time it takes from placing an order with a supplier to receiving the inventory.
  4. 点击保存
  5. 相关术语 部分中,点击 修改相关术语
  6. 搜索 Buffer Stock,选择该术语,然后点击关闭

在 BigQuery 中创建示例表

如需将您创建的业务术语附加到实际数据资产,请先创建一个包含相关列的资产。

  1. 在 Google Cloud 控制台中,前往 BigQuery 页面。

    前往 BigQuery

  2. 如果您是首次使用 BigQuery,请点击完成 以关闭欢迎窗口。

  3. 在查询编辑器中,粘贴以下查询以创建示例数据集和表:

    CREATE SCHEMA omnichannel_prod OPTIONS(location="us");
    CREATE TABLE omnichannel_prod.daily_stock_summary (
      sku STRING,
      buffer_qty INT64,
      order_lead_time INT64
    );
    INSERT INTO omnichannel_prod.daily_stock_summary (sku, buffer_qty, order_lead_time)
    VALUES
      ('SH001', 50, 7),
      ('BT002', 20, 14),
      ('SH003', 60, 5),
      ('BT004', 30, 10),