Accessory demand prediction method and system for tobacco production equipment
By constructing a graph database to integrate data models and time series forecasting algorithms, we have achieved accurate forecasting of demand for tobacco production equipment parts and automated inventory management. This solves the problems of inaccurate forecasting and lagging inventory management in traditional methods, thereby improving production efficiency and enterprise benefits.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-03
AI Technical Summary
Traditional methods for forecasting demand for tobacco production equipment parts rely on manual experience and simple historical data, leading to inaccurate forecasts, an inability to respond in real time to changes in the production workshop, impacting production progress and corporate profits, and untimely inventory management, which increases costs.
By collecting real-time operating condition data and inventory data, a fusion data model based on graph database is constructed. A health assessment algorithm is used to calculate the operating condition health index, and a time series forecasting algorithm is combined to predict future parts demand, thus achieving full automation of the process from data collection to forecasting.
It improved the accuracy and timeliness of tobacco production equipment parts management, solved the problems of accuracy and real-time response lag in traditional forecasting methods, optimized the inventory management process, and reduced production costs.
Smart Images

Figure CN121787645A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tobacco production equipment technology, and in particular to a method and system for predicting the demand for accessories of tobacco production equipment. Background Technology
[0002] In tobacco production, timely supply of spare parts is crucial to ensuring production continuity and efficiency. Traditional management models rely on manual experience and simple historical data statistics, which have several drawbacks. On the one hand, insufficient analysis of historical outbound data leads to rough forecasts, easily resulting in spare parts shortages or over-purchasing, affecting production progress, corporate profits, and increasing inventory costs. On the other hand, it cannot respond to changes in the production workshop in real time, making it difficult to adjust forecasts and procurement plans based on machine operating status and model usage, resulting in poor timeliness and accuracy of supply.
[0003] In inventory management, traditional periodic inventory checks cannot dynamically compare inventory levels with demand forecasts, often revealing insufficient inventory only when production is imminent, making it difficult to shorten the procurement cycle. Furthermore, the traditional application-procurement-delivery process is cumbersome, with low efficiency in multi-department communication, and information transmission issues easily arise, further extending the process cycle.
[0004] In summary, the traditional model is prone to impacting tobacco production in terms of the accuracy of demand forecasting and the lag in real-time response. Summary of the Invention
[0005] The main purpose of this application is to provide a method and system for forecasting the demand for parts of tobacco production equipment, so as to solve the problems of the traditional mode in the prior art, which has poor demand forecasting accuracy, slow real-time response, and is prone to affecting tobacco production.
[0006] To achieve the above objectives, this application provides the following technical solution: A method for forecasting the demand for spare parts of tobacco production equipment, the method being applied to the spare parts of the tobacco production equipment, the method comprising: Step S1: Real-time collection of operating condition data of the tobacco production equipment and inventory and in-transit data of the accessories; preprocessing of the operating condition data and the inventory and in-transit data; integration to obtain a standardized multi-source dataset. Step S2: Based on the standardized multi-source dataset, construct a fusion data model that associates model, accessories, and lifespan using a graph database; Step S3: Calculate the working condition health index of the tobacco production equipment based on the fused data model using a health assessment algorithm; Step S4: Classify the working condition health values into at least two preset health value intervals, and obtain the equipment health status classification result according to the preset health status of each preset health value interval. Step S5: Based on the equipment health status classification results of the tobacco production equipment, predict the predicted demand for the accessories within a future preset period using a time series prediction algorithm.
[0007] Beneficial effects: Steps S1 to S5 achieve a programmed closed-loop forecasting of demand for tobacco production equipment parts through multi-stage technological collaboration. Specifically, Step S1 constructs a unified multi-source dataset by collecting real-time operating condition data and inventory data and performing standardized preprocessing, providing a structured data foundation for subsequent analysis. Step S2 establishes a fusion data model based on graph database technology, linking machine models, parts, and lifespan indicators through a node relationship network, enabling visualization and rapid retrieval of multi-dimensional relationships between equipment, parts, and lifespan. Step S3 develops a health assessment algorithm that quantifies the operating status of parts into an operating condition health index through feature weighted fusion and hierarchical aggregation, forming a numerical assessment standard for equipment health status. Step S4 automatically maps the health index to preset health status categories using a dynamic interval classification algorithm, outputting the equipment health status classification results. Step S5 constructs a time series prediction system that integrates equipment health status and historical consumption data, employing a decomposition-prediction-reorganization strategy to generate a predicted sequence of parts demand for future periods. The above steps together achieve full automation from raw data collection to predictive demand generation. Through a technical closed loop of data standardization, relationship modeling, health quantification, status classification, and prediction algorithms, the accuracy and timeliness of tobacco production equipment parts management have been significantly improved.
[0008] As a further improvement to this application, step S2, based on the standardized multi-source dataset, constructs a fusion data model relating model, accessories, and lifespan using a graph database, including: Step S21: Import the equipment model entities, accessory entities, and their respective attribute data from the standardized multi-source dataset into the graph database node set to establish a structured node system; Step S22: Input the structured node system into the graph database relationship creation function to construct the assembly relationship edge between the model node and the part node, and the association relationship edge between the part node and the life index node; Step S23: Using a graph database indexing mechanism, a graph topology network is established for the assembly relationship edges and the association relationship edges, along with the model node, accessory node, life index node, and their respective relationship edges. Step S24: Based on the graph topology network, construct a multi-hop relationship retrieval function and an attribute association query function from component nodes to life index nodes through a graph database path query algorithm; Step S25: Connect and integrate the model node, the accessory node, and the life index node through the multi-hop relationship retrieval function and the attribute association query function to obtain a fused data model that is related to the model, accessory, and life.
[0009] Beneficial effects: Steps S21 to S25, through a systematic graph database construction process, realize the structured modeling and multidimensional association analysis of tobacco production equipment parts management data. Specifically, step S21 imports equipment model entities, parts entities, and their attribute data from a standardized multi-source dataset into a graph database node set, establishing a structured node system containing equipment numbers, parts codes, and technical parameters, providing basic data units for subsequent relationship construction. Step S22, based on this structured node system, constructs assembly relationship edges between model nodes and parts nodes using graph database relationship creation functions, and simultaneously establishes association relationship edges between parts nodes and lifespan indicator nodes, realizing the construction of a three-dimensional relationship network of equipment-parts-lifespan. Step S23 establishes a composite index structure for the aforementioned nodes and relationship edges through an index construction mechanism, forming a highly efficient query... The graph topology network with query capabilities significantly improves the efficiency of multi-hop relationship retrieval; step S24 develops multi-hop relationship retrieval and attribute association query functions based on this graph topology network, supporting the retrieval of parts paths and the traceability of parts attributes starting from any model node; step S25, by integrating the multi-hop retrieval and attribute association functions, finally generates a fusion data model containing complete model-parts-lifetime association relationships. This model not only realizes the visual association display of equipment parts data, but also provides a structured data interface that can be directly called for subsequent health assessment algorithms. The natural relational expression capability of graph databases solves the performance bottleneck problem of traditional relational databases in complex association queries.
[0010] As a further improvement to this application, step S3, calculating the operating health index of the tobacco production equipment based on the fused data model using a health assessment algorithm, includes: Step S31: Obtain the real-time operating parameters and historical life indicators of each component node in the fusion data model, and integrate them to obtain the component operating status dataset; Step S32: Based on the component operation status dataset, calculate the current operation status score of each component node using a feature weighted fusion algorithm, and integrate all component nodes to obtain a component status score set; Step S33: Normalize all component status scores in the component status score set using a hierarchical aggregation algorithm to obtain a comprehensive status score vector based on a component node. Step S34: Convert the comprehensive status score vector into a standardized health score numerical sequence using a health score mapping function; Step S35: Input the standardized health value sequence into the health index calculation model, and calculate the working condition health index through a linear weighted combination algorithm.
[0011] Beneficial effects: Steps S31 to S35 achieve precise quantification of the health index of tobacco production equipment through a systematic health assessment process. Specifically, step S31 extracts real-time operating parameters and historical lifespan indicators for each component node from the fusion data model, constructing a dataset comprehensively reflecting the current operating status of the components, providing fundamental data support for subsequent assessments. Step S32 employs a feature-weighted fusion algorithm to perform multi-dimensional analysis of the component operating status, calculating the current operating status score for each component through a dynamic weight allocation mechanism. This algorithm automatically identifies key influencing factors and adjusts the weight allocation strategy to ensure that the score accurately reflects the actual wear and tear of the components. Step S33 uses a hierarchical aggregation algorithm to globally normalize the status scores of multiple components, eliminating the influence of differences in scoring scales among different components and generating a comprehensive equipment-level status. The scoring vector retains both the status characteristics of individual components and reflects the overall health trend of the equipment. Step S34 uses a health mapping function to convert the comprehensive status scoring vector into a standardized health value sequence. This function maps the scoring data to a unified health scale through nonlinear transformation, achieving horizontal comparability of the health status of different equipment and different components. Step S35 uses a linear weighted combination algorithm to integrate and calculate the standardized health value sequence, finally outputting the operating condition health index. This index integrates the health status information of all key components of the equipment, intuitively representing the overall operating condition level of the equipment in a single numerical form, providing an accurate quantitative basis for subsequent equipment health status classification and component demand prediction.
[0012] As a further improvement to this application, step S5, predicting the predicted demand for the accessories within a future preset period based on the equipment health status classification results of the tobacco production equipment using a time series prediction algorithm, includes: Step S51: Obtain historical parts consumption data corresponding to the health status classification result of each device, and construct a correlation dataset between device health status and parts consumption; Step S52: Decompose the historical parts consumption data into trend components, seasonal components, and residual components using a time series decomposition algorithm; Step S53: The trend component is fitted and predicted using an autoregressive integral moving average model to obtain the trend component prediction sequence. Step S54: The seasonal component is fitted and predicted using a seasonal autoregressive integral moving average model to obtain the seasonal component prediction sequence. Step S55: Input the trend component prediction sequence and the seasonal component prediction sequence into the sequence recombination algorithm, and combine the residual components to obtain the component demand prediction sequence for the future preset period through weighted fusion calculation.
[0013] Beneficial effects: Steps S51 to S55 achieve accurate prediction of the demand for tobacco production equipment parts through a multi-component collaborative prediction mechanism. Specifically, step S51 acquires historical parts consumption data corresponding to the equipment health status classification results, constructing a dataset linking health status and consumption behavior, providing historical pattern support for subsequent predictions; step S52 uses a time series decomposition algorithm to split historical data into trend, seasonal, and residual components. This decomposition process effectively separates long-term trends, periodic fluctuations, and random noise through frequency domain analysis, creating conditions for targeted prediction; step S53 applies an autoregressive integral moving average model to fit and predict the trend component. This model eliminates data non-stationarity through differencing and accurately captures the long-term evolution of parts consumption using a dual adjustment mechanism of autoregressive and moving average terms; step S54… A seasonal autoregressive integral moving average model is used to process the seasonal components. This model effectively solves the problem of periodic fluctuations in the consumption of tobacco production equipment parts by introducing lagged seasonal terms and seasonal difference terms, especially achieving accurate modeling of the difference in demand between peak and off-peak production seasons. In step S55, the trend prediction sequence and the seasonal prediction sequence are weighted and fused using a sequence recombination algorithm. At the same time, combined with the random characteristics of the residual components, the algorithm adopts a dynamic weight allocation strategy to ensure that the contribution of different prediction components matches the historical error distribution. The final prediction sequence retains the stability of the long-term trend and reflects the regularity of seasonal fluctuations. Meanwhile, the residual correction eliminates systematic bias and achieves the organic integration of features at multiple time scales.
[0014] As a further improvement to this application, step S5 involves predicting the forecasted demand for the accessories within a preset future period based on the equipment health status classification results of the tobacco production equipment using a time series prediction algorithm. Following this, the process includes: Step S10: Based on the predicted demand and the inventory and in-transit data, dynamically calculate the inventory risk value of the accessories using a safety factor calculation model; Step S20: Classify the inventory risk value into at least two preset risk value ranges, and obtain the risk level corresponding to the inventory risk value according to the preset risk level of each preset risk value range. Step S30: Match the procurement decision logic corresponding to the preset risk level according to the preset risk level decision list; Step S40: Generate a parts requirement application based on the corresponding procurement decision logic and send it to the external monitoring terminal.
[0015] Beneficial effects: Steps S10 to S40 achieve closed-loop optimization of tobacco production equipment parts management through a dynamic inventory risk calculation and intelligent decision-making linkage mechanism. Specifically, step S10 dynamically calculates inventory risk values based on predicted demand and inventory data using a safety factor calculation model. This model comprehensively utilizes inventory consumption rate calculation, safety stock formula matching, and gap value smoothing techniques to quantify real-time inventory status into standard risk indicators. Step S20 classifies inventory risk values into different risk levels by pre-setting risk value ranges and uses an interval matching algorithm to automate risk status determination, providing structured input for subsequent decisions. Step S30 automatically matches corresponding procurement decision logic based on the risk level decision list using a rule engine. This mechanism uses a decision tree model to accurately correlate risk levels with procurement strategies, ensuring differentiated response processes are triggered for different risk scenarios. Step S40 uses an automated workflow engine to convert procurement decision logic into standard parts demand requests, generates structured procurement instructions using templated output and data binding technology, and achieves real-time transmission of demand data through an external monitoring interface, ultimately forming a fully automated closed loop from risk identification to procurement execution.
[0016] As a further improvement to this application, step S10, based on the predicted demand and the inventory and in-transit data, dynamically calculates the inventory risk value of the accessories using a safety factor calculation model, including: Step S101: Calculate the average consumption per unit period using the inventory consumption rate by combining the predicted demand and the inventory and in-transit data. Step S102: Calculate the minimum inventory level required to meet the average consumption using the safety stock formula; Step S103: Perform a difference calculation between the minimum inventory level and the inventory and in-transit data to obtain the inventory gap value; Step S104: The inventory gap values for several periods are smoothed using an exponentially weighted moving average method to convert the real-time inventory gap values into standardized inventory risk values.
[0017] Beneficial effects: Steps S101 to S104 achieve a precise quantitative assessment of the inventory status of tobacco production equipment parts through a dynamic inventory risk calculation mechanism. Specifically, step S101 calculates the average consumption per unit period using the inventory consumption rate. This calculation, based on a comprehensive analysis of predicted demand and inventory and in-transit data, accurately reflects the actual consumption patterns of parts, providing fundamental parameters for subsequent inventory decisions. Step S102 applies the safety stock formula to calculate the minimum inventory level required to meet the average consumption. This calculation comprehensively considers supply cycle fluctuations and demand uncertainties, determining the benchmark threshold for inventory management through a theoretical model. Step S103 generates an inventory gap value by comparing the minimum inventory level with real-time inventory data. This difference calculation intuitively reveals the gap between the current inventory and the theoretically optimal level, providing direct input for risk quantification. Step S104 uses an exponentially weighted moving average method to smooth the multi-period inventory gap. This method, through a dynamic weight allocation mechanism, retains the key characteristics of the latest inventory gap data while eliminating short-term fluctuation interference, ultimately converting the real-time inventory gap into a standardized inventory risk value.
[0018] As a further improvement to this application, step S5, based on the equipment health status classification results of the tobacco production equipment, uses a time series prediction algorithm to predict the predicted demand for the accessories within a future preset period. Following this, the method further includes: Step S100: Integrate all predicted demand quantities within all future preset periods and send them to the external monitoring terminal.
[0019] Beneficial effects: Step S100 achieves centralized management of multi-period forecasted demand through a standardized data integration and transmission mechanism. Specifically, it involves structurally summarizing the component demand forecast sequences from different time dimensions to form a unified formatted forecast data set. Real-time data transmission is achieved through an external monitoring interface, providing complete forecast data support for the inventory monitoring system and ensuring that subsequent procurement decisions are based on comprehensive and systematic forecast information. This step eliminates the error risks of manual integration through automated data pipelines, while standardized output formats ensure data compatibility and traceability across different systems, significantly enhancing the practical value of forecast data in supply chain management.
[0020] To achieve the above objectives, this application also provides the following technical solutions: A spare parts demand forecasting system for tobacco production equipment, wherein the spare parts demand forecasting system is applied to the spare parts demand forecasting method described above, and the spare parts demand forecasting system includes: The standardized multi-source dataset integration module is used to collect the operating condition data of the tobacco production equipment and the inventory and in-transit data of the accessories in real time, and to preprocess the operating condition data and the inventory and in-transit data to integrate them into a standardized multi-source dataset. The fusion data model building module is used to build a fusion data model that relates models, accessories, and lifespan based on the standardized multi-source dataset through a graph database; The working condition health index calculation module is used to calculate the working condition health index of the tobacco production equipment based on the fusion data model and a health assessment algorithm. The equipment health status classification module is used to classify the operating condition health values into at least two preset health value intervals, and obtain the equipment health status classification result according to the preset health status of each preset health value interval. The spare parts demand prediction module is used to predict the predicted demand for the spare parts within a preset period based on the equipment health status classification results of the tobacco production equipment and a time series prediction algorithm.
[0021] To achieve the above objectives, this application also provides the following technical solutions: An electronic device includes a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the accessory demand forecasting method described above.
[0022] To achieve the above objectives, this application also provides the following technical solutions: A computer-readable storage medium storing program instructions that, when executed by a processor, enable the implementation of the component demand prediction method described above. Attached Figure Description
[0023] Figure 1 This is a schematic flowchart illustrating the steps of an embodiment of a method for predicting the demand for parts of tobacco production equipment according to this application. Figure 2 This is a schematic diagram of the functional modules of an embodiment of a tobacco production equipment parts demand forecasting system according to this application; Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the storage medium of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0025] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] like Figure 1 As shown, this embodiment provides an example of a method for predicting the demand for parts of tobacco production equipment. In this embodiment, the method for predicting the demand for parts is applied to the parts of tobacco production equipment.
[0028] Preferably, accessories for tobacco production equipment, such as printheads, solenoid valve diaphragms, Marken labeling machine printheads, industrial power sockets, proximity switches, and solenoid valves, all require maintenance and replacement. The accessories mentioned in this embodiment are mainly wear-prone equipment accessories of tobacco production equipment during the production process.
[0029] Specifically, the method for forecasting demand for spare parts includes the following steps: Step S1: Real-time collection of operating condition data of tobacco production equipment and inventory and in-transit data of spare parts, and preprocessing of operating condition data and inventory and in-transit data to obtain a standardized multi-source dataset.
[0030] Preferably, data collection can be based on the existing ERP system, and the MES system can be used to integrate the operating condition data of each unit in the production workshop, the inventory and in-transit data of spare parts in the ERP system, etc., and the decision-making can be assisted by knowledge graphs to realize the transformation of the spare parts required for each operating condition in the production workshop from "post-event statistics" to "operating condition prediction". The prediction of various types of spare parts is upgraded from "experience threshold" to "dynamic risk control based on equipment operating conditions", realizing a closed-loop management of "data collection → prediction → decision → execution" to achieve the goal of improving the management efficiency of tobacco spare parts and reducing production costs.
[0031] Preferably, the operating condition data acquisition source can collect equipment operating condition data in real time through the Manufacturing Execution System (MES) in the production workshop, such as machine operating parameters (e.g., temperature, speed, vibration frequency), equipment status logs (e.g., startup duration, fault codes), and production plan data (e.g., machine model changeover time, output).
[0032] Preferably, the MES system data stream can be subscribed to in real time via REST API or Apache Kafka message queue to achieve low-latency and high-integrity data collection operations.
[0033] Step S2: Based on the standardized multi-source dataset, construct a fusion data model that associates model, parts, and lifespan using a graph database.
[0034] Further, step S2 involves constructing a fusion data model linking model, parts, and lifespan based on a standardized multi-source dataset using a graph database. This specifically includes the following steps: Step S21: Import the equipment model entities, accessory entities, and their respective attribute data from the standardized multi-source dataset into the graph database node set to establish a structured node system.
[0035] Preferably, the standardized multi-source dataset from step S1 is parsed to identify three core entities: model nodes, parts nodes, and lifespan indicator nodes. Model node attributes include model ID, model name, and status (e.g., running / stopped); parts node attributes include parts ID, name, inventory quantity, and lifespan baseline value (unit: hours); lifespan indicator node attributes include indicator ID, average lifespan, and failure rate coefficient (dynamically updated).
[0036] Preferably, node creation can be achieved by using the batch import function of the graph database to convert standardized data in CSV or JSON format into nodes.
[0037] Preferably, the code block based on the Neo4j Cypher query language is as follows: / / Create machine type nodes (imported from standardized dataset) LOAD CSV WITH HEADERS FROM 'file: / / / standardized_data.csv' AS row CREATE (m:Machine { machineId: row.device_id, model: row.machine_type, status: row.operation_status }); / / Create accessory node LOAD CSV WITH HEADERS FROM 'file: / / / standardized_data.csv' AS row CREATE (p:Part { partId: row.part_id, name: row.part_name, stockQty: toInteger(row.stock_quantity) }); / / Create a lifetime metric node (initialized based on historical data) MERGE (l:LifespanIndicator { indicatorId: row.part_id + "_lifespan", avgLifespan: toFloat(row.avg_lifespan_hours) }); Step S22: Input the structured node system into the graph database relationship creation function to construct the assembly relationship edges between the model node and the part node, as well as the association relationship edges between the part node and the life index node.
[0038] Preferably, assembly relationship edges (ASSEMBLES_WITH) represent the parts used in the model, and the edge attributes may include assembly time and quantity; association relationship edges (RELATES_TO) represent the association between the parts and the life index, and the edge attributes may include association strength (e.g., weight value). The association strength weight of the edge is calculated as the number of times they co-occur divided by the total number of records.
[0039] Preferably, the edge creation logic dynamically generates edges based on business rules (such as BOM tables) or data association rules (such as accessory ID matching).
[0040] Preferably, the code block based on the Neo4j Cypher query language is as follows: / / Create assembly relationship edge: Model - Part MATCH (m:Machine {machineId: "DEV_001"}), (p:Part {partId: "P_001"}) WHERE m.machineId = p.associatedMachineId / / Assuming the dataset has associated fields CREATE (m)-[r:ASSEMBLES_WITH { installedDate: date(), Quantity: 1 }]->(p); / / Create a relationship edge: Parts - Lifespan Indicators MATCH (p:Part {partId: "P_001"}), (l:LifespanIndicator {indicatorId: "P_001_lifespan"}) CREATE (p)-[r:RELATES_TO { correlationWeight: 0.95, / / Calculated based on historical fault data lastUpdated: timestamp() }]->(l); Step S23: Using the graph database indexing mechanism, a graph topology network is established for the assembly relationship edges and association relationship edges, along with the model node, accessory node, life index node, and their respective relationship edges.
[0041] Preferably, index building can accelerate node lookup by creating database indexes on key node attributes (such as IDs). Topology optimization can reduce query latency through native indexing algorithms of graph databases (such as B-trees or Lucene indexes).
[0042] Preferably, if the B-tree index algorithm is used, the query complexity is O(log n) in a balanced multi-way search tree, which is suitable for scalar attributes such as ID.
[0043] Preferably, network density can also be optimized by pre-computing degree centrality or community detection, such as the Louvain algorithm.
[0044] Step S24: Based on the graph topology network, construct a multi-hop relationship retrieval function and an attribute association query function from component nodes to life index nodes through a graph database path query algorithm.
[0045] Preferably, multi-hop retrieval can be performed using the breadth-first search (BFS) algorithm, with a time complexity of O(V+E), where V is the number of nodes and E is the number of edges, traversing multi-hop relationships in the graph, such as from 1 hop to 3 hops; attribute association queries can be performed using attribute filtering and aggregation to achieve conditional retrieval, such as using an SQL-like WHERE clause.
[0046] Preferably, the code block based on the Neo4j Cypher query language is as follows: / / Multi-hop search: Find all accessories and their lifespan indicators for model DEV_001 (maximum 2 hops) MATCH (m:Machine {machineId: "DEV_001"})-[:ASSEMBLES_WITH*1..2]->(p:Part)-[:RELATES_TO]->(l:LifespanIndicator) RETURN m.machineId, p.partId, l.avgLifespan; / / Attribute-related query: Filter accessories with a lifespan below the threshold MATCH (p:Part)-[:RELATES_TO]->(l:LifespanIndicator) WHERE l.avgLifespan < 500 / / Threshold 500 hours RETURN p.partId, l.avgLifespan; Step S25: Connect and integrate the model node, parts node, and life index node through the multi-hop relationship retrieval function and attribute association query function to obtain a fused data model that is related to the model, parts, and life.
[0047] Preferably, the connectivity of a graph can be checked using a connectivity detection algorithm based on a union-find structure, with a complexity close to O(1).
[0048] Beneficial effects of steps S21 to S25: Steps S21 to S25, through a systematic graph database construction process, realize the structured modeling and multidimensional association analysis of tobacco production equipment parts management data. Specifically, step S21 imports equipment model entities, parts entities, and their attribute data from a standardized multi-source dataset into a graph database node set, establishing a structured node system containing equipment numbers, parts codes, and technical parameters, providing basic data units for subsequent relationship construction. Step S22, based on this structured node system, constructs assembly relationship edges between model nodes and parts nodes using graph database relationship creation functions, and simultaneously establishes association relationship edges between parts nodes and lifespan indicator nodes, realizing the construction of a three-dimensional relationship network of equipment-parts-lifespan. Step S23 establishes a composite index structure for the aforementioned nodes and relationship edges through an index construction mechanism, forming a highly efficient query... The graph topology network with query capabilities significantly improves the efficiency of multi-hop relationship retrieval; step S24 develops multi-hop relationship retrieval and attribute association query functions based on this graph topology network, supporting the retrieval of parts paths and the traceability of parts attributes starting from any model node; step S25, by integrating the multi-hop retrieval and attribute association functions, finally generates a fusion data model containing complete model-parts-lifetime association relationships. This model not only realizes the visual association display of equipment parts data, but also provides a structured data interface that can be directly called for subsequent health assessment algorithms. The natural relational expression capability of graph databases solves the performance bottleneck problem of traditional relational databases in complex association queries.
[0049] Step S3: Calculate the working condition health index of tobacco production equipment based on the fusion data model and the health assessment algorithm.
[0050] Further, step S3, calculating the operational health index of tobacco production equipment based on the fused data model and a health assessment algorithm, specifically includes the following steps: Step S31: Obtain the real-time operating parameters and historical life indicators of each component node in the fusion data model, and integrate them to obtain the component operating status dataset.
[0051] Preferably, the relevant attributes of each component node can be retrieved through graph database path queries using the Cypher language. Real-time operating parameters are integrated from data obtained from the MES system, such as temperature, vibration amplitude, and runtime (in hours); historical life indicators are obtained from life nodes, such as mean time between failures (MTBF) and historical replacement cycles; dataset integration converts the query results into a tabular format, with each row representing a component node and columns including parameter and indicator values.
[0052] Preferably, the code block based on the Neo4j Cypher query language is as follows: / / Query the component nodes and their associated lifespan metrics MATCH (p:Part)-[:RELATES_TO]->(l:LifespanIndicator) WHERE p.partId = "P_001" RETURN p.partId AS part_id, p.currentTemperature AS temp, p.vibrationLevel AS vibration, l.avgLifespan AS avg_lifespan, l.failureRate AS failure_rate; Step S32: Calculate the current operating status score of each component node based on the component operating status dataset using a feature weighted fusion algorithm, and integrate all component nodes to obtain a component status score set.
[0053] Preferably, the feature selection of the component operation status dataset can select key parameters (such as temperature, vibration, and life deviation) as scoring features; the weighted fusion algorithm can use the entropy weight method to dynamically calculate the feature weights to avoid subjective bias.
[0054] Among them, the calculation of feature information entropy is achieved through The calculation yielded that, Let the feature information entropy of the j-th feature be , Let i be the relative contribution of the i-th component to the j-th characteristic value (e.g., temperature, vibration). , Let be the i-th accessory at the j-th feature value.
[0055] Next, the feature weights are processed through... The calculation shows that the operating status score of the i-th component is obtained. The calculation yields n, where n is the total number of parts and m is the total number of characteristic values.
[0056] Step S33: Normalize all part status scores in the part status score set using a hierarchical aggregation algorithm, and obtain a comprehensive status score vector based on a part node.
[0057] Preferably, the hierarchical aggregation algorithm can employ weighted average aggregation, taking into account the importance of components. For example, critical components have higher weights. Let the weight of the i-th component be the number of failures of the i-th component divided by the total number of failures of all components, then the overall equipment score can be calculated. ,in, Let be the component weight of the i-th component.
[0058] Preferably, the normalization process can be performed using Min-Max standardization.
[0059] Step S34: Convert the comprehensive status score vector into a standardized health score numerical sequence through the health score mapping function.
[0060] Preferably, the health mapping function can use the Sigmoid function to smoothly map the score to the health score, as expressed by the formula: ,in, Here is the health mapping function, specifically the health status at time t. The overall equipment score at time t. The slope is given by k, which is typically set to 10 to control the steepness. The threshold for health status is θ = 0.5 under normal circumstances.
[0061] Step S35: Input the standardized health value sequence into the health index calculation model, and calculate the working condition health index through a linear weighted combination algorithm.
[0062] Preferably, the linear weighted combination algorithm assigns higher weights to recent health scores to reflect the importance of trends. The weight allocation uses exponentially decaying weights, for example... ,in Let t be the weight at time t, α be the decay factor (0 < α < 1), T be the current time, and t be the time t, specifically referring to time t in the history.
[0063] Then, the health index is obtained through Calculated.
[0064] Preferably, α can be set to 0.9. The calculated health index HI is greater than 0.7 to indicate good health and less than 0.3 to indicate an emergency.
[0065] Beneficial effects of steps S31 to S35: Steps S31 to S35 achieve precise quantification of the health index of tobacco production equipment through a systematic health assessment process. Specifically, step S31 extracts real-time operating parameters and historical lifespan indicators for each component node from the fusion data model, constructing a dataset comprehensively reflecting the current operating status of the components, providing fundamental data support for subsequent assessments. Step S32 employs a feature-weighted fusion algorithm to perform multi-dimensional analysis of the component operating status, calculating the current operating status score for each component through a dynamic weight allocation mechanism. This algorithm automatically identifies key influencing factors and adjusts the weight allocation strategy to ensure that the score accurately reflects the actual wear and tear of the components. Step S33 uses a hierarchical aggregation algorithm to globally normalize the status scores of multiple components, eliminating the influence of differences in scoring scales among different components and generating a comprehensive equipment-level status. The scoring vector retains both the status characteristics of individual components and reflects the overall health trend of the equipment. Step S34 uses a health mapping function to convert the comprehensive status scoring vector into a standardized health value sequence. This function maps the scoring data to a unified health scale through nonlinear transformation, achieving horizontal comparability of the health status of different equipment and different components. Step S35 uses a linear weighted combination algorithm to integrate and calculate the standardized health value sequence, finally outputting the operating condition health index. This index integrates the health status information of all key components of the equipment, intuitively representing the overall operating condition level of the equipment in a single numerical form, providing an accurate quantitative basis for subsequent equipment health status classification and component demand prediction.
[0066] Step S4: Classify the operating condition health values into at least two preset health value intervals, and obtain the equipment health status classification result based on the preset health status of each preset health value interval.
[0067] Preferably, the classification objective of step S4 is to discretize the continuous working condition health index (HI, range [0,1]) into a finite number of health status categories.
[0068] The classification is based on a three-tiered health status system: Normal status (green / low risk): The HI value is high, and the equipment is operating normally.
[0069] Preventive maintenance status (yellow / medium risk): HI value is moderate, requiring preventive maintenance.
[0070] Emergency Part Replacement Status (Red / High Risk): The HI value is low, requiring urgent intervention.
[0071] Preferably, to avoid errors caused by human classification, the K-means clustering algorithm can be used to find the natural dividing point of the health index, so as to cluster the working condition health values into 3 categories, and the boundary of each category is the threshold.
[0072] Preferably, the code block for implementing the classification is as follows: class HealthStateClassifier: def __init__(self, low_threshold=0.3, high_threshold=0.7): """ Initialize the classifier :param low_threshold: Low-risk threshold :param high_threshold: High-risk threshold """ self.low_threshold = low_threshold self.high_threshold = high_threshold # Define health status mapping self.state_mapping = { 'normal': 'normal state' 'preventive': 'Preventive maintenance status' 'emergency': 'Emergency parts replacement status' } def classify_with_confidence(self, health_index): """ Health status classification with confidence """ # Calculate the distance to each classification center centers = { 'emergency': 0.15, # Emergency Center 'preventive': 0.5, # Preventive Maintenance Center 'normal': 0.85 # Center of normal state } # Calculate membership degree (using Gaussian membership function) membership = {} for state, center in centers.items(): # Gaussian membership function: μ(x) = exp(-(x-center)² / (2*σ²)) sigma = 0.2 # Control function width membership[state] = np.exp(-(health_index - center)**2 / (2 * sigma**2)) # Normalize membership degrees total = sum(membership.values()) normalized_membership = {state: degree / total for state,degree in membership.items()} # Determine the main classification if health_index <= self.low_threshold: primary_state = 'emergency' elif health_index <= self.high_threshold: primary_state = 'preventive' else: primary_state = 'normal' confidence = normalized_membership[primary_state] return { 'primary_state': self.state_mapping[primary_state], 'confidence': confidence, 'membership_degrees': normalized_membership } def batch_classify(self, health_indices): """ Batch classification processing """ results = [] for hi in health_indices: classification = self.classify_with_confidence(hi) results.append(classification) return results Preferably, the visualization output of one type of device health status classification result is as follows, in JSON format: { "device_id": "DEV_001", "timestamp": "2025-12-18T15:40:47", "health_index": 0.28, "health_state": "Emergency Part Replacement Status", "confidence_score": 0.892, "thresholds_used": { "low_threshold": 0.35, "high_threshold": 0.65 }, Recommendation: Arrange for immediate repair and prepare for emergency parts replacement. } Step S5: Based on the equipment health status classification results of tobacco production equipment, predict the expected demand for spare parts within a preset period using a time series prediction algorithm.
[0073] Further, step S5 involves predicting the forecast demand for spare parts within a preset period based on the equipment health status classification results of the tobacco production equipment using a time series prediction algorithm. This specifically includes the following steps: Step S51: Obtain historical parts consumption data corresponding to the health status classification result of each device, and construct a correlation dataset between device health status and parts consumption.
[0074] Preferably, the code block for constructing the association dataset between equipment health status and parts consumption is as follows: import pandas as pd import numpy as np from datetime import datetime, timedelta class DataPreprocessor: def __init__(self, historical_data_path): self.historical_data = pd.read_csv(historical_data_path) def build_health_consumption_dataset(self, lookback_period=365): """ Construct a dataset linking equipment health status and parts consumption. """ # Filter data for the most recent lookback_period days cutoff_date = datetime.now() - timedelta(days=lookback_period) recent_data = self.historical_data[ self.historical_data['timestamp'] >= cutoff_date ].copy() # Data cleaning and feature engineering recent_data['health_state_encoded'] = recent_data['health_state'].map({ 'Normal state': 0, 'Preventative maintenance status': 1, 'Emergency Part Replacement Status': 2 }) # Constructing Time Series Features recent_data['date'] = pd.to_datetime(recent_data['timestamp']) recent_data['day_of_week'] = recent_data['date'].dt.dayofweek recent_data['month'] = recent_data['date'].dt.month recent_data['is_weekend'] = (recent_data['day_of_week'] >=5).astype(int) # Aggregate by device and date daily_consumption = recent_data.groupby([ 'device_id', 'part_id', 'date', 'health_state_encoded' ]).agg({ 'consumption_qty': 'sum', 'day_of_week': 'first', 'month': 'first', 'is_weekend': 'first' }).reset_index() return daily_consumption Step S52: Decompose the historical parts consumption data into trend components, seasonal components, and residual components using a time series decomposition algorithm.
[0075] Preferably, a seasonal decomposition algorithm (STL-Seasonal-Trend Loess decomposition) can be used, as shown in the code block below: from statsmodels.tsa.seasonal import STL import matplotlib.pyplot as plt class TimeSeriesDecomposer: def __init__(self, period=7): # Assuming a periodic cycle self.period = period def stl_decomposition(self, time_series): """ STL Time Series Decomposition """ # Ensure the time series are evenly spaced. ts_series = time_series.asfreq('D').fillna(method='ffill') # STL decomposition stl = STL(ts_series, period=self.period, robust=True) result = stl.fit() return { 'original': result.observed, 'trend': result.trend, 'seasonal': result.seasonal, 'residual': result.resid } def plot_decomposition(self, decomposition_result, title): """ Visualize the decomposition results """ fig, axes = plt.subplots(4, 1, figsize=(12, 10)) decomposition_result['original'].plot(ax=axes[0], title=f'{title} - Original') decomposition_result['trend'].plot(ax=axes[1], title='Trend') decomposition_result['seasonal'].plot(ax=axes[2], title='Seasonal') decomposition_result['residual'].plot(ax=axes[3], title='Residual') plt.tight_layout() return fig # Decompose each health state separately health_states = ['Normal state', 'Preventive maintenance state', 'Emergency parts replacement state'] decomposition_results = {} for state in health_states: state_data = dataset[dataset['health_state'] == state] if len(state_data) > 0: # Building Time Series ts = state_data.set_index('date')['consumption_qty'] decomposition_results[state] = decomposer.stl_decomposition(ts) Step S53: The trend component is fitted and predicted using an autoregressive integral moving average model to obtain the trend component prediction sequence.
[0076] Preferably, the regression integral moving average model can be fitted and predicted using the ARIMA model, as shown in the following code block: from statsmodels.tsa.arima.model import ARIMA from statsmodels.tsa.stattools import adfuller import warnings warnings.filterwarnings('ignore') class TrendPredictor: def __init__(self, max_p=3, max_d=2, max_q=3): self.max_p = max_p self.max_d = max_d self.max_q = max_q def check_stationarity(self, series): """ Checking the stationarity of time series (ADF test) """ result = adfuller(series.dropna()) return result[1] <= 0.05 # A p-value less than 0.05 indicates stationarity. def find_best_arima(self, trend_component): """ Find the optimal ARIMA parameters using a grid search. """ best_aic = np.inf best_order = None best_model = None # Parameter grid search for p in range(self.max_p + 1): for d in range(self.max_d + 1): for q in range(self.max_q + 1): try: model = ARIMA(trend_component, order=(p, d,q)) fitted_model = model.fit() if fitted_model.aic < best_aic: best_aic = fitted_model.aic best_order = (p, d, q) best_model = fitted_model except: continue return best_order, best_model, best_aic def predict_trend(self, trend_component, forecast_period=30): """ Trend component prediction """ # Finding the optimal ARIMA parameters best_order, best_model, aic = self.find_best_arima(trend_component) print(f"Optimal ARIMA parameters: {best_order}, AIC: {aic}") # Make predictions forecast = best_model.get_forecast(steps=forecast_period) forecast_mean = forecast.predicted_mean confidence_intervals = forecast.conf_int() return { 'trend_forecast': forecast_mean, 'confidence_intervals': confidence_intervals, 'model': best_model, 'order': best_order } # Predict the trend component for each health status trend_predictions = {} for state, decomposition in decomposition_results.items(): trend_component = decomposition['trend'].dropna() if len(trend_component) > 10: # Ensure there is enough data prediction = trend_predictor.predict_trend(trend_component,30) trend_predictions[state] = prediction Step S54: The seasonal component is fitted and predicted using a seasonal autoregressive integral moving average model to obtain the predicted sequence of the seasonal component.
[0077] Preferably, the seasonal autoregressive integral moving average model can be fitted and predicted using the SARIMA model, as shown in the following code block: from statsmodels.tsa.statespace.sarimax import SARIMAX class SeasonalPredictor: def __init__(self, seasonal_period=7): self.seasonal_period = seasonal_period def find_best_sarima(self, seasonal_component): """ Finding the optimal SARIMA parameters """ best_aic = np.inf best_order = None best_seasonal_order = None # Simplify parameter search (more complex grid search may be needed in practical applications) orders = [(1,0,1), (1,1,1), (2,0,2)] seasonal_orders = [(1,0,1,self.seasonal_period), (1,1,1,self.seasonal_period)] For order in orders: for seasonal_order in seasonal_orders: try: model = SARIMAX( seasonal_component, order = order, seasonal_order=seasonal_order, enforce_stationarity=False, enforce_invertibility=False ) fitted_model = model.fit(disp=False) if fitted_model.aic < best_aic: best_aic = fitted_model.aic best_order = order[[ID=⑦]] [[ID=⑧]]best_seasonal_order = seasonal_order[[ID=⑨]] except: continue return best_order, best_seasonal_order, best_aic def predict_seasonal(self, seasonal_component, forecast_period=30): """ Seasonal component prediction """ best_order, best_seasonal_order, aic = self.find_best_sarima(seasonal_component) print(f"Optimal SARIMA parameters: {best_order}{best_seasonal_order}, AIC: {aic}") # Train the final model model = SARIMAX( seasonal_component, order=best_order, seasonal_order=best_seasonal_order ) fitted_model = model.fit(disp=False) # Make predictions forecast = fitted_model.get_forecast(steps=forecast_period)[[ID=⑦]] forecast_mean = forecast.predicted_mean return { 'seasonal_forecast': forecast_mean, 'model': fitted_model, 'order': best_order, 'seasonal_order': best_seasonal_order } seasonal_predictions = {} for state, decomposition in decomposition_results.items(): seasonal_component = decomposition['seasonal'].dropna() if len(seasonal_component) > 14: # At least two cycles prediction = seasonal_predictor.predict_seasonal(seasonal_component, 30) seasonal_predictions[state] = prediction Step S55: Input the trend component prediction sequence and the seasonal component prediction sequence into the sequence recombination algorithm, and combine the residual components to obtain the component demand prediction sequence for the future preset period through weighted fusion calculation.
[0078] Preferably, the code block for implementing step S55 is as follows: class SequenceRecombiner: def __init__(self, residual_weight=0.1): self.residual_weight = residual_weight def weighted_fusion(self, trend_forecast, seasonal_forecast, recent_residuals): """ Weighted fusion prediction results """ # Basic Restructuring: Trends + Seasons base_forecast = trend_forecast + seasonal_forecast # Residual Adjustment: Use the weighted average of the most recent residuals if len(recent_residuals) > 0: residual_adjustment = np.mean(recent_residuals) *self.residual_weight adjusted_forecast = base_forecast + residual_adjustment else: adjusted_forecast = base_forecast # Ensure non-negative predictions adjusted_forecast = np.maximum(adjusted_forecast, 0) return adjusted_forecast def health_state_adjusted_forecast(self, health_state, base_forecast, adjustment_factors): """ Predictions adjusted based on health status """ adjustment_map = { 'Normal state': adjustment_factors.get('normal', 1.0), 'Preventive maintenance status': adjustment_factors.get('preventive', 1.2), 'Emergency Part Replacement Status': adjustment_factors.get('emergency', 1.5) } adjustment_factor = adjustment_map.get(health_state, 1.0) adjusted_forecast = base_forecast * adjustment_factor return adjusted_forecast def recombine_sequences(self, decomposition_results, predictions, forecast_period=30): """ Complete sequence recombination process """ final_predictions = {} for state in decomposition_results.keys(): if state in predictions['trend'] and state in predictions['seasonal']: # Obtain predictions for each component trend_forecast = predictions['trend'][state]['trend_forecast'] seasonal_forecast = predictions['seasonal'][state]['seasonal_forecast'] # Get the most recent residual (for adjustment) recent_residuals = decomposition_results[state]['residual'].tail(10) # Weighted fusion base_prediction = self.weighted_fusion( trend_forecast, seasonal_forecast, recent_residuals ) # Health status adjustment factor (based on historical analysis) adjustment_factors = { 'normal': 1.0, # No adjustment is needed for normal operation. 'preventive': 1.3, # Preventive maintenance requirements increase by 30% 'emergency': 2.0 # Emergency requirements doubled } # Application health status adjustment final_prediction = self.health_state_adjusted_forecast( state, base_prediction, adjustment_factors ) final_predictions[state] = { 'final_forecast': final_prediction, 'base_components': { 'trend': trend_forecast, 'seasonal': seasonal_forecast }, 'health_state': state, 'adjustment_factor': adjustment_factors.get( 'normal' if state == 'normal state' else 'preventive' if state == 'preventive maintenance state' else 'emergency', 1.0 ) } return final_predictions predictions = { 'trend': trend_predictions, 'seasonal': seasonal_predictions } final_predictions = recombiner.recombine_sequences( decomposition_results, predictions, forecast_period=30 ) Beneficial effects of steps S51 to S55: Steps S51 to S55 achieve accurate prediction of the demand for tobacco production equipment parts through a multi-component collaborative prediction mechanism. Specifically, step S51 acquires historical parts consumption data corresponding to the equipment health status classification results, constructing a dataset linking health status and consumption behavior, providing historical pattern support for subsequent predictions; step S52 uses a time series decomposition algorithm to split historical data into trend, seasonal, and residual components. This decomposition process effectively separates long-term trends, periodic fluctuations, and random noise through frequency domain analysis, creating conditions for targeted prediction; step S53 applies an autoregressive integral moving average model to fit and predict the trend component. This model eliminates data non-stationarity through differencing and accurately captures the long-term evolution of parts consumption using a dual adjustment mechanism of autoregressive and moving average terms; step S54… A seasonal autoregressive integral moving average model is used to process the seasonal components. This model effectively solves the problem of periodic fluctuations in the consumption of tobacco production equipment parts by introducing lagged seasonal terms and seasonal difference terms, especially achieving accurate modeling of the difference in demand between peak and off-peak production seasons. In step S55, the trend prediction sequence and the seasonal prediction sequence are weighted and fused using a sequence recombination algorithm. At the same time, combined with the random characteristics of the residual components, the algorithm adopts a dynamic weight allocation strategy to ensure that the contribution of different prediction components matches the historical error distribution. The final prediction sequence retains the stability of the long-term trend and reflects the regularity of seasonal fluctuations. Meanwhile, the residual correction eliminates systematic bias and achieves the organic integration of features at multiple time scales.
[0079] Beneficial effects of steps S1 to S5: Steps S1 to S5 achieve a programmed closed-loop forecasting of demand for tobacco production equipment parts through multi-stage technological collaboration. Specifically, Step S1 constructs a unified multi-source dataset by collecting real-time operating condition data and inventory data and performing standardized preprocessing, providing a structured data foundation for subsequent analysis. Step S2 establishes a fusion data model based on graph database technology, linking machine models, parts, and lifespan indicators through a node relationship network, enabling visualization and rapid retrieval of multi-dimensional relationships between equipment, parts, and lifespan. Step S3 develops a health assessment algorithm that quantifies the operating status of parts into an operating condition health index through feature weighted fusion and hierarchical aggregation, forming a numerical assessment standard for equipment health status. Step S4 automatically maps the health index to preset health status categories using a dynamic interval classification algorithm, outputting the equipment health status classification results. Step S5 constructs a time series prediction system that integrates equipment health status and historical consumption data, employing a decomposition-prediction-reorganization strategy to generate a predicted sequence of parts demand for future periods. The above steps together achieve full automation from raw data collection to predictive demand generation. Through a technical closed loop of data standardization, relationship modeling, health quantification, status classification, and prediction algorithms, the accuracy and timeliness of tobacco production equipment parts management have been significantly improved.
[0080] Further, in step S5, based on the equipment health status classification results of the tobacco production equipment, the predicted demand for spare parts within a future preset period is predicted using a time series prediction algorithm. This is followed by the following steps: Step S10: Based on the predicted demand and inventory and in-transit data, dynamically calculate the inventory risk value of the parts using a safety factor calculation model.
[0081] Further, step S10, based on the predicted demand and inventory and in-transit data, dynamically calculates the inventory risk value of the parts using a safety factor calculation model, specifically including the following steps: Step S101: Calculate the average consumption per unit period using the inventory consumption rate by combining the predicted demand and inventory data with the in-transit data.
[0082] Preferably, higher weights can be assigned to recent inventory and in-transit data, based on the same principle as assigning higher weights to recent data mentioned above.
[0083] Step S102: Calculate the minimum inventory level required to meet the average consumption using the safety stock formula.
[0084] Preferably, the safety stock formula can be characterized as follows: ,in, Let Z be the safety stock, Z be the Z-score corresponding to the service level, σ be the standard deviation of demand, and L be the average lead time.
[0085] Safety stock is a buffer inventory set up to cope with demand fluctuations and supply delays. Its goal is to ensure that there is no shortage of stock during the lead time. The larger the value, the more conservative the inventory, but the higher the holding cost. If the formula calculates SS=20, it means that an additional 20 units of inventory need to be held to prevent unexpected events.
[0086] The service level Z-value is the quantile of the standard normal distribution, reflecting the service level, which refers to the probability of no stockouts during the lead time. The Z-value is determined by the service level and can be obtained by looking up the standard normal distribution table or using one of the following functions: scipy, stats, norm, or ppf. For example, a service level of 95% corresponds to a Z-value of approximately 1.645.
[0087] The standard deviation of demand is used to measure the dispersion of historical demand data. The larger the value, the stronger the demand fluctuation. The general standard deviation formula can be used.
[0088] The average lead time is the average time (e.g., in days) from placing an order to receiving the goods.
[0089] Step S103: Calculate the difference between the minimum inventory level and the inventory and in-transit data to obtain the inventory gap value.
[0090] Preferably, the inventory gap value is max(0,SS−(I+IT)), where SS = safety stock, I = current inventory, and IT = inventory in transit.
[0091] Step S104: The inventory gap values for several periods are smoothed using the exponentially weighted moving average method to convert the real-time inventory gap values into standardized inventory risk values.
[0092] Preferably, the exponentially weighted moving average (EWMA) can be characterized by the following formula: .
[0093] in, Let be the exponentially weighted moving average at time t, i.e., the inventory risk value. As a smoothing factor, . The closer to 1, the better the current observation value. The larger the weight, the more sensitive the model is to recent changes, but the less smooth it is.
[0094] The closer to 0, the higher the historical average. The larger the weight, the smoother the model, but the less sensitive it is to recent changes.
[0095] Beneficial effects: Steps S101 to S104 achieve a precise quantitative assessment of the inventory status of tobacco production equipment parts through a dynamic inventory risk calculation mechanism. Specifically, step S101 calculates the average consumption per unit period using the inventory consumption rate. This calculation, based on a comprehensive analysis of predicted demand and inventory and in-transit data, accurately reflects the actual consumption patterns of parts, providing fundamental parameters for subsequent inventory decisions. Step S102 applies the safety stock formula to calculate the minimum inventory level required to meet the average consumption. This calculation comprehensively considers supply cycle fluctuations and demand uncertainties, determining the benchmark threshold for inventory management through a theoretical model. Step S103 generates an inventory gap value by comparing the minimum inventory level with real-time inventory data. This difference calculation intuitively reveals the gap between the current inventory and the theoretically optimal level, providing direct input for risk quantification. Step S104 uses an exponentially weighted moving average method to smooth the multi-period inventory gap. This method, through a dynamic weight allocation mechanism, retains the key characteristics of the latest inventory gap data while eliminating short-term fluctuation interference, ultimately converting the real-time inventory gap into a standardized inventory risk value.
[0096] Step S20: Classify the inventory risk value into at least two preset risk value ranges, and obtain the risk level corresponding to the inventory risk value according to the preset risk level of each preset risk value range.
[0097] Preferably, the natural dividing point of risk value can also be found by K-means clustering algorithm, so that the risk level is clustered into 3 categories, and the boundary of each category is the threshold.
[0098] Step S30: Match the procurement decision logic corresponding to the risk level according to the preset risk level decision list.
[0099] Preferably, a three-tiered risk response strategy corresponding to the three-tiered early warning mechanism described above can be defined based on business rules. Specifically, low risk is defined as an operating condition health index greater than 0.7 and an inventory risk value less than 0.3; the response strategy can be set to no action or the system not automatically triggering procurement. Medium risk is defined as 0.3 ≤ operating condition health index ≤ 0.7 and 0.3 ≤ inventory risk value ≤ 0.7; the response strategy can be set to the system automatically creating a draft procurement order and sending it to an external monitoring terminal, while simultaneously prompting for accelerated approval and tracking monitoring. High risk is defined as an operating condition health index less than 0.3 and an inventory risk value greater than 0.3; the response strategy can be set to the system automatically creating and executing procurement without manual intervention, using automatic system approval or simplified approval.
[0100] Step S40: Generate a parts requirement application based on the corresponding procurement decision logic and send it to the external monitoring terminal.
[0101] Beneficial effects: Steps S10 to S40 achieve closed-loop optimization of tobacco production equipment parts management through a dynamic inventory risk calculation and intelligent decision-making linkage mechanism. Specifically, step S10 dynamically calculates inventory risk values based on predicted demand and inventory data using a safety factor calculation model. This model comprehensively utilizes inventory consumption rate calculation, safety stock formula matching, and gap value smoothing techniques to quantify real-time inventory status into standard risk indicators. Step S20 classifies inventory risk values into different risk levels by pre-setting risk value ranges and uses an interval matching algorithm to automate risk status determination, providing structured input for subsequent decisions. Step S30 automatically matches corresponding procurement decision logic based on the risk level decision list using a rule engine. This mechanism uses a decision tree model to accurately correlate risk levels with procurement strategies, ensuring differentiated response processes are triggered for different risk scenarios. Step S40 uses an automated workflow engine to convert procurement decision logic into standard parts demand requests, generates structured procurement instructions using templated output and data binding technology, and achieves real-time transmission of demand data through an external monitoring interface, ultimately forming a fully automated closed loop from risk identification to procurement execution.
[0102] Further, in step S5, based on the equipment health status classification results of the tobacco production equipment, the predicted demand for spare parts within a future preset period is predicted using a time series prediction algorithm. This is followed by the following steps: Step S100: Integrate all predicted demand quantities within all future preset periods and send them to the external monitoring terminal.
[0103] Beneficial effects: Step S100 achieves centralized management of multi-period forecasted demand through a standardized data integration and transmission mechanism. Specifically, it involves structurally summarizing the component demand forecast sequences from different time dimensions to form a unified formatted forecast data set. Real-time data transmission is achieved through an external monitoring interface, providing complete forecast data support for the inventory monitoring system and ensuring that subsequent procurement decisions are based on comprehensive and systematic forecast information. This step eliminates the error risks of manual integration through automated data pipelines, while standardized output formats ensure data compatibility and traceability across different systems, significantly enhancing the practical value of forecast data in supply chain management.
[0104] like Figure 2 As shown, this embodiment provides an example of a parts demand forecasting system for tobacco production equipment. In this embodiment, the parts demand forecasting system is applied to the parts demand forecasting method described in the above embodiments. Specifically, the spare parts demand forecasting system includes a standardized multi-source dataset integration module 1 for sequential electrical or signal connections, a fusion data model construction module 2, an operating condition health index calculation module 3, an equipment health status classification module 4, and a spare parts demand forecasting module 5.
[0105] The system comprises the following modules: Standardized Multi-Source Dataset Integration Module 1, which collects real-time operating condition data of tobacco production equipment and inventory and in-transit data of spare parts, preprocesses the operating condition data and inventory and in-transit data, and integrates them to obtain a standardized multi-source dataset; Fusion Data Model Construction Module 2, which constructs a fusion data model based on the standardized multi-source dataset using a graph database to associate machine models, spare parts, and lifespan; Operating Condition Health Index Calculation Module 3, which calculates the operating condition health index of tobacco production equipment using a health assessment algorithm based on the fusion data model; Equipment Health Status Classification Module 4, which classifies operating condition health values into at least two preset health value intervals and obtains the equipment health status classification result based on the preset health status of each preset health value interval; and Spare Parts Demand Prediction Module 5, which predicts the predicted demand for spare parts within a preset future period based on the equipment health status classification result of tobacco production equipment using a time series prediction algorithm.
[0106] It should be noted that this embodiment is a functional module embodiment based on the above method embodiment. For additional content such as extensions, optimizations, limitations, examples, principle explanations, and beneficial effects of this embodiment, please refer to the above embodiments. This embodiment will not repeat them here.
[0107] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Figure 3 As shown, the electronic device 6 includes a processor 61 and a memory 62 coupled to the processor 61.
[0108] The memory 62 stores program instructions for implementing the federated learning-based collaborative energy-saving method for government data clusters in any of the above embodiments.
[0109] The processor 61 is used to execute program instructions stored in the memory 62 for collaborative energy saving of government data clusters based on federated learning.
[0110] The processor 61 can also be referred to as a CPU (Central Processing Unit). The processor 61 may be an integrated circuit chip with signal processing capabilities. The processor 61 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0111] Furthermore, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of this application. See also: Figure 4 In this embodiment of the application, the storage medium 7 stores program instructions 71 capable of implementing all the above methods. These program instructions 71 can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods in each embodiment of the application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, signal, or other forms.
[0113] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for forecasting the demand for spare parts of tobacco production equipment, wherein the method is applied to the spare parts of the tobacco production equipment, characterized in that, The method for forecasting the demand for the components includes: Step S1: Real-time collection of operating condition data of the tobacco production equipment and inventory and in-transit data of the accessories; preprocessing of the operating condition data and the inventory and in-transit data; integration to obtain a standardized multi-source dataset. Step S2: Based on the standardized multi-source dataset, construct a fusion data model that associates model, accessories, and lifespan using a graph database; Step S3: Calculate the working condition health index of the tobacco production equipment based on the fused data model using a health assessment algorithm; Step S4: Classify the working condition health values into at least two preset health value intervals, and obtain the equipment health status classification result according to the preset health status of each preset health value interval. Step S5: Based on the equipment health status classification results of the tobacco production equipment, predict the predicted demand for the accessories within a future preset period using a time series prediction algorithm.
2. The component demand forecasting method according to claim 1, characterized in that, Step S2, based on the standardized multi-source dataset, constructs a fusion data model linking model, accessories, and lifespan using a graph database, including: Step S21: Import the equipment model entities, accessory entities, and their respective attribute data from the standardized multi-source dataset into the graph database node set to establish a structured node system; Step S22: Input the structured node system into the graph database relationship creation function to construct the assembly relationship edge between the model node and the part node, and the association relationship edge between the part node and the life index node; Step S23: Using a graph database indexing mechanism, a graph topology network is established for the assembly relationship edges and the association relationship edges, along with the model node, accessory node, life index node, and their respective relationship edges. Step S24: Based on the graph topology network, construct a multi-hop relationship retrieval function and an attribute association query function from component nodes to life index nodes through a graph database path query algorithm; Step S25: Connect and integrate the model node, the accessory node, and the life index node through the multi-hop relationship retrieval function and the attribute association query function to obtain a fused data model that is related to the model, accessory, and life.
3. The component demand forecasting method according to claim 1, characterized in that, Step S3, based on the fused data model, calculate the working condition health index of the tobacco production equipment using a health assessment algorithm, including: Step S31: Obtain the real-time operating parameters and historical life indicators of each component node in the fusion data model, and integrate them to obtain the component operating status dataset; Step S32: Based on the component operation status dataset, calculate the current operation status score of each component node using a feature weighted fusion algorithm, and integrate all component nodes to obtain a component status score set; Step S33: Normalize all component status scores in the component status score set using a hierarchical aggregation algorithm to obtain a comprehensive status score vector based on a component node. Step S34: Convert the comprehensive status score vector into a standardized health score numerical sequence using a health score mapping function; Step S35: Input the standardized health value sequence into the health index calculation model, and calculate the working condition health index through a linear weighted combination algorithm.
4. The spare parts demand forecasting method according to claim 1, characterized in that, Step S5, based on the equipment health status classification results of the tobacco production equipment, predicts the predicted demand for the accessories within a future preset period using a time series prediction algorithm, including: Step S51: Obtain historical parts consumption data corresponding to the health status classification result of each device, and construct a correlation dataset between device health status and parts consumption; Step S52: Decompose the historical parts consumption data into trend components, seasonal components, and residual components using a time series decomposition algorithm; Step S53: The trend component is fitted and predicted using an autoregressive integral moving average model to obtain the trend component prediction sequence. Step S54: The seasonal component is fitted and predicted using a seasonal autoregressive integral moving average model to obtain the seasonal component prediction sequence. Step S55: Input the trend component prediction sequence and the seasonal component prediction sequence into the sequence recombination algorithm, and combine the residual components to obtain the component demand prediction sequence for the future preset period through weighted fusion calculation.
5. The spare parts demand forecasting method according to claim 1, characterized in that, Step S5: Based on the equipment health status classification results of the tobacco production equipment, predict the predicted demand for the accessories within a future preset period using a time series prediction algorithm. This then includes: Step S10: Based on the predicted demand and the inventory and in-transit data, dynamically calculate the inventory risk value of the accessories using a safety factor calculation model; Step S20: Classify the inventory risk value into at least two preset risk value ranges, and obtain the risk level corresponding to the inventory risk value according to the preset risk level of each preset risk value range. Step S30: Match the procurement decision logic corresponding to the preset risk level according to the preset risk level decision list; Step S40: Generate a parts requirement application based on the corresponding procurement decision logic and send it to the external monitoring terminal.
6. The spare parts demand forecasting method according to claim 5, characterized in that, Step S10, based on the predicted demand and the inventory and in-transit data, dynamically calculate the inventory risk value of the parts using a safety factor calculation model, including: Step S101: Calculate the average consumption per unit period using the inventory consumption rate by combining the predicted demand and the inventory and in-transit data. Step S102: Calculate the minimum inventory level required to meet the average consumption using the safety stock formula; Step S103: Perform a difference calculation between the minimum inventory level and the inventory and in-transit data to obtain the inventory gap value; Step S104: The inventory gap values for several periods are smoothed using an exponentially weighted moving average method to convert the real-time inventory gap values into standardized inventory risk values.
7. The method for forecasting component demand according to claim 1, characterized in that, Step S5 involves predicting the forecasted demand for the accessories within a preset future period based on the equipment health status classification results of the tobacco production equipment using a time series prediction algorithm. Following this, the process further includes: Step S100: Integrate all predicted demand quantities within all future preset periods and send them to the external monitoring terminal.
8. A parts demand forecasting system for tobacco production equipment, wherein the parts demand forecasting system is applied to the parts demand forecasting method as described in any one of claims 1 to 7, characterized in that, The parts demand forecasting system includes: The standardized multi-source dataset integration module is used to collect the operating condition data of the tobacco production equipment and the inventory and in-transit data of the accessories in real time, and to preprocess the operating condition data and the inventory and in-transit data to integrate them into a standardized multi-source dataset. The fusion data model building module is used to build a fusion data model that relates models, accessories, and lifespan based on the standardized multi-source dataset through a graph database; The working condition health index calculation module is used to calculate the working condition health index of the tobacco production equipment based on the fusion data model and a health assessment algorithm. The equipment health status classification module is used to classify the operating condition health values into at least two preset health value intervals, and obtain the equipment health status classification result according to the preset health status of each preset health value interval. The spare parts demand prediction module is used to predict the predicted demand for the spare parts within a preset period based on the equipment health status classification results of the tobacco production equipment and a time series prediction algorithm.
9. An electronic device, characterized in that, The method includes a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the accessory demand forecasting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed by a processor, enable the component demand forecasting method as described in any one of claims 1 to 7.