创建和使用业务术语库
借助 Knowledge Catalog,您可以创建业务术语库,为数据资产建立标准化的词汇,减少歧义,并提高整个组织的数据发现效率。在此快速入门中,您将使用零售行业场景和 BigQuery 中的示例数据,构建用于产品目录管理系统的类别层次结构。然后,您可以定义安全库存水平等业务术语,将其附加到 BigQuery 列,并使用业务上下文搜索数据。
准备工作
设置项目:
- 登录您的 Google Cloud 账号。如果您是 Google Cloud新手,请 创建一个账号来评估我们的产品在实际场景中的表现。新客户还可获享 $300 赠金,用于运行、测试和部署工作负载。
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
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.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex and BigQuery APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
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.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex and BigQuery APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.
所需的角色
如需获得创建和管理业务术语库所需的权限,请让您的管理员为您授予以下 IAM 角色:
- 针对 Knowledge Catalog(原 Dataplex Universal Catalog)资源项目的 Dataplex Catalog Admin (
roles/dataplex.catalogAdmin) - 针对您在其中使用 BigQuery 的项目的 BigQuery Data Editor (
roles/bigquery.dataEditor)
如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
创建零售运营术语表
在 Google Cloud 控制台中,前往 Knowledge Catalog > Glossaries 页面。
点击创建业务术语库。
在显示名称字段中,输入
Global Retail Operations Glossary。在位置列表中,选择美国(美国的多个区域)。
多区域可提供更高的可用性和弹性,而单区域有助于满足严格的数据驻留要求。如需了解详情,请参阅 Knowledge Catalog 位置。
点击创建。
构建类别层次结构
将术语整理成层次结构,帮助用户浏览您的业务网域。您最多可以嵌套 3 个级层的类别。在此快速入门中,请考虑以下类别:
供应链和物流:表示整个供应链运营的父类别。
库存水平:用于对与库存管理相关的特定指标和参数进行分组的子类别。
创建父类别
在此部分中,创建类别 Supply Chain & Logistics。
- 在
Global Retail Operations Glossary的词库详情页面上,点击创建类别。 - 在显示名称字段中,输入
Supply Chain & Logistics。 - 点击创建。
创建子类别
在本部分中,将类别 Inventory Levels 创建为 Supply Chain & Logistics 的子集。
在左侧窗格中,选择
Global Retail Operations Glossary下的供应链和物流类别。在主窗格中,点击创建类别。
在显示名称字段中,输入
Inventory Levels。点击创建。
定义业务术语
在零售业,术语的一致性对于管理库存、销售和物流至关重要。定义术语以捕获业务逻辑,并通过同义词或相关字词将它们关联起来。在本快速入门中,请注意以下术语:
安全库存水平:为防止因需求或供应链中断而导致缺货而保持的最低库存水平。在本快速入门中,此文件也称为
Buffer Stock。交货时间:从向供应商下单到收到库存所需的时间。
将“安全库存水平”定义为业务术语
- 在左侧窗格中选择库存水平类别,然后点击添加术语。
- 在显示名称字段中,输入
Safety Stock Level,然后点击创建。 - 在条款详情页面中,点击说明对应的 添加,然后输入
Minimum inventory maintained to mitigate risk of stockouts during supply chain volatility. - 点击保存。
添加“缓冲库存”作为同义词
- 在左侧窗格中选择库存水平类别,然后点击添加字词。
- 在显示名称字段中,输入
Buffer Stock,然后点击创建。 - 在同义词部分中,点击 修改同义词。
- 搜索
Safety Stock Level,选择该结果,然后点击关闭。
定义“提前期”并将其与“缓冲库存”相关联
- 在左侧窗格中选择库存水平类别,然后点击添加字词。
- 在显示名称字段中,输入
Lead Time,然后点击创建。 - 点击说明对应的 添加,然后输入
The time it takes from placing an order with a supplier to receiving the inventory. - 点击保存。
- 在相关字词部分中,点击 修改相关字词。
- 搜索
Buffer Stock,选择该结果,然后点击关闭。
在 BigQuery 中创建示例表
如需将您创建的业务术语附加到实际数据资产,请先创建包含相关列的资产。
在 Google Cloud 控制台中,前往 BigQuery 页面。
如果您是首次使用 BigQuery,请点击完成以关闭欢迎窗口。
在查询编辑器中,粘贴以下查询以创建示例数据集和表:
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), ('SH005', 70, 7), ('BT006', 40, 12), ('SH007', 80, 6);点击 运行。 查询成功后,您会在名为
omnichannel_prod的数据集中获得一个名为daily_stock_summary的新表。
将条款附加到表格列
在 Google Cloud 控制台中,返回 Knowledge Catalog > 搜索页面。
如有需要,请刷新页面。
在搜索栏中,输入
omnichannel_prod.daily_stock_summary,然后按试试自然语言搜索。点击搜索结果中的 daily_stock_summary 表,查看其详细信息。
点击架构标签页。
在
buffer_qty对应的行中,选中复选框,然后点击 添加业务术语。在添加业务术语窗格中,搜索并选择
Safety Stock Level。选择
order_lead_time对应的行,点击 添加业务术语。在添加业务术语窗格中,搜索并选择
Lead Time。
使用业务情境搜索数据
用户现在可以使用业务语言查找技术资产。
在 Google Cloud 控制台中,前往 Knowledge Catalog 搜索页面。
尝试以下搜索查询,以返回
daily_stock_summary表:在搜索栏中,输入
term: "Safety Stock Level"。点击试试自然语言搜索。
系统随即会显示 daily_stock_summary 表。
在搜索栏中,输入
term: "Lead Time",然后按 Enter 键。系统随即会显示 daily_stock_summary 表。
如需查找通过同义词关系关联的资产,请前往术语库页面。
点击全球零售运营术语库。
在左侧导航窗格中,依次点击供应链和物流 > 库存水平 > 安全库存水平。
相关条目会列出所有关联的数据资产。
对于大规模词汇表,请使用 Knowledge Catalog 批量导入功能,通过 JSON 或 CSV 文件以编程方式管理术语。
清理
为避免因本页中使用的资源导致您的 Google Cloud 账号产生费用,请按照以下步骤操作。
删除项目资源
为避免系统因本快速入门中使用的资源向您的 Google Cloud 账号收取费用,请删除您创建的词汇表和数据集。
删除术语表
在 Google Cloud 控制台中,前往 Knowledge Catalog > Glossaries 页面。
点击全球零售运营术语库。
请先删除供应链和物流类别。
删除库存水平类别。
删除所有业务术语。
点击术语库本身的删除。
确认删除操作。
删除 BigQuery 数据集
在 Google Cloud 控制台中,前往 BigQuery 页面。
在探索器面板中,展开您的项目,然后找到 omnichannel_prod 数据集。
点击 omnichannel_prod 数据集旁边的 查看操作,然后选择删除。
在对话框中,输入
delete以确认删除,然后点击删除。
后续步骤
- 了解如何在知识目录中搜索资源。
- 详细了解如何管理业务术语表。
- 了解如何使用方面丰富条目。
- 尝试 Knowledge Catalog 应用场景。