Defective cigarette case information management method, device, equipment and storage medium
By collecting multi-source data from cigarette boxes using sensing devices and processing it with the DBSCAN clustering algorithm, unique data tags are generated and transmission paths are optimized. This solves the problem of difficulty in identifying and tracing defective cigarette boxes in existing technologies, and realizes intelligent management of tobacco production lines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONGYUN HONGHE TOBACCO (GRP) CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-05
Smart Images

Figure CN122155582A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tobacco technology, and in particular to an information management method, apparatus, equipment and storage medium for defective cigarette boxes. Background Technology
[0002] In the cigarette production process of the tobacco industry, multiple brands of cigarettes are simultaneously transported along the carton conveyor of a single production line. Multiple detection and rejection systems are incorporated into the finished cigarette carton conveyor path, with all rejection mechanisms operating at the same workstation. Existing methods struggle to accurately and efficiently determine the reasons for rejection, leading to numerous loopholes in production management. For specific reasons for rejection, manual re-inspection and simple equipment feedback are primarily relied upon.
[0003] The existing cigarette box rejection system has the following technical defects: ① High difficulty in manual re-inspection: Rejection stations typically have at least two different brands of cigarette boxes, making it difficult to find the cause of rejection and resulting in low efficiency of manual re-inspection; ② Data silos: Each rejection device (e.g., device A / B / C) operates independently, with its own rejection data, lacking multi-source information fusion and correlation analysis capabilities, making it difficult to provide comprehensive data value; ③ Lack of systematic fault identification function for detection equipment: Due to the numerous and independent detection devices in the cigarette box conveying process, there are frequent instances of incorrect rejection or failure of certain detection devices, leading to excessive rejection of cigarette boxes or loss of defective boxes at the rejection station, resulting in a comprehensive failure of the equipment. The judgment relies entirely on manual methods and lacks effective fault identification assistance functions, resulting in low fault identification efficiency; ④ Lack of blockage warning function: Under the current situation, the single rejection channel often forces the conveyor line to stop due to the accumulation of cigarette boxes at the rejection station. It does not have a blockage warning function, which seriously affects the continuity of the production line; ⑤ Difficulty in tracing the source of defective cigarette boxes: Since defective cigarette boxes are concentrated in the single rejection channel, even if the defective cigarette box information of the current rejection station is determined by manual means, the cigarette box information may be confused again as procedural defects are added. The moving cigarette boxes lack dynamic information tracking, making it difficult to trace the source and making it impossible to achieve intelligent management and maintenance of the entire rejection channel conveyor line.
[0004] In summary, the current method suffers from high difficulty in manual re-inspection, isolated equipment data, lack of systematic equipment fault identification, lack of blockage early warning, and lack of real-time dynamic information processing, resulting in low efficiency in handling faults of cigarette box testing equipment and failing to provide effective data value for production management. Summary of the Invention
[0005] The main objective of this application is to provide a method, apparatus, equipment, and storage medium for information management of defective cigarette boxes, in order to solve the problems in the current technology where manual re-inspection is difficult, equipment data is isolated, there is a lack of systematic equipment fault identification function, a lack of blockage early warning function, and a lack of real-time dynamic information processing function, resulting in low efficiency in handling faults of cigarette box detection equipment and an inability to provide effective data value for production management.
[0006] To achieve the above objectives, this application provides the following technical solution: A method for information management of defective cigarette boxes, wherein the method is applied to cigarette boxes in the conveying process, the cigarette boxes are transported and sorted through a conveying path, the conveying path is equipped with sensing devices, and the information management method includes: Step S1: Collect the detection signal, appearance image, and transport status data of the cigarette box through the sensing device to obtain the multi-source raw dataset of the cigarette box; Step S2: Perform data preprocessing on the original multi-source dataset of the cigarette box to obtain the preprocessed multi-source dataset of the cigarette box; Step S3: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm. The density clustering mechanism of the DBSCAN clustering algorithm is used to identify abnormal samples in the preprocessed multi-source tobacco box dataset to obtain a subset of tobacco box data with defect categories. Step S4: Perform equipment signal and product traceability operation on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for defective cigarette boxes; Step S5: Input the unique data tag and the corresponding conveying status data of the multi-source original data of the cigarette box into the dynamic transmission optimization algorithm based on the workstation load, and plan the optimal transmission path by adapting the data load of the external production management system through the load adjustment mechanism. Step S6: Based on the optimal transmission path, store the transportation status data corresponding to the unique data tag and the multi-source original data of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database.
[0007] Beneficial effects of steps S1 to S6: A systematic solution is developed to address existing pain points in the cigarette carton transportation process during cigarette production. Step S1 involves the synchronous collection of multi-dimensional data from the cigarette cartons, providing a unified data foundation for end-to-end information management and breaking down data silos caused by the independent operation of various testing devices. Step S2 standardizes and preprocesses the collected raw data to ensure consistency and validity for subsequent analysis. Step S3 uses density clustering to identify abnormal samples and classify defects in the cigarette carton data, reducing the workload of manual re-inspection and alleviating the difficulty of locating defect causes in multi-brand cigarette cartons rejected at the same workstation. Step S4 establishes signal tracing and product information association for defective cigarette cartons, creating a correspondence between detection signals and rejection reasons, and generating defect... The unique identifier for each cigarette box solves the problems of chaotic information and difficulty in tracing defective cigarette boxes, enabling dynamic information tracking during the movement of cigarette boxes. Step S5 optimizes the transmission path of defective cigarette box information based on the workstation load, adapts to the data load status of the production management system, ensures the real-time and stability of defective cigarette box information transmission, and provides dynamic data support for production line blockage early warning and equipment status identification. Step S6 completes the standardized storage of defective cigarette box information throughout the entire process, forming a complete data closed loop, providing traceable and analyzable full-process data support for the refined production management of cigarette production lines, and making up for the shortcomings of insufficient data value mining and lack of intelligent management capabilities in the existing system.
[0008] As a further improvement to this application, step S1 involves acquiring the detection signal, appearance image, and transport status data of the cigarette box through the sensing device to obtain a multi-source raw dataset of the cigarette box, including: Step S1.1: The sensing device identifies that the cigarette box has entered the conveying path and generates a cigarette box acquisition trigger command; Step S1.2: In response to the cigarette box acquisition trigger command, capture several exterior image data of the cigarette box to obtain a cigarette box exterior image dataset; Step S1.3: In response to the cigarette box acquisition trigger command, collect the weight data and sealing status detection signal data of the cigarette box to obtain the cigarette box detection signal dataset; Step S1.4: In response to the cigarette box acquisition trigger command, collect the cigarette box conveying status data to obtain the cigarette box conveying status dataset; Step S1.5: Perform format unification processing on the cigarette box appearance image dataset, the cigarette box detection signal dataset, and the cigarette box conveying status dataset to obtain a unified cigarette box multi-source dataset; Step S1.6: Merge and store the unified multi-source dataset of cigarette boxes to obtain the original multi-source dataset of cigarette boxes.
[0009] Beneficial effects of steps S1.1 to S1.6: Step S1.1 generates a trigger command for identifying and collecting data upon the entry of the cigarette box into the conveying path, achieving precise triggering of cigarette box data collection and providing a unified timing benchmark for the synchronous collection of multi-source data, adapting to the collection needs of multiple brands of cigarette boxes transported in the same channel; Step S1.2 completes the collection of cigarette box appearance image data, supplementing the basic data of cigarette box appearance defect dimensions and making up for the lack of data in the single detection dimension of the existing system; Step S1.3 completes the collection of cigarette box weight and sealing status detection signal data, covering the core detection dimension data of the existing rejection equipment, providing basic support for cross-equipment data fusion; Step S 1.4 Complete the collection of cigarette box conveying status data and match the real-time position information of the cigarette box in the conveying path to provide a position benchmark for tracking the dynamic information of the cigarette box; Step S1.5 Through the unified processing of multi-source data formats, eliminate the format differences of output data from different detection devices, break down the data silos of each independent device, and achieve compatibility and adaptation of multi-source data; Step S1.6 Through the merging and storage of the unified multi-source dataset, a complete multi-source original dataset of cigarette boxes is formed, providing unified and complete basic data for subsequent defect identification and traceability management, and alleviating the problem of scattered multi-source data and inability to conduct linkage analysis in the existing system.
[0010] As a further improvement to this application, step S2 involves preprocessing the original multi-source dataset of the cigarette boxes to obtain a preprocessed multi-source dataset of the cigarette boxes, including: Step S2.1: Perform duplicate data removal operation on the original multi-source dataset of cigarette boxes to obtain a deduplicated multi-source dataset of cigarette boxes; Step S2.2: Perform missing value imputation on the deduplicated multi-source cigarette box dataset to obtain the imputed multi-source cigarette box dataset; Step S2.3: Perform data standardization on the filled cigarette box multi-source dataset to obtain a standardized cigarette box multi-source dataset; Step S2.4: Perform data verification and integration operations on the standardized multi-source tobacco box dataset to obtain a preprocessed multi-source tobacco box dataset.
[0011] Beneficial effects of steps S2.1 to S2.4: Step S2.1 removes redundant and duplicate content from multi-source data through deduplication, reducing the interference of invalid data on subsequent analysis and adapting to the data deduplication requirements in scenarios where multiple devices collect data independently. Step S2.2 fills in missing values to fill in information gaps generated during data collection, ensuring the integrity of data corresponding to a single cigarette box and solving the problem of data loss caused by differences in the sequence of multiple devices operating independently. Step S2.3 eliminates the differences in the dimensions and magnitudes of output data from different testing devices through data standardization, breaking down the data silos formed by each independent device and achieving unified adaptation of multi-source data. Step S2.4 completes the compliance verification and standardization integration of preprocessed data through data verification and integration, forming a unified and effective preprocessed dataset, ensuring the consistency and effectiveness of data used in subsequent analysis, and making up for the shortcomings of existing systems where multi-source data is scattered and cannot be linked for analysis.
[0012] As a further improvement to this application, step S3 involves inputting the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm. The DBSCAN clustering algorithm's density clustering mechanism identifies anomalous samples in the preprocessed multi-source tobacco box dataset, resulting in a subset of tobacco box data with defect categories, including: Step S3.1: Input the preprocessed multi-source dataset of cigarette boxes into the DBSCAN clustering algorithm, and obtain the neighborhood sample set of the cigarette box data through the neighborhood sample search operation; Step S3.2: Perform density reachability analysis on the neighborhood sample set to obtain the clustering results of the cigarette box data; Step S3.3: Based on the clustering results, samples that do not belong to any cluster are selected to obtain a subset of abnormal cigarette box data; Step S3.4: Mark the defect category of the abnormal cigarette box data subset to obtain the cigarette box data subset with defect category.
[0013] Beneficial effects of steps S3.1 to S3.4: Step S3.1 uses a neighborhood sample search operation to complete the neighborhood feature matching of the preprocessed multi-source data of cigarette boxes, providing a basic sample set for subsequent density clustering analysis, and adapting to the multi-source data feature analysis needs in the scenario of multi-brand cigarette boxes being transported in the same channel; Step S3.2 uses a density reachability analysis operation to complete the clustering of cigarette box data, distinguishing the data feature boundaries between normal and abnormal cigarette boxes, alleviating the problem of existing systems relying solely on single device signals to determine defects and being prone to misjudgment; Step S3.3 uses the clustering results to complete the screening of abnormal samples, accurately locating cigarette box data that deviates from the normal data distribution, reducing the difficulty of defect location during manual re-inspection in the scenario of removing multi-brand cigarette boxes at the same workstation, and reducing the workload of manual re-inspection; Step S3.4 uses defect category labeling of abnormal cigarette box data subsets to complete the defect attribute classification of abnormal samples, providing a clear classification basis for subsequent defect cause tracing, further making up for the shortcomings of existing systems in that defect data cannot be uniformly classified and cannot be analyzed in a coordinated manner.
[0014] As a further improvement to this application, step S4 involves performing equipment signal and product traceability operations on the subset of cigarette box data, establishing a mapping relationship between equipment signals and rejection reasons, and generating a unique data tag for the defective cigarette box, including: Step S4.1: Extract equipment signal features from the subset of smoke box data with defect categories to obtain the set of equipment signal features for defective smoke boxes; Step S4.2: Perform signal tracing operation on the set of equipment signal features of the defective smoke box to match the corresponding detection equipment trigger record and obtain the correspondence between the equipment signal and the triggering device; Step S4.3: Based on the correspondence between device signals and triggering devices, associate preset rejection reason rules to establish a mapping relationship between device signals and rejection reasons; Step S4.4: Extract the unique identifier information of the cigarette box data subset with defect category, and obtain the unique data label of the defective cigarette box by combining it with the mapping relationship.
[0015] Beneficial effects of steps S4.1 to S4.4: Step S4.1 Extracts equipment signal features from a subset of smoke box data with defect categories to obtain a set of equipment signal features for defective smoke boxes. This breaks down the signal data barriers between independent detection devices and adapts to the signal tracing requirements in scenarios where multiple devices are rejected at the same workstation. Step S4.2 Performs signal tracing operations on the set of equipment signal features for defective smoke boxes, matching the trigger records of the corresponding detection devices to obtain the correspondence between equipment signals and triggering devices. This solves the problem of inaccurate association between rejection signals and corresponding devices when multiple devices are operating independently, alleviating the workload of manually searching for rejection causes. Step S4.3 Analyzes the correspondence between equipment signals and triggering devices... The system establishes a mapping relationship between equipment signals and rejection reasons by associating relationships with preset rejection rules, thereby achieving precise binding between defect signals and rejection reasons. This addresses the shortcomings of existing systems that cannot analyze rejection data from multiple devices or clearly identify the causes of defects. Step S4.4 extracts unique identifier information of cigarette boxes from a subset of cigarette box data with defect categories and generates unique data tags for defective cigarette boxes by combining the mapping relationship between equipment signals and rejection reasons. This achieves unified identification of defective cigarette box information throughout the entire process, solving the problems of information chaos and difficulty in tracing the source of defective cigarette boxes in the same workstation rejection scenario, and providing a unique identification benchmark for the dynamic tracking of defective cigarette boxes.
[0016] As a further improvement to this application, step S5 involves inputting the unique data tag and the corresponding conveying status data of the multi-source raw data set of the cigarette box into a dynamic transmission optimization algorithm based on workstation load. This algorithm adapts to the data load of the external production management system through a load adjustment mechanism to plan the optimal transmission path, including: Step S5.1: Read the unique data tag of the defective cigarette box and the transportation status data in the multi-source original dataset of the cigarette box to obtain the defective cigarette box data set with the planned transmission path; Step S5.2: Obtain the data load status of the external production management system to get the current system load data; Step S5.3: Input the defective smoke box data set of the transmission path to be planned into the dynamic transmission optimization algorithm based on workstation load, and calculate the preliminary transmission path scheme based on the defective smoke box data set and the current system load data through the load adjustment mechanism. Step S5.4: Perform load adaptability verification on the preliminary transmission path scheme to obtain a transmission path scheme that adapts to the load of the external production management system. Step S5.5: Perform optimality screening on the transmission path scheme to obtain the optimal transmission path for the defective cigarette box information data.
[0017] Beneficial effects of steps S5.1 to S5.5: Step S5.1 integrates the unique data tags of defective cigarette boxes with the cigarette box conveying status data to obtain a defective cigarette box data set for the planned transmission path, providing complete core data input for transmission path planning and adapting to the dynamic information management needs of multi-brand cigarette box conveying scenarios in the same channel; Step S5.2 obtains the current system load data by acquiring the data load status of the external production management system, breaking down the data barrier between independent testing equipment and the upper-level management system, providing a real-time load benchmark for transmission path planning, and alleviating the problem that existing systems cannot link and adapt to the system's operating status due to multiple data sources; Step S5.3 calculates a preliminary transmission path scheme by combining the defective cigarette box data set and the current system load data through a load adjustment mechanism based on the dynamic conveying optimization algorithm of the workstation load, and matches the workstations. Real-time load status provides a feasible solution for the dynamic transmission of defective cigarette box information, supporting dynamic information tracking during the cigarette box flow process; Step S5.4, through load adaptability verification of the preliminary transmission path scheme, obtains a transmission path scheme adapted to the load of the external production management system, ensuring compatibility between the information transmission process and the system operating status, avoiding information lag caused by data transmission congestion, and making up for the shortcomings of the existing system's lack of dynamic data transmission adaptability; Step S5.5, through optimal screening of the adapted transmission path scheme, obtains the optimal transmission path for defective cigarette box information data, ensuring the real-time and stability of defective cigarette box information transmission, providing dynamic data support for production line blockage early warning and equipment operating status identification, and alleviating the problems of information transmission lag and inability to support intelligent management of the conveyor line in the existing system.
[0018] As a further improvement to this application, step S6, according to the optimal transmission path, stores the unique data tag and the corresponding transport status data of the multi-source original data set of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database, including: Step S6.1: Match the data transmission link of the external production management system according to the optimal transmission path; Step S6.2: Retrieve the full-process association data of the corresponding defective cigarette box through the information transmission link to obtain the full-process information of the defective cigarette box to be put into the warehouse; Step S6.3: Perform data consistency and integrity verification on the entire process information of the defective cigarette boxes to be put into storage, and obtain the full process information of the defective cigarette boxes that have passed the verification. Step S6.4: Write the full process information of the defective cigarette boxes that have passed the verification into the cigarette box production management database.
[0019] Beneficial effects of steps S6.1 to S6.4: Step S6.1 Matches the data transmission link of the external production management system according to the optimal transmission path, opening up the transmission channel between defective cigarette box information and the production management system. This adapts to the information transmission needs of scenarios involving the simultaneous transport of multiple brands of cigarette boxes and the rejection of multiple devices at the same workstation, breaking down the data barriers between independent testing equipment and the upper-level management system. Step S6.2 Retrieves the full-process related data of the corresponding defective cigarette box through the information transmission link, obtaining the full-process information of the defective cigarette box to be put into storage. This integrates the related data of the entire defective cigarette box chain, addressing the shortcomings of the existing system where defective data is scattered and cannot form a complete information chain, providing a complete data foundation for the traceability of defective cigarette boxes. S6.3 Perform data consistency and integrity verification on the entire process information of defective cigarette cartons to be put into storage, and obtain the verified complete process information of defective cigarette cartons. This ensures the accuracy and standardization of the data entering the warehouse, avoids the information chaos problem in the scenario of removing cigarette cartons from the same workstation of multiple brands, and reduces the error risk of subsequent data application. Step S6.4 Write the verified complete process information of defective cigarette cartons into the cigarette carton production management database, complete the standardized storage of the complete process information of defective cigarette cartons, form a complete data closed loop, and provide traceable and analyzable effective data support for the refined management of cigarette production, making up for the problems of insufficient data value mining and lack of intelligent management capabilities in the existing system.
[0020] To achieve the above objectives, this application also provides the following technical solutions: An information management device for defective cigarette boxes, wherein the information management device is applied to the information management method described above, and the information management device includes: The cigarette box data collection module is used to collect the detection signals, appearance images, and transport status data of the cigarette box through the sensing device to obtain a multi-source raw dataset of the cigarette box; The cigarette box data preprocessing module is used to preprocess the multi-source raw dataset of the cigarette box to obtain the preprocessed multi-source dataset of the cigarette box. The cigarette box data clustering module is used to input the preprocessed multi-source cigarette box dataset into the DBSCAN clustering algorithm, and identify abnormal samples in the preprocessed multi-source cigarette box dataset through the density clustering mechanism of the DBSCAN clustering algorithm to obtain a subset of cigarette box data with defect categories. The defective cigarette box data tag generation module is used to perform equipment signal and product traceability operations on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for the defective cigarette box. The data tag transmission path planning module is used to input the conveying status data corresponding to the unique data tag and the multi-source original data of the cigarette box into the dynamic transmission optimization algorithm based on the workstation load, and adapt the data load of the external production management system to plan the optimal transmission path through the load adjustment mechanism. The data tag transmission and storage module is used to store the transportation status data corresponding to the unique data tag and the multi-source original data of the cigarette box as the whole process information of defective cigarette boxes into the cigarette box production management database according to the optimal transmission path.
[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 information management method for defective cigarette boxes as described above.
[0022] To achieve the above objectives, this application also provides the following technical solutions: A computer-readable storage medium storing program instructions, which, when executed by a processor, enable the information management method for defective cigarette boxes as described above. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the steps of an embodiment of the information management method for defective cigarette boxes according to this application. Figure 2 This is a functional module diagram of an embodiment of an information management device for defective cigarette boxes 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 an information management method for defective cigarette boxes. In this embodiment, the information management method is applied to cigarette boxes in the conveying process. The cigarette boxes are transported and sorted through a conveying path, and the conveying path has sensing devices.
[0028] Specifically, the information management method includes the following steps: Step S1: Collect the detection signal, appearance image and transport status data of the cigarette box through the sensing device to obtain the multi-source raw dataset of the cigarette box.
[0029] Furthermore, step S1 specifically includes the following steps: Step S1.1: The sensor device identifies the smoke box entering the conveying path and generates a smoke box acquisition trigger command.
[0030] Preferably, a through-beam photoelectric sensor can be deployed at the entrance of the cigarette box conveying path, with the installation height flush with the center line of the cigarette box body, and the horizontal installation spacing being 1.2 to 1.4 times the width of the cigarette box conveying channel. The response time can be set to ≤1ms, and the detection distance can be set to 0-2m, adapting to the conventional cigarette box conveying speed of 30m / min in the cigarette production line. The sensor output is connected to the production line PLC controller, and the communication protocol adopts Profinet bus.
[0031] Preferably, the transmitter and receiver of the photoelectric sensor maintain continuous optical path connection, and the sensor outputs a high level under normal conditions. When the smoke box enters the detection area of the conveying path, the optical path is blocked, and the sensor output level flips to a low level. The PLC controller collects the level signal in real time. When the level flip lasts for ≥20ms, it is determined as a valid smoke box entry event, filtering out false triggering events caused by debris or frame vibration during the conveying process.
[0032] Preferably, after the valid smoke box entry event is determined, the PLC controller immediately generates a smoke box acquisition trigger instruction with a high-precision timestamp. The timestamp accuracy is calibrated to 1ms. The instruction includes three core fields: smoke box entry sequence number, trigger time, and corresponding conveying channel number. The instruction is synchronously sent to all acquisition terminals through the Profinet bus to ensure the timing synchronization of subsequent multi-source data acquisition.
[0033] Step S1.2: In response to the cigarette box acquisition trigger command, capture several exterior image data of the cigarette box to obtain a cigarette box exterior image dataset.
[0034] Preferably, the image acquisition equipment can be deployed by circumferentially deploying four industrial area array cameras along the conveying path to the rear of the workstation, corresponding to the front, back, left, and right facades of the smoke box respectively. The camera model is MV-CA050-10GC, with a resolution of 2592×2048, a frame rate of 20fps, and a lens focal length of 16mm. Each camera is equipped with a ring light with a brightness of 800 lux and a color rendering index of ≥90 to avoid image blurring caused by reflections from the smoke box surface coating and ambient light interference.
[0035] Preferably, all camera terminals are clock-synchronized with the PLC controller. Upon receiving the smoke box acquisition trigger command, they synchronously trigger the shutter. Each camera acquires and outputs one 8-bit RGB format facade image at a time. The four cameras synchronously acquire four full facade images of the smoke box. The file size of a single image is ≤5MB, and the image distortion rate is ≤1%.
[0036] Preferably, the dataset generation rule can generate an appearance image data unit corresponding to a single cigarette box by strongly binding the four synchronously acquired appearance images with the time sequence number and timestamp in the trigger command; during continuous acquisition, all appearance image data units of cigarette boxes are sorted in ascending order according to the time sequence number to form a structured cigarette box appearance image dataset.
[0037] Step S1.3: In response to the cigarette box acquisition trigger command, collect the weight data and sealing status detection signal data of the cigarette box to obtain the cigarette box detection signal dataset.
[0038] Preferably, the weight detection device can be a dynamic weighing belt scale, installed at the rear end of the trigger station of the conveying path, with a weighing accuracy calibrated to ±5g, a sampling frequency calibrated to 100Hz, and a range suitable for the weight range of finished cigarette boxes in the cigarette industry, which is typically 5-25kg. The sealing status detection device uses 3 sets of laser displacement sensors, corresponding to the top, bottom, and side sealing tape positions of the cigarette box, respectively. The sensor sampling frequency is calibrated to 1kHz, and the detection accuracy is calibrated to ±0.1mm, used to identify defects such as curled sealing tape, box openings, and incomplete sealing.
[0039] Preferably, after receiving the cigarette box acquisition trigger command, the weighing terminal and the laser displacement sensor terminal immediately enter the acquisition state; when the cigarette box fully enters the weighing area, the weight data acquisition is triggered, and the average value of 100 sets of sampled data is output as the final weight value; when the cigarette box passes through the detection area of the laser displacement sensor, the displacement data of the sealing position is continuously acquired, and the switch signal of the sealing state and the analog signal of continuous displacement are output synchronously.
[0040] Preferably, the collected weight data and sealing status detection signals can be strongly bound to the time sequence number and timestamp of the corresponding cigarette box to generate a detection signal data unit corresponding to a single cigarette box; the detection signal data units of all cigarette boxes are sorted in ascending order according to the time sequence number to form a structured cigarette box detection signal dataset.
[0041] Step S1.4: In response to the smoke box acquisition trigger command, collect the smoke box conveying status data to obtain the smoke box conveying status dataset.
[0042] Preferably, the conveying status data acquisition device includes an incremental encoder and a station position photoelectric sensor; the encoder is installed on the main shaft of the conveying roller drive motor, with a resolution calibrated to 1000 pulses / revolution and a sampling frequency calibrated to 500Hz, and is used to collect data on the conveying roller speed and the real-time conveying speed of the tobacco box; the station position photoelectric sensor is deployed at equal intervals along the conveying path, with a spacing calibrated to 1.1 times the length of the standard tobacco box and a response time ≤1ms, and is used to collect data on the real-time station position and station dwell time of the tobacco box.
[0043] Preferably, after the encoder and the station sensor terminal receive the cigarette box acquisition trigger command, they continuously acquire the corresponding cigarette box's conveying speed, station position, and dwell time data at a sampling interval of 2ms until the cigarette box leaves the conveying path or enters the rejection station, forming a conveying status time sequence of a single cigarette box.
[0044] Preferably, the dataset generation rule can be achieved by integrating the continuously collected transport status time sequence according to timestamps and strongly binding it with the time sequence number of the corresponding cigarette box to generate a transport status data unit corresponding to a single cigarette box; all transport status data units of cigarette boxes are sorted in ascending order according to time sequence number to form a structured cigarette box transport status dataset.
[0045] Step S1.5: The cigarette box appearance image dataset, cigarette box detection signal dataset, and cigarette box conveying status dataset are processed to unify their formats, resulting in a unified multi-source cigarette box dataset.
[0046] Preferably, a unified structured data format specification is formulated to address the heterogeneous characteristics of the three types of datasets. The core rules include: all data units use "time sequence number + timestamp" as the unique primary key; non-image numerical data is uniformly converted into a float64 format numerical array; image data is uniformly converted into a base64 encoded string format, while preserving image resolution, channel data, and other data; and the field naming, data length, and encoding format of all data units follow the unified specification to eliminate format barriers between heterogeneous data.
[0047] Preferably, for data alignment and format conversion: First, all data units of the cigarette box appearance image dataset, cigarette box detection signal dataset, and cigarette box conveying status dataset are read. Data alignment is performed according to the unique primary key to ensure that the three types of data with the same time sequence number are matched into the same data group. For time sequence number ID_i, a data group G_i={Img_i,Sig_i,State_i} is generated, where Img_i is the appearance image data corresponding to ID_i, Sig_i is the detection signal data corresponding to ID_i, and State_i is the conveying status data corresponding to ID_i. Then, each data group is format converted according to the above format specification. The converted data is then checked for format compliance. Data units that fail the check are marked and the conversion is repeated until compliance is achieved.
[0048] Preferably, all compliant structured data groups can be sorted in ascending order by time sequence number to form a unified post-cigarette box multi-source dataset with uniform format and primary key alignment.
[0049] Step S1.6: Merge and store the unified multi-source dataset of cigarette boxes to obtain the original multi-source dataset of cigarette boxes.
[0050] Preferably, the time-series database InfluxDB can be used for data storage. The storage rules are defined as follows: the time series number is used as the unique index key, and the unique identifier of the cigarette box, timestamp, appearance image data, detection signal data, and conveying status data are used as the core field values. Each data record corresponds to the full multi-source data of a single cigarette box. Data writing adopts a batch writing mode, and the batch writing threshold is set to 100 data records to reduce database IO overhead and adapt to the high-frequency data writing scenario of continuous conveying on the production line.
[0051] Preferably, the merged storage execution process is as follows: First, all structured data groups of the unified multi-source tobacco box dataset are read, and deduplication is performed according to the index key to ensure that each index key corresponds to a unique data record; then, the data groups are converted into a record format writable by the database according to the storage rules, and written to the time-series database in batches according to the batch write threshold; after the writing is completed, data integrity verification is performed, and the verification rule is that the missing rate of the core field of a single record is 0, and the verification pass rate must reach 100%.
[0052] Preferably, after verification, the full set of time-series data stored in the time-series database can be labeled as the multi-source original dataset of the cigarette box.
[0053] Beneficial effects of steps S1.1 to S1.6: Step S1.1 generates a trigger command for identifying and collecting data upon the entry of the cigarette box into the conveying path, achieving precise triggering of cigarette box data collection and providing a unified timing benchmark for the synchronous collection of multi-source data, adapting to the collection needs of multiple brands of cigarette boxes transported in the same channel; Step S1.2 completes the collection of cigarette box appearance image data, supplementing the basic data of cigarette box appearance defect dimensions and making up for the lack of data in the single detection dimension of the existing system; Step S1.3 completes the collection of cigarette box weight and sealing status detection signal data, covering the core detection dimension data of the existing rejection equipment, providing basic support for cross-equipment data fusion; Step S 1.4 Complete the collection of cigarette box conveying status data and match the real-time position information of the cigarette box in the conveying path to provide a position benchmark for tracking the dynamic information of the cigarette box; Step S1.5 Through the unified processing of multi-source data formats, eliminate the format differences of output data from different detection devices, break down the data silos of each independent device, and achieve compatibility and adaptation of multi-source data; Step S1.6 Through the merging and storage of the unified multi-source dataset, a complete multi-source original dataset of cigarette boxes is formed, providing unified and complete basic data for subsequent defect identification and traceability management, and alleviating the problem of scattered multi-source data and inability to conduct linkage analysis in the existing system.
[0054] Step S2: Perform data preprocessing on the original multi-source dataset of the cigarette boxes to obtain the preprocessed multi-source dataset of the cigarette boxes.
[0055] Furthermore, step S2 specifically includes the following steps: Step S2.1: Perform duplicate data removal on the original multi-source dataset of cigarette boxes to obtain the deduplicated multi-source dataset of cigarette boxes.
[0056] Preferably, a two-level deduplication method can be used to remove duplicate data. The first level is primary key deduplication, using the "cigarette box time sequence number + millisecond-level timestamp" generated in step S1 as the unique composite primary key. If two data records have completely identical composite primary keys, they are considered primary key duplicates. The second level is content deduplication. For implicit duplicate data with different primary keys but the same cigarette box being collected, numerical fields (detection signal, transmission status) are determined using Euclidean distance with a threshold of ≤1e-5. Image fields are determined using the Perceptual Hash algorithm (pHash) to calculate Hamming distance with a threshold of ≤5. If both conditions are met, the data is considered content duplicate.
[0057] Preferably, a hierarchical rejection process can also be used to perform the rejection operation. Specifically, the entire original dataset of the cigarette boxes from multiple sources is read, sorted in ascending order by the composite primary key, and then traversed. First, primary key duplication rejection is performed, retaining the original record with the highest timestamp precision under the same primary key, and marking all others as redundant data for rejection. Then, content duplication is determined on the remaining data, locking adjacent data groups at the same conveying station with a timestamp difference ≤ 500ms. The Euclidean distance of numerical features and the Hamming distance of image features are calculated for each group. If the data meets the duplication criteria, the original acquisition record with the earlier time sequence number is retained, and the rest are marked as redundant data for rejection. The core pseudocode is as follows: # Primary Key Duplicate Removal sorted_data = sorted(raw_dataset, key=lambda x: (x.seq_id,x.timestamp)) dedup_by_key = {item.union_key: item for item in sorted_data}.values() # Duplicate Content Removal final_dedup = [] window = [] for item in dedup_by_key: window = [x for x in window if item.timestamp - x.timestamp<= 0.5] is_duplicate = False for exist_item in window: dist = euclidean_distance(item.numeric_feature, exist_item.numeric_feature) ham_dist = hamming_distance(phash(item.image_data), phash(exist_item.image_data)) if dist<= 1e-5 and ham_dist<=5: is_duplicate = True break if not is_duplicate: final_dedup.append(item) window.append(item) Preferably, after completing the removal of all redundant data, the remaining valid data records are re-sorted in ascending order according to their time sequence number to generate a deduplicated multi-source dataset of cigarette boxes. A duplicate data removal log is output synchronously, recording the number of removed records, the duplicate type, and the corresponding time sequence number to ensure that no valid data is mistakenly removed.
[0058] Step S2.2: Perform missing value imputation on the deduplicated multi-source tobacco box dataset to obtain the imputed multi-source tobacco box dataset.
[0059] Preferably, missing values can also be determined using a hierarchical approach. Specifically, each record in the deduplicated multi-source dataset of the cigarette box undergoes a full field-level scan, classifying it into three levels of missing values and establishing corresponding processing rules: Level 1 missing values are those in the core primary key fields (time sequence number, timestamp), which are directly determined as invalid records; Level 2 missing values are those in numerical fields (weight, sealing displacement signal, conveying speed, workstation position) where single or multiple fields have empty values, NaN, or exceed the calibrated reasonable range. The calibrated reasonable range is: weight data 5-25kg, conveying speed 0-30m / min, sealing displacement data 0-500mm; Level 3 missing values are those in image fields with missing metadata or abnormal encoding formats, which do not affect the main image data.
[0060] Preferably, invalid records with Level 1 missing data can be directly removed first to avoid interfering with subsequent data processing; for Level 3 missing image metadata, fixed metadata fields are filled in strictly according to the unified format specification of step S1.5 to completely preserve the original image encoded data; for Level 2 missing numerical data, the K-nearest neighbor (KNN) filling algorithm is used first, with the nearest neighbor K value set to 5, the distance metric being Manhattan distance, and the average value of the same field of 5 adjacent valid data of the same brand and workstation as the filling value; for missing data in continuous time series, if the number of missing records in a single segment is ≤3, linear interpolation is used to fill the missing data.
[0061] Preferably, after completing the full missing value processing, the field integrity of all data records is checked. The integrity rate of the core fields of a single record must reach 100%. The records that pass the check are sorted in ascending order by time sequence number to generate the filled cigarette box multi-source dataset.
[0062] Step S2.3: Perform data standardization on the filled cigarette box multi-source dataset to obtain the standardized cigarette box multi-source dataset.
[0063] Preferably, taking advantage of the core characteristic of the DBSCAN clustering algorithm based on Euclidean distance density measurement, Z-score normalization (zero mean normalization) is used to standardize all numerical data to eliminate the differences in the units and magnitudes of different fields; for image data, Min-Max normalization is used to map pixel values to the [0,1] interval to ensure the consistency of subsequent image feature extraction.
[0064] Preferably, the multi-source dataset of the filled cigarette box is read and split into a numerical feature matrix and an image dataset. For the numerical feature matrix, the mean μ and standard deviation σ of the full dataset are calculated according to the field dimension. Z-score standardization is performed on all values of each field row by row. For fields with no fluctuation constants and standard deviation σ=0, the value is directly assigned to 0 to avoid division by zero error. For the image dataset, the base64 encoding is first restored to a pixel matrix. The original pixel values of 0-255 are converted to floating-point values in the range of 0-1 through Min-Max normalization. Then, they are re-encoded into the unified format specified in step S1.5 to completely preserve the structural features of the original image.
[0065] Preferably, after completing the standardization process of all data, the standardized numerical data and normalized image data are re-bound to the original primary key field and timestamp field to ensure that the standardized data of a single record corresponds one-to-one with the unique identifier of the original cigarette box. After sorting in ascending order by time sequence number, a standardized multi-source dataset of cigarette boxes is generated.
[0066] Step S2.4: Perform data verification and integration operations on the standardized multi-source tobacco box dataset to obtain the preprocessed multi-source tobacco box dataset.
[0067] Preferably, full-dimensional verification rules can be set. The first level is format compliance verification, where all data fields must strictly conform to the unified structured format specification defined in step S1.5. Numerical data is in float64 format, image data is in standard base64 encoding format, and the primary key field is not null. The second level is data validity verification, where the proportion of outliers in the standardized numerical data is ≤0.1%, and outliers are defined as values exceeding the ±3σ range. Image data has no encoding errors and no missing pixels. The third level is temporal continuity verification, where the temporal numbers of data records are consecutive without skipping numbers, the timestamp difference between adjacent records matches the cigarette box conveying speed, and there are no temporal disorder or inversion issues.
[0068] Preferably, the standardized multi-source dataset of cigarette boxes is read, and a three-level full-dimensional verification is performed row by row. For records that fail the verification, the abnormal type is marked and returned to the corresponding pre-processing stage for reprocessing. Abnormal records that cannot be repaired are removed. All valid data records that pass the verification are integrated according to a fixed structure of "time sequence number-time stamp-standardized numerical feature matrix-normalized image data-original data mapping address" to generate a structured data set that can be directly input into the DBSCAN clustering algorithm. During the integration process, the mapping relationship between all preprocessed data and original collected data is completely preserved to ensure that subsequent defect tracing can be completely traced back to the original collected data.
[0069] Preferably, after completing the full verification and integration operation, metadata statistics are performed on the final valid data set, outputting the total data volume, data validity rate, and full-process preprocessing operation log. This structured data set is then labeled as the preprocessed multi-source dataset for cigarette boxes. Beneficial effects of steps S2.1 to S2.4: Step S2.1 removes redundant and duplicate content from multi-source data through deduplication, reducing the interference of invalid data on subsequent analysis and adapting to the data deduplication requirements in scenarios where multiple devices collect data independently. Step S2.2 fills in missing values to fill in information gaps generated during data collection, ensuring the integrity of data corresponding to a single cigarette box and solving the problem of data loss caused by differences in the sequence of multiple devices operating independently. Step S2.3 eliminates the differences in the dimensions and magnitudes of output data from different testing devices through data standardization, breaking down the data silos formed by each independent device and achieving unified adaptation of multi-source data. Step S2.4 completes the compliance verification and standardization integration of preprocessed data through data verification and integration, forming a unified and effective preprocessed dataset, ensuring the consistency and effectiveness of data used in subsequent analysis, and making up for the shortcomings of existing systems where multi-source data is scattered and cannot be linked for analysis.
[0070] Step S3: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm. The DBSCAN clustering algorithm uses density clustering mechanism to identify abnormal samples in the preprocessed multi-source tobacco box dataset, and obtain a subset of tobacco box data with defect categories.
[0071] Furthermore, step S3 specifically includes the following steps: Step S3.1: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm to obtain the neighborhood sample set of the tobacco box data through the neighborhood sample search operation.
[0072] Preferably, the preprocessed multi-source dataset of cigarette boxes is first read and split to obtain a standardized numerical feature matrix and a normalized image feature matrix. For the numerical features, four core dimensions are selected as numerical feature vectors: weight deviation, sealing displacement deviation, conveying speed fluctuation, and station dwell time, with the dimension number set to 4. For the image features, the standard perceptual hashing algorithm pHash is used to extract 64-dimensional hash features from each cigarette box facade image. The four facade images are stitched together to obtain a 256-dimensional image feature vector. The numerical feature vector and the image feature vector are then stitched together to generate a 300-dimensional fusion feature vector corresponding to a single cigarette box. The fusion feature vectors of all cigarette boxes are stacked row by row to generate an n×300-dimensional sample feature matrix X, where n is the total number of valid cigarette box samples.
[0073] Next, based on the distribution characteristics of cigarette box data from the cigarette production line, the two core input parameters of the DBSCAN algorithm will be calibrated: ① The neighborhood radius eps was calibrated using the K-distance curve inflection point method, with the K value taken as the subsequent MinPts value. Verified by actual production line test data, the eps calibration was 0.85.
[0074] ② The minimum number of samples in the neighborhood, MinPts, is set to 8 based on the rule of twice the number of feature dimensions and scenario adaptation. This ensures that the clustering results are resistant to noise samples and adapts to the sample distribution characteristics of multiple brands of cigarette boxes being transported on the same line.
[0075] Next, the sample feature matrix X is input into the DBSCAN clustering algorithm. The standard KD-Tree spatial index structure is used to accelerate the neighborhood search and avoid the computational overhead of brute-force matching of all samples. For each sample point Xi in the feature matrix, the Euclidean distance between it and all sample points is calculated. All sample points whose Euclidean distance to Xi is ≤ eps are selected to form the ε-neighborhood sample set Ni of sample Xi.
[0076] Next, after completing the ε-neighborhood search for all n sample points, the neighborhood sample sets corresponding to all samples are sorted in ascending order by time sequence number to construct the neighborhood sample set of the entire cigarette box data. The number of samples in the neighborhood of each sample is recorded simultaneously to provide core input for subsequent density reachability analysis. The pseudocode for the neighborhood search execution is as follows: from sklearn.neighbors import KDTree import numpy as np # Input: Preprocessed fused feature matrix X, neighborhood radius eps def neighborhood_search(X, eps): n_samples = X.shape[0] kd_tree = KDTree(X, leaf_size=30) # Standard KD-Tree indexing speedup neighborhood_set = {} # Perform neighborhood search on a sample-by-sample basis for i in range(n_samples): xi = X[i:i+1, :] # Filter all sample indices with a distance ≤ eps idx = kd_tree.query_radius(xi, r=eps)[0] neighborhood_set[i] = idx # Stores the set of neighborhood sample indices corresponding to sample i return neighborhood_set # Perform a search and generate a set of neighborhood samples eps = 0.85 neighborhood_set = neighborhood_search(X, eps) Step S3.2: Perform density reachability analysis on the neighborhood sample set to obtain the clustering results of the cigarette box data.
[0077] Preferably, it is necessary to strictly follow the density definition rules of the standard DBSCAN algorithm and complete the definition adaptation in combination with the cigarette box detection scenario: ① Core point: If the number of samples within the ε-neighborhood of sample Xi ≥ MinPts (calibrated as 8), then Xi is determined as a core point, corresponding to the core sample of a normal cigarette box; ② Direct density reachability: If sample Xj is within the ε-neighborhood of sample Xi and Xi is a core point, then Xj is said to be directly density reachable from Xi; ③ Density reachability: For the sample sequence Xi1, Xi2,..., Xin, if Xik+1 is directly density reachable from Xik, then Xin is said to be density reachable from Xi1; ④ Density connection: If there exists a sample Xk such that both Xi and Xj are density reachable from Xk, then Xi and Xj are said to be density connected and belong to the same cluster.
[0078] Preferably, the logic for density reachability analysis and cluster division execution: Based on the full neighborhood sample set, use the standard breadth-first search (BFS) algorithm to perform density reachability traversal of all samples. The specific process is as follows: ① Initialize the access marker array for all samples. The initial state of all samples is unvisited, the cluster number is initialized to 0, and the noise samples are marked as -1.
[0079] ② Traverse all samples in the order of sample indices. If the current sample Xi is not visited, mark it as visited and read its neighborhood sample set Ni.
[0080] ③ If the number of samples in Ni ≥ MinPts, determine Xi as a core point, create a new cluster C, add Xi and all unvisited samples in Ni to cluster C, and at the same time add the samples in Ni to the BFS traversal queue.
[0081] ④ Traverse each sample Xj in the queue. If Xj is not visited, mark it as visited and read its neighborhood sample set Nj. If the number of samples in Nj ≥ MinPts, add the samples in Nj to the traversal queue; if Xj does not belong to any cluster, add it to the current cluster C.
[0082] ⑤ If the number of neighborhood samples of the current sample Xi < MinPts and it does not belong to any cluster, temporarily mark it as a noise sample.
[0083] ⑥ Repeat the above traversal process until all samples are visited, and complete the cluster division of all density-connected samples.
[0084] Next, after completing the density reachability analysis of the full sample, three core results will be output: ① A full set of clusters, each cluster corresponding to a group of density-connected normal cigarette box samples, adapting to the normal data distribution of different brands and batches of cigarette boxes; ② A set of core point indices, corresponding to the core normal samples within the clusters; ③ A set of boundary point indices, corresponding to the normal fluctuating samples at the edges of the clusters; ④ A set of temporary noise point indices, corresponding to potential abnormal samples that do not belong to any cluster. All results are strongly bound to the original cigarette box time sequence number and unique identifier, forming a structured cluster partitioning result for the cigarette box data. The pseudocode is as follows: def dbscan_cluster(neighborhood_set, min_pts, n_samples): visited = np.zeros(n_samples, dtype=bool) # Array of visit markers cluster_labels = np.full(n_samples, -1) # Cluster labels, -1 represents noise cluster_id = 0 # Initialize cluster ID for i in range(n_samples): if visited[i]: continue visited[i] = True ni = neighborhood_set[i] # Determine if it is a core point if len(ni)>= min_pts: # Create a new cluster and perform a BFS traversal queue = list(ni) cluster_labels[i] = cluster_id # Traverse the queue while queue: j = queue.pop(0) if not visited[j]: visited[j] = True nj = neighborhood_set[j] # Add the core points to the queue if len(nj)>= min_pts: queue.extend(nj) # Samples not belonging to any cluster are added to the current cluster. if cluster_labels[j] == -1: cluster_labels[j] = cluster_id cluster_id += 1 # Output cluster partitioning results return cluster_labels, cluster_id # Perform clustering partitioning min_pts = 8 cluster_labels, cluster_total = dbscan_cluster(neighborhood_set, min_pts, n_samples) Step S3.3: Based on the clustering results, samples that do not belong to any cluster are selected to obtain a subset of abnormal cigarette box data.
[0085] Preferably, the anomaly judgment rules need to be strictly based on the output results of the DBSCAN clustering algorithm, without manually preset defect thresholds, and are judged entirely based on the data distribution characteristics: samples with a cluster label of -1 and not belonging to any cluster are judged as abnormal samples; samples with a cluster label ≥0 and belonging to a certain cluster are judged as normal samples; for multi-brand cigarette boxes transported on the same line, normal cigarette box samples from different brands will be automatically divided into different clusters to avoid misjudgment caused by cross-brand data distribution differences, without the need to split data by brand in advance.
[0086] Preferably, the cluster label array and cluster partitioning results can be read, and the cluster labels of all samples can be traversed row by row to perform the following operations: ① Filter out all sample indices with a cluster label of -1, and lock the original cigarette box time sequence number and unique identifier corresponding to the abnormal samples.
[0087] ② Based on the locked sample index, extract the full data of the corresponding sample from the preprocessed multi-source dataset of cigarette boxes, including fused feature vectors, original detection signals, appearance images, delivery status data, and timestamp information.
[0088] ③ Perform time-series consistency verification on the selected abnormal samples to ensure that the time sequence number and timestamp of the sample correspond one-to-one with the original collected data, without index misalignment or data mismatch issues, and avoid normal samples being mistakenly selected.
[0089] Preferably, after completing the screening and verification of all abnormal samples, the full data of all abnormal samples are sorted in ascending order by time sequence number to generate a structured subset of abnormal cigarette box data. The total number, percentage, and distribution log of the corresponding cluster division of abnormal samples are output synchronously to provide an accurate target data set for subsequent defect category labeling.
[0090] Step S3.4: Mark the defect category of the abnormal cigarette box data subset to obtain the cigarette box data subset with defect category.
[0091] Preferably, by combining the core defect types rejected from cigarette cartons in the cigarette production line, and based on the dimensional deviation characteristics of the fused feature vectors, four mutually exclusive defect categories can be identified. The labeling rules are entirely based on the quantitative deviation of data features, for example: ① Weight defect labeling: Abnormal samples whose weight feature standardized values exceed the ±3σ range, and whose other feature dimensions standardized values are within the ±2σ range, are labeled as category 01-weight defect; ② Sealing Defect Marking: If the standardized value of the sealing displacement feature of the abnormal sample exceeds the ±3σ range, and the standardized value of the other feature dimensions is within the ±2σ range, it is marked as category 02-sealing defect; ③ Appearance defect labeling: If the image feature hash value of an abnormal sample is ≥20 and the average hash value of the core sample of the corresponding cluster is within ±2σ, it is labeled as category 03-appearance defect; ④ Composite defect labeling: Abnormal samples with two or more feature dimensions exceeding the ±3σ range, or samples that cannot be classified into the above single-type defects, are labeled as category 04-composite defects.
[0092] Preferably, after completing the defect category labeling of all abnormal samples, all abnormal samples with category labels are sorted in ascending order by time sequence number to generate a structured subset of cigarette box data with defect categories. The sample quantity and proportion statistics of each category of defects are output synchronously to complete the entire process of step S3 and provide accurate classification data input for the subsequent source tracing operation in step S4.
[0093] Beneficial effects of steps S3.1 to S3.4: Step S3.1 uses a neighborhood sample search operation to complete the neighborhood feature matching of the preprocessed multi-source data of cigarette boxes, providing a basic sample set for subsequent density clustering analysis, and adapting to the multi-source data feature analysis needs in the scenario of multi-brand cigarette boxes being transported in the same channel; Step S3.2 uses a density reachability analysis operation to complete the clustering of cigarette box data, distinguishing the data feature boundaries between normal and abnormal cigarette boxes, alleviating the problem of existing systems relying solely on single device signals to determine defects and being prone to misjudgment; Step S3.3 uses the clustering results to complete the screening of abnormal samples, accurately locating cigarette box data that deviates from the normal data distribution, reducing the difficulty of defect location during manual re-inspection in the scenario of removing multi-brand cigarette boxes at the same workstation, and reducing the workload of manual re-inspection; Step S3.4 uses defect category labeling of abnormal cigarette box data subsets to complete the defect attribute classification of abnormal samples, providing a clear classification basis for subsequent defect cause tracing, further making up for the shortcomings of existing systems in that defect data cannot be uniformly classified and cannot be analyzed in a coordinated manner.
[0094] Step S4: Perform equipment signal and product traceability operations on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for defective cigarette boxes.
[0095] Furthermore, step S4 specifically includes the following steps: Step S4.1: Extract equipment signal features from the subset of tobacco box data with defect categories to obtain the set of equipment signal features for defective tobacco boxes.
[0096] Preferably, the subset of cigarette box data with defect categories output in step S3 is first read, and each data item is split into its time-series primary key, millisecond-level timestamp, original detection signal time-series sequence, defect category label, and conveying status data. Based on the actual types of detection equipment deployed on the cigarette production line, two categories of core signal feature dimensions, totaling eight dimensions, are calibrated, each corresponding to a specific device without cross-correlation: The first category is trigger-type switch quantity features, including four dimensions: trigger signal from weight detection equipment, trigger signal from sealing detection equipment, trigger signal from appearance detection equipment, and trigger signal from station position sensor. Each dimension is a 0 / 1 binary value, where 1 represents a valid trigger by the corresponding device, and 0 represents no trigger. The second category is analog continuous quantity features, including four dimensions: weight deviation value of weight detection equipment, maximum displacement deviation value of sealing laser displacement sensor, image feature deviation value of appearance camera, and speed fluctuation value of conveying encoder. Each dimension is a standardized floating-point value.
[0097] Preferably, for each defective cigarette box data, based on the timestamp of the cigarette box entering the corresponding inspection station, a 500ms effective signal window is extracted before and after the timestamp, filtering out environmental interference and invalid signals generated by equipment idling outside the window; for switch quantity features, the signal rising edge trigger state within the effective window is extracted, marked as 1 if a valid rising edge exists, and marked as 0 if no valid rising edge exists, solving the timing misalignment problem caused by multiple devices operating independently; for analog quantity features, the peak deviation value between the effective window and the standard value of normal cigarette boxes of the same brand is extracted, eliminating feature offset caused by conventional signal fluctuations; the extracted 8-dimensional feature values are strongly bound to the corresponding cigarette box's time sequence number, defect category, and timestamp to generate a single defective cigarette box's equipment signal feature unit. The pseudocode for feature extraction is as follows: import numpy as np def extract_signal_feature(defect_data, time_window=0.5, standard_value_dict): feature_units = [] for item in defect_data: # Baseline timestamp and effective window truncation base_ts = item.detect_ts start_ts = base_ts - time_window / 2 end_ts = base_ts + time_window / 2 valid_signal = item.raw_signal[(item.raw_signal.ts>= start_ts)&(item.raw_signal.ts<= end_ts)] # Feature Extraction of Switch Quantities switch_feature = np.array([ 1 if np.any(np.diff(valid_signal.weight_trigger) == 1) else 0, 1 if np.any(np.diff(valid_signal.seal_trigger) == 1) else 0, 1 if np.any(np.diff(valid_signal.vision_trigger) == 1) else 0, 1 if np.any(np.diff(valid_signal.position_trigger) == 1) else 0 ]) # Analog Feature Extraction standard_val = standard_value_dict[item.brand_code] analog_feature = np.array([ np.max(np.abs(valid_signal.weight_val - standard_val.weight)), np.max(np.abs(valid_signal.seal_displacement - standard_val.seal_dis)), np.max(np.abs(valid_signal.vision_feature - standard_val.vision_feature)), np.max(np.abs(valid_signal.speed_val - standard_val.speed)) ]) # Feature Unit Binding and Storage feature_unit = { "seq_id": item.seq_id, "defect_type": item.defect_type, "ts": base_ts, "feature_vector": np.concatenate([switch_feature, analog_feature]) } feature_units.append(feature_unit) return feature_units Step S4.2: Perform signal tracing operation on the set of equipment signal features of the defective smoke box to match the corresponding detection equipment trigger record and obtain the correspondence between the equipment signal and the triggering device.
[0098] Preferably, the construction of the basic information database and trigger record database for testing equipment is as follows: A standardized basic information database for testing equipment can be constructed first. Each record contains six core fields: unique equipment number, equipment type, installation station number, signal output protocol, trigger timing threshold, and corresponding defect type. These fields correspond one-to-one with the weight, sealing, and appearance testing equipment actually deployed on the production line. The equipment number uses a 6-digit fixed-length unique coding rule: 2-digit equipment type code + 2-digit station code + 2-digit sequence code.
[0099] For example, the weight detection equipment is coded as 010101, and the sealing detection equipment is coded as 020101, ensuring that each device has a globally unique identifier; a device trigger history database is built simultaneously to store the trigger timestamp, signal characteristics at the time of triggering, and device number of all detection devices on the production line in real time, and the data storage cycle is consistent with the cigarette box production cycle.
[0100] Preferably, a two-level source matching logic of standard time sequence matching + cosine similarity matching can be adopted, without any manual subjective judgment, and is based entirely on quantitative data matching: The first level is time sequence matching, with the matching window set at ±200ms, that is, if the absolute value of the difference between the timestamp of the defective smoke box signal trigger and the timestamp of the equipment trigger record is ≤200ms, it is judged as a time sequence match, and invalid records with time sequence mismatch are filtered out; The second level is feature similarity matching, which uses the standard cosine similarity algorithm to calculate the matching degree between the equipment signal features and the equipment standard trigger features, with the similarity threshold set at ≥0.95 to ensure matching accuracy.
[0101] Preferably, the system can read the set of equipment signal features of the defective smoke box, the basic information database of the detection equipment, and the equipment trigger history database, and perform a matching operation on a feature-by-feature basis: ① Extract the timestamp, 8-dimensional feature vector, and defect category of the current feature unit.
[0102] ② Filter out all device trigger records with timestamps within a ±200ms window from the device trigger history database and generate a candidate matching set.
[0103] ③ For each record in the candidate matching set, extract the standard trigger feature vector of the corresponding device from the basic information database, and calculate the cosine similarity with the current feature vector.
[0104] ④ Filter out device records with a similarity of ≥0.95. If it is a unique match, directly lock the corresponding triggering device; if there are multiple match results, combine the defect category output in step S3, match the defect type corresponding to the device, and lock the unique triggering device.
[0105] ⑤ Establish a one-to-one correspondence between the current defective smoke box timing number, equipment signal characteristics, locked trigger device number, and equipment basic information, without chaotic one-to-many or many-to-one matching.
[0106] Preferably, after completing the source matching of all feature units, all one-to-one correspondences are sorted in ascending order by time sequence number to generate a structured correspondence between equipment signals and triggering devices; the matching success rate and unmatched sample logs are output synchronously, and the matching success rate of a single batch must be ≥99.9% to ensure that the equipment signal of each defective cigarette box can be accurately matched to a unique triggering detection device.
[0107] Step S4.3: Based on the correspondence between the device signal and the triggering device, associate the preset rejection reason rules and establish the mapping relationship between the device signal and the rejection reason.
[0108] Preferably, a standardized rule base for rejection reasons can be constructed using a three-level mapping structure of "equipment number - trigger signal feature - rejection reason". Each rule contains five core fields: unique rule ID, equipment number, trigger signal feature threshold, standard rejection reason code, and rejection reason description. The rule base covers all rejection scenarios on the production line without ambiguity or overlap.
[0109] For example, the core rules are defined as follows: Rule IDR01, device number 010101, trigger feature is absolute weight deviation ≥ 50g, reason code 01 is removed, description is "cigarette box weight out of tolerance"; Rule IDR02, device number 020101, trigger feature is sealing displacement deviation ≥ 2mm, reason code 02 is removed, description is "box not sealed tightly"; Rule IDR03, device number 030101, trigger feature is image feature Hamming distance ≥ 20, reason code 03 is removed, description is "cigarette box appearance defect"; Rule IDR04, triggered by multiple devices simultaneously, reason code 04 is removed, description is "multi-dimensional composite defect"; at the same time, rule priorities are defined, with safety defect rules having higher priority than appearance defect rules, to avoid rule conflicts in composite triggering scenarios.
[0110] Preferably, the mapping relationship can be established by reading the correspondence between device signals and triggering devices, and a preset rule base for eliminating reasons, and then performing the association operation line by line: ① Extract the equipment number, equipment signal characteristics of the defective smoke box, and timing number from the current correspondence.
[0111] ② Using the device number as the search key, filter out all rule entries for the corresponding device from the rule base for removal reasons, and generate a candidate rule set.
[0112] ③ For each rule in the candidate rule set, the current device signal characteristics are quantitatively matched with the feature thresholds in the rule to determine whether the rule triggering conditions are met.
[0113] ④ Locate the unique matching rule entry, extract the corresponding removal reason code and description, and establish a one-to-one mapping relationship between the current device signal, the triggering device, and the removal reason.
[0114] ⑤ For multi-device composite triggering scenarios, merge and eliminate causes according to rule priority, generate a unique mapping relationship corresponding to the composite defect, and ensure that a single device signal corresponds to a unique elimination cause.
[0115] Preferably, after completing the rule association of the full correspondence, all the mapping relationships of "device signal-triggering device-removal reason" are sorted in ascending order by time sequence number to generate a structured mapping relationship between device signal and removal reason.
[0116] Step S4.4: Extract the unique identifier information of the cigarette box data subset with defect category, and obtain the unique data label of the defective cigarette box by combining the mapping relationship.
[0117] Preferably, two types of natively unique identifiers without human intervention are extracted from the subset of cigarette box data with defect categories to ensure the global uniqueness of the identifiers: The first type is the native identifier of the production line, including the global time sequence number of the cigarette box, the production batch number, the brand code, and the cigarette pack inkjet code segment, all of which are natively unique codes generated by the production line inkjet system and control system; the second type is the process unique identifier, including the millisecond-level timestamp of the cigarette box entering the conveying path, the triggering equipment number, and the defect category code, which are strongly bound to the entire process data of the defective cigarette box.
[0118] For example, a standard 32-bit fixed-length numeric encoding rule can be used, which can be generated automatically throughout the entire process without human intervention. The encoding is divided into 5 fixed fields to ensure that the label is globally unique and can be traced throughout the entire process. ① The first four digits: Brand batch code, which corresponds to the four-digit code of the cigarette box brand and production batch.
[0119] ②5-12: Time sequence timestamp code, which is the last 8 decimal digits of the timestamp when the cigarette box enters the conveying path.
[0120] ③ 13th-14th digits: Defect category code, corresponding to the 2-digit defect category code marked in step S3.
[0121] ④ 15th-16th digits: Removal reason code, corresponding to the 2-digit removal reason code generated in step S4.3.
[0122] ⑤ Bits 17-32: Device and sequence code, the first 6 bits are the trigger device number, and the last 10 bits are the global timing serial number of the cigarette box.
[0123] Preferably, this involves generating unique data tags. The system can read subsets of cigarette box data with defect categories, the mapping relationship between equipment signals and rejection reasons, and perform tag generation for each cigarette box. ① Extract the original unique identifier and process unique identifier of the current cigarette box, and complete the numerical encoding of each field according to the encoding rules.
[0124] ② Extract the rejection reason code and trigger device number of the corresponding cigarette box from the mapping relationship and fill them into the corresponding fields.
[0125] ③ Concatenate all fields according to the 32-bit fixed-length rule to generate a unique data label for the current defective cigarette box.
[0126] ④ Strongly bind the generated unique data tag with the full amount of multi-source data, defect category, triggering device information, and removal reason information of the corresponding cigarette box, establish a globally unique mapping between the tag and the original data, and ensure that the entire process data of the defective cigarette box can be completely traced back through the tag.
[0127] Beneficial effects of steps S4.1 to S4.4: Step S4.1 Extracts equipment signal features from a subset of smoke box data with defect categories to obtain a set of equipment signal features for defective smoke boxes. This breaks down the signal data barriers between independent detection devices and adapts to the signal tracing requirements in scenarios where multiple devices are rejected at the same workstation. Step S4.2 Performs signal tracing operations on the set of equipment signal features for defective smoke boxes, matching the trigger records of the corresponding detection devices to obtain the correspondence between equipment signals and triggering devices. This solves the problem of inaccurate association between rejection signals and corresponding devices when multiple devices are operating independently, alleviating the workload of manually searching for rejection causes. Step S4.3 Analyzes the correspondence between equipment signals and triggering devices... The system establishes a mapping relationship between equipment signals and rejection reasons by associating relationships with preset rejection rules, thereby achieving precise binding between defect signals and rejection reasons. This addresses the shortcomings of existing systems that cannot analyze rejection data from multiple devices or clearly identify the causes of defects. Step S4.4 extracts unique identifier information of cigarette boxes from a subset of cigarette box data with defect categories and generates unique data tags for defective cigarette boxes by combining the mapping relationship between equipment signals and rejection reasons. This achieves unified identification of defective cigarette box information throughout the entire process, solving the problems of information chaos and difficulty in tracing the source of defective cigarette boxes in the same workstation rejection scenario, and providing a unique identification benchmark for the dynamic tracking of defective cigarette boxes.
[0128] Step S5: Input the unique data tag and the corresponding conveying status data of the multi-source original data of the cigarette box into the dynamic transmission optimization algorithm based on the workstation load, and plan the optimal transmission path by adapting the data load of the external production management system through the load adjustment mechanism.
[0129] Furthermore, step S5 specifically includes the following steps: Step S5.1: Read the unique data tag of the defective cigarette box and the transportation status data in the multi-source original dataset of the cigarette box to obtain the defective cigarette box data set for the planned transmission path.
[0130] Preferably, firstly, the unique data tag set of defective cigarette boxes output in step S4 is read, and the core fields of global time sequence number, defect category code, rejection reason code, and triggering device number of the cigarette box are extracted from the tags; simultaneously, the full amount of conveying status data in the multi-source raw dataset of cigarette boxes generated in step S1 is read, and the core fields of cigarette box time sequence number, real-time workstation location, conveying channel number, real-time conveying speed, workstation dwell time, target rejection workstation number, and timestamp are extracted; the global time sequence number of the cigarette box is calibrated as the unique joint primary key for matching the two types of data, ensuring that the unique data tag of a single cigarette box matches the conveying status data.
[0131] Preferably, an inner join method can be used to align the primary keys of the two types of data, retaining only data entries with completely matching primary keys and filtering out invalid data with failed primary key matches. Based on the timestamp and workstation information of the conveying status data, offline cigarette box data that has been removed and left the conveying path is filtered out, while only defective cigarette box data that is in the process of conveying and has not yet reached the removal workstation is retained. The pseudocode for alignment and filtering is as follows: import pandas as pd def align_planning_data(label_dataset, transport_dataset): # Primary key inner join alignment merged_data = pd.merge(label_dataset, transport_dataset, on="seq_id", how="inner") # Filtering Offline Defective Smoke Box Data online_data = merged_data[(merged_data.is_online == 1)&(merged_data.arrive_reject_station == 0)] # Constructing Data Units to be Planned planning_dataset = online_data[["seq_id","unique_label","current_station","channel_id", "transport_speed","target_station","defect_type","reject_reason_code","ts"]] return planning_dataset.to_dict("records") Step S5.2: Obtain the data load status of the external production management system to get the current system load data.
[0132] Preferably, it can interface with external cigarette production management systems, including Manufacturing Execution System (MES), conveyor line PLC control systems, and Supervisory Control and Data Acquisition (SCADA) systems, via the standard OPCUA communication protocol. There is no proprietary protocol adaptation, ensuring the universality and real-time nature of data acquisition. The acquired data is calibrated across three core dimensions, with all dimensions being native, real-time output data from the system. ① Transmission link load: bandwidth utilization rate of data transmission channels at each workstation, data buffer queue length, and one-way transmission delay.
[0133] ②Workstation operating load: Motor load rate of each conveying station, number of smoke boxes to be processed, and station passage occupancy status.
[0134] ③System computing load: CPU utilization, memory utilization, and database write queue length of the production management system.
[0135] Preferably, the data sampling frequency is 10Hz, the data refresh cycle is 100ms, the acquisition time window is aligned with the timestamp of the data set to be planned in step S5.1, and the timing error is ≤50ms, to ensure that the load data and the delivery status of the cigarette box to be planned are matched in real time; the standard Min-Max normalization algorithm is used to standardize all load data and map the values of all dimensions to the [0,1] interval.
[0136] Preferably, this involves load data acquisition and generation. According to calibrated acquisition rules, real-time data from three major load dimensions can be read synchronously to complete data cleaning, filtering out abnormal acquisition values exceeding the measurement range, and using linear interpolation to complete occasional missing data. Standardization processing is then performed on the cleaned full load data, constructing an n×m dimensional system current load data matrix, where n is the total number of acquisition nodes and m is the total number of load dimensions. The load data matrix is strongly bound to the acquisition timestamp and node number to generate structured system current load data. The real-time performance of the data is simultaneously verified to ensure that the difference between the data acquisition completion time and the path planning start time is ≤200ms.
[0137] Step S5.3: Input the defective smoke box data set of the transmission path to be planned into the dynamic transmission optimization algorithm based on workstation load. Based on the defective smoke box data set and the current system load data, a preliminary transmission path scheme is calculated through the load adjustment mechanism.
[0138] Preferably, the standard weighted directed graph shortest path algorithm (Dijkstra's algorithm) can be used as the core computing framework of the dynamic transmission optimization algorithm based on workstation load, and the path weight can be dynamically updated by combining the load adjustment mechanism.
[0139] Among them, the core parameters of the algorithm are: ① Construction rules for the directed graph of the conveying path: Each conveying station and data transmission access node is used as a vertex of the directed graph, and the physical conveying channels and data transmission links between stations are used as directed edges. The initial weight of the edge is the standard one-way transmission delay of the link, in milliseconds.
[0140] ② Load adjustment weight coefficients: The weights of the calibrated link bandwidth utilization rate are α=0.4, the weights of the number of cigarette boxes to be processed at the workstation are β=0.4, and the weights of the system computing power load rate are γ=0.2. The sum of the three types of coefficients is 1 to ensure that the impact of the load on the path weights is in line with the production line operation priority.
[0141] ③ Path constraints: The path follows the flow of "current station of defective cigarette box → target rejection station → data access node of production management system".
[0142] Preferably, regarding the load adjustment mechanism and weight update, the weight of each directed edge in the directed graph can be updated in real time based on the current system load data output in step S5.2, using the following update formula: w ij =w ij0 ×(1+α×l ij +β×s ij +γ×c sys Where wij is the real-time weight of the edge from vertex i to vertex j, and wj is the weight of the edge from vertex i to vertex j. ij0 Let l be the initial weight of the edge. ij s represents the standardized bandwidth utilization of this link. ij c represents the standardized number of smoke boxes to be processed at the corresponding workstation in this link. sys To standardize the system's computing power load rate.
[0143] Preferably, the defective smoke box data set of the transmission path to be planned output in step S5.1 and the current system load data output in step S5.2 are input into the algorithm to perform the path calculation operation: ① Based on real-time load data, complete the full update of the edge weights of the directed graph and construct a real-time dynamic directed graph.
[0144] ② For each defective cigarette box data unit, starting from the vertex corresponding to the current workstation and ending at the data access node of the production management system, use Dijkstra's algorithm to traverse all feasible paths, calculate the total weight, estimated transmission delay, and sequence of nodes along each path.
[0145] ③ For each defective cigarette box, retain the top 5 feasible paths with the highest total weight, and remove invalid paths whose total weight exceeds the threshold.
[0146] ④ Group all feasible paths according to the time sequence number of the defective smoke boxes to generate a preliminary set of structured transmission path schemes. The pseudocode for the algorithm execution is as follows: import networkx as nx def generate_initial_path(planning_dataset, load_data, G_origin): initial_path_scheme = [] # Update graph edge weights based on load data G = G_origin.copy() for u, v, data in G.edges(data=True): l_ij = load_data.loc[(u, v),"bandwidth_usage"] s_ij = load_data.loc[(u, v),"box_count"] c_sys = load_data["sys_cpu_usage"].mean() w_ij = data["init_weight"] * (1 + 0.4*l_ij + 0.4*s_ij + 0.2*c_sys) G[u][v]["weight"] = w_ij # Calculate feasible paths for each smoke box for item in planning_dataset: start_node = item["current_station"] end_node = sys_access_node # Calculate the top 5 shortest feasible paths feasible_paths = list(nx.shortest_simple_paths(G, start_node,end_node, weight="weight"))[:5] # Generate Path Scheme Unit path_unit = { "seq_id": item["seq_id"], "unique_label": item["unique_label"], "feasible_paths": feasible_paths, "ts": item["ts"] } initial_path_scheme.append(path_unit) return initial_path_scheme Step S5.4: Perform load adaptability verification on the preliminary transmission path scheme to obtain a transmission path scheme that adapts to the load of the external production management system.
[0147] Preferably, all verification rules are quantified hard constraints, with no subjective human judgment involved. For example, the specific rules are as follows: ① Topology compliance verification: The path node sequence must conform to the physical topology of the conveyor line. All nodes along the route must be online and running, with no offline or faulty nodes. Paths with offline nodes will be eliminated. ② Load threshold verification: The bandwidth occupancy rate of all transmission links along the path is ≤85%, the number of cigarette boxes to be processed at the current workstations is ≤10, and the computing power load rate of the production management system is ≤90%. All indicators must be met simultaneously to pass the verification. Paths with any indicators exceeding the threshold will be eliminated. The threshold is based on the safety boundary of continuous operation of the cigarette production line to avoid transmission congestion and workstation accumulation. ③ Timing compatibility check: The estimated transmission delay of the path is less than or equal to the estimated time for the cigarette box to reach the target rejection station from the current workstation, ensuring that the defect information arrives at the rejection station before the cigarette box, avoiding information lag that causes confusion in the cigarette box information and rejection of paths with mismatched timing.
[0148] Step S5.5: Perform optimality screening on the transmission path scheme to obtain the optimal transmission path for the defective cigarette box information data.
[0149] Preferably, the optimality evaluation system can use the standard TOPSIS method (approximation of ideal solution ranking method) as the core algorithm for path optimality screening; it has four quantitative evaluation dimensions, all of which are objective values that can be calculated in real time: ① Total path weight, minimized metric, weight percentage 30%.
[0150] ②Estimated transmission delay, minimized metric, weighted at 30%.
[0151] ③ Average load rate of the transit links, a minimum metric, with a weighting of 25%.
[0152] ④ Number of path nodes, a minimum indicator, with a weight of 15% and a total weight of 100%, matching the priority requirements of production line transmission.
[0153] Next, read the set of transmission path schemes adapted to the load of the external production management system output in step S5.4, and perform a filtering operation on each defective smoke box: ① Extract all the adaptation paths corresponding to the current cigarette box and construct a decision matrix according to 4 evaluation dimensions.
[0154] ② Perform vector standardization on the decision matrix to eliminate the dimensional differences between different dimensions.
[0155] ③ Determine the positive ideal solution (optimal value of each dimension) and the negative ideal solution (worst value of each dimension).
[0156] ④ Calculate the Euclidean distance from each path to the positive ideal solution and the negative ideal solution.
[0157] ⑤ Calculate the relative proximity of each path. The proximity value ranges from [0,1]. The closer the proximity is to 1, the better the overall performance of the path.
[0158] ⑥ Select the path with the highest relative proximity as the optimal transmission path for the current defective cigarette box.
[0159] Beneficial effects of steps S5.1 to S5.5: Step S5.1 integrates the unique data tags of defective cigarette boxes with the cigarette box conveying status data to obtain a defective cigarette box data set for the planned transmission path, providing complete core data input for transmission path planning and adapting to the dynamic information management needs of multi-brand cigarette box conveying scenarios in the same channel; Step S5.2 obtains the current system load data by acquiring the data load status of the external production management system, breaking down the data barrier between independent testing equipment and the upper-level management system, providing a real-time load benchmark for transmission path planning, and alleviating the problem that existing systems cannot link and adapt to the system's operating status due to multiple data sources; Step S5.3 calculates a preliminary transmission path scheme by combining the defective cigarette box data set and the current system load data through a load adjustment mechanism based on the dynamic conveying optimization algorithm of the workstation load, and matches the workstations. Real-time load status provides a feasible solution for the dynamic transmission of defective cigarette box information, supporting dynamic information tracking during the cigarette box flow process; Step S5.4, through load adaptability verification of the preliminary transmission path scheme, obtains a transmission path scheme adapted to the load of the external production management system, ensuring compatibility between the information transmission process and the system operating status, avoiding information lag caused by data transmission congestion, and making up for the shortcomings of the existing system's lack of dynamic data transmission adaptability; Step S5.5, through optimal screening of the adapted transmission path scheme, obtains the optimal transmission path for defective cigarette box information data, ensuring the real-time and stability of defective cigarette box information transmission, providing dynamic data support for production line blockage early warning and equipment operating status identification, and alleviating the problems of information transmission lag and inability to support intelligent management of the conveyor line in the existing system.
[0160] Step S6: Based on the optimal transmission path, store the unique data tag and the corresponding transport status data of the multi-source original data of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database.
[0161] Furthermore, step S6 specifically includes the following steps: Step S6.1: Match the data transmission link of the external production management system according to the optimal transmission path.
[0162] Preferably, a standardized production management system transmission link basic information database can be constructed. Each link record contains nine core fields: globally unique link ID, link start node, link end node, standard communication protocol, interface unified resource locator, access authentication rules, link rated bandwidth, real-time operating status, and the system business domain mapped to the link. This database is fully mapped to the directed graph topology structure constructed in step S5. The communication protocol uniformly adopts the standard OPC UA and MQTT 3.1.1 protocol, which is compatible with the general interface specifications of mainstream production management systems (MES, SCADA) in the cigarette industry, without any proprietary protocol adaptation. Access authentication adopts the standard X.509 digital certificate two-way authentication mechanism to ensure the security and compliance of link transmission.
[0163] Preferably, link matching can be based on the node sequence of the optimal transmission path, extracting adjacent node pairs segment by segment, using the adjacent node pairs as the retrieval key, and filtering out the physical transmission links with corresponding link IDs from the transmission link basic information database; performing availability hard constraint verification on the filtered links, eliminating links that do not meet the constraints, and locking in the unique physical transmission link that meets the requirements; concatenating all segmented links corresponding to the path node sequence in sequence to form an end-to-end complete data transmission channel, and establishing a one-to-one mapping relationship between the unique data tag of the defective cigarette box and the complete transmission link; the pseudocode for matching execution is as follows: import pandas as pd def match_transmission_link(optimal_path_result, link_base_lib): matched_link_set = [] for path_item in optimal_path_result: seq_id = path_item["seq_id"] unique_label = path_item["unique_label"] node_sequence = path_item["optimal_path_node_seq"] full_link = [] link_valid = True for i in range(len(node_sequence)-1): start_node = node_sequence[i] end_node = node_sequence[i+1] target_link = link_base_lib[(link_base_lib["start_node"] ==start_node)&(link_base_lib["end_node"] == end_node)] if target_link.empty or target_link["online_status"].values[0]!= 1 or target_link["bandwidth_usage"].values[0]>0.8: link_valid = False break full_link.append(target_link["link_id"].values[0]) if link_valid: matched_unit = { "seq_id": seq_id, "unique_label": unique_label, "matched_full_link": full_link, "link_access_address": target_link["interface_url"].values[0], "auth_cert": target_link["auth_cert"].values[0] } matched_link_set.append(matched_unit) return matched_link_set Step S6.2: Retrieve the full-process association data of the corresponding defective cigarette box through the information transmission link to obtain the full-process information of the defective cigarette box to be put into the warehouse.
[0164] Preferably, the 32-bit unique data tag of the defective cigarette box is used as the globally unique retrieval key to define the scope of data retrieval for the entire process, covering the entire lifecycle data of the defective cigarette box from production line to transportation. For example, it is specifically divided into 6 core data fields: ① Original data acquisition domain: The tobacco box appearance image dataset, tobacco box detection signal dataset, and tobacco box conveying status dataset generated in step S1.
[0165] ②Preprocessed data domain: The full set of standardized feature data generated in step S2.
[0166] ③Defect identification data domain: defect category labels, cluster analysis results, and abnormal feature deviation data generated in step S3.
[0167] ④ Source Mapping Data Domain: The mapping relationship between the triggering device information, the removal reason code, and the device signal and removal reason generated in step S4.
[0168] ⑤ Path transmission data field: the optimal transmission path node sequence, link matching information, and system load data generated in step S5.
[0169] ⑥ Production Native Data Domain: Cigarette box production batch, work order number, brand code, inkjet printing information, corresponding equipment operation log, and baseline data of normal cigarette boxes in the same batch, retrieved from the external production management system.
[0170] Preferably, data retrieval and integration can be based on the adapted information transmission link, completing two-way authentication and link connection with the external production management system. Standardized data retrieval commands are sent to the production management system and the local front-end database according to the calibrated search key and retrieval range. The original data of each data field is received and aligned according to the unique search key, ensuring that all data fields of the same defective cigarette box match to the same data group, with no primary key misalignment or data mismatch. The aligned full data is then checked for format compliance; data that does not conform to the format specifications is converted according to unified rules to ensure the consistency of the entire data format. All data fields are then spliced and integrated according to a fixed structure to generate a full-process information unit corresponding to a single defective cigarette box. The retrieval execution pseudocode is as follows: def fetch_full_process_data(matched_link_set, retrieve_time_window): pending_storage_dataset = [] for link_unit in matched_link_set: connect_status = link_connect(link_unit["link_access_address"],link_unit["auth_cert"]) if connect_status != 0: continue unique_label = link_unit["unique_label"] seq_id = link_unit["seq_id"] start_ts = retrieve_time_window[seq_id]["start_ts"] end_ts = retrieve_time_window[seq_id]["end_ts"] data_domains = {} data_domains["raw_collection"] = fetch_data(unique_label, start_ts, end_ts,"raw_data_domain") data_domains["preprocess"] = fetch_data(unique_label, start_ts,end_ts,"preprocess_domain") data_domains["defect_detect"] = fetch_data(unique_label, start_ts, end_ts,"defect_domain") data_domains["traceability"] = fetch_data(unique_label, start_ts,end_ts,"trace_domain") data_domains["path_trans"] = fetch_data(unique_label, start_ts,end_ts,"path_domain") data_domains["production_original"] = fetch_data(unique_label,start_ts, end_ts,"production_domain") full_info_unit = { "seq_id": seq_id, "unique_label": unique_label, "full_process_data": data_domains, "ts": end_ts } pending_storage_dataset.append(full_info_unit) return pending_storage_dataset Step S6.3: Perform data consistency and integrity verification on the entire process information of the defective cigarette boxes to be put into storage, and obtain the complete process information of the defective cigarette boxes that have passed the verification.
[0171] Preferably, a fully automated verification system without human intervention can be constructed, divided into two levels: integrity verification and consistency verification. All verification rules are quantitative hard constraints, with no subjective judgment steps. For example, the first level is integrity verification, which defines a whitelist of 32 core fields, covering unique data tags, time series numbers, timestamps, and the core key fields of 6 data fields. The verification rules are that the non-empty rate of the core fields of a single full-process information unit must reach 100%, with no null values, NaN values, or outliers exceeding the measurement range; image data must have no encoding errors or missing pixels; and time series numbers must be consecutive without skipping numbers. The second level is consistency verification, which defines 4 quantitative constraints, all of which must be satisfied simultaneously: ① Primary key consistency: Each field of the unique data tag completely matches the brand code, time sequence timestamp, defect category code, removal reason code, and equipment number of the corresponding data field, with a matching accuracy of 100%.
[0172] ②Time sequence consistency: All timestamps of the entire process data are incremented in the forward direction according to the cigarette box transportation process, with no timestamp inversion or time sequence misalignment issues, and the difference between the timestamps of adjacent links and the time deviation of the transportation process is ≤500ms.
[0173] ③ Feature consistency: The deviation of abnormal features in the defect identification process from the corresponding feature values in the original collected data is ≤1e-5, with no feature tampering or mismatch issues; ④ Hash consistency: The SHA-256 hash verification value of the entire process data is completely consistent with the original hash value of the output data of each stage.
[0174] Preferably, the verification pseudocode is as follows: import hashlib import numpy as np def data_verify(pending_storage_dataset, core_field_list): verified_dataset = [] for info_unit in pending_storage_dataset: integrity_pass = True for field in core_field_list: if info_unit.get(field) is None or info_unit.get(field) =="": integrity_pass = False break if not integrity_pass: continue consistency_pass = True label_split = split_unique_label(info_unit["unique_label"]) if label_split["defect_type"] != info_unit["full_process_data"]["defect_detect"]["defect_type"]: consistency_pass = False ts_list = get_all_ts(info_unit["full_process_data"]) if not all(ts_list[i]<= ts_list[i+1]for i in range(len(ts_list)-1)): consistency_pass = False feature_raw = info_unit["full_process_data"]["raw_collection"]["feature_vector"] feature_defect = info_unit["full_process_data"]["defect_detect"]["feature_vector"] if np.max(np.abs(feature_raw - feature_defect))>1e-5: consistency_pass = False raw_hash = info_unit["full_process_data"]["raw_collection"]["data_hash"] current_hash = hashlib.sha256(str(info_unit["full_process_data"]["raw_collection"]).encode()).hexdigest() if raw_hash != current_hash: consistency_pass = False if consistency_pass: info_unit["verify_pass"] = 1 info_unit["verify_ts"] = get_current_ts() info_unit["verify_hash"] = hashlib.sha256(str(info_unit).encode()).hexdigest() verified_dataset.append(info_unit) return verified_dataset Step S6.4: Write the full process information of the defective cigarette boxes that have passed the verification into the cigarette box production management database.
[0175] Preferably, the cigarette box production management database can adopt a two-tier distributed architecture of "time-series database + relational database". The time-series database uses standard InfluxDB 2.0 to store time-series data for the entire cigarette box process, adapting to high-frequency writes and fast traceability query scenarios. The relational database uses standard MySQL 8.0 to store non-time-series core data such as structured information, unique data tags, and defect categories of defective cigarette boxes, adapting to relational query scenarios in production management. Wherein: ① Primary Key Rule: The 32-bit unique data tag of the defective cigarette box is used as the globally unique primary key to ensure that each record is globally unique.
[0176] ② Transaction rules: The database transaction adopts ACID properties. The full data writing of a single defective cigarette box is an atomic transaction. Either all data is written successfully or all data is rolled back, avoiding information loss caused by partial data writing.
[0177] ③ Idempotency rule: An idempotent write mechanism is built based on the unique primary key. When data with the same primary key is written repeatedly, it is directly overwritten and updated without generating duplicate records.
[0178] ④ Batch write rule: The batch write threshold is set to 50 records to reduce database IO overhead and adapt to high-frequency write scenarios in continuous production line operation.
[0179] Beneficial effects of steps S6.1 to S6.4: Step S6.1 Matches the data transmission link of the external production management system according to the optimal transmission path, opening up the transmission channel between defective cigarette box information and the production management system. This adapts to the information transmission needs of scenarios involving the simultaneous transport of multiple brands of cigarette boxes and the rejection of multiple devices at the same workstation, breaking down the data barriers between independent testing equipment and the upper-level management system. Step S6.2 Retrieves the full-process related data of the corresponding defective cigarette box through the information transmission link, obtaining the full-process information of the defective cigarette box to be put into storage. This integrates the related data of the entire defective cigarette box chain, addressing the shortcomings of the existing system where defective data is scattered and cannot form a complete information chain, providing a complete data foundation for the traceability of defective cigarette boxes. S6.3 Perform data consistency and integrity verification on the entire process information of defective cigarette cartons to be put into storage, and obtain the verified complete process information of defective cigarette cartons. This ensures the accuracy and standardization of the data entering the warehouse, avoids the information chaos problem in the scenario of removing cigarette cartons from the same workstation of multiple brands, and reduces the error risk of subsequent data application. Step S6.4 Write the verified complete process information of defective cigarette cartons into the cigarette carton production management database, complete the standardized storage of the complete process information of defective cigarette cartons, form a complete data closed loop, and provide traceable and analyzable effective data support for the refined management of cigarette production, making up for the problems of insufficient data value mining and lack of intelligent management capabilities in the existing system.
[0180] Overall beneficial effects of steps S1 to S6: A systematic solution is developed to address existing pain points in the cigarette carton transportation process during cigarette production. Step S1 involves the synchronous collection of multi-dimensional data from the cigarette cartons, providing a unified data foundation for end-to-end information management and breaking down data silos caused by the independent operation of various testing devices. Step S2 standardizes and preprocesses the collected raw data to ensure consistency and validity for subsequent analysis. Step S3 uses density clustering to identify abnormal samples and classify defects in the cigarette carton data, reducing the workload of manual re-inspection and alleviating the difficulty of locating defect causes in multi-brand cigarette cartons rejected at the same workstation. Step S4 establishes signal tracing and product information association for defective cigarette cartons, creating a correspondence between detection signals and rejection reasons, and generating defect... The unique identifier for each cigarette box solves the problems of chaotic information and difficulty in tracing defective cigarette boxes, enabling dynamic information tracking during the movement of cigarette boxes. Step S5 optimizes the transmission path of defective cigarette box information based on the workstation load, adapts to the data load status of the production management system, ensures the real-time and stability of defective cigarette box information transmission, and provides dynamic data support for production line blockage early warning and equipment status identification. Step S6 completes the standardized storage of defective cigarette box information throughout the entire process, forming a complete data closed loop, providing traceable and analyzable full-process data support for the refined production management of cigarette production lines, and making up for the shortcomings of insufficient data value mining and lack of intelligent management capabilities in the existing system.
[0181] like Figure 2As shown, this embodiment provides an example of an information management device for defective cigarette boxes. In this embodiment, the information management device is applied to the information management method described in the above embodiment.
[0182] Specifically, the information management device includes a tobacco box data collection module 1, a tobacco box data preprocessing module 2, a tobacco box data clustering module 3, a defective tobacco box data tag generation module 4, a data tag transmission path planning module 5, and a data tag transmission and storage module 6, which are connected electrically or communicationally in sequence.
[0183] The system comprises the following modules: a cigarette box data collection module 1, which collects detection signals, appearance images, and transport status data of the cigarette boxes using sensing devices to obtain a multi-source raw dataset; a cigarette box data preprocessing module 2, which preprocesses the multi-source raw dataset to obtain a preprocessed multi-source dataset; a cigarette box data clustering module 3, which inputs the preprocessed multi-source dataset into the DBSCAN clustering algorithm to identify anomalous samples in the preprocessed multi-source dataset using the density clustering mechanism of the DBSCAN algorithm, thereby obtaining a subset of cigarette box data with defect categories; and a defective cigarette box data label generation module 4, which generates labels for the cigarette box data. The subset performs equipment signal and product traceability operations, establishes a mapping relationship between equipment signals and rejection reasons, and generates a unique data tag for the defective cigarette box; the data tag transmission path planning module 5 is used to input the unique data tag and the corresponding conveying status data of the multi-source original data of the cigarette box into a dynamic transmission optimization algorithm based on the workstation load, and plans the optimal transmission path to adapt to the data load of the external production management system through a load adjustment mechanism; the data tag transmission storage module 6 is used to store the unique data tag and the corresponding conveying status data of the multi-source original data of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database according to the optimal transmission path.
[0184] 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.
[0185] 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 7 includes a processor 71 and a memory 72 coupled to the processor 71.
[0186] The memory 72 stores program instructions for implementing information management of the defective cigarette box in any of the above embodiments.
[0187] The processor 71 is used to execute program instructions stored in the memory 72 to perform information management of defective cigarette boxes.
[0188] The processor 71 can also be referred to as a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip with signal processing capabilities. The processor 71 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.
[0189] 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 The storage medium 8 in this embodiment stores program instructions 81 capable of implementing all the above methods. These program instructions 81 can be stored in the storage medium as 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 this 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.
[0190] 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.
[0191] 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 information management of defective cigarette boxes, wherein the method is applied to cigarette boxes in a conveying process, the cigarette boxes being transported and sorted via a conveying path, the conveying path having sensing devices, characterized in that, The information management method includes: Step S1: Collect the detection signal, appearance image, and transport status data of the cigarette box through the sensing device to obtain the multi-source raw dataset of the cigarette box; Step S2: Perform data preprocessing on the original multi-source dataset of the cigarette box to obtain the preprocessed multi-source dataset of the cigarette box; Step S3: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm. The density clustering mechanism of the DBSCAN clustering algorithm is used to identify abnormal samples in the preprocessed multi-source tobacco box dataset to obtain a subset of tobacco box data with defect categories. Step S4: Perform equipment signal and product traceability operation on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for defective cigarette boxes; Step S5: Input the unique data tag and the corresponding conveying status data of the multi-source original data of the cigarette box into the dynamic transmission optimization algorithm based on the workstation load, and plan the optimal transmission path by adapting the data load of the external production management system through the load adjustment mechanism. Step S6: Based on the optimal transmission path, store the transportation status data corresponding to the unique data tag and the multi-source original data of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database.
2. The information management method according to claim 1, characterized in that, Step S1: Collect the detection signal, appearance image, and transport status data of the cigarette box using the sensing device to obtain a multi-source raw dataset of the cigarette box, including: Step S1.1: The sensing device identifies that the cigarette box has entered the conveying path and generates a cigarette box acquisition trigger command; Step S1.2: In response to the cigarette box acquisition trigger command, capture several exterior image data of the cigarette box to obtain a cigarette box exterior image dataset; Step S1.3: In response to the cigarette box acquisition trigger command, collect the weight data and sealing status detection signal data of the cigarette box to obtain the cigarette box detection signal dataset; Step S1.4: In response to the cigarette box acquisition trigger command, collect the cigarette box conveying status data to obtain the cigarette box conveying status dataset; Step S1.5: Perform format unification processing on the cigarette box appearance image dataset, the cigarette box detection signal dataset, and the cigarette box conveying status dataset to obtain a unified cigarette box multi-source dataset; Step S1.6: Merge and store the unified multi-source dataset of cigarette boxes to obtain the original multi-source dataset of cigarette boxes.
3. The information management method according to claim 1, characterized in that, Step S2: Perform data preprocessing on the original multi-source dataset of the cigarette boxes to obtain a preprocessed multi-source dataset of the cigarette boxes, including: Step S2.1: Perform duplicate data removal operation on the original multi-source dataset of cigarette boxes to obtain a deduplicated multi-source dataset of cigarette boxes; Step S2.2: Perform missing value imputation on the deduplicated multi-source cigarette box dataset to obtain the imputed multi-source cigarette box dataset; Step S2.3: Perform data standardization on the filled cigarette box multi-source dataset to obtain a standardized cigarette box multi-source dataset; Step S2.4: Perform data verification and integration operations on the standardized multi-source tobacco box dataset to obtain a preprocessed multi-source tobacco box dataset.
4. The information management method according to claim 1, characterized in that, Step S3: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm. Use the density clustering mechanism of the DBSCAN algorithm to identify anomalous samples in the preprocessed multi-source tobacco box dataset, obtaining a subset of tobacco box data with defect categories, including: Step S3.1: Input the preprocessed multi-source tobacco box dataset into the DBSCAN clustering algorithm to obtain the neighborhood sample set of the tobacco box data through neighborhood sample search operation; Step S3.2: Perform density reachability analysis on the neighborhood sample set to obtain the clustering results of the cigarette box data; Step S3.3: Based on the clustering results, samples that do not belong to any cluster are selected to obtain a subset of abnormal cigarette box data; Step S3.4: Mark the defect category of the abnormal cigarette box data subset to obtain the cigarette box data subset with defect category.
5. The information management method according to claim 1, characterized in that, Step S4: Perform equipment signal and product traceability operations on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for the defective cigarette box, including: Step S4.1: Extract equipment signal features from the subset of smoke box data with defect categories to obtain the set of equipment signal features for defective smoke boxes; Step S4.2: Perform signal tracing operation on the set of equipment signal features of the defective smoke box to match the corresponding detection equipment trigger record and obtain the correspondence between the equipment signal and the triggering device; Step S4.3: Based on the correspondence between device signals and triggering devices, associate preset rejection reason rules to establish a mapping relationship between device signals and rejection reasons; Step S4.4: Extract the unique identifier information of the cigarette box data subset with defect category, and combine it with the mapping relationship to obtain the unique data label of the defective cigarette box.
6. The information management method according to claim 1, characterized in that, Step S5 involves inputting the unique data tag and the corresponding conveying status data from the multi-source raw data set of the cigarette box into a dynamic transmission optimization algorithm based on workstation load. This algorithm uses a load adjustment mechanism to adapt to the data load of the external production management system and plan the optimal transmission path, including: Step S5.1: Read the unique data tag of the defective cigarette box and the transportation status data in the multi-source original dataset of the cigarette box to obtain the defective cigarette box data set with the planned transmission path; Step S5.2: Obtain the data load status of the external production management system to get the current system load data; Step S5.3: Input the defective smoke box data set of the transmission path to be planned into the dynamic transmission optimization algorithm based on workstation load, and calculate the preliminary transmission path scheme based on the defective smoke box data set and the current system load data through the load adjustment mechanism. Step S5.4: Perform load adaptability verification on the preliminary transmission path scheme to obtain a transmission path scheme that adapts to the load of the external production management system. Step S5.5: Perform optimality screening on the transmission path scheme to obtain the optimal transmission path for the defective cigarette box information data.
7. The information management method according to claim 1, characterized in that, Step S6: Based on the optimal transmission path, store the transport status data corresponding to the unique data tag and the multi-source raw data of the cigarette box as the whole process information of the defective cigarette box into the cigarette box production management database, including: Step S6.1: Match the data transmission link of the external production management system according to the optimal transmission path; Step S6.2: Retrieve the full-process association data of the corresponding defective cigarette box through the information transmission link to obtain the full-process information of the defective cigarette box to be put into the warehouse; Step S6.3: Perform data consistency and integrity verification on the entire process information of the defective cigarette boxes to be put into storage, and obtain the full process information of the defective cigarette boxes that have passed the verification. Step S6.4: Write the full process information of the defective cigarette boxes that have passed the verification into the cigarette box production management database.
8. An information management device for defective cigarette boxes, wherein the information management device is applied to the information management method as described in any one of claims 1 to 7, characterized in that, The information management device includes: The cigarette box data collection module is used to collect the detection signals, appearance images, and transport status data of the cigarette box through the sensing device to obtain a multi-source raw dataset of the cigarette box; The cigarette box data preprocessing module is used to preprocess the multi-source raw dataset of the cigarette box to obtain the preprocessed multi-source dataset of the cigarette box. The cigarette box data clustering module is used to input the preprocessed multi-source cigarette box dataset into the DBSCAN clustering algorithm, and identify abnormal samples in the preprocessed multi-source cigarette box dataset through the density clustering mechanism of the DBSCAN clustering algorithm to obtain a subset of cigarette box data with defect categories. The defective cigarette box data tag generation module is used to perform equipment signal and product traceability operations on the subset of cigarette box data, establish a mapping relationship between equipment signals and rejection reasons, and generate a unique data tag for the defective cigarette box. The data tag transmission path planning module is used to input the conveying status data corresponding to the unique data tag and the multi-source original data of the cigarette box into the dynamic transmission optimization algorithm based on the workstation load, and adapt the data load of the external production management system to plan the optimal transmission path through the load adjustment mechanism. The data tag transmission and storage module is used to store the transportation status data corresponding to the unique data tag and the multi-source original data of the cigarette box as the whole process information of defective cigarette boxes into the cigarette box production management database according to the optimal transmission path.
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 information management 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 information management method as described in any one of claims 1 to 7.