Product boxing state recognition method and system based on internet of things, and storage medium
By linking the imaging module and the force application module under the Internet of Things architecture, and combining them with image recognition algorithms, the problem of accurate detection of local structural openings in aluminum-plastic soft capsule boxes on high-speed production lines has been solved, achieving efficient quality control and real-time detection on the production line.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI ZHONGYANG OCEAN BIOLOGY ENG CO LTD
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-21
AI Technical Summary
Existing cartoning equipment on high-speed production lines struggles to accurately detect openings in the structure of aluminum-plastic soft capsule boxes, leading to a high risk of substandard products entering the market. Furthermore, existing quality inspection methods rely on manual labor, which is inefficient and inaccurate.
The product packaging status recognition method based on the Internet of Things is adopted. By linking the shooting module and the force application module and combining dual image recognition algorithms, the automatic detection of packaging gaps is realized, and graded prompts are given to indicate whether the product passes or is in a warning state. The detection parameters are dynamically adjusted to adapt to changes in the production line environment.
It achieves full coverage and real-time detection of high-speed production lines, improves the accuracy of identifying abnormal box openings, reduces the risk of defective products entering the market, and balances quality control precision with production efficiency.
Smart Images

Figure CN121366323B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a product packaging status identification method, system, and storage medium based on IoT. Background Technology
[0002] Soft capsules, as a common form of pharmaceutical preparation, are widely used in aluminum-plastic packaging due to their advantages of being airtight, moisture-proof, light-proof, and easy to dispense in measured quantities. This packaging process first uses aluminum-plastic blister molding equipment to press out grooves suitable for the soft capsule specifications. After the capsules are precisely filled into the grooves, a heat-sealing process is used to achieve a tight bond between the aluminum foil and the plastic substrate. Then, a cutting mechanism obtains individual aluminum-plastic packaging units. The subsequent boxing process involves organizing and assembling several individual packaging units according to a preset quantity, sequentially completing steps such as adding the instruction manual, placing the product into the box, and sealing the box to form the final product, meeting the needs of large-scale production and market distribution.
[0003] Soft capsule cartoning equipment is the core equipment for achieving automated cartoning. It mainly consists of a feeding mechanism, a sorting and positioning mechanism, a cartoning execution mechanism, a sealing mechanism, and a conveyor line. Its working principle is as follows: The feeding mechanism continuously transports the aluminum-plastic packaged soft capsules to the sorting and positioning mechanism via a conveyor belt or vibrating plate. The products are then arranged into a set number of groups by baffles or deflectors. Subsequently, the pusher plate of the cartoning execution mechanism pushes the grouped products into the opened packaging box, simultaneously inserting the instruction manual. The sealing mechanism seals the box using folding, gluing, or snap-fit methods. Finally, the conveyor line transports the finished product to the next process. The entire process relies on mechanical transmission and photoelectric sensors to achieve automated operation.
[0004] During operation, existing cartoning equipment is affected by factors such as the elastic deformation of aluminum-plastic packaging, pressure fluctuations of the cartoning pusher, or deviations in packaging box dimensions. This can cause some product boxes to have openings exceeding preset standards, such as incompletely sealed box edges. Such defects can easily lead to soft capsule breakage, moisture absorption, and deterioration during subsequent warehousing, stacking, long-distance transportation, and multiple transfers due to external pressure and friction, directly impacting product quality and safety. Current quality inspection methods rely heavily on manual visual inspection, which is not only inefficient but also susceptible to human fatigue and subjective judgment differences. This makes it difficult to achieve comprehensive coverage and real-time detection of high-speed production lines, resulting in a high risk of substandard products entering the market, causing economic losses and damaging brand reputation for enterprises. Summary of the Invention
[0005] To improve the recognition rate of product box openings that exceed preset standards, this application provides a product packaging status recognition method, system, and storage medium based on the Internet of Things.
[0006] Firstly, this application provides a product packaging status identification method based on the Internet of Things, employing the following technical solution:
[0007] A product packaging status identification method based on the Internet of Things includes the following steps:
[0008] Obtain the product packaging inspection command, and in response to the product packaging inspection command, take a picture of the box based on the shooting module to obtain the first box image;
[0009] The first box target image is identified from the first box image based on the preset first recognition algorithm, and the first gap target image is identified from the first box target image based on the preset second recognition algorithm.
[0010] Calculate the first difference value between the first gap target image and the preset gap reference image. If the first difference value is less than the preset first difference reference value, the first detection is indicated as passed; otherwise, an abnormal box opening warning is issued, the force application module is activated, the force application module is used to apply additional force to the box gap and continue for a preset first duration, and the shooting module is called to take a second picture of the box to obtain a second box image.
[0011] The second box target image is identified from the second box image based on the first recognition algorithm, and the second gap target pattern is identified from the second box target image based on the second recognition algorithm. The second difference value between the second gap target pattern and the gap reference pattern is calculated. If the second difference value is less than the preset second difference reference value, the second detection is indicated as passed. If the second difference value is greater than or equal to the preset second difference reference value and less than the preset third difference reference value, an alarm is triggered for abnormal box opening. The magnitude of the additional force applied by the force application module is adjusted according to the positive correlation of the second difference value. The third difference reference value is greater than the second difference reference value.
[0012] By adopting the above technical solution, the imaging module and the force application module are linked through an IoT architecture, and a dual image recognition algorithm is used to realize the automated detection of box gaps. The first imaging identifies gap differences and provides graded prompts for pass or warning. For warning cases, additional force is applied and a second imaging is taken for verification. This not only eliminates interference factors such as elastic deformation of aluminum-plastic packaging and instantaneous dimensional deviations, but also improves the accuracy of identifying abnormal box openings. Furthermore, through graded warning and alarm mechanisms and a positive correlation adjustment function for force, real-time response and dynamic optimization detection of defects are achieved, effectively replacing manual visual observation, meeting the comprehensive coverage and real-time detection needs of high-speed production lines, and reducing the risk of defective products entering the market.
[0013] Optionally, the method further includes the following steps:
[0014] If the second difference value is greater than or equal to the preset third difference reference value, a boxing failure alarm will be prompted, the product will be marked as defective, and the control force application module will apply additional force to restore the additional force before the last adjustment.
[0015] By adopting the above technical solution, unqualified products that cannot be corrected by adjusting the force can be quickly screened out, preventing them from flowing into subsequent stages; at the same time, controlling the force application module to return to the previous adjustment value can prevent the force after abnormal adjustment from affecting the accuracy of subsequent product testing.
[0016] Optionally, the method further includes the following steps:
[0017] Multiple first difference values are obtained within a preset re-inspection cycle;
[0018] Calculate the average of multiple first difference values;
[0019] Calculate the growth trend value of the average value of the most recent multiple re-inspection cycles;
[0020] If the growth trend value is greater than the preset reference trend value, the trend ratio between the growth trend value and the reference trend value is calculated, and the first difference reference value is adjusted according to the positive correlation of the trend ratio.
[0021] Obtain a calibration instruction within each re-inspection cycle. If a calibration instruction is obtained, stop adjusting the first difference reference value and obtain a continue instruction in each subsequent re-inspection cycle. If a continue instruction is obtained, continue adjusting the first difference reference value.
[0022] A reset command is obtained during each retest cycle. If a reset command is obtained, the first difference reference value is initialized.
[0023] By adopting the above technical solution, and periodically collecting and analyzing the mean and growth trend of the first difference value, dynamic adaptive adjustment of the first difference reference value is achieved. This can accurately capture systematic detection deviations caused by equipment wear, material batch changes, etc., and avoid false detections and missed detections caused by environmental and working condition fluctuations in long-term production due to fixed thresholds. This significantly improves the robustness and environmental adaptability of the detection system. At the same time, the setting of correction, continuation, and reset commands constructs a flexible manual intervention mechanism, which can deal with trend anomalies caused by temporary interference. This retains the efficiency of automatic adjustment while ensuring the accuracy of threshold adjustment through manual experience correction, avoiding over-adaptation.
[0024] Optionally, the method further includes the following steps:
[0025] Within the preset re-inspection cycle, the number of times a test passes is recorded as the number of passes, and the number of times a test fails is recorded as the number of failures.
[0026] The ratio of a single failure to a single success is calculated as the single detection ratio.
[0027] The first duration is adjusted based on the positive correlation between the ratio of a single test and the initial duration.
[0028] By adopting the above technical solution, when the first detection ratio is high, the first detection time is extended to ensure that the additional force is fully applied to the gap of the box to effectively correct problems such as elastic deformation and non-fitting, thereby improving the pass rate of the second detection; when the ratio is low, the first detection time is shortened to avoid unnecessary waste of time and to take into account detection efficiency.
[0029] Optionally, the method further includes the following steps:
[0030] Within the preset re-inspection cycle, the number of times a warning is issued for abnormal box opening is recorded as the number of warnings, and the number of times an alarm is issued for abnormal box opening is recorded as the number of alarms.
[0031] The ratio of the number of alarms to the number of warnings is the secondary detection ratio.
[0032] The moving speed of the box during the detection process is adjusted according to the positive correlation between the two detection ratios.
[0033] By adopting the above technical solution, when the secondary detection ratio is high, the moving speed is appropriately slowed down to allow sufficient time for the imaging module to accurately acquire images and for the force application module to fully exert its correction function, thereby improving the effectiveness of anomaly identification and correction; when the ratio is low, the speed is maintained or finely adjusted to ensure production efficiency.
[0034] Optionally, the method further includes the following steps:
[0035] Within the preset re-inspection cycle, the number of times a test passes is recorded as the number of passes, the number of times a test fails is recorded as the number of failures, the number of times a box opening abnormality warning is issued is recorded as the number of warnings, and the number of times a box opening abnormality alarm is issued is recorded as the number of alarms.
[0036] The ratio of a single failure to a single success is called the first detection ratio, and the ratio of the number of alarms to the number of warnings is called the second detection ratio.
[0037] The overall testing ratio is calculated by weighting the ratios of the first and second tests.
[0038] Adjust the retesting cycle based on the negative correlation between the overall test ratio and the retesting results.
[0039] By adopting the above technical solutions, a high overall ratio indicates frequent packaging abnormalities and poor correction effects. Shortening the re-inspection cycle allows for more intensive monitoring of production status, timely optimization of testing parameters, and rapid response to quality fluctuations. Conversely, a low overall ratio indicates stable packaging status and good correction effects. Extending the re-inspection cycle reduces unnecessary periodic testing losses, balancing testing specificity with production efficiency.
[0040] Optionally, the force application module is a fan assembly, which includes at least one fan, a wind direction adjustment mechanism, and a wind power control unit. The fan is fixedly installed on a preset bracket at the box-packing and inspection station, with its air outlet facing the area where the box edge may have an opening, and the air outlet axis forming a preset angle with the box surface. The wind direction adjustment mechanism includes a guide plate rotatably connected to the fan outlet and a micro servo motor that drives the guide plate to rotate. The micro servo motor is signal-connected to the wind power control unit.
[0041] The step of adjusting the magnitude of the additional force applied by the force application module based on the positive correlation of the second difference value includes the following sub-steps:
[0042] The wind control unit calculates the target wind force value and the target wind direction angle based on the second difference value, controls the fan to output the airflow corresponding to the target wind force value, and simultaneously controls the micro servo motor to drive the guide plate to rotate to the target wind direction angle. The directional airflow applies a fitting force to the gap of the box. The larger the second difference value, the greater the output wind force and the closer the wind direction is to the fitting direction of the box edge. The smaller the second difference value, the smaller the output wind force and the wind direction returns to the initial preset angle.
[0043] By adopting the above technical solution, when the second difference value is larger, the stronger the wind force and the wind direction that is closer to the folding direction can specifically strengthen the sealing effect of the gap and effectively correct more serious opening defects; when the second difference value is smaller, the wind force is reduced and the wind direction is reset, avoiding excessive force from damaging the box or soft capsule. At the same time, the airflow is gentle and will not damage the aluminum-plastic packaging and box structure.
[0044] Optionally, the force application module includes a mechanical spring roller assembly and a telescopic electric cylinder assembly symmetrically arranged on both sides of the conveyor belt. The mechanical spring roller assembly includes a mounting base, a roller body, an elastic spring, and a rotating shaft. The mounting base is slidably connected to the guide rail of the frame, and the guide rail extends along the width direction of the conveyor belt. The rotating shaft is rotatably mounted on the mounting base. The roller body is sleeved on the outside of the rotating shaft and parallel to the surface of the conveyor belt. One end of the elastic spring is fixed inside the mounting base, and the other end abuts against the end face of the roller body, forming a buffer compression structure. The telescopic electric cylinder assembly includes a servo telescopic electric cylinder and a displacement sensor. The servo telescopic electric cylinder is fixed on the frame, and its output shaft is fixedly connected to the mounting base of the mechanical spring roller assembly. The displacement sensor is mounted on the output shaft of the electric cylinder to detect the telescopic length in real time.
[0045] The step of adjusting the magnitude of the additional force applied by the force application module according to the second difference value includes the following sub-steps: calculating the target telescopic length according to the second difference value; driving the mounting base to slide along the guide rail according to the target telescopic length; driving the mechanical spring roller to move closer to or away from the box body; and using the squeezing force between the roller and the side of the box body to make the gap fit together. The larger the second difference value, the greater the extension of the telescopic cylinder; the smaller the second difference value, the smaller the extension of the telescopic cylinder.
[0046] By adopting the above technical solution, the larger the second difference value, the greater the extension of the electric cylinder and the stronger the squeezing force of the roller, which can efficiently correct more serious gap openings; the smaller the second difference value, the smaller the extension of the electric cylinder and the weaker the squeezing force, avoiding excessive squeezing that could cause the box to deform.
[0047] Secondly, this application provides a product packaging status identification system based on the Internet of Things, which adopts the following technical solution:
[0048] A product packaging status identification system based on the Internet of Things (IoT) includes a processor, wherein the processor performs the steps of the product packaging status identification method based on the IoT as described in any of the preceding claims.
[0049] Thirdly, this application provides a storage medium, which adopts the following technical solution:
[0050] A storage medium storing a program, which, when executed by a processor, implements the steps of the IoT-based product packaging status identification method described above.
[0051] In summary, this application includes at least one of the following beneficial technical effects: by constructing an automated cartoning status detection system, it completely replaces traditional manual visual inspection, achieving comprehensive coverage and real-time detection of high-speed production lines. It not only accurately identifies abnormalities in carton openings through algorithms, eliminating interference factors such as elastic deformation and dimensional deviations, thus improving identification accuracy, but also quickly screens and isolates defective products through a grading mechanism. Furthermore, it dynamically adjusts the difference reference value, the duration of force application, the carton movement speed, and the re-inspection cycle based on the detection data within the re-inspection cycle, coupled with flexible manual intervention instructions, adapting to scenarios such as equipment wear and tear and fluctuations in operating conditions, balancing quality control accuracy and production efficiency, and effectively reducing the risk of defective products entering the market. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating the steps of a product packaging status identification method based on the Internet of Things.
[0053] Figure 2 This is the first implementation structure diagram of the force application module.
[0054] Figure 3 This is the second implementation structure diagram of the force application module.
[0055] Reference numerals in the attached drawings: 1. Centrifugal fan; 2. Airflow adjustment mechanism; 3. Preset support; 4. Box body; 5. Conveyor belt; 6. Mounting base; 7. Roller body; 8. Elastic spring; 9. Servo telescopic electric cylinder; 10. Guide rail. Detailed Implementation
[0056] The embodiments of this application are described in detail below, and examples of the embodiments are shown in the accompanying drawings.
[0057] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with the described embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0058] This application discloses a product packaging status recognition method based on the Internet of Things (IoT). The detection system, built on an IoT architecture, includes a core imaging module, a force application module, a control terminal with a processor and storage unit, and an IoT communication module. Each module transmits data and interacts with commands in real time via industrial Ethernet or wireless communication protocols such as WiFi and LoRa. After the packaging equipment completes the box sealing process, its PLC controller automatically generates a product packaging detection command and sends it to the control terminal via the IoT communication module. Upon receiving the command, the control terminal triggers the imaging module to start operating. The imaging module preferably uses a high-definition industrial camera, mounted above and to the side of the packaging detection station using an adjustable bracket to ensure comprehensive capture of image information from all folded areas of the box. A ring light can also be used during shooting to avoid the impact of ambient light changes on image quality. Finally, a clear first image of the box is obtained in a single shot and transmitted to the control terminal.
[0059] Reference Figure 1After receiving the first box image, the processor of the control terminal calls a preset first recognition algorithm to process the image. This first recognition algorithm is preferably based on the YOLOv5 target detection algorithm. Through a pre-trained box 4 feature model, it quickly segments the box 4 region from the first box image, removes background interference elements such as the conveyor belt 5 and the frame, and obtains a first box target image containing only box 4. The processor calls a preset second recognition algorithm to refine the first box target image. The second recognition algorithm uses a combination of Canny edge detection and contour extraction algorithms to accurately identify the gap contour of the folded edge of box 4 in the first box target image, forming the first gap target graphic. To ensure recognition accuracy, the second recognition algorithm also performs noise reduction processing on the extracted gap contour, removing false contours caused by image noise and retaining only the real gap features.
[0060] The processor compares and analyzes the first gap target image with the gap reference image pre-stored in the storage unit, calculating the first difference value between the two. The gap reference image is a qualified box 4 gap image that meets production standards. The first difference value is calculated using a weighted sum of contour similarity, maximum gap width difference, and gap length difference. The weighting coefficients can be preset according to actual detection needs, such as contour similarity weight 0.5, maximum width difference weight 0.3, and length difference weight 0.2. The specific calculation formula is: First difference value = (1 - contour similarity) × 0.5 + (maximum gap width difference / standard gap width) × 0.3 + (gap length difference / standard gap length) × 0.2. The calculation result is presented as a percentage, ranging from 0% to 100%. A first difference reference value is preset in the control terminal. This reference value is determined based on industry quality standards and enterprise production requirements; for example, a comprehensive difference value less than 5% is considered compliant with the standard. If the first difference value is less than the first difference reference value, the control terminal will issue a prompt signal indicating that the test has passed through the sound and light alarm, and the box 4 will be conveyed to the next process by the conveyor belt 5; if the first difference value is greater than or equal to the first difference reference value, it will be determined that there is a risk of abnormal box opening, and the control terminal will immediately issue a warning prompt for abnormal box opening, and at the same time activate the force application module and control the module to apply additional force to the gap of the box 4, and the duration of the force is a preset first duration, which can be set to 2-5 seconds. After the force is applied, the control terminal will call the shooting module again to take a second picture of the box 4 to obtain a second box image.
[0061] The processing flow for the second box image is the same as that for the first box image. The processor identifies the second box target image from the second box image using the first recognition algorithm, then extracts the second gap target image using the second recognition algorithm, and obtains the second difference value using the same calculation method as the first difference value. The second difference reference value preset in the control terminal is slightly higher than the first difference reference value. For example, if the overall difference value is less than 8%, and the second difference value is less than the second difference reference value, the second test is passed and the box 4 is processed normally. If the second difference value is greater than or equal to the second difference reference value and less than the preset third difference reference value, an alarm for abnormal box opening is issued, where the third difference reference value is greater than the second difference reference value. At the same time, the processor adjusts the magnitude of the additional force applied by the force application module in a positive correlation adjustment manner according to the magnitude of the second difference value. That is, the second difference value and the magnitude of the force are directly proportional. For every 1 percentage point increase in the second difference value, the force intensity increases by a preset ratio, such as 5%-10%, to ensure that the subsequent correction effect for similar opening abnormalities is more targeted. When the second difference value decreases, the force weakens simultaneously to avoid excessive force causing damage to the product.
[0062] As an optional implementation, when the third difference reference value is greater than or equal to the second difference reference value, the control terminal issues a boxing failure alarm and simultaneously triggers the inkjet printer to print a defective mark on the surface of the box 4, or controls the sorting mechanism to push the product to the defective product collection channel, achieving rapid marking and isolation of defective products to prevent them from flowing into subsequent warehousing and transportation stages. At the same time, the control terminal controls the force application module to restore the applied additional force to the additional force before the last adjustment. Specifically, the storage unit records the parameters of each force adjustment in real time, such as wind force value and extension length. When the boxing failure alarm is triggered, the last valid adjustment parameters are called and sent to the controller of the force application module to ensure that the force is still within the reasonable range of the adapted working conditions during subsequent normal product testing, preventing the strong force adjustment for serious defects from affecting the accuracy of subsequent testing and ensuring the stable operation of the testing system.
[0063] To adapt to fluctuations in operating conditions during long-term production, this method also incorporates a dynamic adaptive positive correlation adjustment mechanism for the first difference reference value. The control terminal has a preset re-inspection cycle, initially set to 10-30 minutes. Within each re-inspection cycle, the processor automatically collects the first difference values of all products within that cycle and calculates the arithmetic mean of these first difference values as the difference characteristic value for that cycle. The processor retrieves the difference characteristic values from the most recent multiple re-inspection cycles. For example, if the re-inspection cycle is the most recent three consecutive cycles, its growth trend value is calculated using a linear regression algorithm. Specifically, the calculation method is as follows: Let the difference characteristic values for the most recent n cycles be x1, x2, ..., xn, and the corresponding cycle numbers be 1, 2, ..., n. The regression line y = kx + b is obtained by fitting using the least squares method, where k is the slope (i.e., the growth trend value), and b is the intercept. A larger k value indicates a more pronounced growth trend in the opening anomaly. This growth trend value is used to reflect the overall trend of abnormal box opening. The corresponding reference trend value is preset based on data such as normal wear and tear rate of equipment and fluctuation range of material batches in the industry. For example, k≤0.5% / cycle, that is, the difference characteristic value increases by no more than 0.5% in each cycle. If the calculated growth trend value k is greater than the preset reference trend value k0, then the trend ratio k / k0 is further calculated, and the first difference reference value is adjusted according to the positive correlation of the trend ratio. The adjustment formula is: new first difference reference value = original first difference reference value × (1 + α × (k / k0 - 1)), where α is the adjustment coefficient, preset to 0.2-0.5, which can be adjusted according to the quality requirements of the enterprise. For example, if the original first difference reference value is 5%, k = 0.8% / cycle, k0 = 0.5% / cycle, α = 0.3, then the trend ratio = 1.6, and the new first difference reference value = 5% × (1 + 0.3 × (1.6 - 1)) = 5% × 1.18 = 5.9%. This adjustment is used to adapt to systematic detection deviations caused by equipment wear, material batch changes, etc. Meanwhile, to address trend anomalies caused by temporary disturbances, such as sudden fluctuations in material specifications or abrupt changes in environmental temperature and humidity, operators can input correction, continuation, or reset commands via the touchscreen of the control terminal or the host computer software. When the control terminal receives a correction command within a re-inspection cycle, the processor immediately stops the current adjustment process for the first difference reference value and actively checks for a continuation command at the end of each subsequent re-inspection cycle. If a continuation command is received, the adjustment resumes from the parameters at the time of stopping. If a reset command is received within any re-inspection cycle, the first difference reference value is directly initialized to the initial set value, such as 5%. By combining manual intervention with automatic adjustment, the high efficiency of automatic adjustment is maintained while avoiding over-adaptation caused by temporary disturbances, ensuring the accuracy and flexibility of threshold adjustment.
[0064] For the initial duration of force application, this method employs a positive correlation adjustment mechanism based on the first-time detection ratio. Within each preset re-inspection cycle, the control terminal automatically records the number of successful first-time detections (i.e., the number of successful first-time detections N1) and the number of failed first-time detections (i.e., the number of failed first-time detections N2) within that cycle. The first-time detection ratio is calculated using the formula "first-time detection ratio R1 = N2 / N1," which directly reflects the frequency of initial packaging opening abnormalities within that cycle. The processor adjusts the first duration T1 based on the positive correlation between the detection ratio R1 and the first detection. The adjustment logic is as follows: multiple ratio ranges and corresponding duration ranges are preset. For example, when R1 < 0.05, that is, less than 1 out of every 20 products has an initial abnormality, T1 = 2 seconds; when 0.05 ≤ R1 < 0.1, that is, 1 out of every 10-20 products has an initial abnormality, T1 = 3 seconds; when 0.1 ≤ R1 < 0.15, that is, 1 out of every 6-10 products has an initial abnormality, T1 = 4 seconds; when R1 ≥ 0.15, T1 = 5 seconds. The adjustment boundary of the first duration is set from 1 second (minimum value) to 6 seconds (maximum value) to avoid the effect of insufficient force due to the duration being too short, or the production cycle being affected by the duration being too long. In specific adjustments, the processor determines the target duration based on R1 of the current re-inspection cycle and sends a duration adjustment command to the force application module through the control terminal. For example, in a certain re-inspection cycle, N1=1200, N2=90, R1=0.075, corresponding to a target duration of 3 seconds. If the previous first duration was 2 seconds, it will be automatically extended to 3 seconds to ensure that the additional force can fully act on the four gaps of the box body, effectively correcting problems such as elastic deformation of aluminum-plastic packaging and incomplete edge fitting, and improving the pass rate of secondary inspection. If R1 drops to 0.04 in the next re-inspection cycle, the first duration will be shortened to 2 seconds to avoid unnecessary time waste, ensuring both inspection effect and production efficiency.
[0065] To further optimize the detection and correction effects, this method also incorporates a positive correlation adjustment mechanism for the box 4 moving speed based on the secondary detection ratio. Within each re-inspection cycle, the control terminal automatically records the number of warnings for abnormal box openings (warning count M1) and the number of alarms for abnormal box openings (alarm count M2). The secondary detection ratio is calculated using the formula "secondary detection ratio R2 = M2 / M1," which reflects the success rate of defect correction after a warning. A higher R2 indicates a higher proportion of defects that cannot be corrected by force after a warning, requiring more time for detection and correction. The processor adjusts the moving speed V of conveyor belt 5 based on the positive correlation of the secondary detection ratio R2. The initial value of the moving speed of conveyor belt 5 is set to 20-30 m / min, and the adjustment range is 15-35 m / min. The specific adjustment logic is as follows: A preset threshold range for R2 is defined. When R2 < 0.1, the correction success rate is ≥ 90%, V = 30 m / min, maintaining high-speed operation; when 0.1 ≤ R2 < 0.2, the correction success rate is 80%-90%, V = 25 m / min; when 0.2 ≤ R2 < 0.3, the correction success rate is 70%-80%, V = 20 m / min; when R2 ≥ 0.3, the correction success rate is < 70%, V = 15 m / min. A smooth transition strategy is adopted during the adjustment process, i.e., the speed change rate does not exceed 5 m / min·s, avoiding sudden drops or rises that could cause box 4 to tip over or conveyor belt 5 to jam, affecting the stability of the production line. For example, in a certain re-inspection cycle, M1=80, M2=12, R2=0.15, corresponding to a target speed of 25m / min. If the previous speed was 30m / min, the control conveyor belt driver 5 will smoothly reduce the speed to 25m / min within 2 seconds. This allows sufficient time for the imaging module to accurately acquire images (ensuring that the image exposure time matches the moving speed to avoid motion blur) and for the force application module to fully exert its correction function, thereby improving the effectiveness of anomaly identification and correction. If R2 drops to 0.08 in the next cycle, the speed will be gradually increased back to 30m / min to ensure production efficiency.
[0066] Regarding the re-inspection cycle itself, this method sets up a negative correlation adjustment mechanism based on the comprehensive inspection ratio to achieve dynamic matching between inspection frequency and production status. Within each re-inspection cycle, the control terminal simultaneously records the number of passes (N1), the number of failures (N2), the number of warnings (M1), and the number of alarms (M2). R1 and R2 are calculated using the formulas "first-time inspection ratio R1 = N2 / N1" and "second-time inspection ratio R2 = M2 / M1," respectively. Then, the two ratios are weighted and averaged according to preset weighting coefficients to obtain the comprehensive inspection ratio R = ω1 × R1 + ω2 × R2, where ω1 is the weight of the first-time inspection ratio (preset to 0.6) and ω2 is the weight of the second-time inspection ratio (preset to 0.4). The weight allocation is based on the fact that the first-time inspection ratio reflects the initial frequency of anomalies and has a more direct impact on production quality, hence it is given a higher weight. The processor adjusts the re-inspection cycle T based on the negative correlation between the detection comprehensive ratio R and the re-inspection cycle. A larger R results in a shorter T, enabling more intensive monitoring; a smaller R results in a longer T, reducing detection losses. The specific adjustment logic is as follows: the initial value of the preset re-inspection cycle is T0 = 20 minutes, with an adjustment range of 10-30 minutes. Simultaneously, a threshold range for the comprehensive ratio and its corresponding target cycle are set: when R ≥ 0.2, box-packing anomalies occur frequently and correction effects are poor, with a target cycle T = 10 minutes; when 0.1 ≤ R < 0.2, the anomaly rate is moderate and some corrections are ineffective, with a target cycle T = 15 minutes; when 0.05 ≤ R < 0.1, the anomaly rate is low and correction effects are good, with a target cycle T = 20 minutes; when R < 0.05, the box-packing status is stable and the correction success rate is high, with a target cycle T = 30 minutes. To avoid frequent fluctuations in the cycle, a stepped adjustment and delayed triggering strategy is adopted. That is, cycle adjustment is only initiated when the comprehensive ratio of two consecutive re-inspection cycles is within the same range, and the adjustment increment does not exceed 5 minutes to ensure system stability. The specific adjustment formula is: New re-inspection cycle T_new = T_old + ΔT, where ΔT is determined based on the current range of R. For example, if the current T_old = 20 minutes, and R = 0.22 (≥ 0.2) for two consecutive cycles, then ΔT = -10 minutes, T_new = 10 minutes; if R drops to 0.08 (0.05 ≤ R < 0.1) for two consecutive cycles, then ΔT = +5 minutes, gradually returning to 20 minutes. Through this negative correlation adjustment, when production fluctuates, more frequent re-inspection cycles quickly capture quality changes and optimize detection parameters in a timely manner; when production is stable, longer re-inspection cycles reduce the losses from periodic data processing and parameter adjustment, balancing the timeliness of quality control with the efficiency of system operation.
[0067] Regarding the two specific implementation methods of the force application module, their adjustment logic has also been refined and expanded to ensure the quantification and operability of positive correlation adjustment.
[0068] Reference Figure 2In the first embodiment, the force application module is a fan assembly, which includes at least one fan, a wind direction adjustment mechanism 2, and a wind power control unit. In this embodiment, the fan is a centrifugal fan 1, which is fixedly installed on a preset bracket 3 at the box-packing and inspection station by bolts. Its air outlet faces the area where openings are likely to occur on the folded edge of the box body 4, such as the top and side folded edge seams of the box body 4. The axis of the air outlet forms a preset angle of 30°-60° with the surface of the box body 4 to ensure that the airflow can accurately act on the gap position. The wind direction adjustment mechanism 2 consists of a guide plate rotatably connected to the air outlet of the fan and a micro servo motor that drives the guide plate to rotate. The guide plate is made of lightweight plastic material with a smooth surface to reduce airflow resistance. The micro servo motor establishes a signal connection with the wind power control unit through a signal line, which can achieve precise angle control. When the magnitude of the force needs to be adjusted, the wind control unit first calculates the target wind force value and the target wind direction angle based on the second difference value. The wind force adjustment range is set to 0.5-5 m / s, and the wind direction adjustment range is ±30° of the normal direction of the surface of the box 4. Then, the wind control unit sends a control signal to the fan to output the airflow corresponding to the target wind force value, and at the same time sends a drive signal to the micro servo motor to make the guide plate rotate to the target wind direction angle, and apply a fitting force to the gap of the box 4 through the directional airflow.
[0069] The wind turbine assembly's positive correlation adjustment logic based on the second difference value is as follows: The wind power control unit has a built-in positive correlation adjustment algorithm, presets a mapping relationship table between the second difference value and the target wind force value and the target wind direction angle, and adopts a piecewise linear adjustment method to improve control accuracy. For example, when the second difference value is ≤5%, the target wind force value is close to the qualified standard of 0.5m / s, and the target wind direction angle is the normal direction of the surface of the box 4 (initial preset angle); when 5% < second difference value ≤10%, the wind force value increases linearly to 2m / s as the difference value increases, and the wind direction angle deflects 10° towards the folded edge bonding direction; when 10% < second difference value ≤15%, the wind force value continues to increase linearly to 3.5m / s, and the wind direction angle deflects 20°; when the second difference value >15%, the wind force value reaches the maximum value of 5m / s, and the wind direction angle deflects 30° close to the folded edge bonding direction of the box 4. To achieve precise control, the wind power control unit adjusts the fan's power supply voltage via PWM (Pulse Width Modulation) signals, thereby controlling the airflow speed. The voltage adjustment range is 12-24V, corresponding to wind speeds of 0.5-5m / s. Simultaneously, a micro servo motor receives angle control signals and drives the guide vane to rotate via a stepper motor, achieving an angle control accuracy of ±1° to ensure the wind direction is precisely directed towards the gap area. During adjustment, the wind power control unit receives image data from the imaging module in real time, dynamically correcting wind force and direction parameters to form a closed-loop control system. This ensures strong correction for severe opening defects while avoiding excessive force applied to minor deviations that could deform the box or damage the aluminum-plastic packaging.
[0070] Reference Figure 3 In the second embodiment, the force application module includes a mechanical spring roller assembly and a telescopic electric cylinder assembly symmetrically arranged on both sides of the conveyor belt 5, suitable for box-packing scenarios with stronger force requirements. The mechanical spring roller assembly consists of a mounting base 6, a roller body 7, an elastic spring 8, and a rotating shaft. The mounting base 6 is slidably connected to the guide rail 10 of the frame via a slider. The guide rail 10 extends along the width direction of the conveyor belt 5 to ensure that the mounting base 6 can move smoothly. The rotating shaft is rotatably mounted on the mounting base 6 via bearings. The roller body 7 is sleeved on the outside of the rotating shaft and parallel to the surface of the conveyor belt 5. Its material is preferably wear-resistant rubber, and the surface is provided with anti-slip texture to ensure the squeezing effect and avoid scratching the box body 4. One end of the elastic spring 8 is fixed in the spring groove inside the mounting base 6 by a buckle, and the other end abuts against the end face of the roller body 7, forming a squeezing structure with a buffer function, which can automatically adapt the squeezing force according to the size of the box body 4. The telescopic electric cylinder assembly includes a servo telescopic electric cylinder 9 and a displacement sensor. The servo telescopic electric cylinder 9 is fixed to the frame via a flange, and its output shaft is fixedly connected to the mounting base 6 of the mechanical spring roller assembly via a coupling. The displacement sensor is installed at the end of the cylinder's output shaft and can detect the telescopic length in real time and provide feedback to the control terminal. When adjusting the force, the processor calculates the target telescopic length adjustment range of 0-50mm based on the second difference value and sends this parameter to the controller of the servo telescopic electric cylinder 9. The servo telescopic electric cylinder 9 drives the mounting base 6 to slide along the guide rail 10, causing the mechanical spring roller to move closer to or away from the box body 4. The squeezing force between the roller and the side of the box body 4 promotes the sealing of the gap.
[0071] The adjustment logic of the mechanical spring roller assembly and the telescopic electric cylinder assembly based on the second difference value is as follows: The processor calculates the target telescopic length according to the second difference value and uses a quadratic function positive correlation model to achieve precise adjustment, that is, the target telescopic length L=a×(D2)2+b×D2+c, where D2 is the second difference value (percentage), a=0.1mm / %2, b=0.5mm / %, c=20mm, the reference telescopic length, the adjustment range is 0-50mm, the lower limit is 0mm to avoid no compression, the upper limit is 50mm to prevent excessive compression of the box, and the telescopic length is positively correlated with the compression force. The stiffness coefficient of the elastic spring 8 is k=5N / mm, the compression force is F=k×(L-L0), and L0 is the telescopic length corresponding to the free length of the spring. For example, when D2 = 5% (minor anomaly), L = 0.1 × 25 + 0.5 × 5 + 20 = 25 mm, and the extrusion pressure F = 5 × (25 - 10) = 75 N, assuming L0 = 10 mm; when D2 = 10% (moderate anomaly), L = 0.1 × 100 + 0.5 × 10 + 20 = 10 + 5 + 20 = 35 mm, and the extrusion pressure F = 5 × (35 - 10) = 125 N, requiring moderate extrusion reinforcement correction; when D2 = 15% (severe anomaly): L = 0.1 × 15² + 0.5 × 15 + 20 = 22.5 +7.5 + 20 = 50mm (reaching the upper limit of adjustment), the extrusion force F = 5 × (50 - 10) = 200N, maximum extrusion correction; when D2 = 20% (severe abnormality): L = 0.1 × 20² + 0.5 × 20 + 20 = 40 + 10 + 20 = 70mm, since it exceeds the upper limit, take L = 50mm, and maintain the extrusion force at 200N (to avoid damage to the box); when D2 ≤ 3% (close to the qualified standard): take L = 20mm (reference length), extrusion force F = 5 × (20 - 10) = 50N, light pressure holding is sufficient. At the same time, the displacement sensor collects the actual extension length of the telescopic electric cylinder in real time and feeds it back to the processor for comparison with the target length. If the deviation exceeds ±0.5mm, the electric cylinder drive signal is corrected through the PID adjustment algorithm to ensure the control accuracy of the extension length. Through this positive correlation adjustment, the larger the second difference value, the greater the extension of the telescopic electric cylinder, and the stronger the squeezing force of the mechanical spring roller on the box 4, which can efficiently correct more serious gap openings; the smaller the second difference value, the smaller the extension of the telescopic electric cylinder, and the squeezing force gradually weakens. Combined with the buffering effect of the elastic spring 8, it avoids deformation of the box 4 caused by hard contact, and achieves a precise match between the force and the degree of defect.
[0072] This application also discloses an Internet of Things (IoT) based product packaging status identification system, including a processor, wherein the processor executes the steps of the IoT-based product packaging status identification method as described in any of the above embodiments.
[0073] This application also discloses a storage medium storing a program, which, when executed by a processor, implements the steps of the IoT-based product packaging status identification method described above.
[0074] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. An Internet of Things-based product boxing state recognition method, characterized by, Includes the following steps: Obtain the product packaging inspection instruction, and in response to the product packaging inspection instruction, take a picture of the box (4) once based on the shooting module to obtain the first box image; The first box target image is identified from the first box image based on the preset first recognition algorithm, and the first gap target image is identified from the first box target image based on the preset second recognition algorithm. Calculate the first difference value between the first gap target image and the preset gap reference image. If the first difference value is less than the preset first difference reference value, then indicate that the detection has passed. Otherwise, a warning will be issued for abnormal box opening, and the force application module will be activated. The force application module is used to apply additional force to the gap of the box (4) and continue for a preset first duration. The shooting module will be called to take a second picture of the box (4) to obtain a second box image. The second box target image is identified from the second box image based on the first recognition algorithm, and the second gap target graphic is identified from the second box target image based on the second recognition algorithm. Calculate the second difference value between the second gap target image and the gap reference image. If the second difference value is less than the preset second difference reference value, the second detection is indicated as passed. If the second difference value is greater than or equal to the preset second difference reference value and less than the preset third difference reference value, an alarm for abnormal box opening will be triggered, and the magnitude of the additional force applied by the force application module will be adjusted according to the positive correlation of the second difference value; wherein, the third difference reference value is greater than the second difference reference value; The force application module is a fan assembly, which includes at least one fan, a wind direction adjustment mechanism (2) and a wind power control unit. The fan is fixedly installed on a preset bracket (3) at the boxing inspection station, with its air outlet facing the area where the box body (4) has an opening, and the air outlet axis forms a preset angle with the surface of the box body (4). The wind direction adjustment mechanism (2) includes a guide plate rotatably connected to the air outlet of the fan and a micro servo motor that drives the guide plate to rotate. The micro servo motor is signal connected to the wind power control unit. The step of adjusting the magnitude of the additional force applied by the force application module based on the positive correlation of the second difference value includes the following sub-steps: The wind control unit calculates the target wind force value and the target wind direction angle based on the second difference value, controls the fan to output the airflow corresponding to the target wind force value, and controls the micro servo motor to drive the guide plate to rotate to the target wind direction angle. The directional airflow applies a fitting force to the gap of the box (4). The larger the second difference value, the greater the output wind force and the closer the wind direction is to the folding and fitting direction of the box (4). The smaller the second difference value, the smaller the output wind force and the wind direction is reset to the initial preset angle. Alternatively, the force application module includes a mechanical spring roller assembly and a telescopic electric cylinder assembly symmetrically arranged on both sides of the conveyor belt (5). The mechanical spring roller assembly includes a mounting base (6), a roller body (7), an elastic spring (8), and a rotating shaft. The mounting base (6) is slidably connected to the guide rail (10) of the frame. The guide rail (10) extends along the width direction of the conveyor belt (5). The rotating shaft is rotatably mounted on the mounting base (6). The roller body (7) is sleeved on the outside of the rotating shaft and parallel to the surface of the conveyor belt (5). One end of the elastic spring (8) is fixed inside the mounting base (6), and the other end abuts against the end face of the roller body (7) to form a buffer compression structure. The telescopic electric cylinder assembly includes a servo telescopic electric cylinder (9) and a displacement sensor. The servo telescopic electric cylinder (9) is fixed on the frame, and its output shaft is fixedly connected to the mounting base (6) of the mechanical spring roller assembly. The displacement sensor is mounted on the output shaft of the electric cylinder to detect the telescopic length in real time. The step of adjusting the magnitude of the additional force applied by the force application module according to the second difference value includes the following sub-steps: calculating the target telescopic length according to the second difference value, and driving the mounting base (6) to slide along the guide rail (10) according to the target telescopic length, thereby driving the mechanical spring roller to move closer to or away from the box (4). The gap is made to fit by the squeezing force between the roller and the side of the box (4). The larger the second difference value, the greater the extension of the telescopic cylinder; the smaller the second difference value, the smaller the extension of the telescopic cylinder. 2.The IoT-based product boxing state recognition method of claim 1, wherein, The method also includes the following steps: If the second difference value is greater than or equal to the preset third difference reference value, a boxing failure alarm will be prompted, the product will be marked as defective, and the control force application module will apply additional force to restore the additional force before the last adjustment. 3.The IoT-based product boxing state recognition method of claim 1, wherein, The method also includes the following steps: Multiple first difference values are obtained within a preset re-inspection cycle; Calculate the average of multiple first difference values; Calculate the growth trend value of the average value of the most recent multiple re-inspection cycles; If the growth trend value is greater than the preset reference trend value, the trend ratio between the growth trend value and the reference trend value is calculated, and the first difference reference value is adjusted according to the positive correlation of the trend ratio. Obtain a calibration instruction within each re-inspection cycle. If a calibration instruction is obtained, stop adjusting the first difference reference value and obtain a continue instruction in each subsequent re-inspection cycle. If a continue instruction is obtained, continue adjusting the first difference reference value. A reset command is obtained during each retest cycle. If a reset command is obtained, the first difference reference value is initialized. 4.The IoT-based product boxing state recognition method of claim 1, wherein, The method also includes the following steps: Within the preset re-inspection cycle, the number of times a test passes is recorded as the number of passes, and the number of times a test fails is recorded as the number of failures. The ratio of a single failure to a single success is calculated as the single detection ratio. The first duration is adjusted based on the positive correlation between the ratio of a single test and the initial duration. 5.The IoT-based product boxing state recognition method of claim 1, wherein, The method also includes the following steps: Within the preset re-inspection cycle, the number of times a warning is issued for abnormal box opening is recorded as the number of warnings, and the number of times an alarm is issued for abnormal box opening is recorded as the number of alarms. The ratio of the number of alarms to the number of warnings is the secondary detection ratio. The moving speed of the box (4) during the detection process is adjusted according to the positive correlation of the secondary detection ratio. 6.The IoT-based product boxing state recognition method of claim 1, wherein, The method also includes the following steps: Within the preset re-inspection cycle, the number of times a test passes is recorded as the number of passes, the number of times a test fails is recorded as the number of failures, the number of times a box opening abnormality warning is issued is recorded as the number of warnings, and the number of times a box opening abnormality alarm is issued is recorded as the number of alarms. The ratio of a single failure to a single success is called the first detection ratio, and the ratio of the number of alarms to the number of warnings is called the second detection ratio. The overall testing ratio is calculated by weighting the ratios of the first and second tests. Adjust the retesting cycle based on the negative correlation between the overall test ratio and the retesting results.
7. An Internet of Things-based product boxing state recognition system, characterized by, The device includes a processor that performs the steps of the IoT-based product packaging status identification method as described in any one of claims 1-6.
8. A storage medium, characterized by The storage medium stores a program, which, when executed by a processor, implements the steps of the IoT-based product packaging status identification method according to any one of claims 1-6.
Citation Information
Patent Citations
Medicine packaging box quality detection method and system based on image data analysis
CN117649404A