Barcode printing repetition prevention device

By using timestamps, serial numbers, and random numbers to generate unique barcodes in the barcode printing system, and combining hash tables and database detection, the problem of barcode duplication in large-scale, high-concurrency environments is solved, achieving barcode uniqueness and accuracy.

CN223778057UActive Publication Date: 2026-01-09HANGZHOU GUBEI INTELLIGENT MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202520096307.X
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2026-01-09
Estimated Expiration
2035-01-16

AI Technical Summary

Technical Problem

Existing barcode printing systems are prone to missed or false detections when faced with large-scale, high-concurrency barcode printing demands, and cannot fully guarantee the uniqueness of barcodes.

Method used

A unique barcode is generated by using an anti-duplicate barcode printing device that combines timestamps, serial numbers, and random numbers. The barcode is then detected in real time using a hash table and a database. Multiple detection mechanisms are integrated to ensure the uniqueness of the barcode, including hash table detection, database query, and rule verification.

Benefits of technology

It effectively ensures the uniqueness of barcodes, improves the accuracy and reliability of barcode generation and printing, and avoids the occurrence of duplicate barcodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223778057U_ABST
    Figure CN223778057U_ABST
Patent Text Reader

Abstract

The utility model relates to the technical field of bar code printing, in particular to a bar code printing repetition prevention device which comprises a repetition prevention bar code printing device box, a control module box, a bar code printer and a conveying belt. The anti-repetition bar code printing device box is installed on the conveying belt, a bar code printer is arranged on one side in the anti-repetition bar code printing device box, and a control module box is arranged in the anti-repetition bar code printing device box on one side of the bar code printer. The control module box is internally provided with a bar code generation module, a database module, a hash table module, a repetition detection module, a printing control module and a user interface module arranged outside the anti-repetition bar code printing device box. The device has the technical characteristics of multiple detection mechanisms, real-time detection, high concurrent processing, user friendliness, expandability and the like, and can meet the requirements of different users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model relates to the field of barcode printing technology, specifically a device for preventing duplicate barcode printing. Background Technology

[0002] A barcode printer is a specialized printer. The biggest difference between a barcode printer and a regular printer is that barcode printers use heat as the printing medium and a ribbon (or thermal paper) to complete the printing. The biggest advantage of this printing method over regular printing is that it can achieve continuous high-speed printing without supervision.

[0003] While existing barcode printing systems have some anti-duplicate features, they often rely on simple database queries or memory checks. When faced with large-scale, high-concurrency barcode printing demands, these methods are prone to missed or false detections, and cannot fully guarantee the uniqueness of barcodes.

[0004] Therefore, in view of the above-mentioned problems, this technical solution proposes a device for preventing duplicate barcode printing. Utility Model Content

[0005] The purpose of this invention is to provide a device for preventing duplicate barcode printing, so as to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, this utility model provides the following technical solution: a barcode printing anti-duplicate device, comprising an anti-duplicate barcode printing device box, a control module box, a barcode printer, and a conveyor belt; the anti-duplicate barcode printing device box is installed on the conveyor belt, a barcode printer is installed on one side inside the anti-duplicate barcode printing device box, and a control module box is installed inside the anti-duplicate barcode printing device box on the side of the barcode printer; the barcode strip to be printed is placed on the conveyor belt for automated transmission, then passes through the barcode printer for barcode printing, and then the uniqueness of the printed barcode is detected by the control module box to prevent duplication; the control module box contains a barcode generation module, a database module, a hash table module, a duplicate detection module, a printing control module, and a user interface module located outside the anti-duplicate barcode printing device box;

[0007] The barcode generation module generates barcodes according to preset rules, and combines elements such as timestamps, serial numbers, and random numbers during the generation process to ensure the uniqueness of the barcodes;

[0008] The database module is used to store generated barcode information, supports fast query and insertion operations, and ensures the uniqueness of barcodes;

[0009] The hash table module maintains a hash table in memory for real-time storage and detection of generated barcodes, improving detection speed.

[0010] The duplicate detection module integrates multiple detection mechanisms, including database query, hash table detection, and rule verification, to ensure the uniqueness of barcodes;

[0011] The printing control module controls the printing operation of the barcode printer based on the results of the duplicate detection module to avoid printing duplicate barcodes.

[0012] The user interface module provides a user-friendly interface to facilitate barcode generation, detection, and printing operations.

[0013] The operation process of this device is as follows: barcode generation - duplicate detection - rule verification - print control - user interaction;

[0014] The conveyor belt is activated to transfer the barcode strip to the underside of the barcode printer. The barcode generation module generates barcodes on the strip according to preset rules. During generation, elements such as timestamps, serial numbers, and random numbers can be incorporated to ensure the uniqueness of the barcodes. The generated barcodes are first checked in real-time by the hash table module. If the barcode already exists in the hash table, it is considered a duplicate, subsequent operations are stopped, and a warning is issued. If the barcode does not exist in the hash table, it is further queried through the database module to ensure its uniqueness. After passing the hash table and database checks, the barcode also needs to be verified by the rule verification module to ensure it conforms to the preset generation rules. If the barcode passes all checks and verifications, the print control module will control the barcode printer to print. If a duplicate barcode is detected, printing stops, a warning is issued, and the user is prompted to take action. The user interface module provides a user-friendly interface for easy barcode generation, detection, and printing operations. Users can view the results of barcode generation and detection in real time and perform corresponding operations.

[0015] Compared with existing technologies, the advantages of this invention are: by combining elements such as timestamps, serial numbers, random numbers, and checksums, the uniqueness of barcodes can be effectively ensured. After barcode generation, a duplicate check is performed to ensure uniqueness. A user-friendly interface facilitates barcode generation, detection, and printing operations.

[0016] The barcode generation method of this invention integrates multiple elements and detection mechanisms to ensure that no duplicate barcodes occur during the barcode generation process, thereby improving the accuracy and reliability of barcode generation and printing. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of a barcode printing anti-duplicate device.

[0018] Figure 2 This is a schematic diagram of a frame for a barcode printing anti-duplicate device.

[0019] The components include: anti-duplicate barcode printing device box 10, control module box 11, barcode printer 12, and conveyor belt 13. Detailed Implementation

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0021] In the description of this utility model, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this utility model and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this utility model. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this utility model, unless otherwise stated, "a plurality of" means two or more.

[0022] In the description of this utility model, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this utility model based on the specific circumstances.

[0023] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0024] Please see Figures 1-2A barcode printing anti-duplicate device includes an anti-duplicate barcode printing device box 10, a control module box 11, a barcode printer 12, and a conveyor belt 13. The anti-duplicate barcode printing device box 10 is installed on the conveyor belt 13. The barcode printer 12 is installed on one side of the anti-duplicate barcode printing device box 10, and the control module box 11 is installed inside the anti-duplicate barcode printing device box 10 on the other side of the barcode printer 12. The barcode strip to be printed is placed on the conveyor belt 13 for automated transmission, and then the barcode is printed by the barcode printer 12. After that, the uniqueness of the printed barcode is detected by the control module box 11 to prevent duplicates. The control module box 11 contains a barcode generation module, a database module, a hash table module, a duplicate detection module, a printing control module, and a user interface module located outside the anti-duplicate barcode printing device box 10.

[0025] The barcode generation module generates barcodes according to preset rules, and combines elements such as timestamps, serial numbers, and random numbers during the generation process to ensure the uniqueness of the barcodes;

[0026] The database module is used to store generated barcode information, supports fast query and insertion operations, and ensures the uniqueness of barcodes;

[0027] The hash table module maintains a hash table in memory for real-time storage and detection of generated barcodes, improving detection speed.

[0028] The duplicate detection module integrates multiple detection mechanisms, including database query, hash table detection, and rule verification, to ensure the uniqueness of barcodes;

[0029] Based on the results of the duplicate detection module, the printing control module controls the printing operation of the barcode printer 12 to avoid printing duplicate barcodes.

[0030] The user interface module provides a user-friendly interface to facilitate barcode generation, detection, and printing operations.

[0031] The operation process of this device is as follows: barcode generation - duplicate detection - rule verification - print control - user interaction;

[0032] The conveyor belt 13 is activated to transfer the barcode strip to the underside of the barcode printer 12. The barcode generation module generates barcodes on the barcode strip according to preset rules. During the generation process, elements such as timestamps, serial numbers, and random numbers can be combined to ensure the uniqueness of the barcodes. The generated barcodes are first checked in real time by the hash table module. If the barcode already exists in the hash table, it is determined to be a duplicate barcode, subsequent operations are stopped, and a warning is issued. If the barcode does not exist in the hash table, it is further queried through the database module to ensure the uniqueness of the barcodes. After passing the hash table and database checks, the barcodes also need to be verified by the rule verification module to ensure that the barcodes conform to the preset generation rules. If the barcodes pass all checks and verifications, the print control module will control the barcode printer 12 to perform the printing operation. If a duplicate barcode is detected, printing is stopped and a warning is issued, prompting the user to take action. The user interface module provides a user-friendly interface for convenient barcode generation, detection, and printing operations. Users can view the results of barcode generation and detection in real time and perform corresponding operations.

[0033] In this embodiment of the invention, the timestamp is one of the important elements to ensure the uniqueness of the barcode. By using the current timestamp, it can be ensured that each barcode has a unique time identifier when it is generated;

[0034] Implementation method: Generate a timestamp using the current system time. For example, you can use Python's datetime module to generate a timestamp.

[0035] The serial number is another important element to ensure the uniqueness of a barcode. By using an incrementing serial number, it can be ensured that barcodes generated under the same timestamp are also unique.

[0036] Implementation method: Use a global variable or database field to store the current serial number, and increment the serial number each time a barcode is generated.

[0037] Random numbers can further enhance the uniqueness of barcodes, especially in high-concurrency environments, ensuring that barcodes are unique even if the timestamp and serial number are the same;

[0038] Implementation method: Use a random number generator to generate random numbers. For example, you can use Python's random module to generate random numbers.

[0039] The barcode is generated by combining timestamps, serial numbers, and random numbers. These elements are then concatenated according to certain rules to ensure the uniqueness and readability of the barcode.

[0040] Implementation method: Concatenate the timestamp, serial number, and random number together in a certain order.

[0041] In one embodiment of the present invention, duplicate detection includes hash table detection and database query;

[0042] A hash table is a data structure that uses a hash function to map keys to values, enabling fast insertion, lookup, and deletion operations. In barcode generation and detection, hash tables are used to store generated barcodes and to quickly check if a barcode already exists using a hash function.

[0043] Hash table lookups are implemented using built-in data structures in programming languages. For example, in Python, hash tables can be implemented using sets or dictionaries;

[0044] The example used is implementing a hash table using a set.

[0045] A set is a collection data structure in Python that can be used to store unique elements and supports fast lookup operations.

[0046] Initialize the hash table: Create an empty set to store the generated barcodes.

[0047] 1 barcodes = set()

[0048] Insert Barcode: After generating the barcode, insert it into the set.

[0049] 1 def insert_barcode(barcode):

[0050] 2. barcodes.add(barcode)

[0051] Barcode lookup: When generating a new barcode, first check if the barcode already exists in the set.

[0052] 1 def check_duplicate(barcode):

[0053] 2 return barcode in barcodes

[0054] During barcode generation and detection, the real-time detection process of the hash table module is as follows:

[0055] Generate barcode

[0056] First, the barcode generation module generates barcodes according to preset rules. For example, barcodes can be generated using elements such as timestamps, serial numbers, and random numbers.

[0057] 1 def generate_barcode():

[0058] 2 timestamp=generate_timestamp()

[0059] 3 sequence=generate_sequence_number()

[0060] 4 random_number=generate_random_number()

[0061] 5 return f"{timestamp}{sequence}{random_number}"

[0062] Real-time barcode detection

[0063] After the barcode is generated, it is immediately checked in real time through the hash table module to ensure the uniqueness of the barcode.

[0064] Barcode detection: After generating the barcode, call the check_duplicate function to check if the barcode already exists in the hash table.

[0065] 1 def generate_and_check_barcode():

[0066] 2 barcode=generate_barcode()

[0067] 3 if check_duplicate(barcode):

[0068] 4 print("Barcode duplicated, stop generating!")

[0069] 5 return None else:

[0070] 6. insert_barcode(barcode)

[0071] 7 print("Barcode generated successfully:",barcode)

[0072] 8 return barcode

[0073] Insert barcode: If the barcode does not exist in the hash table, insert the barcode into the hash table to ensure that subsequent generated barcodes will not be duplicated.

[0074] 1 def insert_barcode(barcode):

[0075] 2. barcodes.add(barcode)

[0076] The hash table module plays a crucial role in barcode generation and detection. It enables fast insertion, lookup, and deletion operations, ensuring the uniqueness of barcodes. During real-time barcode detection, the hash table module quickly checks if a barcode already exists using a hash function and immediately inserts it into the hash table after barcode generation, ensuring that subsequently generated barcodes will not be duplicated.

[0077] As a preferred embodiment of the present invention, database querying includes the following steps: database selection;

[0078] Commonly used databases include relational databases (such as MySQL, PostgreSQL, SQLite) and non-relational databases (such as MongoDB, Redis);

[0079] Writing query statements

[0080] Use SQL (Structured Query Language) to write query statements;

[0081] Common query operations: Querying a single or multiple records usually uses the SELECT statement, combined with the WHERE clause to specify the query conditions; inserting records usually uses the INSERT statement to insert the newly generated barcode into the database.

[0082] The processing of query results includes parsing the query results, determining whether the barcode exists, and handling abnormal situations.

[0083] In a preferred embodiment of the present invention, the core task of the rule verification module is to verify whether the newly generated barcode conforms to preset generation rules. Generation rules may include barcode length, format, character set, checksum, etc. Rule verification ensures the uniqueness and validity of the barcode, preventing the generation of invalid or duplicate barcodes.

[0084] The operation of the rule validation module can be divided into the following steps:

[0085] Define generation rules

[0086] First, the barcode generation rules need to be defined. These rules can include the following aspects:

[0087] Length rule: The length of the barcode must meet the preset length requirements.

[0088] Formatting rules: The barcode format must meet the preset format requirements, such as whether it contains specific characters or conforms to specific encoding rules.

[0089] Character set rules: The character set of a barcode must meet the preset character set requirements, such as only containing numbers, letters, or specific symbols.

[0090] Checksum rule: Barcodes must include a checksum to verify the integrity and correctness of the barcode.

[0091] Generate barcode

[0092] When generating barcodes, they are generated according to preset generation rules. The generated barcodes can contain elements such as timestamps, serial numbers, and random numbers to ensure the uniqueness of the barcodes.

[0093] Rule Validation

[0094] After the barcode is generated, it is verified by the rule verification module to ensure that the barcode conforms to the preset generation rules.

[0095] Length verification: Verifies whether the length of the barcode meets the preset length requirements.

[0096] Format verification: Verifies whether the barcode format meets the preset format requirements.

[0097] Character set verification: Verifies whether the character set of the barcode meets the preset character set requirements.

[0098] Checksum verification: Verifies whether the barcode contains a checksum and verifies the correctness of the checksum.

[0099] Comprehensive verification

[0100] The results of length verification, format verification, character set verification, and checksum verification are combined to determine whether the barcode conforms to the preset generation rules.

[0101] Processing verification results

[0102] Based on the results of rule verification, the barcode generation and printing operations are processed.

[0103] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A device for preventing duplicate barcode printing, characterized in that, The device includes an anti-duplicate barcode printing device box (10), a control module box (11), a barcode printer (12), and a conveyor belt (13). The anti-duplicate barcode printing device box (10) is installed on the conveyor belt (13). A barcode printer (12) is installed on one side inside the anti-duplicate barcode printing device box (10). A control module box (11) is installed inside the anti-duplicate barcode printing device box (10) on one side of the barcode printer (12). The control module box (11) contains a barcode generation module, a database module, a hash table module, a duplicate detection module, a printing control module, and a user interface module installed outside the anti-duplicate barcode printing device box (10).

2. The barcode printing anti-duplicate device according to claim 1, characterized in that, The barcode generation module generates barcodes according to preset rules, and can combine timestamps, serial numbers, and random numbers during the generation process.

3. The barcode printing anti-duplicate device according to claim 1, characterized in that, The database module is used to store generated barcode information and supports fast query and insert operations.

4. The barcode printing anti-duplicate device according to claim 1, characterized in that, The hash table module has a hash table in memory, which is used for real-time storage and detection of generated barcodes.

5. A barcode printing anti-duplicate device according to claim 1, characterized in that, The duplicate detection module integrates hash table detection, database query, and rule validation.