# IoT-Driven Intelligent Scheduling Solution for Industrial Sewing Based on Real-RCPSP Model
## 4 Storing Sewing Data and Transforming into Experimental Datasets
### Data of Production Contracts  
The company's garment contracts signed with partners are stored in the system, including necessary details such as contract name, contract type, partner information, product order type, and the number of products to produce and export. In addition, to facilitate production, businesses must calculate the number of steps necessary to complete each product. Based on information from signed contracts, the garment company will organize sewing lines to produce products according to partners' orders. For example, Table 2 illustrates the primary information of TNG company's sewing contracts [43], information including product name (can include product code and specifications in the name), product name needed to be produced, quantity of products ordered, number of stages to produce a corresponding product. According to product manufacturing requirements, certain stages must be completed in a specific order, with higher priority stages needing to be finished before subsequent stages can be started. Based on actual production data for each product type, contract #1 (as shown in Table 2) includes 1026 priority constraints, while contract #2 has 1894 priority constraints. To carry out these contracts, the enterprise arranged four production teams (sewing lines) with 37, 39, 47, and 41 workers, respectively. This insight is converted into input datasets to assist businesses with automated production planning, ensuring that all prioritization and resource allocation constraints are managed effectively. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**No.** & **Contract** & **Product Type** & **Product Number** & **Number of Task** \\ \hline
1 & WE1190/1698402 Liner Buy Mar 14-F19 & T-shirt & 33,693 & 71 \\
2 & FM4013/1536181 buy 11/11-F19 & Swimming trunks & 83,340 & 137 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Garment contracts [44]. Figure 5: Total working/non-working time of sewing machines. Converting contract data into input data for the scheduling problem is conducted based on data characteristics and constraints in the garment industry, such as:  
* Each production contract signed between a business and a customer may include one or more types of products. * Each type of product has a specific quantity, and each type of product includes many stages of production, with specific constraints on the priority order of performing each stage. Higher-priority stages must be completed before lower-priority stages. * Each production stage requires professional skills and workers to perform. Workers with lower skill levels than required cannot perform that step. On the contrary, only workers with qualifications equal to or above the required level can perform the process. Generally, the higher the worker's skill level, the better the quality or the faster the production can be completed. The characteristics of industrial sewing line data are highly compatible with the input dataset of the Real-RCPSP problem (to be detailed in Section 5). Therefore, digitizing the data from garment contracts and production resource information into a standardized dataset suitable for the Real-RCPSP problem is necessary. The digitalization of sewing line data is carried out according to the following rules:  
* Each garment contract is considered a project and can generate multiple data files depending on the allocation of resources. * Each stage in the sewing line is treated as a task. * The duration of a stage corresponds to the task execution time. * Sewing workers have various skill levels or grades (ranging from 1 to 7), which correspond to skill levels in the MS-RCPSP model. * Each worker is a resource, and each resource is assigned a specific skill level. * The sequence of sewing stages for finished products represents the priority order of task execution.