Cigarette box strip two-dimensional code verification method and system
By setting up optical fiber sensors, solid-state code readers and removal cylinders on the cigarette conveyor device to detect and verify the QR code of the cigarette, the problem of abnormal QR code association caused by leakage in cigarette production is solved, and effective removal is achieved Treatment reduces waste of manpower and material resources.
Patent Information
- Application Number
- CN202411586556.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-14
AI Technical Summary
During the cigarette production process, due to abnormal manual operation of the packaging machine or irregular automatic removal process, the missing strips of cigarettes are transported to the packaging and packaging machine, resulting in abnormal correlation between the strips of cigarettes and the QR codes of cigarettes and cigarettes, and additional processing is added Difficulty and increase market feedback risks, resulting in waste of manpower and material resources.
Using a box QR code verification method and system, by setting up an optical fiber sensor, solid state code reader and removing cylinder on the cigarette conveyor device, detecting and verifying the QR code on the cigarette, if the association fails, Remove the cigarette immediately.
It effectively avoids the subsequent processing of associated cigarettes at the box sealer, reduces the market feedback risks of unrelated cigarettes in the cigarette QR code "box conditions" and saves a lot of manpower and material resources.
Smart Images

Figure CN119443132A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of cigarette machinery and equipment, and in particular, relates to a method and system for verifying a two-dimensional code of a cigarette box bar. Background Art
[0002] The industrial "box condition" association management system (also known as the box condition system) is mainly used to manage and trace the production, circulation and sales information of tobacco products and other products. The system uses QR codes or other identification technologies to achieve full traceability of each boxed product, thereby accurately associating the QR codes of boxes of cigarettes, cartons of cigarettes and individual cigarettes.
[0003] However, in the production process of cigarettes, due to abnormal manual operation of the packaging machine or irregular process of automatic rejection of cigarette cartons, the missed cigarette cartons are easily transported to the box filling and sealing machine stage, which not only makes the association between the cigarette cartons and the QR codes of boxes and pieces of cigarettes abnormal, but also increases the difficulty for subsequent related personnel to handle the cigarette cartons with abnormal association, as well as the risk of market feedback for pieces of cigarettes that are not associated with the "box conditions" of the cigarette QR codes, thereby causing a huge waste of manpower and material resources. Summary of the invention
[0004] This application aims to solve the above-mentioned problems that due to abnormal manual operation of the packaging machine or the irregular process of automatically rejecting cigarette cartons, the missed cigarette cartons are easily transported to the stage of packing and sealing machines, which not only makes the association between the cigarette cartons and the QR codes of the box cigarettes and the individual cigarettes abnormal, but also increases the difficulty for subsequent related personnel to handle the abnormally associated cigarette cartons, as well as the market feedback risk of individual cigarettes whose QR codes are not associated with the "box conditions", thereby causing a huge waste of manpower and material resources. A method and system for verifying the QR code of a box bar of cigarettes is proposed, and its technical solution is as follows: In a first aspect, an embodiment of the present application provides a method for verifying a two-dimensional code of a box barcode of a cigarette, the method being applied to a cigarette conveying device, the cigarette conveying device comprising a cigarette feeding belt conveyor, an optical fiber sensor arranged on the cigarette feeding belt conveyor, a solid-state code reader, and a reject cylinder, the method comprising: When a cigarette to be inspected is detected on the cigarette feeding belt conveyor, at least two light intensity signals collected by the optical fiber sensor are obtained; When the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the target character code parsed by the solid-state code reader is obtained; wherein the target character code is parsed by the solid-state code reader according to the box bar QR code on the cigarette carton to be checked; The association result of the to-be-checked cigarette carton is obtained based on the target character code, and when the association result is an association failure, the rejecting cylinder is controlled to reject the to-be-checked cigarette carton.
[0005] In an optional solution of the first aspect, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Acquire a first image containing the cigarette cartons to be checked, and identify the total number of cigarette cartons to be checked from the first image; Obtain the total weight of the cigarette cartons to be checked, calculate the weight of a single cigarette carton according to the total number of cigarette cartons and the total weight of the cigarette cartons, and query the target running speed corresponding to the weight of a single cigarette carton in a preset weight-speed correspondence list; wherein the preset weight-speed correspondence list includes at least two groups of cigarette carton weight intervals, and the standard running speed corresponding to each group of cigarette carton weight intervals; Control the belt running speed of the smoke inlet belt conveyor to be consistent with the target running speed.
[0006] In yet another optional solution of the first aspect, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Identify the contour features of the cigarette carton to be checked from the first image, and mark the contour center axis corresponding to the contour features of the cigarette carton in the first image; When it is detected that the axis angle between the profile center axis and the preset belt center axis exceeds the preset angle threshold, the smoke feeding belt conveyor is controlled to be in a stopped state; Prompt information is generated based on the axis angle and fed back to the user terminal.
[0007] In yet another optional solution of the first aspect, after the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the method further includes: When the target character code parsed by the solid-state code reader is not received within a preset period of time, a second image including the box bar two-dimensional code is acquired; Performing grayscale processing on the second image, and performing Gaussian blur processing on the grayscale processed second image; Identify the edge area of the box-bar QR code from the second image after Gaussian blur processing, and calculate the pixel ratio between the number of pixels in the edge area and the total number of pixels corresponding to the box-bar QR code; When the pixel ratio is lower than a preset ratio threshold, the smoke feeding belt conveyor is controlled to be in a stopped state.
[0008] In another optional solution of the first aspect, before obtaining the association result of the cigarette carton to be checked based on the target character code, the method further includes: Convert the target character encoding to obtain the corresponding batch number; The associated results of the cigarette cartons to be checked are obtained based on the target character encoding, including: When the batch number is queried in the preset cigarette carton number database, the associated result of the cigarette carton to be checked is obtained based on the target character code; wherein the preset cigarette carton number data includes at least two standard numbers corresponding to qualified cigarette carton.
[0009] In another optional solution of the first aspect, obtaining the association result of the cigarette carton to be checked based on the target character code includes: Filtering out at least two historical character codes corresponding to the target character code from a character code library; wherein the character code library includes at least three historical character codes; Inputting the target character code and each historical character code into a preset deep learning model in turn to obtain corresponding predicted association values; wherein the preset deep learning model is trained by at least two groups of character code samples and association value labels of each group of character code samples; When all the predicted correlation values are within the preset predicted value range, it is determined that the correlation result of the cigarette strip to be verified is successful; When any predicted correlation value is not within the preset predicted value interval, it is determined that the correlation result of the cigarette carton to be verified is a correlation failure.
[0010] In another optional solution of the first aspect, the cigarette conveying device further comprises a relay and a normally open contact corresponding to the relay, and the normally open contact is arranged on the circuit where the reject cylinder is located; Control the rejection cylinder to reject the cigarette cartons to be tested, including: A high level signal is output to the circuit where the relay is located, so that the normally open contact is converted from an open state to an on state, and the reject cylinder is used to reject the cigarette cartons to be inspected.
[0011] In a second aspect, an embodiment of the present application provides a box bar QR code verification system for cigarettes, the system is applied to a cigarette conveying device, the cigarette conveying device includes a cigarette feeding belt conveyor, an optical fiber sensor arranged on the cigarette feeding belt conveyor, a solid-state code reader and a rejection cylinder, the system includes: A first processing module is used to obtain at least two light intensity signals collected by the optical fiber sensor when a cigarette to be inspected is detected on the cigarette feeding belt conveyor; The second processing module is used to obtain the target character code parsed by the solid-state code reader when the difference between any two adjacent light intensity signals exceeds a preset difference threshold; wherein the target character code is obtained by the solid-state code reader according to the two-dimensional code of the box bar on the cigarette to be checked; The third processing module is used to obtain the association result of the cigarette carton to be checked based on the target character code, and when the association result is association failure, control the rejection cylinder to reject the cigarette carton to be checked.
[0012] In a third aspect, an embodiment of the present application provides a box bar QR code verification system for cigarettes, including a processor and a memory; The processor is connected to the memory; A memory for storing executable program codes; The processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the box bar QR code verification method for cigarettes provided by the first aspect of the embodiment of the present application or any one of the implementations of the first aspect.
[0013] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the method for verifying a box bar QR code for cigarettes provided in the first aspect of the embodiment of the present application or any one of the implementation methods of the first aspect can be implemented.
[0014] Beneficial effects of this application: When verifying the box bar QR code in the cigarette production process, when the cigarette to be verified is detected on the cigarette feeding belt conveyor, at least two light intensity signals collected by the optical fiber sensor are obtained; when the difference between any two adjacent light intensity signals exceeds the preset difference threshold, the target character code parsed by the solid-state code reader is obtained; based on the target character code, the association result of the cigarette to be verified is obtained, and when the association result is a failure to associate, the rejection cylinder is controlled to reject the cigarette to be verified. By setting structures such as optical fiber sensors, solid-state code readers, and rejection cylinders, the flexible setting and scene applicability of the box bar QR code verification method can be enhanced; secondly, the association result of the cigarette to be verified is obtained according to the target character code parsed by the solid-state code reader, and the unassociated cigarettes are rejected by the rejection cylinder, which can effectively avoid the subsequent processing of the cigarettes that failed to associate at the carton sealing machine, and not only reduce the market feedback risk of the cigarettes whose "box conditions" are not associated with the cigarette QR code, but also save a lot of manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 An overall flow chart of a method for verifying a two-dimensional code on a cigarette box provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a cigarette conveying device provided in an embodiment of the present application; Figure 3 An electrical hardware schematic diagram of a method for verifying a two-dimensional code on a cigarette box provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a two-dimensional code verification system for cigarette box bars provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of another cigarette box bar QR code verification system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0018] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0019] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0020] See also Figure 1 , Figure 1 The overall flow chart of a method for verifying a two-dimensional code on a cigarette box provided in an embodiment of the present application is shown.
[0021] like Figure 1 As shown, the method for verifying the two-dimensional code of a cigarette box barcode may at least include the following steps: Step 102: When a cigarette carton to be inspected is detected on the cigarette feeding belt conveyor, at least two light intensity signals collected by the optical fiber sensor are obtained.
[0022] In the embodiment of the present application, the two-dimensional code verification method for cigarette box barcodes can be, but is not limited to, applied to a control terminal, which establishes a connection with a cigarette conveying device to control the cigarette conveying device to promptly reject the cigarettes that failed to be associated, thereby avoiding the transportation of the missed cigarettes to the carton sealing machine. Here, the cigarette conveying device may at least include a cigarette feeding belt conveyor, an optical fiber sensor, a solid-state barcode reader, and a rejection cylinder, wherein the two ends of the cigarette feeding belt conveyor may be respectively arranged on the cigarette conveying line, so that after receiving the packaged cigarettes, the packaged cigarettes are transported through a cigarette channel provided with a belt, and transported to the cigarette conveying line connected to the carton sealing machine, and the transport speed or operating state of the cigarette feeding belt conveyor may be controlled by the control terminal; the type of optical fiber sensor may be, but is not limited to, an optical fiber displacement sensor, an optical fiber proximity sensor, or an optical fiber interference sensor, which is installed on the left side of the cigarette channel of the above-mentioned cigarette belt conveyor to detect in real time whether there are cigarettes being transported on the cigarette channel, and the light intensity signal used to detect whether there are cigarettes being transported may be fed back to the control terminal; the solid-state barcode reader may However, it is not limited to being installed on the right side of the cigarette channel of the above-mentioned cigarette belt conveyor (the straight-line distance between the solid-state code reader and the input end of the cigarette channel is greater than the straight-line distance between the optical fiber sensor and the input end of the cigarette channel), so as to recognize and process the two-dimensional barcode of the cigarette box on the cigarette channel in real time, and the recognized character code can be fed back to the control terminal; the rejection cylinder can be but not limited to a motor, a cylinder body and a piston rod and other structures (it can also be understood as a cigarette rejection device known in the art, but not limited to this), and the motor receives the command issued by the control terminal, and then controls the piston rod to reciprocate in the cylinder body in a direction perpendicular to the cigarette channel, so as to realize the rejection of cigarettes that fail to associate, and the rejected cigarettes can also be transported to the packaging machine and processed by the operator in time.
[0023] In addition, the control terminal can also, but is not limited to, establish a connection with an industrial camera installed above the cigarette feeding belt machine to improve the correlation recognition accuracy and rejection efficiency of cigarette strips by processing the images collected by the industrial camera, and is not limited to this.
[0024] It can be understood that by setting up structures such as fiber optic sensors, solid-state code readers and reject cylinders on the cigarette feeding belt conveyor, the flexible setting (such as simple installation and flexible deployment location) and scenario applicability of the box bar QR code verification method can be enhanced; secondly, the control terminal can also obtain the association result of the cigarette cartons to be verified based on the target character code parsed by the solid-state code reader, and use the reject cylinder to reject the unassociated cigarette cartons, which can effectively avoid the subsequent processing of cigarette cartons that fail to associate at the carton sealing machine, and not only reduce the market feedback risk of cigarette cartons whose QR code "box conditions" are not associated, but also save a lot of manpower and material resources.
[0025] Also see here Figure 2 The structural schematic diagram of a cigarette conveying device provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the cigarette conveying device may include a cigarette feeding belt machine, a cigarette rod conveying line arranged at the output end of the cigarette feeding belt machine, an optical fiber sensor arranged on the left side of the cigarette feeding belt machine, a solid-state code reader arranged on the right side of the cigarette feeding belt machine, and a rejection cylinder. Two cigarette rods are placed on the cigarette rod channel of the cigarette feeding belt machine for transportation from right to left.
[0026] Specifically, when verifying the QR code of the box bar in the cigarette production process, the control terminal can, but is not limited to, determine whether there are cigarettes to be verified on the cigarette channel of the cigarette feeding belt machine through the gravity sensor set on the cigarette feeding belt machine. For example, when it is detected that the gravity data collected by the gravity sensor exceeds the preset gravity threshold, it can be determined that there are cigarettes to be verified on the cigarette channel of the cigarette feeding belt machine; when it is detected that the gravity data collected by the gravity sensor does not exceed the preset gravity threshold, it can be determined that there are no cigarettes to be verified on the cigarette channel of the cigarette feeding belt machine. It can be understood that the cigarettes to be verified can be, but are not limited to, one or more packaged cigarettes output by the packaging machine, and can be transported to the cigarette feeding belt machine through the cigarette conveyor line, and the cigarette conveyor line can transport multiple packaged cigarettes to the cigarette feeding belt machine in sequence at a certain interval or time interval.
[0027] Furthermore, after determining that there are cigarettes to be checked on the cigarette conveyor, the control terminal can control the optical fiber sensor to collect multiple light intensity signals at preset time intervals to determine whether the cigarettes to be checked are transported to the designated location. Here, the type of the optical fiber sensor can be an optical fiber displacement sensor or an optical fiber proximity sensor, so that when the cigarettes to be checked pass the location of the transmitting optical fiber of the optical fiber sensor, the light intensity signal collected by the optical fiber sensor can change.
[0028] As an option of the embodiment of the present application, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Acquire a first image containing the cigarette cartons to be checked, and identify the total number of cigarette cartons to be checked from the first image; Obtain the total weight of the cigarette cartons to be checked, calculate the weight of a single cigarette carton according to the total number of cigarette cartons and the total weight of the cigarette cartons, and query the target running speed corresponding to the weight of a single cigarette carton in a preset weight-speed correspondence list; wherein the preset weight-speed correspondence list includes at least two groups of cigarette carton weight intervals, and the standard running speed corresponding to each group of cigarette carton weight intervals; Control the belt running speed of the smoke inlet belt conveyor to be consistent with the target running speed.
[0029] Specifically, in order to improve the efficiency of rejecting the cigarettes to be checked, before obtaining at least two light intensity signals collected by the optical fiber sensor, the control terminal can also, but is not limited to, obtain a first image containing the cigarettes to be checked through an industrial camera arranged above the cigarette feeding belt conveyor, and can identify the total number of cigarettes to be checked from the first image through algorithms such as image recognition. It is understandable that when identifying the total number of cigarettes to be checked, the control terminal can first identify all contour feature points corresponding to the cigarettes to be checked from the first image, and divide the contour feature points corresponding to each cigarette according to all the contour feature points, and then count the total number of cigarettes to be checked, and is not limited to this.
[0030] Then, while obtaining the first image containing the cigarette cartons to be checked, the control terminal can also use the gravity sensor mentioned above to obtain the total weight of the cigarette cartons to be checked on the cigarette feeding belt conveyor at this time, and calculate the ratio of the total weight of the cigarette cartons to the total number of cigarette cartons to obtain the corresponding weight of a single cigarette cart.
[0031] Since the weight of individual cigarettes of different types of cigarettes is different, the transportation speed on the cigarette feeding belt conveyor will be different. Here, the control terminal can query the target running speed corresponding to the weight of the individual cigarette in the preset weight-speed correspondence list, and can control the belt running speed of the cigarette feeding belt conveyor to be consistent with the target running speed, thereby ensuring the transportation stability and rejection efficiency of the cigarettes to be tested. Here, the preset weight-speed correspondence list can be, but is not limited to, obtained by the operator through testing and analysis, including multiple groups of cigarette weight intervals, and the standard running speed corresponding to each group of cigarette weight intervals. When the above-mentioned single cigarette weight is within any group of cigarette weight intervals, the corresponding standard running speed can be used as the target running speed.
[0032] As another option of the embodiment of the present application, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Identify the contour features of the cigarette carton to be checked from the first image, and mark the contour center axis corresponding to the contour features of the cigarette carton in the first image; When it is detected that the axis angle between the profile center axis and the preset belt center axis exceeds the preset angle threshold, the smoke feeding belt conveyor is controlled to be in a stopped state; Prompt information is generated based on the axis angle and fed back to the user terminal.
[0033] Specifically, in order to further improve the efficiency of rejecting the cigarettes to be checked and ensure the reading efficiency of the solid-state code reader, before acquiring at least two light intensity signals collected by the optical fiber sensor, the control terminal can also, but is not limited to, identify all the contour features of the cigarettes to be checked from the first image mentioned above, and can mark the contour center axis corresponding to all the contour features of the cigarettes in the first image. It can be understood that when the total number of cigarettes to be checked exceeds one, the control terminal can also determine whether any two contour center axes are parallel, and when it is detected that any two contour center axes are not parallel, it indicates that the placement of the cigarettes to be checked on the cigarette feeding belt conveyor may be abnormal, and then the cigarette feeding belt conveyor can be controlled to be in a stopped state to remind the operator to adjust the cigarettes to be checked on the cigarette feeding belt conveyor in time.
[0034] Next, when it is detected that the axis angle between the contour center axis and the preset belt center axis exceeds the preset angle threshold, it indicates that the placement method of the cigarette strips to be checked on the cigarette feeding belt conveyor is abnormal (or the cigarette transport method of the cigarette conveyor line is abnormal), and the cigarette feeding belt conveyor can be controlled to be in a stopped state, and a prompt message corresponding to the axis angle is generated, such as but not limited to a prompt message of "The cigarette strip angle is too large (30 degrees), please adjust it in time", so that the prompt message is promptly fed back to the user terminal corresponding to the operator, and the operator promptly adjusts the cigarette strips to be checked on the cigarette feeding belt conveyor.
[0035] Of course, in the embodiment of the present application, the control terminal may also control other cigarette adjustment devices to automatically adjust the position of the cigarette to be checked on the cigarette feeding belt conveyor, but no further details will be given here.
[0036] It should be noted that after adjusting the position of the cigarette strips to be checked on the cigarette feeding belt conveyor, the control terminal can also control the cigarette feeding belt conveyor to resume normal operation to ensure the normal execution of the box bar QR code verification, and this is not limited to this.
[0037] Step 104: When the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the target character code parsed by the solid-state code reader is obtained.
[0038] Specifically, when it is detected in real time that the difference between any two adjacent light intensity signals exceeds a preset difference threshold, it indicates that the cigarette to be checked has been transported to the designated location, and the control terminal can then send a trigger signal to the solid-state code reader, and receive the target character code parsed by the solid-state code reader based on the two-dimensional code on the box bar on the cigarette to be checked; when it is detected that the difference between any two adjacent light intensity signals has not exceeded the preset difference threshold, it indicates that the cigarette to be checked has not been transported to the designated location, and the control terminal can then send a control signal to the optical fiber sensor to increase the frequency of the optical fiber sensor collecting light intensity signals, thereby ensuring the accuracy of judging whether the cigarette to be checked has been transported to the designated location.
[0039] It can be understood that when the solid-state code reader recognizes and processes the QR code on the box bar of the cigarette to be checked, the solid-state code reader can, but is not limited to, irradiating the QR code on the box bar of the cigarette to be checked with an LED light source, and then capturing and focusing the reflected light signal with a built-in imager, and then using a preset decoding algorithm to recognize and process the QR code on the box bar obtained by the focused processing, and then converting it into a corresponding character code. The method of recognizing the QR code on the box bar by a solid-state code reader can effectively ensure recognition accuracy and production efficiency in the actual production process, and there is no need to invest in process research and development costs.
[0040] Of course, in the embodiment of the present application, other photographing devices can also be used to capture the box bar QR code on the cigarette carton to be checked, and the box bar QR code on the cigarette carton to be checked can be identified and processed through the control terminal to obtain the corresponding character code, and it is not limited to this.
[0041] As another option of the embodiment of the present application, after the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the method further includes: When the target character code parsed by the solid-state code reader is not received within a preset period of time, a second image including the box bar two-dimensional code is acquired; Performing grayscale processing on the second image, and performing Gaussian blur processing on the grayscale processed second image; Identify the edge area of the box-bar QR code from the second image after Gaussian blur processing, and calculate the pixel ratio between the number of pixels in the edge area and the total number of pixels corresponding to the box-bar QR code; When the pixel ratio is lower than a preset ratio threshold, the smoke feeding belt conveyor is controlled to be in a stopped state.
[0042] In order to ensure the efficiency and accuracy of the solid-state code reader in recognizing the box bar QR code, the image quality of the box bar QR code on the cigarette to be verified can also be judged in advance. Specifically, after detecting that the difference between any two adjacent light intensity signals exceeds the preset difference threshold, the control terminal can also obtain a second image containing the box bar QR code on the cigarette to be verified through an industrial camera set on the same side of the solid-state code reader, and perform grayscale processing and binarization processing on the second image in turn to ensure the recognition accuracy of the second image.
[0043] Next, the control terminal may perform Gaussian blur processing on the processed second image to reduce noise in the second image, and identify edge areas from the second image after Gaussian blur processing based on a preset edge detection algorithm. It is understandable that the higher the edge density of the box bar QR code, the clearer the boundaries between the lines and blank areas of the box bar QR code, that is, the higher the clarity.
[0044] Then, the control terminal can also count the number of pixels corresponding to the edge area and the total number of pixels corresponding to the box bar QR code in the second image, and calculate the pixel ratio between the number of pixels and the total number of pixels. Here, when the pixel ratio is lower than the preset ratio threshold, it indicates that the image quality of the box bar QR code of the current cigarette to be checked is poor, and then the control terminal can control the cigarette feeding belt conveyor to be in a stopped state, and promptly notify the operator to conduct troubleshooting; when the pixel ratio is higher than or equal to the preset ratio threshold, it indicates that the image quality of the box bar QR code of the current cigarette to be checked is high, and then the solid-state code reader can be used to quickly and effectively identify the character code corresponding to the box bar QR code.
[0045] Step 106: obtaining the association result of the cigarette carton to be checked based on the target character code, and when the association result is an association failure, controlling the rejecting cylinder to reject the cigarette carton to be checked.
[0046] Specifically, after obtaining the target character code recognized by the solid-state code reader, the control terminal may, but is not limited to, filter out at least two historical character codes corresponding to the target character code from the character code library, for example, it may determine the recognition time period according to the recognition time corresponding to the target character code, and filter out all historical character codes whose recognition time is within the recognition time period, that is, filter out multiple historical character codes whose recognition time is closest to the target character code. Here, the character code library may, but is not limited to, be obtained by an operator based on the analysis of all historical character codes received by the two-dimensional code main power cabinet, which may be used to receive all character codes recognized by the solid-state code reader on each cigarette production line, and the character code library may include all historical character codes recognized by different solid-state encoders and manually confirmed to be successfully associated, as well as the recognition time corresponding to each historical character code.
[0047] Furthermore, after screening out a plurality of historical character codes, the control terminal may also input the target character code and each historical character code into a preset deep learning model in sequence, so as to quickly and accurately obtain the corresponding predicted association value through an intelligent algorithm. Here, the preset deep learning model may be a neural network structure well known in the art, which may be trained by a plurality of groups of character code samples and artificial association value labels corresponding to each group of character code samples.
[0048] It can be understood that when all the predicted association values are within the preset prediction value interval, it indicates that there is an association between the QR code of the box bar of the cigarette to be checked and the box of cigarettes, and then it can be determined that the association result of the cigarette to be checked is a successful association, and the cigarette feeding belt conveyor can transport the cigarette to be checked to the cigarette conveyor line for subsequent packaging processing; when any predicted association value is not within the preset prediction value interval, it indicates that there is no association between the QR code of the box bar of the cigarette to be checked and the box of cigarettes, and then it can be determined that the association result of the cigarette to be checked is a failed association, and the control terminal can control the rejection cylinder to perform rejection processing on the cigarette to be checked to avoid the cigarette feeding belt conveyor from transporting the cigarette to be checked to the cigarette conveyor line.
[0049] As another option of the embodiment of the present application, before obtaining the association result of the cigarette to be checked based on the target character code, the method further includes: Convert the target character encoding to obtain the corresponding batch number; The associated results of the cigarette cartons to be checked are obtained based on the target character encoding, including: When the batch number is queried in the preset cigarette carton number database, the associated result of the cigarette carton to be checked is obtained based on the target character code; wherein the preset cigarette carton number data includes at least two standard numbers corresponding to qualified cigarette carton.
[0050] Specifically, in order to determine the validity of the target character code in advance, before obtaining the associated result of the cigarette to be checked based on the target character code, the control terminal can also convert the target character code based on a preset conversion algorithm or a preset conversion character list to obtain the corresponding batch number, and can query whether the batch number exists in the preset cigarette code database. It can be understood that when the batch number is queried in the preset cigarette code database, it indicates that the target character code is valid, and then the associated result of the cigarette to be checked can be obtained based on the target character code; when the batch number is not queried in the preset cigarette code database, it indicates that the target character code is invalid, and then the control terminal can directly control the rejection cylinder to reject the cigarette to be checked.
[0051] As another optional embodiment of the present application, the cigarette conveying device further includes a relay and a normally open contact corresponding to the relay, and the normally open contact is arranged on the circuit where the rejecting cylinder is located; Control the rejection cylinder to reject the cigarette cartons to be tested, including: A high level signal is output to the circuit where the relay is located, so that the normally open contact is converted from an open state to an on state, and the reject cylinder is used to reject the cigarette cartons to be inspected.
[0052] Specifically, in order to avoid excessive power consumption by the rejection cylinder and to meet the process requirements of cigarette production, the control terminal can also output a high-level signal to the circuit where the relay is located, so that the normally open contact corresponding to the relay is converted from an open state to a conductive state, thereby connecting the rejection cylinder and the circuit where the power supply is located to realize the rejection processing of the cigarette strips to be inspected.
[0053] Also see here Figure 3 The electrical hardware schematic diagram of a method for verifying a two-dimensional code of a cigarette box provided by an embodiment of the present application is shown, as shown in FIG. Figure 3 As shown, the model of the control terminal may be Siemens PLC SMART200, the I0.0 terminal of the SMART200 may be connected to the optical fiber sensor, the Q0.0 of the SMART200 may be connected to the relay, the Q0.1 of the SMART200 may be connected to the solid-state code reader, the Profinet bus terminal of the SMART200 may be connected to the two-dimensional code main power cabinet (for receiving the character code recognized by the solid-state code reader output by the two-dimensional code main power cabinet), the two-dimensional code main power cabinet is also connected to the output terminal of the solid-state code reader, the normally open contact corresponding to the relay is connected to the reject cylinder and the 24V source, and the SMART200, the optical fiber sensor and the solid-state code reader are also connected to the 24V power supply respectively.
[0054] See next Figure 4 , Figure 4 A schematic structural diagram of a cigarette box bar QR code verification system provided in an embodiment of the present application is shown.
[0055] The two-dimensional code verification system for cigarette boxes can be applied to a cigarette conveying device, which can at least include a cigarette feeding belt conveyor, an optical fiber sensor arranged on the cigarette feeding belt conveyor, a solid-state code reader, and a reject cylinder. Figure 4 As shown, the box bar QR code verification system for cigarettes may include at least a first processing module 401, a second processing module 402 and a third processing module 403, wherein: The first processing module 401 is used to obtain at least two light intensity signals collected by the optical fiber sensor when a cigarette to be inspected is detected on the cigarette feeding belt conveyor; The second processing module 402 is used to obtain the target character code parsed by the solid-state code reader when the difference between any two adjacent light intensity signals exceeds a preset difference threshold; wherein the target character code is obtained by the solid-state code reader according to the two-dimensional code of the box bar on the cigarette to be checked; The third processing module 403 is used to obtain the association result of the cigarette carton to be checked based on the target character code, and when the association result is association failure, control the rejection cylinder to reject the cigarette carton to be checked.
[0056] In some possible embodiments, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Acquire a first image containing the cigarette cartons to be checked, and identify the total number of cigarette cartons to be checked from the first image; Obtain the total weight of the cigarette cartons to be checked, calculate the weight of a single cigarette carton according to the total number of cigarette cartons and the total weight of the cigarette cartons, and query the target running speed corresponding to the weight of a single cigarette carton in a preset weight-speed correspondence list; wherein the preset weight-speed correspondence list includes at least two groups of cigarette carton weight intervals, and the standard running speed corresponding to each group of cigarette carton weight intervals; Control the belt running speed of the smoke inlet belt conveyor to be consistent with the target running speed.
[0057] In some possible embodiments, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Identify the contour features of the cigarette carton to be checked from the first image, and mark the contour center axis corresponding to the contour features of the cigarette carton in the first image; When it is detected that the axis angle between the profile center axis and the preset belt center axis exceeds the preset angle threshold, the smoke feeding belt conveyor is controlled to be in a stopped state; Prompt information is generated based on the axis angle and fed back to the user terminal.
[0058] In some possible embodiments, after the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the method further includes: When the target character code parsed by the solid-state code reader is not received within a preset period of time, a second image including the box bar two-dimensional code is acquired; Performing grayscale processing on the second image, and performing Gaussian blur processing on the grayscale processed second image; Identify the edge area of the box-bar QR code from the second image after Gaussian blur processing, and calculate the pixel ratio between the number of pixels in the edge area and the total number of pixels corresponding to the box-bar QR code; When the pixel ratio is lower than a preset ratio threshold, the smoke feeding belt conveyor is controlled to be in a stopped state.
[0059] In some possible embodiments, before obtaining the association result of the cigarette carton to be checked based on the target character code, the method further includes: Convert the target character encoding to obtain the corresponding batch number; The associated results of the cigarette cartons to be checked are obtained based on the target character encoding, including: When the batch number is queried in the preset cigarette carton number database, the associated result of the cigarette carton to be checked is obtained based on the target character code; wherein the preset cigarette carton number data includes at least two standard numbers corresponding to qualified cigarette carton.
[0060] In some possible embodiments, obtaining the association result of the cigarette carton to be checked based on the target character code includes: Filtering out at least two historical character codes corresponding to the target character code from a character code library; wherein the character code library includes at least three historical character codes; Inputting the target character code and each historical character code into a preset deep learning model in turn to obtain corresponding predicted association values; wherein the preset deep learning model is trained by at least two groups of character code samples and association value labels of each group of character code samples; When all the predicted correlation values are within the preset predicted value range, it is determined that the correlation result of the cigarette strip to be verified is successful; When any predicted correlation value is not within the preset predicted value interval, it is determined that the correlation result of the cigarette carton to be verified is a correlation failure.
[0061] In some possible embodiments, the cigarette conveying device further includes a relay and a normally open contact corresponding to the relay, and the normally open contact is arranged on the circuit where the reject cylinder is located; Control the rejection cylinder to reject the cigarette cartons to be tested, including: A high level signal is output to the circuit where the relay is located, so that the normally open contact is converted from an open state to an on state, and the reject cylinder is used to reject the cigarette cartons to be inspected.
[0062] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0063] See next Figure 5 , Figure 5A schematic structural diagram of another cigarette box barcode two-dimensional code verification system provided in an embodiment of the present application is shown.
[0064] The two-dimensional code verification system for cigarette boxes can be applied to a cigarette conveying device, which can at least include a cigarette feeding belt conveyor, an optical fiber sensor arranged on the cigarette feeding belt conveyor, a solid-state code reader, and a reject cylinder. Figure 5 As shown, the cigarette box strip two-dimensional code verification system 500 may include at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 and at least one communication bus 502 .
[0065] The communication bus 502 may be used to realize the connection and communication among the above-mentioned components.
[0066] The user interface 503 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.
[0067] The network interface 504 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.
[0068] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the box strip two-dimensional code verification system 500 for cigarettes, and executes various functions and processes data of the box strip two-dimensional code verification system 500 for cigarettes by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 501 can integrate one or more combinations of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application program; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented by a single chip.
[0069] The memory 505 may include a RAM or a ROM. Optionally, the memory 505 includes a non-transitory computer-readable medium. The memory 505 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for verifying the box barcode of cigarettes.
[0070] Specifically, the processor 501 may be used to call the box bar QR code verification application for cigarettes stored in the memory 505, and specifically perform the following operations: When a cigarette to be inspected is detected on the cigarette feeding belt conveyor, at least two light intensity signals collected by the optical fiber sensor are obtained; When the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the target character code parsed by the solid-state code reader is obtained; wherein the target character code is parsed by the solid-state code reader according to the box bar QR code on the cigarette carton to be checked; The association result of the to-be-checked cigarette carton is obtained based on the target character code, and when the association result is an association failure, the rejecting cylinder is controlled to reject the to-be-checked cigarette carton.
[0071] In some possible embodiments, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Acquire a first image containing the cigarette cartons to be checked, and identify the total number of cigarette cartons to be checked from the first image; Obtain the total weight of the cigarette cartons to be checked, calculate the weight of a single cigarette carton according to the total number of cigarette cartons and the total weight of the cigarette cartons, and query the target running speed corresponding to the weight of a single cigarette carton in a preset weight-speed correspondence list; wherein the preset weight-speed correspondence list includes at least two groups of cigarette carton weight intervals, and the standard running speed corresponding to each group of cigarette carton weight intervals; Control the belt running speed of the smoke inlet belt conveyor to be consistent with the target running speed.
[0072] In some possible embodiments, before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Identify the contour features of the cigarette carton to be checked from the first image, and mark the contour center axis corresponding to the contour features of the cigarette carton in the first image; When it is detected that the axis angle between the profile center axis and the preset belt center axis exceeds the preset angle threshold, the smoke feeding belt conveyor is controlled to be in a stopped state; Prompt information is generated based on the axis angle and fed back to the user terminal.
[0073] In some possible embodiments, after the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the method further includes: When the target character code parsed by the solid-state code reader is not received within a preset period of time, a second image including the box bar two-dimensional code is acquired; Performing grayscale processing on the second image, and performing Gaussian blur processing on the grayscale processed second image; Identify the edge area of the box-bar QR code from the second image after Gaussian blur processing, and calculate the pixel ratio between the number of pixels in the edge area and the total number of pixels corresponding to the box-bar QR code; When the pixel ratio is lower than a preset ratio threshold, the smoke feeding belt conveyor is controlled to be in a stopped state.
[0074] In some possible embodiments, before obtaining the association result of the cigarette carton to be checked based on the target character code, the method further includes: Convert the target character encoding to obtain the corresponding batch number; The associated results of the cigarette cartons to be checked are obtained based on the target character encoding, including: When the batch number is queried in the preset cigarette carton number database, the associated result of the cigarette carton to be checked is obtained based on the target character code; wherein the preset cigarette carton number data includes at least two standard numbers corresponding to qualified cigarette carton.
[0075] In some possible embodiments, obtaining the association result of the cigarette carton to be checked based on the target character code includes: Filtering out at least two historical character codes corresponding to the target character code from a character code library; wherein the character code library includes at least three historical character codes; Inputting the target character code and each historical character code into a preset deep learning model in turn to obtain corresponding predicted association values; wherein the preset deep learning model is trained by at least two groups of character code samples and association value labels of each group of character code samples; When all the predicted correlation values are within the preset predicted value range, it is determined that the correlation result of the cigarette strip to be verified is successful; When any predicted correlation value is not within the preset predicted value interval, it is determined that the correlation result of the cigarette carton to be verified is a correlation failure.
[0076] In some possible embodiments, the cigarette conveying device further includes a relay and a normally open contact corresponding to the relay, and the normally open contact is arranged on the circuit where the reject cylinder is located; Control the rejection cylinder to reject the cigarette cartons to be tested, including: A high level signal is output to the circuit where the relay is located, so that the normally open contact is converted from an open state to an on state, and the reject cylinder is used to reject the cigarette cartons to be inspected.
[0077] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0078] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0079] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0080] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0082] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
Claims
1. A method for verifying a two-dimensional code of a cigarette box bar, characterized in that: The method is applied to a cigarette conveying device, the cigarette conveying device comprising a cigarette feeding belt conveyor, an optical fiber sensor arranged on the cigarette feeding belt conveyor, a solid-state code reader and a reject cylinder, and the method comprises: When a cigarette to be inspected is detected on the cigarette feeding belt conveyor, at least two light intensity signals collected by the optical fiber sensor are obtained; When the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the target character code parsed by the solid-state code reader is obtained; wherein the target character code is parsed by the solid-state code reader according to the box bar QR code on the cigarette to be checked; The association result of the to-be-checked cigarette carton is obtained based on the target character code, and when the association result is an association failure, the rejecting cylinder is controlled to reject the to-be-checked cigarette carton.
2. The method according to claim 1, characterized in that Before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Acquire a first image containing the cigarette cartons to be checked, and identify the total number of cigarette cartons to be checked from the first image; Obtain the total weight of the cigarette cartons to be checked, calculate the weight of a single cigarette carton according to the total number of cigarette cartons and the total weight of the cigarette cartons, and query the target running speed corresponding to the weight of the single cigarette carton in a preset weight-speed correspondence list; wherein the preset weight-speed correspondence list includes at least two groups of cigarette carton weight intervals, and the standard running speed corresponding to each group of the cigarette cart weight intervals; The belt running speed of the smoke feeding belt conveyor is controlled to be consistent with the target running speed.
3. The method according to claim 2, characterized in that Before acquiring at least two light intensity signals collected by the optical fiber sensor, the method further includes: Identifying the contour features of the cigarette to be verified from the first image, and marking the contour center axis corresponding to the contour features of the cigarette in the first image; When it is detected that the axis angle between the central axis of the profile and the preset central axis of the belt exceeds a preset angle threshold, the smoke feeding belt conveyor is controlled to be in a stopped state; Prompt information is generated based on the axis angle, and the prompt information is fed back to the user terminal.
4. The method according to claim 1, characterized in that: After the difference between any two adjacent light intensity signals exceeds a preset difference threshold, the method further includes: When the target character code parsed by the solid-state code reader is not received within a preset period of time, a second image including the box bar two-dimensional code is acquired; Performing grayscale processing on the second image, and performing Gaussian blur processing on the second image after the grayscale processing; Identify the edge area of the box bar two-dimensional code from the second image after Gaussian blur processing, and calculate the pixel ratio between the number of pixels in the edge area and the total number of pixels corresponding to the box bar two-dimensional code; When the pixel ratio is lower than a preset ratio threshold, the smoke feeding belt conveyor is controlled to be in a stopped state.
5. The method according to claim 1, characterized in that Before obtaining the association result of the cigarette to be checked based on the target character code, the method further includes: Convert the target character code to obtain a corresponding batch number; The step of obtaining the association result of the cigarette to be checked based on the target character code includes: When the batch number is queried in the preset cigarette carton number database, the associated result of the cigarette carton to be checked is obtained based on the target character code; wherein the preset cigarette carton number data includes at least two standard numbers corresponding to qualified cigarette carton.
6. The method according to claim 1 or 5, characterized in that: The step of obtaining the association result of the cigarette to be checked based on the target character code includes: Filtering out at least two historical character codes corresponding to the target character code from a character code library; wherein the character code library includes at least three historical character codes; Inputting the target character code and each of the historical character codes into a preset deep learning model in sequence to obtain corresponding predicted association values; wherein the preset deep learning model is trained by at least two groups of character code samples and association value labels of each group of character code samples; When all the predicted association values are within the preset prediction value interval, it is determined that the association result of the cigarette carton to be checked is successful; When any one of the predicted association values is not within the preset prediction value interval, it is determined that the association result of the cigarette carton to be checked is an association failure.
7. The method according to claim 1, characterized in that The cigarette conveying device also includes a relay and a normally open contact corresponding to the relay, and the normally open contact is arranged on the circuit where the rejecting cylinder is located; The step of controlling the rejecting cylinder to reject the cigarette cartons to be inspected comprises: A high level signal is output to the circuit where the relay is located, so that the normally open contact is converted from an open state to a conductive state, and the rejecting cylinder is made to reject the cigarette cartons to be inspected.
8. A two-dimensional code verification system for cigarette box bars, characterized in that: The system is applied to a cigarette conveying device, which includes a cigarette feeding belt conveyor, an optical fiber sensor, a solid-state code reader and a reject cylinder arranged on the cigarette feeding belt conveyor, and the system includes: A first processing module, for acquiring at least two light intensity signals collected by the optical fiber sensor when a cigarette to be inspected is detected on the cigarette feeding belt conveyor; The second processing module is used to obtain the target character code parsed by the solid-state code reader when the difference between any two adjacent light intensity signals exceeds a preset difference threshold; wherein the target character code is parsed by the solid-state code reader according to the box bar QR code on the cigarette to be checked; The third processing module is used to obtain the association result of the to-be-checked cigarette carton based on the target character code, and when the association result is an association failure, control the rejection cylinder to perform a rejection process on the to-be-checked cigarette carton.
9. A two-dimensional code verification system for cigarette box bars, characterized in that: including a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 7.