Cigarette case two-dimensional code quality detection method and system

By generating and comparing the task code and time code of the cigarette box QR code, the problem of duplicate code in QR code identification and detection in the tobacco industry is solved, real-time control of QR code quality and reduction of production losses are achieved.

CN119399156APending Publication Date: 2025-02-07HUBEI CHINA TOBACCO INDUSTRY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483185.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the quality inspection process of the tobacco industry, there may be recode problems in QR code identification and testing, resulting in the product after production needs to be reworked and increased production losses.

Method used

By receiving production task information, generating preliminary QR codes, collecting QR code images for binary processing, obtaining image parameters to determine the QR code level, and extracting task codes and time codes for comparison, detecting whether there are multiple QR codes. The task code and time code are the same.

Benefits of technology

Real-time control of quality during the QR code printing process, timely detection and discovery of re-code conditions to prevent further expansion of losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399156A_ABST
    Figure CN119399156A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cigarette case two-dimensional code quality detection method and system, and the method comprises the steps: receiving production task information, and generating a preliminary two-dimensional code of a cigarette case based on the production task information; a two-dimensional code image of the preliminary two-dimensional code is collected, binarization processing is carried out on the two-dimensional code image, and a two-dimensional code grayscale image is obtained; acquiring image parameters of the two-dimensional code grayscale image, determining the two-dimensional code grade based on the image parameters, and judging whether the two-dimensional code grade meets the grade requirement of the cigarette case to be detected or not; when the two-dimensional code grade meets the grade requirement of the production task information, task codes and time codes are extracted from the two-dimensional code gray level image, the task codes and the time codes between the two-dimensional codes are compared, and whether the task codes and the time codes between multiple two-dimensional codes are the same or not is detected; and when it is detected that the task codes and the time codes among the multiple two-dimensional codes are the same, outputting a detection result that the matched two-dimensional codes have repeated codes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of two-dimensional codes, and in particular to a quality detection method and system for two-dimensional codes on cigarette boxes. Background Art

[0002] At present, with the development of big data technology, QR code has gradually become an essential part of every link of commodity production, storage, and sales, which can provide convenience for commodity anti-counterfeiting, traceability, information provision, etc. Specifically in the tobacco industry, QR code technology runs through every step of quality inspection, transportation and delivery, product packaging, and market launch, providing data support for the production, management, and sales of cigarettes.

[0003] However, in the current quality inspection process of the tobacco industry, the problem of duplicate codes may occur when conducting QR code recognition inspection. The problem of duplicate QR codes can only be confirmed through inspection at the back end of the production line, and once duplicate codes are confirmed, all products after production need to be reworked, increasing production losses. Summary of the invention

[0004] In view of the problems existing in the prior art, an embodiment of the present invention provides a quality detection method and system for a cigarette box QR code.

[0005] An embodiment of the present invention provides a method for quality detection of a two-dimensional code on a cigarette box, the method comprising: Receiving production task information, and generating a preliminary two-dimensional code of the cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes a task code corresponding to the cigarette box sequence and a time code corresponding to the spraying time of the two-dimensional code; Collecting a two-dimensional code image of the preliminary two-dimensional code, and performing binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image; Acquire image parameters of the grayscale image of the two-dimensional code, determine the level of the two-dimensional code based on the image parameters, and judge whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected; When the level of the two-dimensional code meets the level requirement of the production task information, extract the task code and time code from the grayscale image of the two-dimensional code, compare the task code and time code between the two-dimensional codes, and detect whether there are multiple two-dimensional codes with the same task code and time code; When it is detected that there are multiple QR codes with the same task code and time code, the detection result of duplicate codes appearing in the matching QR codes is output.

[0006] In one embodiment, the method further comprises: Acquire a target area of ​​the task code and the time code in the grayscale image of the two-dimensional code, and extract key feature points from the target area; Match key feature points between different QR codes using a nearest neighbor matching algorithm, evaluate similarity based on the matching results, and mark the key feature points as identical feature points when the similarity is greater than a preset threshold; The number of the same feature points is detected, and when the number exceeds a preset ratio, the task codes and / or time codes corresponding to the key feature points are the same.

[0007] In one embodiment, the method further comprises: A feature point database is established based on the key feature points, and the two-dimensional code image of the production line is extracted and compared in real time through the feature point database, and it is determined whether there is a duplicate code problem on the production line through the comparison result.

[0008] In one embodiment, the method further comprises: Determine the coding equipment and coding requirements based on the production task information, determine the coding timeline in combination with the production task information and the equipment parameters of the coding equipment, and determine the cigarette box serial number according to the coding timeline; Based on the cigarette box serial number and the coding time axis, the task code and time code of the cigarette box are determined, and combined with the coding requirements, a two-dimensional code of the cigarette box to be inspected is generated.

[0009] In one embodiment, the image parameters include: Decoding, symbol contrast, print increment, axial non-uniformity, and unused error correction parameters.

[0010] An embodiment of the present invention provides a quality inspection system for a cigarette box two-dimensional code, the system comprising: A generating module, used for receiving production task information, and generating a preliminary two-dimensional code of a cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes a task code corresponding to the cigarette box sequence and a time code corresponding to the spraying time of the two-dimensional code; A binarization module is used to collect the two-dimensional code image of the preliminary two-dimensional code, and perform binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image; A grade module, used for acquiring image parameters of the grayscale image of the two-dimensional code, and determining the grade of the two-dimensional code based on the image parameters, and judging whether the grade of the two-dimensional code meets the grade requirements of the cigarette box to be inspected; A comparison module is used to extract the task code and time code from the grayscale image of the two-dimensional code when the level of the two-dimensional code meets the level requirements of the production task information, compare the task code and time code between the two-dimensional codes, and detect whether there are multiple two-dimensional codes with the same task code and time code; The output module is used to output the detection result of duplicate codes in the matching QR codes when it is detected that the task codes and time codes are the same among multiple QR codes.

[0011] In one embodiment, the system further comprises: An extraction module, used for acquiring a target area of ​​the task code and the time code in the grayscale image of the two-dimensional code, and extracting key feature points from the target area; A marking module is used to match key feature points between different QR codes by a nearest neighbor matching algorithm, evaluate the similarity based on the matching results, and mark the key feature points as identical feature points when the similarity is greater than a preset threshold; The detection module is used to detect the number of the same feature points. When the number exceeds a preset ratio, the task codes and / or time codes corresponding to the key feature points are the same.

[0012] In one embodiment, the system further comprises: The database module is used to establish a feature point database based on the key feature points, and to extract and compare the two-dimensional code image of the production line in real time through the feature point database, and to determine whether there is a duplicate code problem on the production line through the comparison result.

[0013] An embodiment of the present invention provides an electronic device, 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 method described in one or more embodiments.

[0014] An embodiment of the present invention provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the quality detection method of the two-dimensional code of a cigarette box are implemented.

[0015] In view of the above, in one or more embodiments of the present specification, the production task information is received, and the preliminary two-dimensional code of the cigarette box is generated based on the production task information. The generation source of the preliminary two-dimensional code includes the task code corresponding to the cigarette box sequence and the time code corresponding to the spraying time of the two-dimensional code; the two-dimensional code image of the preliminary two-dimensional code is collected, and the two-dimensional code image is binarized to obtain the grayscale image of the two-dimensional code; the image parameters of the grayscale image of the two-dimensional code are obtained, and the level of the two-dimensional code is determined based on the image parameters, and it is judged whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected; when the level of the two-dimensional code meets the level requirements of the production task information, the task code and time code are extracted from the grayscale image of the two-dimensional code, and the task code and time code between the two-dimensional codes are compared to detect whether there are multiple two-dimensional codes The task code and time code are the same; when it is detected that there are multiple two-dimensional codes The task code and time code are the same, the detection result of the matching two-dimensional code appears. In this way, the quality of the two-dimensional code can be controlled during the printing process of the two-dimensional code, and the presence of duplicate codes can be detected in real time, and the duplicate code situation can be discovered in time to prevent further expansion of losses. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a flow chart of a quality detection method of a cigarette box QR code provided in one embodiment of this specification.

[0018] Figure 2 It is a structural schematic diagram of a quality inspection system for a cigarette box QR code provided by an embodiment of this specification.

[0019] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0020] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed can be changed without departing from the scope of protection of the contents of this specification. Various examples can omit, replace or add various processes or components as needed. For example, the described method can be performed in an order different from the described order, and various steps can be added, omitted or combined. In addition, the features described relative to some examples can also be combined in other examples.

[0021] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.

[0022] like Figure 1 As shown, an embodiment of the present invention provides a quality detection method for a cigarette box two-dimensional code, comprising: Step S101, receiving production task information, and generating a preliminary QR code of a cigarette box based on the production task information, wherein the generation source of the preliminary QR code includes a task code corresponding to a cigarette box sequence and a time code corresponding to a QR code spraying time.

[0023] Specifically, the production task information of cigarettes is received, wherein the production task information may include cigarette type, cigarette quantity, batch information, production date, etc., and the preliminary QR code of the cigarette box may be determined according to the production task information. The specific determination steps may include: the inkjet device and inkjet requirements of the QR code may be determined from the production task information, that is, according to the specific requirements of the production task information, such as (such as output, speed, accuracy, etc.), and the current task operation status of the inkjet device, a suitable inkjet device is selected. Different inkjet devices may have different performance characteristics, such as different inkjet speeds, resolutions, inkjet widths, paper feed paper sizes, etc. The inkjet requirements may include error correction levels, including data content, etc., wherein the error correction level is an error correction capability that can be divided into four levels, from the lowest to the highest, namely L (about 7%), M (about 15%), Q (about 25%) and H (about 30%). According to the production batch arrangement of the product in the production task information and the coding speed in the equipment parameters of the coding equipment, the coding time axis of the product is determined, wherein the coding time axis refers to the coding sequence time axis corresponding to the product. For example, in a batch of production task information, there are 3 batches of Class A cigarettes, A1, A2, A3, and 2 batches of Class B cigarettes, B1, B2. According to the equipment parameters, the coding time is designated from 2 o'clock to 4 o'clock, and the corresponding coding time axis can be: 2 o'clock-A1, 2:20-A2, 2:40-A3, 3 o'clock-B1, 3:30-B2. In addition, on this basis, each batch of cigarettes can be further divided into the coding time axis. For example, for the first batch of Class A cigarettes, which contains 1,000 packs of cigarettes, each pack, or every 10 packs of cigarettes, can be divided into the corresponding time axis, thereby realizing the reasonable planning of each stage in the production process. After dividing the time axis, the cigarette box serial numbers can be further divided. For example, when dividing the time axis of every 10 packs of cigarettes in the first batch of Class A cigarettes, the corresponding serial numbers can also be divided according to the same rules. For example, the serial numbers of the first batch of Class A cigarettes can be: A1-1 (first 10 packs), A1-2 (first 20 packs), A1-3 (first 30 packs)..., and the serial numbers of other batches can be deduced in the same way.

[0024] In addition, after determining the coding timeline, the task code and time code corresponding to the cigarette box can be further determined. The task code is the cigarette box sequence, that is, the identifier related to the batch and serial number of the cigarette, which is used to identify the production batch, production line number and other production information of the cigarette. The time code is the time identifier of the cigarette, which is used to identify the production timestamp corresponding to the time when the cigarette was produced. Then, through the QR code generation software tool, the above-mentioned related data and parameters are generated into an actual QR code image, thereby determining the preliminary QR code.

[0025] Step S102, collecting the two-dimensional code image of the preliminary two-dimensional code, and performing binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image.

[0026] Specifically, the image information of the preliminary two-dimensional code is collected by an image acquisition device, and the two-dimensional code image is binarized to obtain a two-dimensional code grayscale image. Before the binarization, the two-dimensional code image can also be pre-processed, such as denoising, contrast enhancement and other steps, to further improve the image quality of the binarization. Then, the two-dimensional code image is converted into a binary image through a binarization algorithm, that is, each pixel in the image is compared with a selected threshold, and those greater than the threshold are set to white (255), and those less than or equal to the threshold are set to black (0), to obtain a two-dimensional code grayscale image, which is convenient for the detection of duplicate codes in subsequent steps.

[0027] Step S103, acquiring image parameters of the grayscale image of the two-dimensional code, and determining the level of the two-dimensional code based on the image parameters, and judging whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected.

[0028] Specifically, the image information of the grayscale image of the QR code is analyzed to determine the QR code grade of the QR code, and to determine whether the QR code grade meets the grade requirements of the cigarette box to be inspected. For the evaluation of the QR code grade, a series of parameters of the QR code image can be evaluated based on the ISO / IEC15415 standard or other relevant standards, including but not limited to decoding capability, symbol contrast, printing increment (modulation), axial inconsistency, and unused error correction capability. The QR code grade standard can be divided into 5 levels from high to low, namely, A, B, C, D, and F. Decoding capability means that the entire data information can be successfully decoded, then the decoding is passed, and the decoding level is A, otherwise it is F; symbol contrast is used to measure the contrast between black modules and white modules. Good contrast helps improve reading speed and accuracy; printing increment measures the change in reflectivity of a single module in the QR code. Ideally, all black modules should have the same dark color, and white modules should also be uniformly bright; axial inconsistency reflects the consistency of the QR code pattern in the horizontal or vertical direction; unused error correction capability indicates the gap between the actual error correction capability used and the level set during design. If the QR code does not fully utilize its error correction function, it may indicate a potential problem. Evaluate the QR code level corresponding to the QR code according to the parameters, and judge whether the QR code level meets the level requirements of the production task information. In the above example, for general production task information, the four levels of ABCD are qualified levels, and the F level is unqualified.

[0029] Step S104, when the level of the QR code meets the level requirement of the production task information, extract the task code and time code from the QR code grayscale image, compare the task code and time code between the QR codes, and detect whether there are multiple QR codes with the same task code and time code.

[0030] Specifically, when the quality level of the two-dimensional code meets the level requirements of the production task information, it means that the physical printing requirements of the two-dimensional code meet the requirements and are qualified for the duplicate code detection in the subsequent steps. The duplicate code judgment is performed by comparing the task code and the time code between the two-dimensional code images. The specific judgment process can be, for example: according to the generation rules in the two-dimensional code generation process, determine the target area where the task code and the time code are located, extract the task code and the time code from the corresponding area of ​​the two-dimensional code grayscale image, and use the corner point detection algorithm (such as Harris corner point detection, FAST feature point detection, etc.) to detect the key feature points in the target area, and further screen the key feature points, such as selecting the most representative key feature points according to the quality of the feature points (such as response strength, stability, etc.), and then use the nearest neighbor matching algorithm (such as K-NearestNeighbor, KNN) to match the feature points in different two-dimensional codes, evaluate the similarity based on the matching results, and mark the key feature points as the same feature points when the similarity is greater than the preset threshold. The similarity can be calculated by calculating the Euclidean distance or other distance measurement (such as Hamming distance) between the matching feature points, evaluating the similarity, and then setting an example threshold. If the distance between the matching feature points is less than the threshold, these feature points are considered to be the same and are the same feature points. Finally, the number of the same feature points is detected. When the number exceeds a preset ratio, it is determined that the task code and / or time code corresponding to the key feature points are the same.

[0031] In addition, a feature point database can be established based on key feature points to store the feature point information of all generated QR code task codes and time codes, and use efficient index structures (such as KD trees, hash tables, etc.) to quickly retrieve and compare new QR code feature points. Then, in the real-time production process, the QR code image is collected in real time, and online feature point extraction and comparison are performed to timely discover duplicate code problems. Once duplicate codes are detected, the early warning mechanism is immediately triggered to notify relevant personnel to handle them.

[0032] Step S105, when it is detected that there are multiple QR codes with the same task code and time code, output the detection result of duplicate codes appearing in the matching QR codes.

[0033] Specifically, when it is detected that the task code and time code are the same among multiple QR codes, it means that the QR codes are duplicated and the cigarette boxes with duplicate codes need to be re-sprayed with QR codes or removed. The detection results of duplicate QR codes can be sent to the management system and binding terminal so that the staff can promptly carry out follow-up processing on the cigarette boxes with duplicate codes.

[0034] A quality detection method for a cigarette box two-dimensional code provided by an embodiment of the present invention receives production task information, generates a preliminary two-dimensional code of a cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes the task code corresponding to the cigarette box sequence and the time code corresponding to the spraying time of the two-dimensional code; collects the two-dimensional code image of the preliminary two-dimensional code, performs binarization processing on the two-dimensional code image, and obtains a two-dimensional code grayscale image; obtains the image parameters of the two-dimensional code grayscale image, and determines the level of the two-dimensional code based on the image parameters, and judges whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected; when the level of the two-dimensional code meets the level requirements of the production task information, extracts the task code and the time code from the two-dimensional code grayscale image, compares the task code and the time code between the two-dimensional codes, and detects whether there are multiple two-dimensional codes with the same task code and time code; when it is detected that there are multiple two-dimensional codes with the same task code and time code, outputs the detection result of the matching two-dimensional code with repeated code. In this way, the quality of the two-dimensional code can be controlled during the printing process of the two-dimensional code, and the presence of repeated code can be detected in real time, and the repeated code can be discovered in time to prevent the loss from further expanding.

[0035] See also Figure 2 , Figure 2 Schematic diagram of a cigarette box QR code quality inspection system provided in an embodiment of the present application. Figure 2 As shown, the system comprises: A generating module S201 is used to receive production task information and generate a preliminary two-dimensional code of a cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes a task code corresponding to the cigarette box sequence and a time code corresponding to the spraying time of the two-dimensional code; A binarization module S202 is used to collect a two-dimensional code image of the preliminary two-dimensional code, and perform binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image; The grade module S203 is used to obtain the image parameters of the grayscale image of the two-dimensional code, and determine the grade of the two-dimensional code based on the image parameters, and judge whether the grade of the two-dimensional code meets the grade requirements of the cigarette box to be inspected; A comparison module S204 is used to extract the task code and time code from the grayscale image of the two-dimensional code when the level of the two-dimensional code meets the level requirement of the production task information, compare the task code and time code between the two-dimensional codes, and detect whether there are multiple two-dimensional codes with the same task code and time code; The output module S205 is used to output the detection result of duplicate codes appearing in the matching two-dimensional codes when it is detected that the task codes and time codes are the same among multiple two-dimensional codes.

[0036] In another embodiment, a quality inspection system for cigarette box QR codes further includes: An extraction module, used for acquiring a target area of ​​the task code and the time code in the grayscale image of the two-dimensional code, and extracting key feature points from the target area; A marking module is used to match key feature points between different QR codes by a nearest neighbor matching algorithm, evaluate the similarity based on the matching results, and mark the key feature points as identical feature points when the similarity is greater than a preset threshold; The detection module is used to detect the number of the same feature points. When the number exceeds a preset ratio, the task codes and / or time codes corresponding to the key feature points are the same.

[0037] In another embodiment, a quality inspection system for cigarette box QR codes further includes: The database module is used to establish a feature point database based on the key feature points, and to extract and compare the two-dimensional code image of the production line in real time through the feature point database, and to determine whether there is a duplicate code problem on the production line through the comparison result.

[0038] 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.

[0039] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.

[0040] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3 As shown, the electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .

[0041] The communication bus 302 is used to realize the connection and communication between these components.

[0042] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0043] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0044] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the terminal 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a processor (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0045] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 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 various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.

[0046] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the interactive application based on image generation stored in the memory 305, and specifically perform the following operations: receiving production task information, generating a preliminary two-dimensional code of the cigarette box based on the production task information, the generation source of the preliminary two-dimensional code includes the task code corresponding to the cigarette box sequence and the time code corresponding to the spraying time of the two-dimensional code; collecting the two-dimensional code image of the preliminary two-dimensional code, binarizing the two-dimensional code image, and obtaining a two-dimensional code grayscale image; obtaining the image parameters of the two-dimensional code grayscale image, and determining the level of the two-dimensional code based on the image parameters, and judging whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected; when the level of the two-dimensional code meets the level requirements of the production task information, extracting the task code and time code from the two-dimensional code grayscale image, comparing the task code and time code between the two-dimensional codes, and detecting whether there are multiple two-dimensional codes with the same task code and time code; when it is detected that there are multiple two-dimensional codes with the same task code and time code, outputting the detection result of the occurrence of duplicate codes in the matching two-dimensional code.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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 the 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.

[0051] 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.

[0052] 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.

[0053] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0054] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0055] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A method for detecting the quality of a cigarette box QR code, the method comprising: Receiving production task information, and generating a preliminary two-dimensional code of the cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes a task code corresponding to the cigarette box sequence and a time code corresponding to the spraying time of the two-dimensional code; Collecting a two-dimensional code image of the preliminary two-dimensional code, and performing binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image; Acquire image parameters of the grayscale image of the two-dimensional code, determine the level of the two-dimensional code based on the image parameters, and judge whether the level of the two-dimensional code meets the level requirements of the cigarette box to be inspected; When the level of the two-dimensional code meets the level requirement of the production task information, extract the task code and time code from the grayscale image of the two-dimensional code, compare the task code and time code between the two-dimensional codes, and detect whether there are multiple two-dimensional codes with the same task code and time code; When it is detected that there are multiple QR codes with the same task code and time code, the detection result of duplicate codes appearing in the matching QR codes is output.

2. The method according to claim 1, characterized in that The comparing the task code and the time code between the two-dimensional codes to detect whether there are multiple two-dimensional codes with the same task code and time code, includes: Acquire a target area of ​​the task code and the time code in the grayscale image of the two-dimensional code, and extract key feature points from the target area; Match key feature points between different QR codes using a nearest neighbor matching algorithm, evaluate similarity based on the matching results, and mark the key feature points as identical feature points when the similarity is greater than a preset threshold; The number of the same feature points is detected, and when the number exceeds a preset ratio, the task codes and / or time codes corresponding to the key feature points are the same.

3. The method according to claim 2, characterized in that The method further comprises: A feature point database is established based on the key feature points, and the two-dimensional code image of the production line is extracted and compared in real time through the feature point database, and it is determined whether there is a duplicate code problem on the production line through the comparison result.

4. The method according to claim 1, characterized in that: The receiving of production task information and generating a preliminary QR code of the cigarette box based on the production task information includes: Determine the coding equipment and coding requirements based on the production task information, determine the coding timeline in combination with the production task information and the equipment parameters of the coding equipment, and determine the cigarette box serial number according to the coding timeline; Based on the cigarette box serial number and the coding time axis, the task code and time code of the cigarette box are determined, and combined with the coding requirements, a two-dimensional code of the cigarette box to be inspected is generated.

5. The method according to claim 1, characterized in that The image parameters include: Decoding, symbol contrast, print increment, axial non-uniformity, and unused error correction parameters.

6. A quality inspection system for cigarette box QR codes, characterized in that: The system comprises: A generating module, used for receiving production task information, and generating a preliminary two-dimensional code of a cigarette box based on the production task information, wherein the generation source of the preliminary two-dimensional code includes a task code corresponding to the cigarette box sequence and a time code corresponding to the spraying time of the two-dimensional code; A binarization module is used to collect the two-dimensional code image of the preliminary two-dimensional code, and perform binarization processing on the two-dimensional code image to obtain a two-dimensional code grayscale image; A grade module, used for acquiring image parameters of the grayscale image of the two-dimensional code, and determining the grade of the two-dimensional code based on the image parameters, and judging whether the grade of the two-dimensional code meets the grade requirements of the cigarette box to be inspected; A comparison module is used to extract the task code and time code from the grayscale image of the two-dimensional code when the level of the two-dimensional code meets the level requirements of the production task information, compare the task code and time code between the two-dimensional codes, and detect whether there are multiple two-dimensional codes with the same task code and time code; The output module is used to output the detection result of duplicate codes in the matching QR codes when it is detected that the task codes and time codes are the same among multiple QR codes.

7. The system according to claim 6, characterized in that The system further comprises: An extraction module, used for acquiring a target area of ​​the task code and the time code in the grayscale image of the two-dimensional code, and extracting key feature points from the target area; A marking module is used to match key feature points between different QR codes by a nearest neighbor matching algorithm, evaluate the similarity based on the matching results, and mark the key feature points as identical feature points when the similarity is greater than a preset threshold; The detection module is used to detect the number of the same feature points. When the number exceeds a preset ratio, the task codes and / or time codes corresponding to the key feature points are the same.

8. The system according to claim 7, characterized in that The system further comprises: The database module is used to establish a feature point database based on the key feature points, and to extract and compare the two-dimensional code image of the production line in real time through the feature point database, and to determine whether there is a duplicate code problem on the production line through the comparison result.

9. An electronic device comprising 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 method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 5.