遇见数据集

Simulated Inventory Management Database and Object-Centric Event Logs for Process Analysis

收藏
Zenodo2025-05-28 更新2026-05-29 收录
官方服务:

资源简介:

Abstract: This repository/dataset provides a suite of Python scripts to generate a simulated relational database for inventory management processes and transform this data into object-centric event logs (OCEL) suitable for advanced process mining analysis. The primary goal is to offer a synthetic yet realistic dataset that facilitates research, development, and application of object-centric process mining techniques in the domain of inventory control and supply chain management. The generated event logs capture common inventory operations, track stock level changes, and are enriched with key inventory management parameters (like EOQ, Safety Stock, Reorder Point) and status-based activity labels (e.g., indicating understock or overstock situations). Overview: Inventory management is a critical business process characterized by the interaction of various entities such as materials, purchase orders, sales orders, plants, suppliers, and customers. Traditional process mining often struggles to capture these complex interactions. Object-Centric Process Mining (OCPM) offers a more suitable paradigm. This project provides the tools to create and explore such data. The workflow involves: Database Simulation: Generating a SQLite database with tables for materials, sales orders, purchase orders, goods movements, stock levels, etc., populated with simulated data. Initial OCEL Generation: Extracting data from the SQLite database and structuring it as an object-centric event log (in CSV format). This log includes activities like "Create Purchase Order Item", "Goods Receipt", "Create Sales Order Item", "Goods Issue", and tracks running stock levels for materials. OCEL Post-processing and Enrichment: Calculating standard inventory management metrics such as Economic Order Quantity (EOQ), Safety Stock (SS), and Reorder Point (ROP) for each material-plant combination based on the simulated historical data. Merging these metrics into the event log. Enhancing activity labels to include the current stock status (e.g., "Understock", "Overstock", "Normal") relative to calculated SS and Overstock (OS) levels (where OS = SS + EOQ). Generating new, distinct events to explicitly mark the moments when stock statuses change (e.g., "START UNDERSTOCK", "ST CHANGE NORMAL to OVERSTOCK", "END NORMAL"). Format Conversion: Converting the CSV-based OCELs into the standard OCEL XML/OCEL2 format using the pm4py library. Contents: The repository contains the following Python scripts: 01_generate_simulation.py: Creates a SQLite database named inventory_management.db. Defines and populates tables including: Materials, SalesOrderDocuments, SalesOrderItems, PurchaseOrderDocuments, PurchaseOrderItems, PurchaseRequisitions, GoodsReceiptsAndIssues, MaterialStocks, MaterialDocuments, SalesDocumentFlows, and OrderSuggestions. Simulates data for a configurable number of materials, customers, sales, purchases, etc., with randomized dates and quantities. 02_database_to_ocel_csv.py: Connects to the inventory_management.db. Executes a SQL query to extract relevant events and their associated objects for inventory processes. Constructs an initial object-centric event log, saved as ocel_inventory_management.csv. Identified object types include: MAT (Material), PLA (Plant), PO_ITEM (Purchase Order Item), SO_ITEM (Sales Order Item), CUSTOMER, SUPPLIER. Calculates "Stock Before" and "Stock After" for each event affecting material stock. Standardizes column names to OCEL conventions (e.g., ocel:activity, ocel:timestamp, ocel:type:<OBJECT_TYPE>). 03_ocel_csv_to_ocel.py: Reads ocel_inventory_management.csv. Uses pm4py to convert the CSV event log into the standard OCEL XML format (ocel_inventory_management.xml). 04_postprocess_activities.py: Reads data from inventory_management.db to calculate inventory parameters: Annual Demand (Dm) Average Daily Demand (dm) Standard Deviation of Daily Demand (σm) Average Lead Time (lm) Economic Order Quantity (EOQ): (2⋅Dm⋅S)/H (where S is fixed order cost, H is holding cost) Safety Stock (SS): z⋅σm⋅lm (where z is the z-score for the desired service level) Reorder Point (ROP): (dm⋅lm)+SS Merges these calculated parameters with ocel_inventory_management.csv. Computes an Overstock level (OS) as SS+EOQ. Derives a "Current Status" (Understock, Overstock, Normal) for each event based on "Stock After" relative to SS and OS. Appends this status to the ocel:activity label (e.g., "Goods Issue (Understock)"). Generates new events for status changes (e.g., "START NORMAL", "ST CHANGE UNDERSTOCK to NORMAL", "END OVERSTOCK") with adjusted timestamps to precisely mark these transitions. Creates a new object type MAT_PLA (Material-Plant combination) for easier status tracking. Saves the enriched and transformed log as post_ocel_inventory_management.csv. 05_ocel_csv_to_ocel.py: Reads the post-processed post_ocel_inventory_management.csv. Uses pm4py to convert this enriched CSV event log into the standard OCEL XML format (post_ocel_inventory_management.xml). Generated Dataset Files (if included, or can be generated using the scripts): inventory_management.db: The SQLite database containing the simulated raw data. ocel_inventory_management.csv: The initial OCEL in CSV format. ocel_inventory_management.xml: The initial OCEL in standard OCEL XML format. post_ocel_inventory_management.csv: The post-processed and enriched OCEL in CSV format. post_ocel_inventory_management.xml: The post-processed and enriched OCEL in standard OCEL XML format. How to Use: Ensure you have Python installed along with the following libraries: sqlite3 (standard library), pandas, numpy, pm4py. Run the scripts sequentially in a terminal or command prompt: python 01_generate_simulation.py (generates inventory_management.db) python 02_database_to_ocel_csv.py (generates ocel_inventory_management.csv from the database) python 03_ocel_csv_to_ocel.py (generates ocel_inventory_management.xml) python 04_postprocess_activities.py (generates post_ocel_inventory_management.csv using the database and the initial CSV OCEL) python 05_ocel_csv_to_ocel.py (generates post_ocel_inventory_management.xml) Potential Applications and Research: This dataset and the accompanying scripts can be used for: Applying and evaluating object-centric process mining algorithms on inventory management data. Analyzing inventory dynamics, such as the causes and effects of understocking or overstocking. Discovering and conformance checking process models that involve multiple interacting objects (materials, orders, plants). Investigating the impact of different inventory control parameters (EOQ, SS, ROP) on process execution. Developing educational materials for teaching OCPM in a supply chain context. Serving as a benchmark for new OCEL-based analysis techniques. Keywords: Object-Centric Event Log, OCEL, Process Mining, Inventory Management, Supply Chain, Simulation, Synthetic Data, SQLite, Python, pandas, pm4py, Economic Order Quantity (EOQ), Safety Stock (SS), Reorder Point (ROP), Stock Status Analysis.

Abstract: 本仓库/数据集提供一套Python脚本,用于生成面向库存管理流程的模拟关系型数据库,并将该数据转换为适用于高级流程挖掘分析的以对象为中心的事件日志(Object-Centric Event Log, OCEL)。本项目的核心目标是提供一组合成但贴合实际的数据集,为库存控制与供应链管理领域内以对象为中心的流程挖掘技术的研究、开发与应用提供支撑。生成的事件日志涵盖常见库存操作,追踪库存水平变化,并补充了核心库存管理参数(如经济订货批量(Economic Order Quantity, EOQ)、安全库存(Safety Stock, SS)、再订货点(Reorder Point, ROP))以及基于状态的活动标签(例如用于标记库存缺货或积压情形)。 Overview: 库存管理是一类关键业务流程,以物料、采购订单、销售订单、工厂、供应商与客户等多实体交互为典型特征。传统流程挖掘往往难以捕捉这类复杂交互关系,而以对象为中心的流程挖掘(Object-Centric Process Mining, OCPM)则提供了更适配的范式。本项目提供了创建与探索此类数据的工具。 工作流程包括: 数据库模拟:生成包含物料、销售订单、采购订单、货物移动、库存水平等数据表的SQLite数据库,并填充模拟数据。 初始OCEL生成:从SQLite数据库中提取数据,并将其构建为以对象为中心的事件日志(以逗号分隔的数值格式(Comma-Separated Values, CSV)存储)。该日志包含"创建采购订单条目"、"货物入库"、"创建销售订单条目"、"货物出库"等活动,并追踪物料的实时库存水平。 OCEL后处理与增强: 针对每个物料-工厂组合,基于模拟的历史数据计算标准库存管理指标,如经济订货批量(EOQ)、安全库存(SS)与再订货点(ROP)。 将上述计算得到的参数合并至事件日志中。 优化活动标签,使其包含基于计算得到的SS与积压阈值(OS = SS + EOQ)的当前库存状态(如缺货、积压、正常)。 生成全新的独立事件,以明确标记库存状态发生变更的时刻,例如"START UNDERSTOCK"、"ST CHANGE NORMAL to OVERSTOCK"、"END NORMAL"。 格式转换:使用pm4py库将基于CSV格式的OCEL转换为标准OCEL XML/OCEL2格式。 Contents: 本仓库包含以下Python脚本: 01_generate_simulation.py: 创建名为inventory_management.db的SQLite数据库。 定义并填充以下数据表:Materials(物料表)、SalesOrderDocuments(销售订单文档表)、SalesOrderItems(销售订单条目表)、PurchaseOrderDocuments(采购订单文档表)、PurchaseOrderItems(采购订单条目表)、PurchaseRequisitions(采购申请单)、GoodsReceiptsAndIssues(货物收发记录表)、MaterialStocks(物料库存表)、MaterialDocuments(物料文档表)、SalesDocumentFlows(销售文档流转表)以及OrderSuggestions(订单建议表)。 基于可配置的物料、客户、销售、采购等参数规模,生成带有随机日期与数量的模拟数据。 02_database_to_ocel_csv.py: 连接至inventory_management.db数据库。 执行SQL查询,提取库存流程相关的事件及其关联对象。 构建初始以对象为中心的事件日志,并保存为ocel_inventory_management.csv。 已识别的对象类型包括:MAT(物料,Material)、PLA(工厂,Plant)、PO_ITEM(采购订单条目,Purchase Order Item)、SO_ITEM(销售订单条目,Sales Order Item)、CUSTOMER(客户)、SUPPLIER(供应商)。 为每个影响物料库存的事件计算"库存前值"与"库存后值"。 将列名标准化为OCEL规范格式,例如ocel:activity、ocel:timestamp、ocel:type:<OBJECT_TYPE>。 03_ocel_csv_to_ocel.py: 读取ocel_inventory_management.csv文件,使用pm4py库将CSV格式的事件日志转换为标准OCEL XML格式(ocel_inventory_management.xml)。 04_postprocess_activities.py: 从inventory_management.db中读取数据,计算以下库存参数: 年需求量(Dm) 日均需求量(dm) 日均需求量标准差(σm) 平均提前期(lm) 经济订货批量(EOQ):(2·Dm·S)/H(其中S为固定订货成本,H为持有成本) 安全库存(SS):z·σm·lm(其中z为对应期望服务水平的z得分) 再订货点(ROP):(dm·lm)+SS 将计算得到的参数合并至ocel_inventory_management.csv中。 计算积压阈值(OS)为SS+EOQ。 基于"库存后值"与SS、OS的相对关系,为每个事件推导"当前库存状态"(缺货、积压、正常)。 将该状态追加至ocel:activity标签中,例如"Goods Issue (Understock)"。 生成用于标记状态变更的新事件(例如"START NORMAL"、"ST CHANGE UNDERSTOCK to NORMAL"、"END OVERSTOCK"),并调整时间戳以精准标记此类状态转换。 新增对象类型MAT_PLA(物料-工厂组合),以简化状态追踪。 将增强并转换后的日志保存为post_ocel_inventory_management.csv。 05_ocel_csv_to_ocel.py: 读取经过后处理的post_ocel_inventory_management.csv文件,使用pm4py库将该增强版CSV格式事件日志转换为标准OCEL XML格式(post_ocel_inventory_management.xml)。 生成的数据集文件(若包含或可通过脚本生成): inventory_management.db:包含模拟原始数据的SQLite数据库。 ocel_inventory_management.csv:初始CSV格式以对象为中心的事件日志。 ocel_inventory_management.xml:初始标准OCEL XML格式以对象为中心的事件日志。 post_ocel_inventory_management.csv:经过后处理与增强的CSV格式以对象为中心的事件日志。 post_ocel_inventory_management.xml:经过后处理与增强的标准OCEL XML格式以对象为中心的事件日志。 How to Use: 使用前请确保已安装Python及以下库:sqlite3(标准库)、pandas、numpy、pm4py。 在终端或命令提示符中按顺序运行以下脚本: python 01_generate_simulation.py(生成inventory_management.db) python 02_database_to_ocel_csv.py(从数据库生成ocel_inventory_management.csv) python 03_ocel_csv_to_ocel.py(生成ocel_inventory_management.xml) python 04_postprocess_activities.py(结合数据库与初始CSV格式OCEL生成post_ocel_inventory_management.csv) python 05_ocel_csv_to_ocel.py(生成post_ocel_inventory_management.xml) Potential Applications and Research: 本数据集与配套脚本可用于以下场景: 在库存管理数据上应用并评估以对象为中心的流程挖掘算法。 分析库存动态,例如缺货或积压的成因与影响。 发现并合规性检查涉及多交互实体(物料、订单、工厂)的流程模型。 研究不同库存控制参数(EOQ、SS、ROP)对流程执行的影响。 开发用于供应链场景下以对象为中心的流程挖掘教学的教育材料。 作为新型基于OCEL的分析技术的基准测试集。 Keywords: 以对象为中心的事件日志(Object-Centric Event Log, OCEL)、流程挖掘、库存管理、供应链、模拟、合成数据、SQLite、Python、pandas、pm4py、经济订货批量(Economic Order Quantity, EOQ)、安全库存(Safety Stock, SS)、再订货点(Reorder Point, ROP)、库存状态分析

提供机构:
Zenodo
创建时间:
2025-05-26
二维码
社区交流群
二维码
科研交流群
商业服务