Medicine factory layout planning method and system based on AI multi-source data
By collecting and integrating material and personnel flow data in pharmaceutical factories and using graph neural networks and clustering algorithms to optimize the layout of pharmaceutical factories, the problem of insufficient multi-source data integration in traditional methods is solved, efficient and safe factory planning is achieved, pollution risks are reduced, and space utilization efficiency is improved.
Patent Information
- Application Number
- CN202510679232.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional pharmaceutical plant layout planning methods have difficulty integrating multi-source dynamic data in real time, resulting in redundant connections between functional areas, inefficient space utilization, and insufficient pollution risk control, failing to meet the modern pharmaceutical industry's needs for efficiency, safety, and scalability.
The material flow and personnel flow data of the pharmaceutical factory are collected, and a dynamic flow feature set is generated through time series coding. Then, spatiotemporal alignment and standardization are performed. The spatiotemporal correlation paths between functional areas are extracted using graph neural networks, and the connection model is pruned and reconstructed. The clean area and non-clean area are divided using clustering algorithms, and a spatial optimization model is constructed for layout planning.
Significantly improve the rationality and safety of plant layout, reduce the risk of cross-contamination, enhance the efficiency of space resource utilization, and take into account the dynamic adaptability of production processes and the scalability of future production expansion.
Smart Images

Figure CN120633909A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of pharmaceutical plant management, and in particular relates to a pharmaceutical plant layout planning method and system based on AI multi-source data. Background Art
[0002] Pharmaceutical plant layout planning is a key link in the pharmaceutical industry, directly related to production efficiency, compliance and sustainable development.
[0003] Traditional design methods rely primarily on manual experience or static mathematical models, making them incapable of addressing the dynamic changes and complex interactions inherent in actual production. For example, dynamic data such as material transportation routes and personnel movement trajectories often fluctuate in real time due to adjustments to production plans or changes in equipment operating status. Existing technologies lack the ability to effectively integrate this multi-source, heterogeneous data, resulting in redundant connections between functional areas and inefficient space utilization.
[0004] At the same time, traditional layout design usually adopts fixed rules or simple thresholds when dividing clean areas and non-clean areas, failing to fully consider the spatiotemporal characteristics of the actual interaction intensity between areas, which can easily lead to insufficient pollution risk control or limited flexibility for future production expansion.
[0005] Although artificial intelligence technology has been applied in industrial layout optimization in recent years, existing solutions mostly focus on a single data source or static scenarios, and have not yet solved core issues unique to pharmaceutical factories, such as dynamic data fusion, critical path sparsification, and coordinated optimization of pollution prevention and control.
[0006] Therefore, there is an urgent need for a technical solution that can integrate multi-source dynamic data in real time, accurately quantify regional interactions, and achieve dynamic layout optimization and risk control based on intelligent algorithms to meet the modern pharmaceutical industry's urgent needs for efficient, safe, and scalable plant layouts. Summary of the Invention
[0007] Based on this, it is necessary to provide a pharmaceutical plant layout planning method and system based on AI multi-source data to address the above technical problems.
[0008] In a first aspect, the present application provides a pharmaceutical plant layout planning method based on AI multi-source data, comprising: S1. Collect material flow data and personnel flow data in the pharmaceutical factory, perform time series coding on the material flow data and personnel flow data, and generate a dynamic flow feature set; S2, perform spatiotemporal alignment and standardization on the dynamic flow feature set to generate a flow data matrix with unified spatiotemporal dimensions; S3. Based on the flow data matrix, the graph neural network is used to extract the spatiotemporal correlation paths between the functional areas of the pharmaceutical factory and generate an initial connection weight graph; S4. Perform threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges; S5. Based on the connection weight distribution in the functional area connection model, the clean area and the non-clean area are divided by a clustering algorithm to generate a division result; S6. Based on the partitioning results, a spatial optimization model is constructed and the spatial optimization model is solved to obtain a set of spatial coordinates; S7. Evaluate the reserved space for expansion and pollution risk based on the spatial coordinate set and functional area connection model to obtain evaluation results; generate a pharmaceutical plant layout plan based on the evaluation results.
[0009] Preferably, the S1 includes: S11, collecting material transportation paths, timestamps, and transportation volumes through an RFID sensor network to obtain material flow data; S12. Collecting the movement trajectory coordinates and residence time of personnel through UWB positioning technology to obtain the personnel flow data; S13. Integrate the material flow data and the personnel flow data to obtain the dynamic flow feature set.
[0010] Preferably, the S2 includes: S21. Using a dynamic time warping algorithm, align the time windows of the material flow data and the personnel flow data in the dynamic flow feature set to a uniform granularity to obtain a time-aligned feature set. S22. Perform dimension normalization processing on the data in the time-aligned feature set using a normalization formula to obtain a normalized feature set; the normalization formula is: Among them, z is the standardized value, x is the original data value, μ is the data mean, and σ is the standard deviation; S23. Construct the flow data matrix based on the data of the standardized feature set; the dimension of the flow data matrix is the product of the number of time windows and the number of regional nodes of the pharmaceutical factory area, and the matrix element values of the flow data matrix represent the flow intensity of each of the regional nodes within each of the time windows.
[0011] Preferably, the S3 includes: S31, taking the flow data matrix as input, constructing a spatiotemporal graph neural network based on the ST-GNN model; S32. Extract the spatiotemporal feature vector of the regional node through the spatiotemporal convolution layer in the ST-GNN model; the calculation formula of the spatiotemporal convolution layer is: in, Indicates the The input feature matrix of the layer, For the The output feature matrix of the layer, For the graph convolution kernels, For the Tier The weight matrix of the convolution kernel, is the total number of convolution kernels, σ(·) is the activation function using the ReLU function, and * represents the graph convolution operation; S33. Based on the spatiotemporal feature vector, a graph attention mechanism is used to calculate the weights between the regional nodes to generate the initial connection weight graph; wherein the adjacency matrix element values of the initial connection weight graph represent the interaction strength between the regional nodes.
[0012] Preferably, the S4 includes: S41, setting the quantile of the edge weight of the initial connection weight graph as the connection strength threshold; S42, deleting connection edges in the initial connection weight graph that are lower than the connection strength threshold to obtain a pruned intermediate connection graph; S43, sorting the remaining edges in the intermediate connection graph in descending order of weight value, and selecting the edge with the highest weight using the Kruskal algorithm to construct a minimum spanning tree; S44. Generate the functional area connection model based on the minimum spanning tree.
[0013] Preferably, the S5 includes: S51. Based on the functional area connection model, extract the sum of the connection weights of each area to generate an area density feature vector, where the element value of the area density feature vector is the cumulative sum of the connection weights of the corresponding area and the remaining areas; S52, clustering the regional density feature vectors using a density clustering algorithm based on a preset neighborhood radius and a minimum number of samples to generate a regional cluster label set; S53, dividing the areas belonging to the same cluster into clean areas or non-clean areas according to the regional clustering label set, including: Calculate the average connection weights of the clean area cluster and the non-clean area cluster, respectively denoted as w clean and w nonclean ; If the w of the cluster to which region j belongs clean >w nonclean And w clean With w nonclean If the difference exceeds the preset threshold, the marked area j is the clean area; S54: Outputting the clean area division result and the non-clean area division result.
[0014] Preferably, the S6 includes: S61. Constructing the linear programming objective function ,in, For the region and The Euclidean distance of Connect the areas in the model for the functional areas and The connection weight of S62: Extract the clean area label set C according to the clean area and non-clean area division result. clean and non-clean area label set C nonclean ; For any region i∈C clean and region j∈C nonclean , add constraints ;in, is the preset minimum safety distance; S63, iteratively calculating the region coordinates based on the linear programming objective function and the constraint conditions until all constraints are met and the optimal coordinate set of all regions is output.
[0015] Secondly, this application also provides a pharmaceutical plant layout planning system based on AI multi-source data, including: The data collection and coding module is used to collect material flow data and personnel flow data in the pharmaceutical factory area, perform time series coding on the material flow data and personnel flow data, and generate a dynamic flow feature set; The spatiotemporal unification module is used to align and standardize the dynamic flow feature set in time and space to generate a flow data matrix with unified spatiotemporal dimensions; The spatiotemporal correlation extraction module is used to extract the spatiotemporal correlation paths between functional areas of the pharmaceutical factory based on the flow data matrix through a graph neural network to generate an initial connection weight graph; The model optimization module is used to perform threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges; The area division module is used to divide the clean area and the non-clean area by clustering algorithm according to the connection weight distribution in the functional area connection model and generate the division results; The spatial optimization module is used to construct a spatial optimization model based on the partitioning results, and solve the spatial optimization model to obtain a set of spatial coordinates; The evaluation and planning module is used to evaluate the reserved space for expansion and pollution risks based on the spatial coordinate set and functional area connection model, and obtain evaluation results; based on the evaluation results, a pharmaceutical plant layout plan is generated.
[0016] In a third aspect, the present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements a pharmaceutical plant layout planning method based on AI multi-source data as in the first aspect.
[0017] In a fourth aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
[0018] In a fifth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a pharmaceutical plant layout planning method based on AI multi-source data as in the first aspect.
[0019] Beneficial effects: The method and system of the present invention collect and integrate multi-source dynamic data such as material flow and personnel flow in pharmaceutical factories, use spatiotemporal alignment and standardization processing to build a unified flow data model, and use graph neural networks to extract spatiotemporal correlation paths between regions to generate an initial connection weight graph. Further, redundant connections are eliminated through threshold pruning and key path reconstruction to form a sparse functional area interaction model, and a clustering algorithm based on connection weight distribution is used to achieve accurate division of clean areas and non-clean areas. Finally, relying on spatial optimization models and pollution risk assessments, a plant layout plan is dynamically generated, thereby significantly improving the rationality and safety of the plant layout, reducing the risk of cross-contamination, and enhancing the efficiency of spatial resource utilization, while taking into account the dynamic adaptability of the production process and the scalability of future production expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of a process flow of a pharmaceutical plant layout planning method based on AI multi-source data provided by the present invention; Figure 2 Schematic diagram of the process of step S4 in an optional embodiment of the present invention; Figure 3 This is a structural schematic diagram of a pharmaceutical plant layout planning system based on AI multi-source data provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0023] refer to Figure 1 , which presents a flow chart of a pharmaceutical plant layout planning method based on AI multi-source data provided by this application, which includes the following steps: S1. Collect material flow data and personnel flow data in the pharmaceutical factory area, encode the material flow data and personnel flow data into time series, and generate a dynamic flow feature set.
[0024] Specifically, material flow data covers the entire process, including the flow of raw materials from suppliers to storage locations within the factory, the transfer of materials between production processes, and the logistics path from the finished product warehouse to the shipping area. This data can be collected through sensors installed on transport vehicles, conveyor belts, and material turnover containers, as well as records from the warehouse management system. It can accurately track parameters such as the real-time location, movement speed, and flow rate of materials within the factory. Personnel flow data can involve the movement of employees from the factory entrance to their respective workstations, and between different functional areas. This data can be collected using the factory's intelligent monitoring system, the positioning badges worn by employees, or the positioning function of mobile devices to obtain key indicators such as the location information, movement direction, and speed of personnel over different time periods.
[0025] The collected material and personnel flow data is time-series encoded. Time-series encoding arranges the data in chronological order and assigns a corresponding timestamp to each data point, thereby reflecting the data's dynamic changes over time. For example, when materials are transferred between specific processes on a production line, time-series encoding can record the material's position at each point in time, showing the complete movement of the material from its starting point to its destination. This encoded data is then integrated into a set of dynamic flow features, providing a standardized data format for subsequent spatiotemporal alignment and data processing.
[0026] S2. Perform spatiotemporal alignment and standardization on the dynamic flow feature set to generate a flow data matrix with unified spatiotemporal dimensions.
[0027] Specifically, the purpose of spatiotemporal alignment is to ensure the consistency of material flow data and personnel movement data in terms of time and space coordinates, so that data from different sources can be integrated and analyzed within the same spatiotemporal framework. Specifically, temporal alignment resamples the data at a uniform time interval (such as every minute, every hour, etc.) to adjust all data points to the same time scale. Missing data points can be filled using methods such as linear interpolation or polynomial interpolation; data points that exceed the time range are truncated. Spatial alignment converts the location information from different data sources into the same coordinate system based on the geographic coordinate system within the factory, eliminating positional deviations caused by differences in coordinate systems and ensuring the spatial accuracy of the data.
[0028] Standardization is intended to eliminate the dimensional differences and numerical range differences between different data indicators, making the data comparable and processable. Common data standardization methods such as Z-Score standardization or Min-Max standardization are used. Z-Score standardization converts the data into a standard normal distribution by calculating the mean and standard deviation of the data; Min-Max standardization linearly maps the data to [0,1] or other specified intervals. In this step, indicators such as flow rate and speed in material flow data and indicators such as movement speed and personnel density in personnel movement data are standardized separately. The data after spatiotemporal alignment and standardization are integrated into a flow data matrix. The matrix uses time and spatial position as dimensions, and each element stores the standardized flow characteristic value of the corresponding position and time point, providing unified and standardized data input for the subsequent use of graph neural networks to extract spatiotemporal correlation paths.
[0029] S3. Based on the flow data matrix, the spatiotemporal correlation paths between the functional areas of the pharmaceutical factory are extracted through the graph neural network to generate the initial connection weight graph.
[0030] Specifically, Graph Neural Network (GNN) is a deep learning model specifically designed to process graph-structured data. It can effectively capture the complex relationships and dependency structures between nodes (representing functional areas of the factory in this scenario).
[0031] During implementation, the factory was first divided into multiple functional areas, such as production, storage, office, and quality inspection, and these functional areas served as nodes in the graph neural network. Data from the flow data matrix was then input into the network as edge weights between nodes, reflecting the intensity of material and personnel flows between functional areas, as well as the spatiotemporal correlations of these flows. The graph neural network aggregates and updates node and edge features through iterative computations across multiple layers. At each layer of the network, a node aggregates feature information from its neighboring nodes (i.e., functional areas with which it has direct flow relationships) and updates this information based on its own features, thereby gradually capturing long-range, high-order spatiotemporal correlations between functional areas.
[0032] Specifically, graph convolution operations in graph neural networks aggregate the features of neighboring nodes using specific aggregation functions (such as summation and averaging), linearly transform the aggregated features using a learnable weight matrix, and incorporate nonlinear activation functions (such as ReLU) to increase the model's expressiveness. After multiple layers of graph convolution, the network can learn potential spatiotemporal correlation paths between functional areas. These paths not only reflect direct material and personnel flow relationships, but also indirect connections caused by factors such as production processes and personnel work patterns.
[0033] Ultimately, the graph neural network outputs an initial connection weight graph, presented as a matrix. Each element in this weight graph represents the connection weight between two functional areas. Larger weights indicate a stronger spatiotemporal correlation between the two. For example, the connection weight between the production area and the storage area might be high due to the frequent material transfer and personnel exchanges between them. The connection weight between the office area and the quality inspection area might be relatively low, but if there are regular inspection processes or data exchanges, there will also be a certain weight. This initial connection weight graph intuitively displays the complex relationship network between the functional areas of the factory, providing a foundation for subsequent threshold pruning and critical path reconstruction.
[0034] S4. Perform threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges.
[0035] Specifically, after obtaining the initial connection weight graph, threshold pruning and key path reconstruction are performed on the initial connection weight graph to simplify the model structure and highlight key spatiotemporal correlation paths, generating a functional area connection model with sparse edges. The core of threshold pruning is to set a weight threshold, which is used to filter out functional area connections with strong correlations and remove connections with lower weights and weaker correlations. The threshold can be determined based on a statistical analysis of the initial connection weight graph, such as selecting the median of the weight distribution or the mean plus or minus a certain multiple of the standard deviation as the threshold. In practice, all weight values in the initial connection weight graph can be sorted and their distribution analyzed. Then, an appropriate threshold can be selected based on the specific needs of the plant layout planning and the desired connection sparsity. For example, if a relatively simplified model is desired while retaining key correlations, a higher threshold can be selected; if more connection details are required, a lower threshold can be selected.
[0036] Based on a set threshold, edges in the initial connection weight graph are pruned, retaining edges with weights greater than the threshold and removing edges with weights less than or equal to the threshold. This pruned connection graph retains only the important spatiotemporal paths between the plant's functional areas. However, the graph may still contain some disconnected areas or disconnected paths. Therefore, a further reconstruction of critical paths is performed to ensure connectivity and logical rationality between functional areas.
[0037] Critical path reconstruction can be performed using a variety of methods, such as reconstructing connection paths based on shortest path algorithms (such as Dijkstra's or Floyd's algorithms) or optimizing path flow distribution using network flow algorithms. In this step, critical paths are identified and enhanced within the pruned connection graph, ensuring connectivity between functional areas and meeting the basic production and operational processes of the plant. For example, even if material transport paths or personnel passages are essential to the production process and have low initial weights, these paths will be retained and optimized through reconstruction to ensure normal production operations.
[0038] After threshold pruning and critical path reconstruction, a functional area connection model with sparse edges was ultimately obtained. This model presents the core spatiotemporal relationships between the plant's functional areas in a more concise and intuitive manner, highlighting key logistics and personnel flow pathways while removing redundant connecting edges. This provides a clearer and more efficient model foundation for subsequent clean and non-clean area delineation and spatial optimization, helping to improve the scientific nature and feasibility of plant layout planning.
[0039] S5. Based on the connection weight distribution in the functional area connection model, the clean area and the non-clean area are divided by a clustering algorithm to generate a division result.
[0040] Specifically, a clustering algorithm is an unsupervised learning method that divides data points into clusters (in this scenario, corresponding to clean and unclean areas) based on similarity or distance metrics. In this step, each functional area in the functional area connection model is treated as a data point, and the connection weight is used as a metric to measure the similarity or association between functional areas. Functional areas with larger connection weights are more likely to be classified into the same category during the clustering process.
[0041] Select a clustering algorithm that suits the factory layout characteristics and division requirements, such as the K-Means algorithm, DBSCAN algorithm, or a hierarchical clustering algorithm. The K-Means algorithm randomly initializes cluster centers using a predefined number of clusters (2 in this scenario, i.e., clean areas and non-clean areas). It then iteratively assigns functional areas to the nearest cluster center and updates the position of the cluster center until convergence. The DBSCAN algorithm, based on the concept of density, can automatically identify clusters of different densities and is well-adapted to the irregularly shaped clean and non-clean areas that may exist in the factory. The hierarchical clustering algorithm constructs a hierarchically nested cluster structure, allowing users to select the appropriate division level and number of clusters based on actual needs.
[0042] During the clustering process, the distance or similarity metric between each functional area is calculated based on the distribution of connection weights in the functional area connection model of the plant. For example, 1-connection weight can be used as a distance metric. The larger the connection weight, the smaller the distance, indicating a stronger correlation between the functional areas and the greater the likelihood that they belong to the same category. Through the calculation of the clustering algorithm, the functional areas of the plant are ultimately divided into two clusters: clean areas and non-clean areas, generating a partitioning result. This partitioning result not only considers the strength of the logistics and human flow connections between the functional areas, but also incorporates factors such as the plant's production process and hygiene requirements. This provides a clear basis for regional division for the subsequent construction of the spatial optimization model, facilitates the rational planning of the spatial layout within the plant, ensures the environmental quality and production safety of the clean areas, and improves the operational efficiency and resource utilization of the non-clean areas.
[0043] S6. Based on the division results, a spatial optimization model is constructed, and the spatial optimization model is solved to obtain a set of spatial coordinates.
[0044] Specifically, the spatial optimization model aims to determine the optimal location and layout of each functional area within the plant's geographic space to meet multiple objectives, including production and operational needs, environmental safety requirements, space for expansion, and pollution risk control. The model is based on the plant's geographic information data and combines the connection weight distribution in the functional area connectivity model with the delineation of clean and non-clean areas to define decision variables, objective functions, and constraints.
[0045] Decision variables primarily represent the spatial coordinates of each functional area (such as longitude and latitude, or relative coordinates within the plant), as well as the shape and size parameters of the functional area. Objective functions can be designed based on the specific goals of the plant layout plan, including minimizing material and personnel transportation costs, maximizing collaborative efficiency between functional areas, optimizing plant space utilization efficiency, and reducing environmental pollution risks. For example, a transportation cost objective function can be constructed by calculating the weighted sum of the distance between functional areas and the volume of logistics and personnel flow. A collaborative efficiency objective function can be constructed based on the connection weights in the functional area connection model, measuring the spatial closeness and ease of collaboration between functional areas.
[0046] Constraints encompass plant boundary restrictions, land use planning requirements, building codes, environmental regulations, and separation distance requirements between clean and non-clean areas. For example, functional areas must be located within the plant's legal land use boundaries, building density and heights within different functional areas must comply with local planning regulations, and a minimum safe distance must be maintained between clean and non-clean areas to prevent cross-contamination. These constraints ensure the feasibility and legality of space optimization solutions.
[0047] When solving a spatial optimization model, appropriate optimization algorithms, such as linear programming, genetic algorithms, and particle swarm optimization, are selected based on the model's characteristics and scale. Linear programming algorithms are suitable for models where the objective function and constraints are linearly related and can quickly find the global optimal solution. Genetic algorithms and particle swarm optimization algorithms are more suitable for handling complex nonlinear and multimodal optimization problems, gradually searching for the optimal solution space by simulating biological evolution or particle motion. The optimization algorithm calculates a set of spatial coordinates, which provides specific geographic coordinates and layout parameters for each functional area within the plant. This sets the ideal location, shape, and size of each functional area within the plant, provides precise planning guidance for the plant's on-site construction and renovation, and helps achieve a scientific, rational, and efficient plant layout.
[0048] S7. Evaluate the reserved space for expansion and pollution risk based on the spatial coordinate set and functional area connection model to obtain evaluation results; generate a pharmaceutical plant layout plan based on the evaluation results.
[0049] Specifically, when assessing the space reserved for expansion, the focus is on analyzing the available land resources within the plant, the compactness of the functional area layout, and the scalability between functional areas. Using a spatial coordinate set, the location and area of vacant land within the plant are determined to assess whether they meet the land requirements for future expansion. Furthermore, the connection weight distribution within the functional area connectivity model is combined to analyze whether the existing functional area layout is conducive to future expansion. For example, whether the production area is easily expandable along logistics routes, and whether the storage area has sufficient space to accommodate additional inventory, etc. For pollution risk assessment, the plant's functional area layout, material flow paths, and pollution emission sources during the production process are comprehensively considered. Based on the spatial coordinate set and the functional area connectivity model, the spatial distances and the strength of logistics and personnel connections between potential pollution sources (such as production workshops and wastewater treatment facilities) and sensitive areas (such as clean areas and office areas) are analyzed to assess the likelihood and risk of pollution spread. For example, if the distance between production workshops and clean areas is too close and there is a lack of effective isolation measures, there is a high risk of cross-contamination. If the wastewater treatment facilities within the plant are located upstream of the groundwater, there may be a pollution threat to the plant and surrounding groundwater environment.
[0050] After completing the assessment of reserved space for expansion and pollution risks, the results are integrated to develop a pharmaceutical plant layout plan. The layout plan details the specific location, floor space, building form, interconnectedness, and logistics and personnel flow paths of each functional area within the plant. During the planning process, the need for reserved space for expansion is fully considered, and land and infrastructure interfaces are appropriately reserved to ensure that the plant can flexibly cope with future production expansion. At the same time, corresponding protective measures are implemented for assessed pollution risk points, such as adding isolation zones, optimizing the location and treatment capacity of pollution treatment facilities, and adjusting logistics routes to reduce the intersection of pollution sources and sensitive areas. These measures minimize the environmental impact of plant operations, safeguard the health and safety of plant workers, and ensure the sustainable development of the surrounding ecological environment. The resulting pharmaceutical plant layout plan not only meets current production and operation needs, but also demonstrates excellent foresight and environmental friendliness, providing a scientific and reasonable spatial layout solution for the long-term and stable development of the pharmaceutical plant.
[0051] The above-mentioned pharmaceutical plant layout planning method based on AI multi-source data collects and integrates multi-source dynamic data such as material flow and personnel flow in the pharmaceutical plant, uses spatiotemporal alignment and standardization processing to build a unified flow data model, and combines graph neural networks to extract spatiotemporal correlation paths between regions to generate an initial connection weight graph. It further eliminates redundant connections through threshold pruning and key path reconstruction to form a sparse functional area interaction model, and realizes the precise division of clean areas and non-clean areas based on the clustering algorithm of connection weight distribution. Finally, it relies on spatial optimization models and pollution risk assessment to dynamically generate plant layout plans, thereby significantly improving the rationality and safety of plant layout, reducing cross-contamination risks, and enhancing the efficiency of spatial resource utilization, while taking into account the dynamic adaptability of production processes and the scalability of future production expansion.
[0052] In an optional embodiment, S1 includes the following steps: S11. Collect material transportation routes, timestamps, and transportation volumes through the RFID sensor network to obtain material flow data.
[0053] Specifically, during the data collection phase of pharmaceutical plant layout planning, a network of RFID (radio frequency identification) sensors is used to collect material flow data and record details of material transportation within the plant. RFID readers are deployed at key locations within the plant (such as entrances and exits to the raw material warehouse, transfer points between production lines, and finished product storage areas). These readers work in conjunction with RFID tags attached to material circulation containers or transport vehicles. When tagged materials pass through the reader, the reader automatically recognizes and records information such as the material's unique identifier, transportation timestamp, and transportation volume. This data is transmitted in real time to the data processing center via the plant's local area network, providing a precise material flow trajectory for subsequent analysis.
[0054] Transport timestamps can be accurately recorded down to the second, completely recording the arrival and departure times of materials at key nodes. This allows calculation of material transport duration along each route and identification of potential bottlenecks in the logistics process. Transport volume information covers the type and quantity of materials transported during each shipment. By analyzing fluctuations in transport volume over different time periods, the peaks and valleys of material flow within the factory can be identified, providing a basis for optimizing material storage and allocation. For example, a surge in transport volume for a particular raw material before a month-end inventory count may indicate the need to adjust procurement or production plans for that material to avoid inventory backlogs or shortages.
[0055] S12. Collect the movement trajectory coordinates and residence time of personnel through UWB positioning technology to obtain personnel flow data.
[0056] Specifically, UWB (ultra-wideband) positioning technology is used to collect personnel movement data and achieve high-precision, real-time positioning of factory personnel. UWB positioning base stations are deployed in key areas within the factory, such as production workshops, warehouses, office areas, and quality testing laboratories, to form a positioning network. Factory personnel wear badges or positioning bracelets with integrated UWB tags, which periodically transmit signals to the positioning base stations. Upon receiving the signals, the positioning base stations leverage the high temporal resolution of UWB signals to precisely measure the time difference of arrival of the signals and calculate the real-time 2D or 3D coordinates of the personnel within the factory.
[0057] The time employees spend in each area is also recorded and, combined with their movement trajectory coordinates, allows for a comprehensive understanding of their work rhythms and behavioral patterns. For example, if an employee spends significantly longer than average time in a particular production process area, this may indicate operational difficulties or equipment failures in that process, requiring timely intervention. Dwell time data can also be used to assess the efficiency of personnel use of different work areas, providing support for optimizing factory staffing and workflows.
[0058] S13. Integrate the material flow data and the personnel flow data to obtain a dynamic flow feature set.
[0059] Specifically, after preliminary processing of the collected material flow data and personnel flow data, the data collected by RFID and UWB are cleaned to remove obvious errors or duplicate records (such as abnormal coordinates and disordered timestamps caused by signal interference), and the material data and personnel data are integrated into the same framework.
[0060] The integrated dynamic flow feature set is stored as a multidimensional array, with each element associated with a unique timestamp. This data contains comprehensive information at that moment, including material transportation routes, transportation volumes, personnel movement coordinates, and dwell time. For example, at a specific point in time, the data records not only the route and quantity of a batch of raw materials from the warehouse to the production line, but also the distribution and activity status of workers along the route. This comprehensive dataset provides a comprehensive data foundation for subsequent in-depth analysis of plant layout planning, ensuring that planning solutions fully consider the interplay of various dynamic activities within the plant.
[0061] In an optional embodiment, S2 includes the following steps: S21. Use a dynamic time warping algorithm to align the time windows of material flow data and personnel flow data in the dynamic flow feature set to a uniform granularity to obtain a time-aligned feature set.
[0062] Specifically, when processing dynamic flow feature sets, the Dynamic Time Warping (DTW) algorithm is used to align the time windows of material flow data and personnel flow data to a uniform granularity, generating a time-aligned feature set. The DTW algorithm aligns different time series at key feature points by stretching or compressing the time axis. This algorithm is suitable for addressing time axis inconsistencies in factory material and personnel flow data caused by factors such as differences in collection equipment and data processing delays.
[0063] Specifically, first determine a unified time granularity, such as 15 minutes. Time-regularize the material flow data and personnel flow data separately, and map the data points that are not in this time granularity to the nearest time point through interpolation methods (such as linear interpolation). For missing data points, reasonable estimates are made based on the change trends of adjacent data points to fill in the gaps. After this processing, the time alignment feature set ensures the consistency of material and personnel flow data in the same time frame, laying the foundation for subsequent dimensional normalization processing and matrix construction. For example, if the time of a material transportation record is 9:07, and the unified time granularity is 15 minutes, it will be mapped to the 9:15 time window, and the transportation volume at that moment will be estimated based on the data trends at 9:00 and 9:15, thereby achieving time unification of the data.
[0064] S22. Perform dimension normalization on the data in the time-aligned feature set using a normalization formula to obtain a normalized feature set. The normalization formula is: Among them, z is the standardized value, x is the original data value, μ is the data mean, and σ is the standard deviation.
[0065] Specifically, the mean μ reflects the central tendency of the data, while the standard deviation σ measures the degree of dispersion of the data. Using this formula, raw data such as material transportation volume and personnel movement speed can be converted into standard normal distribution data with a mean of 0 and a standard deviation of 1.
[0066] For example, let's assume that the mean of material transport volume data for a certain period is 500 kg, with a standard deviation of 100 kg. If the transport volume at a certain moment is 600 kg, the normalized value is z = (600 − 500) / 100 = 1. This indicates that the transport volume at that moment was 1 standard deviation above the mean. Normalized data gives different features the same value scale, ensuring that when constructing the flow data matrix, each feature contributes equally to the matrix element value. This prevents certain features from dominating the matrix due to their large value range, obscuring other key information.
[0067] S23. Based on the data of the standardized feature set, a flow data matrix is constructed; the dimension of the flow data matrix is the product of the number of time windows and the number of regional nodes in the pharmaceutical factory area, and the matrix element values of the flow data matrix represent the flow intensity of each regional node within each time window.
[0068] Specifically, the factory is divided into multiple functional areas (such as warehouses, production workshops, and office buildings), each of which is considered a regional node. Time windows are divided according to the aforementioned unified granularity, for example, a day is divided into 96 15-minute windows.
[0069] The matrix element values represent the flow intensity at each regional node within a specific time window. For each time window and regional node, the flow intensity is calculated by comprehensively considering factors such as the material transport volume and personnel movement in and out of the region during that period. For example, within a 15-minute window, a production workshop node has an inflow of 200 kg and an outflow of 150 kg, with 15 personnel entering and 10 leaving. This data is weighted and summed (weights can be set based on actual business importance, such as 0.7 for material transport and 0.3 for personnel movement) to obtain the flow intensity value for that node within that time window. The resulting flow data matrix comprehensively quantifies the level of logistics and personnel activity at each regional node within the factory during different time windows in numerical form. This provides an accurate and unified data foundation for the subsequent extraction of spatiotemporal correlation paths using graph neural networks, ensuring that the model input data accurately reflects the actual dynamic flow conditions within the factory.
[0070] In an optional embodiment, S3 includes the following steps: S31. Take the flow data matrix as input and build a spatiotemporal graph neural network based on the ST-GNN model.
[0071] Specifically, during the generation of the initial connection weight graph, the flow data matrix is first used as input to construct a spatio-temporal graph neural network (ST-GNN) model. The ST-GNN model is a deep learning architecture specifically designed for processing spatio-temporal graph data, capable of simultaneously capturing both the spatial dependencies and temporal evolution patterns between nodes (i.e., nodes within plant areas).
[0072] The flow data matrix is converted into graph-structured data, where each regional node represents a functional area within the plant. The edges between nodes represent the flow relationships between regions, with edge weights determined by flow intensity. The input layer of the ST-GNN model receives this graph-structured data and converts it into node feature vectors. These feature vectors not only contain the flow intensity of the current time window but also integrate flow information from historical time windows, providing a foundation for subsequent spatiotemporal feature extraction.
[0073] S32. Extract the spatiotemporal feature vector of the regional node through the spatiotemporal convolution layer in the ST-GNN model. The calculation formula of the spatiotemporal convolution layer is: in, Indicates the The input feature matrix of the layer, For the The output feature matrix of the layer, For the graph convolution kernels, For the Tier The weight matrix of the convolution kernel, is the total number of convolution kernels, σ(·) is the activation function using the ReLU function, and * represents the graph convolution operation.
[0074] Specifically, the spatiotemporal feature vectors of regional nodes are extracted through the spatiotemporal convolutional layer in the ST-GNN model. The core of the spatiotemporal convolutional layer is to combine convolution operations in spatial and temporal dimensions to capture the complex patterns of nodes in time and space.
[0075] For this formula, It is The input feature matrix of the layer contains the feature vectors of the nodes in each region of the current layer; It is The output feature matrix of the layer represents the updated feature vector; It is Graph convolution kernels are used to capture different spatial relationships between nodes; It is Tier The weight matrix of the convolution kernel is used to learn the linear combination of features; is the total number of convolution kernels, which determines the number of features extracted from different spatial angles; σ(·) is the activation function, which uses the ReLU function to introduce nonlinearity into the model, enabling the network to learn complex feature patterns; “*” represents the graph convolution operation, which applies the convolution kernel to graph structure data.
[0076] Specifically, the graph convolution operation updates the node’s feature vector by aggregating the node’s own features and the features of its neighboring nodes. Each convolution kernel Feature aggregation from different spatial relationship perspectives, weight matrix Then learn how to perform weighted combination of these aggregated features. After ReLU activation, the output feature matrix Contains richer spatiotemporal feature information. The stacking of multiple spatiotemporal convolutional layers enables the model to gradually extract high-level spatiotemporal feature vectors. These vectors not only reflect the current flow status of regional nodes, but also integrate historical flow patterns and spatial correlation information.
[0077] S33. Based on the spatiotemporal feature vector, the graph attention mechanism is used to calculate the weights between the nodes in each region to generate an initial connection weight graph; wherein the adjacency matrix element values of the initial connection weight graph represent the interaction strength between the nodes in each region.
[0078] Specifically, the graph attention mechanism dynamically assigns attention weights to each pair of nodes by measuring the correlation between node pairs, reflecting the interaction strength between regional nodes.
[0079] In the specific implementation, for each pair of regional nodes , calculate their attention scores , the formula is as follows: in, and Node and nodes The spatiotemporal eigenvector of ; is a learnable weight matrix used to map the concatenated feature vector to the attention score; Represents the concatenation operation of the feature vector; LeakyReLU is an activation function that allows a small number of negative values to pass through to avoid gradient disappearance.
[0080] After calculating the attention scores of all node pairs, the softmax function is used for normalization to obtain the attention weight matrix A: in, is a node The set of neighbor nodes.
[0081] Finally, by multiplying the attention weight matrix A with the adjacency matrix of the original graph structure, the adjacency matrix W of the initial connection weight graph is obtained: in, This is an adjacency matrix initialized from the original flow data matrix. The elements of this adjacency matrix represent the strength of interaction between regional nodes. Edges with larger weights indicate stronger connections between two regional nodes. For example, the weight between the production area and the storage area might be higher due to the frequent flow of materials and personnel between them. The initial connection weight map intuitively displays the complex network of relationships between the various functional areas of the factory, providing a foundation for subsequent threshold pruning and critical path reconstruction, helping to identify key logistics and personnel flow channels in the factory layout and potential optimization directions.
[0082] refer to Figure 2 In an optional embodiment, S4 includes the following steps: S41. Set the quantile of the edge weight of the initial connection weight graph as the connection strength threshold.
[0083] Specifically, when optimizing the initial connection weight graph, the quantile of the edge weights in the initial connection weight graph is first set as the connection strength threshold. The quantile is selected based on a statistical analysis of the weight distribution in the initial connection weight graph. For example, the 25th or 20th quantile can be used as the threshold. This threshold is determined to balance the sparsity of connection edges with the degree of information retention. If the threshold is too high, too many important connection edges may be deleted, resulting in the loss of critical paths. If the threshold is too low, redundant connections cannot be effectively removed.
[0084] Specifically, the weights of all edges in the initial connection weight graph are sorted, and the weight corresponding to the selected quantile is calculated as the connection strength threshold. For example, in a certain factory area, the edge weights of the initial connection weight graph are distributed in the range [0.1, 0.9]. If the 25th quantile is selected as the threshold, the calculated threshold is 0.35. This threshold will serve as the basis for subsequent removal of low-weight connections, ensuring that the remaining connections have a relatively strong connection strength between the functional areas of the factory area.
[0085] S42. Delete the connection edges below the connection strength threshold in the initial connection weight graph to obtain a pruned intermediate connection graph.
[0086] Specifically, based on a set connection strength threshold, the initial connection weight graph is pruned, removing edges below the threshold to produce a pruned intermediate connection graph. Pruning thins out the initial connection weight graph, removing weakly correlated edges and highlighting key logistics and personnel flow corridors between functional areas within the factory.
[0087] In practice, each edge in the initial connection weight graph is traversed. If an edge's weight falls below a threshold (such as 0.35 in the example above), the edge is removed from the graph. After pruning, the resulting intermediate connection graph retains only the edges with higher weights. These retained edges represent the more important paths between the plant's functional areas. However, the graph may still contain disconnected areas or isolated nodes. Critical path reconstruction is used to ensure connectivity between functional areas.
[0088] S43. Sort the remaining edges in the intermediate connection graph in descending order of weight value, and use the Kruskal algorithm to select the edge with the highest weight to construct the minimum spanning tree.
[0089] Specifically, the remaining edges in the pruned intermediate connection graph are sorted in descending order by weight, and the Kruskal algorithm is used to select the edges with the highest weight to construct a minimum spanning tree. The Kruskal algorithm is a classic algorithm for constructing minimum spanning trees. It gradually builds a spanning tree by selecting edges with the lowest weight, ensuring that there are no cycles in the tree and that all nodes are connected.
[0090] The specific steps can be as follows: Sort the remaining edges in the intermediate connection graph in descending order by weight. Edges with higher weights are prioritized because they represent more important connection paths between functional areas. Initialize an empty edge set to store the edges of the spanning tree. Select edges in sorted order. If the selected edge does not form a loop with the current edge set, it is added to the edge set. This determination is achieved by finding the sets to which the two endpoints of the edge belong. If the two endpoints belong to different sets, they are merged into one set and the edge is added to the edge set. Repeat the above process until all nodes (functional areas) are included in the spanning tree.
[0091] A minimum spanning tree constructed using the Kruskal algorithm ensures connectivity between the plant's functional areas while preserving critical connection paths. The edges in the minimum spanning tree represent the logistics and personnel flows that must be preserved between the plant's functional areas, providing the foundation for the subsequent functional area connectivity model.
[0092] S44. Generate a functional region connection model based on the minimum spanning tree.
[0093] Specifically, the model is presented as a graph, containing all the functional area nodes of the plant and the connecting edges in a minimum spanning tree. The weights of the connecting edges reflect the strength of the association between functional areas, with larger weights indicating stronger associations.
[0094] The functional area connectivity model not only displays the connections between functional areas within a factory but also highlights key logistics and personnel flow pathways. For example, in one factory case study, the edge weight between the production area and the storage area was high, indicating frequent material transfer and personnel exchanges between them, forming a critical path for factory operations. This model provides clear and concise connectivity for subsequent clean and non-clean area delineation and space optimization, ensuring scientific and rational factory layout planning.
[0095] In an optional embodiment, S5 includes the following steps: S51. Based on the functional region connection model, extract the sum of the connection weights of each region and generate a region density feature vector. The element value of the region density feature vector is the cumulative sum of the connection weights of the corresponding region and the remaining regions.
[0096] Specifically, for each functional area within the factory, the cumulative sum of its connection weights with all other functional areas is calculated. The formula is as follows: in, Indicates area The sum of the connection weights of , that is, the regional density eigenvalue; Indicates area and region The connection weight between them; is the total number of functional areas in the factory.
[0097] The sum of these connection weights constitutes the regional density feature vector Each element in the vector corresponds to the regional density eigenvalue of a functional area. Areas with higher regional density eigenvalues are central to the factory's logistics and personnel flow networks and are closely connected to other areas. Conversely, areas with lower eigenvalues are relatively isolated or at the edge of the network. This eigenvector provides a quantitative basis for subsequent density clustering algorithms, helping to accurately distinguish different functional area types within the factory.
[0098] S52. Based on the preset neighborhood radius and minimum number of samples, a density clustering algorithm is used to cluster the regional density feature vectors to generate a regional cluster label set.
[0099] Specifically, after generating the regional density feature vector, a density clustering algorithm (such as DBSCAN) is used to perform cluster analysis on the regional density feature vector based on a pre-set neighborhood radius ϵ and a minimum sample number MinPts to generate a set of regional cluster labels. The core of the density clustering algorithm is to identify clusters of regions with high density and group densely connected regions into the same cluster.
[0100] During implementation, the neighborhood radius ϵ and the minimum number of samples, MinPts, are first appropriately set based on the distribution of eigenvalues in the regional density feature vector and the actual conditions of the plant's functional areas. The neighborhood radius ϵ is defined in feature space as the distance range encompassing a particular area's neighboring areas, centered on that area. The minimum number of samples, MinPts, is the threshold for determining whether a region and its neighborhood constitute a densely populated area. The setting of these two parameters can comprehensively consider the plant's scale, the number of functional areas, and the distribution characteristics of the regional density feature vector. For example, for a medium-sized pharmaceutical plant with 20-30 functional areas, if preliminary analysis reveals a standard deviation of the regional density feature vector of 0.3-0.5, the neighborhood radius ϵ can be initially set to 0.5-0.8, and the minimum number of samples, MinPts, can be set to 4-6.
[0101] The density clustering algorithm identifies core regions (regions with a number of regions greater than or equal to MinPts) by counting the number of regions within the neighborhood of each region. Then, starting from the core region, the clusters are gradually expanded, merging density-connected regions into the same cluster. Finally, the algorithm outputs a set of regional cluster labels. ,in Indicates area The cluster labels to which they belong. Regions with the same cluster labels represent that they have similar density characteristics in the functional association network of the plant area.
[0102] S53. Based on the regional clustering label set, the regions belonging to the same cluster are divided into clean regions or non-clean regions, including: Calculate the average connection weights of the clean area cluster and the non-clean area cluster, respectively denoted as w clean and w nonclean .
[0103] If the w of the cluster to which region j belongs clean >w nonclean And w clean With w nonclean If the difference between exceeds the preset threshold, the marked area j is a clean area.
[0104] Specifically, based on the regional cluster label set, the areas belonging to the same cluster are divided into clean areas or non-clean areas. First, for each cluster, the average connection weight w of the clean area cluster and the non-clean area cluster is calculated respectively. clean and w nonclean .
[0105] For cluster C, the average connection weight calculation formula is: in, is the number of regions in cluster C; In-cluster area The regional density characteristic value of .
[0106] By comparing w clean and w nonclean , if the w of the cluster to which a region j belongs clean >w nonclean , and w clean With w nonclean If the difference exceeds the preset threshold (this threshold is usually determined based on the production process requirements, cleanliness standards and historical data statistical analysis of the factory, for example, it can be set to 0.2-0.3), then area j is determined to be a clean area; otherwise, it is divided into a non-clean area. This judgment logic fully considers the connection density and cleanliness requirements of different functional areas in the factory, ensuring that the division of clean areas not only meets the actual needs of production operations, but also effectively controls the risk of cross-contamination. For example, in a pharmaceutical factory case, if the average connection weight w of the production area cluster is clean The average connection weight w of the non-production auxiliary area cluster is 3.2. nonclean is 1.8, and the preset threshold is 0.5. The difference between the two, 1.4, is much larger than the threshold. In this case, the production area is clearly divided into a clean area, and the non-production auxiliary area is divided into a non-clean area.
[0107] S54: Outputting the clean area division result and the non-clean area division result.
[0108] Specifically, the clean area division results and the non-clean area division results are output in an intuitive form, which can include a list of area division labels, a schematic diagram of the plant layout division, etc. The area division label list lists the name of each functional area in the plant and its corresponding clean area or non-clean area label, providing a clear textual basis for plant managers. The schematic diagram of the plant layout division uses different colors (such as green for clean areas and yellow for non-clean areas) to mark the division of each functional area on the plant floor plan, making the division results clear at a glance, and facilitating the optimization and adjustment of the spatial layout during the construction and renovation of the plant. These output results not only provide a clear basis for area division for the subsequent construction of the space optimization model, but also help ensure that the production operations of the plant comply with relevant regulations such as GMP (Good Manufacturing Practice for Pharmaceuticals) and guarantee the quality and safety of pharmaceutical products.
[0109] In an optional embodiment, S6 includes the following steps: S61. Constructing the linear programming objective function ,in, For the region and The Euclidean distance of Connect areas in the model for functional areas and The connection weight of .
[0110] Specifically, when optimizing the spatial layout of a pharmaceutical factory, a linear programming objective function is constructed with the core goal of minimizing the logistics and personnel flow costs between functional areas. The objective function is in the form of: in, Indicates area and region The Euclidean distance between two functional areas is the straight-line distance between them in the factory's geographic space. This distance reflects the shortest physical path for material and personnel transportation and is closely related to transportation costs and time. It is the area in the functional area connection model and region The connection weight between them represents a comprehensive measure of the material flow volume and personnel flow frequency between the two areas.
[0111] By minimizing this objective function, frequently interacting functional areas are brought closer together, reducing the cost and time of transportation and personnel movement. For example, if the connection weight between the production area and the storage area is high, the optimized layout should minimize the distance between these two areas to reduce the transportation costs of raw materials and finished products.
[0112] S62. Extract the clean area label set C based on the clean area and non-clean area division results. clean and non-clean area label set C nonclean ; For any region i∈C clean and region j∈C nonclean , add constraints ;in, The preset minimum safety distance.
[0113] Specifically, It is a pre-set minimum safety distance, and its value can be determined according to the Good Manufacturing Practice (GMP) of pharmaceutical production, the specific production process of the factory and the environmental control requirements. For example, for the clean area where highly active drugs are produced and the non-clean area where ordinary storage is carried out, Can be set to 15 meters to reduce the risk of cross contamination.
[0114] By adding this constraint, we ensure that the factory layout meets hygiene and safety standards, prevent clean areas from potential contamination by non-clean areas, and ensure the production quality of pharmaceutical products.
[0115] S63, iteratively calculate the regional coordinates based on the linear programming objective function and constraints until all constraints are met and the optimal coordinate set of all regions is output.
[0116] Specifically, after constructing the objective function and adding constraints, an iterative algorithm is used to find feasible solutions for the regional coordinates. Solutions include sequential quadratic programming (SQP), genetic algorithms, and simulated annealing. SQP constructs quadratic programming subproblems through sequential iterations, gradually approaching the minimum value of the objective function. Genetic algorithms simulate the biological evolution process, searching for the optimal solution through selection, crossover, and mutation. Simulated annealing, by simulating the physical annealing process, accepts less favorable solutions with a certain probability, avoiding local optima.
[0117] In each iteration, the algorithm adjusts the coordinates of each functional area , in order to reduce the objective function value and check whether all constraints are met. For example, if the distance between a clean area and a non-clean area is less than , the result is discarded and the algorithm continues to search for other possible solutions.
[0118] When the iterative results satisfy all constraints and the objective function converges, the optimal coordinate set for all areas is output. These coordinates determine the ideal geographic location of each functional area within the plant, providing precise planning guidance for its actual construction and renovation. Through this optimization process, the plant layout reduces logistics and personnel flow costs while ensuring safe separation between clean and non-clean areas, thereby improving the overall operational efficiency of the plant and ensuring product quality assurance.
[0119] The above-mentioned pharmaceutical plant layout planning method based on AI multi-source data dynamically collects and integrates the material flow and personnel flow data of the pharmaceutical plant, constructs a multidimensional data model with the help of spatiotemporal alignment and standardization processing, uses graph neural networks to extract the interaction features between regions and generate initial connection weights, eliminates redundant paths through threshold pruning and minimum spanning tree reconstruction to form a sparse connection model, combines clustering algorithms to realize dynamic division of clean areas and non-clean areas, optimizes the regional coordinate layout based on linear programming and spatial buffer algorithms, and finally realizes global dynamic optimization of the plant layout, thereby effectively optimizing the production process structure, reducing redundant interactions between regions, improving the accuracy and safety of clean area division, significantly reducing the risk of cross-contamination, improving spatial resource utilization and the dynamic adaptability of production processes, and reserving expandable space to support future production capacity upgrade needs.
[0120] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0121] Based on the same inventive concept, the embodiments of the present application also provide a system for implementing the aforementioned method for pharmaceutical plant layout planning based on AI multi-source data. The implementation solution provided by this system is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the pharmaceutical plant layout planning system based on AI multi-source data provided below can be found in the above-mentioned limitations on the pharmaceutical plant layout planning method based on AI multi-source data, and will not be repeated here.
[0122] In an exemplary embodiment, Figure 3 As shown, a pharmaceutical plant layout planning system 30 based on AI multi-source data is provided, including: The data collection and encoding module 31 is used to collect material flow data and personnel flow data in the pharmaceutical factory area, perform time series encoding on the material flow data and personnel flow data, and generate a dynamic flow feature set.
[0123] The spatiotemporal unification module 32 is used to perform spatiotemporal alignment and standardization processing on the dynamic flow feature set to generate a flow data matrix with unified spatiotemporal dimensions.
[0124] The spatiotemporal correlation extraction module 33 is used to extract the spatiotemporal correlation paths between the functional areas of the pharmaceutical factory based on the flow data matrix through the graph neural network to generate an initial connection weight graph.
[0125] The model optimization module 34 is used to perform threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges.
[0126] The area division module 35 is used to divide the clean area and the non-clean area by a clustering algorithm according to the connection weight distribution in the functional area connection model, and generate a division result.
[0127] The space optimization module 36 is used to construct a space optimization model based on the partitioning result, and solve the space optimization model to obtain a set of space coordinates.
[0128] The evaluation and planning module 37 is used to evaluate the reserved space for expansion and the pollution risk based on the spatial coordinate set and the functional area connection model to obtain an evaluation result; and generate a pharmaceutical plant layout plan based on the evaluation result.
[0129] Optionally, the data acquisition and encoding module includes: The material data collection unit is used to collect material transportation routes, timestamps and transportation quantities through the RFID sensor network to obtain material flow data.
[0130] The personnel data collection unit is used to collect the coordinates of personnel movement tracks and residence time through UWB positioning technology to obtain personnel flow data.
[0131] The dynamic feature integration unit is used to integrate material flow data and personnel flow data to obtain a dynamic flow feature set.
[0132] Optional, spatiotemporal unification modules include: The time warping and alignment unit is used to align the time windows of material flow data and personnel flow data in the dynamic flow feature set to a uniform granularity using a dynamic time warping algorithm to obtain a time-aligned feature set.
[0133] The normalization processing unit is used to perform dimension normalization processing on the data in the time-aligned feature set through a normalization formula to obtain a normalized feature set; the normalization formula is: Among them, z is the standardized value, x is the original data value, μ is the data mean, and σ is the standard deviation.
[0134] The matrix construction unit is used to construct a flow data matrix based on the data of the standardized feature set; the dimension of the flow data matrix is the product of the number of time windows and the number of regional nodes in the pharmaceutical factory area, and the matrix element value of the flow data matrix represents the flow intensity of each regional node within each time window.
[0135] Optionally, the spatiotemporal correlation extraction module includes: The model building unit is used to take the flow data matrix as input and build a spatiotemporal graph neural network based on the ST-GNN model.
[0136] The spatiotemporal feature extraction unit is used to extract the spatiotemporal feature vectors of regional nodes through the spatiotemporal convolution layer in the ST-GNN model; the calculation formula of the spatiotemporal convolution layer is: in, Indicates the The input feature matrix of the layer, For the The output feature matrix of the layer, For the graph convolution kernels, For the Tier The weight matrix of the convolution kernel, is the total number of convolution kernels, σ(·) is the activation function using the ReLU function, and * represents the graph convolution operation.
[0137] The weight graph generation unit is used to calculate the weights between nodes in each region based on the spatiotemporal feature vector and adopt the graph attention mechanism to generate an initial connection weight graph; wherein the element values of the adjacency matrix of the initial connection weight graph represent the interaction strength between nodes in each region.
[0138] Optional model optimization modules include: The threshold setting unit is used to set the quantile of the edge weight of the initial connection weight graph as the connection strength threshold.
[0139] The pruning processing unit is used to delete the connection edges below the connection strength threshold in the initial connection weight graph to obtain a pruned intermediate connection graph.
[0140] The critical path reconstruction unit is used to sort the remaining edges in the intermediate connection graph in descending order of weight value, and select the edge with the highest weight using the Kruskal algorithm to construct the minimum spanning tree.
[0141] The optimized model generation unit is used to generate a functional region connection model based on the minimum spanning tree.
[0142] Optionally, the region division module includes: The density feature extraction unit is used to extract the sum of the connection weights of each region based on the functional region connection model and generate a regional density feature vector. The element value of the regional density feature vector is the cumulative sum of the connection weights of the corresponding region and the remaining regions.
[0143] The regional clustering unit is used to cluster the regional density feature vectors based on the pre-set neighborhood radius and minimum number of samples using the density clustering algorithm to generate a regional cluster label set.
[0144] The region division determination unit is used to divide regions belonging to the same cluster into clean regions or unclean regions according to the region cluster label set, and includes the following steps: Calculate the average connection weights of the clean area cluster and the non-clean area cluster, respectively denoted as w clean and w nonclean .
[0145] If the w of the cluster to which region j belongs clean >w nonclean And w clean With w nonclean If the difference between exceeds the preset threshold, the marked area j is a clean area.
[0146] The division result output unit is used to output the clean area division result and the non-clean area division result.
[0147] Optional space optimization modules include: Objective function construction unit, used to construct linear programming objective function ,in, For the region and The Euclidean distance of Connect areas in the model for functional areas and The connection weight of .
[0148] The constraint condition adding unit is used to extract the clean area label set C based on the clean area and non-clean area division results clean and non-clean area label set C nonclean ; For any region i∈C clean and region j∈C nonclean , add constraints ;in, The preset minimum safety distance.
[0149] Optimal coordinate calculation unit, used to iteratively calculate regional coordinates based on linear programming objective function and constraints until all constraints are met and the optimal coordinate set of all regions is output.
[0150] An embodiment of the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0151] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0152] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without expending creative work.
[0153] The above-described embodiments merely represent several implementation methods of the embodiments of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the concept of the embodiments of the present application, and these modifications and improvements fall within the scope of protection of the embodiments of the present application.
Claims
1. A pharmaceutical plant layout planning method based on AI multi-source data, characterized in that: The method comprises: S1. Collect material flow data and personnel flow data in the pharmaceutical factory, perform time series encoding on the material flow data and the personnel flow data, and generate a dynamic flow feature set; S2. performing spatiotemporal alignment and standardization processing on the dynamic flow feature set to generate a flow data matrix with unified spatiotemporal dimensions; S3. Based on the flow data matrix, extract the spatiotemporal correlation paths between the functional areas of the pharmaceutical factory through a graph neural network to generate an initial connection weight graph; S4, performing threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges; S5. Dividing the clean area and the non-clean area by a clustering algorithm according to the connection weight distribution in the functional area connection model to generate a division result; S6. Based on the division result, construct a space optimization model, and solve the space optimization model to obtain a set of spatial coordinates; S7. Evaluate the reserved space for expansion and the pollution risk based on the spatial coordinate set and the functional area connection model to obtain an evaluation result; and generate a pharmaceutical plant layout plan based on the evaluation result.
2. The pharmaceutical plant layout planning method based on AI multi-source data according to claim 1, characterized in that: Said S1 comprises: S11, collecting material transportation paths, timestamps, and transportation volumes through an RFID sensor network to obtain material flow data; S12. Collecting the movement trajectory coordinates and residence time of personnel through UWB positioning technology to obtain the personnel flow data; S13. Integrate the material flow data and the personnel flow data to obtain the dynamic flow feature set.
3. The pharmaceutical plant layout planning method based on AI multi-source data according to claim 2, characterized in that: The S2 includes: S21. Using a dynamic time warping algorithm, align the time windows of the material flow data and the personnel flow data in the dynamic flow feature set to a uniform granularity to obtain a time-aligned feature set. S22. Perform dimension normalization processing on the data in the time-aligned feature set using a normalization formula to obtain a normalized feature set; the normalization formula is: Among them, z is the standardized value, x is the original data value, μ is the data mean, and σ is the standard deviation; S23. Construct the flow data matrix based on the data of the standardized feature set; the dimension of the flow data matrix is the product of the number of time windows and the number of regional nodes of the pharmaceutical factory area, and the matrix element values of the flow data matrix represent the flow intensity of each of the regional nodes within each of the time windows.
4. The pharmaceutical plant layout planning method based on AI multi-source data according to claim 3 is characterized in that: The S3 includes: S31, taking the flow data matrix as input, constructing a spatiotemporal graph neural network based on the ST-GNN model; S32. Extract the spatiotemporal feature vector of the regional node through the spatiotemporal convolution layer in the ST-GNN model; the calculation formula of the spatiotemporal convolution layer is: in, Indicates the The input feature matrix of the layer, For the The output feature matrix of the layer, For the graph convolution kernels, For the Tier The weight matrix of the convolution kernel, is the total number of convolution kernels, σ(·) is the activation function using the ReLU function, and * represents the graph convolution operation; S33. Based on the spatiotemporal feature vector, a graph attention mechanism is used to calculate the weights between the regional nodes to generate the initial connection weight graph; wherein the adjacency matrix element values of the initial connection weight graph represent the interaction strength between the regional nodes.
5. The pharmaceutical plant layout planning method based on AI multi-source data according to claim 4 is characterized in that: The S4 includes: S41, setting the quantile of the edge weight of the initial connection weight graph as the connection strength threshold; S42, deleting connection edges in the initial connection weight graph that are lower than the connection strength threshold to obtain a pruned intermediate connection graph; S43, sorting the remaining edges in the intermediate connection graph in descending order of weight value, and selecting the edge with the highest weight using the Kruskal algorithm to construct a minimum spanning tree; S44. Generate the functional area connection model based on the minimum spanning tree.
6. The pharmaceutical plant layout planning method based on AI multi-source data according to claim 5, characterized in that: The S5 includes: S51. Based on the functional area connection model, extract the sum of the connection weights of each area to generate an area density feature vector, where the element value of the area density feature vector is the cumulative sum of the connection weights of the corresponding area and the remaining areas; S52, clustering the regional density feature vectors using a density clustering algorithm based on a preset neighborhood radius and a minimum number of samples to generate a regional cluster label set; S53, dividing the areas belonging to the same cluster into clean areas or non-clean areas according to the regional clustering label set, including: Calculate the average connection weights of the clean area cluster and the non-clean area cluster, respectively denoted as w clean and w nonclean ; If the w of the cluster to which region j belongs clean >w nonclean And w clean With w nonclean If the difference exceeds the preset threshold, the marked area j is the clean area; S54: Outputting the clean area division result and the non-clean area division result.
7. A pharmaceutical plant layout planning method based on AI multi-source data according to any one of claims 1 to 6, characterized in that: The S6 includes: S61. Constructing the linear programming objective function ,in, For the region and The Euclidean distance of Connect the areas in the model for the functional areas and The connection weight of S62: Extract the clean area label set C according to the clean area and non-clean area division result. clean and non-clean area label set C nonclean ; For any region i∈C clean and region j∈C nonclean , add constraints ;in, It is the preset minimum safety distance; S63, iteratively calculating the region coordinates based on the linear programming objective function and the constraint conditions until all constraints are met and the optimal coordinate set of all regions is output.
8. A pharmaceutical plant layout planning system based on AI multi-source data, characterized by: The system comprises: A data collection and encoding module is used to collect material flow data and personnel flow data in the pharmaceutical factory area, perform time series encoding on the material flow data and the personnel flow data, and generate a dynamic flow feature set; A spatiotemporal unification module is used to perform spatiotemporal alignment and standardization processing on the dynamic flow feature set to generate a flow data matrix with unified spatiotemporal dimensions; A spatiotemporal correlation extraction module is used to extract the spatiotemporal correlation paths between the functional areas of the pharmaceutical factory based on the flow data matrix through a graph neural network to generate an initial connection weight graph; A model optimization module is used to perform threshold pruning and key path reconstruction on the initial connection weight graph to generate a functional area connection model with sparse edges; An area division module is used to divide the clean area and the non-clean area by a clustering algorithm according to the connection weight distribution in the functional area connection model, and generate a division result; A space optimization module, configured to construct a space optimization model based on the partitioning result, and solve the space optimization model to obtain a set of space coordinates; An evaluation and planning module is used to evaluate the reserved space for expansion and the pollution risk based on the spatial coordinate set and the functional area connection model to obtain an evaluation result; and generate a pharmaceutical plant layout plan based on the evaluation result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements a pharmaceutical plant layout planning method based on AI multi-source data according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a pharmaceutical plant layout planning method based on AI multi-source data according to any one of claims 1 to 7.