Bar code generation and detection-based ticket reading method, system and device

By adopting a vote-based voting method based on barcode generation and detection in the electronic ticketing system, the problems of forgery and data changes during the voting process are solved, and the accuracy and security of voting are achieved.

CN119918556APending Publication Date: 2025-05-02HANGZHOU HULIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411851218.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The existing electronic ticketing system is susceptible to the threat of forgery of vote rights, changes in voting data and fraud during the voting process, resulting in inaccurate voting results or do not reflect the voter's true wishes and may reduce the confidentiality of the vote.

Method used

The vote-calling method based on barcode generation and detection is adopted. By obtaining and identifying the barcode patterns in the vote sample, voting information is obtained, and the completeness and consistency of the information is ensured through verification of the verification position, and the database is finally queried to judge the validity of the vote rights.

Benefits of technology

It improves the efficiency of comparing vote rights information, reduces the error rate, binds the vote code with the voting information one by one, ensuring the accuracy and security of voting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918556A_ABST
    Figure CN119918556A_ABST
Patent Text Reader

Abstract

The invention discloses a ticket reading method, system and device based on bar code generation and detection, and the method comprises the steps: obtaining a bar code pattern of a to-be-recognized bar code in a ticket sample, recognizing the bar code pattern, obtaining recognition feature information, verifying the recognition feature information, and judging whether the bar code pattern meets a preset condition or not; if so, analyzing the bar code pattern to obtain bar code information; converting the bar code information into a bar code serial number character string, segmenting the bar code serial number character string to obtain a check bit character and a non-check bit character string, and adding a check bit for the bar code serial number based on a preset generated check bit function to obtain a check bar code serial number; and comparing the bar code serial number character string with the verification bar code serial number and judging whether the ticket right exists or not, verifying the validity of the ticket right information, and counting the valid ticket right. The efficiency of ticket right information comparison is improved, the error rate is reduced, the ticket codes and the voting information can be bound one by one, and the voting accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of barcode technology, and in particular to a vote counting method, system and device based on barcode generation and detection. Background Art

[0002] With the development of science and technology, various systems for the convenience of the people have emerged, such as various evaluation systems or voting systems or electronic ticketing systems, which have brought convenience to people. Take the electronic ticketing system as an example, it converts traditional manual voting and manual counting into online voting, telephone voting and other convenient voting methods, and performs rights confirmation and counting operations to improve efficiency, reduce error rates, and increase information transparency. Some obvious advantages brought by the electronic ticketing system include convenient voting, high efficiency, accuracy of counting, and the ability to solve the problem of improving voting security and the reliability of voting results.

[0003] However, there are still some problems: forging votes, such as replacing the original ballot with a similar one; changing voting data and falsifying voting records. Of course, there are other problems, which will make the results of the electronic ticketing system inaccurate or fail to reflect the true intentions of voters, and may even reduce the confidentiality of the vote, seriously interfering with the results of the electronic voting. How to ensure the security of voting and provide accurate vote counts when using the electronic ticketing system is an urgent problem to be solved. Summary of the invention

[0004] The present invention aims at the shortcomings of the prior art and provides a method, system and device for counting votes based on barcode generation and detection.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions: A method for counting votes based on barcode generation and detection comprises the following steps: Obtain the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; If it is in compliance, the barcode pattern is parsed to obtain the barcode information, wherein the barcode information includes the voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; The barcode information is converted into a barcode serial number string and segmented to obtain a check digit character and a non-check digit string, and a check digit is added to the barcode serial number based on a preset check digit generation function to obtain a check barcode serial number; The barcode serial number string is compared with the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information to determine whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If valid, it is a valid ticket right and is counted. The ticket right information and the barcode information correspond one to one.

[0006] As an implementable embodiment, the barcode pattern is generated by the following method, including: Determine whether the target barcode pattern exists in the barcode database, and if not, save the target barcode pattern to the database; Convert the non-check digit string into a byte array, and process the byte array according to a preset rule to obtain a check digit value; Determine whether the check digit value is the same as the check digit character. If they are the same, splice the non-check digit character string and the check digit character into a barcode serial number character string in a preset splicing method, and bind the barcode serial number character string to the voting right information, wherein the preset splicing method is that the voting number, voter information, voting time, voting category, digital signature and identification mark are arranged in any order and the identification mark is located at the last position; Convert the barcode serial number string into barcode information, generate a corresponding barcode pattern based on the barcode information, and add the barcode pattern to the ticket sample document.

[0007] As an implementable method, the generating of the barcode pattern according to the barcode information comprises the following steps: Obtain target barcode information of the barcode pattern to be generated; Combine the target barcode information with the identification feature information to obtain the voting number, voter information, voting time, voting category and the width of the black bar pattern corresponding to the digital signature, and calculate the width of each white bar pattern based on the encoding rules; The identification mark is calculated by the identification feature information to obtain the width of the identification stripe pattern corresponding to the identification mark; The black stripe pattern, the white stripe pattern and the identification stripe pattern are arranged according to a preset arrangement rule to obtain a barcode pattern, wherein the identification stripe pattern is also a black stripe pattern.

[0008] As an implementable method, identifying the barcode pattern, obtaining identification feature information, and verifying the identification feature information include the following steps: Preprocessing the barcode pattern to obtain a preprocessed pattern, wherein the preprocessing includes at least one or more of image noise reduction, background separation, and image correction; Converting the preprocessed pattern into a binary image, performing edge detection based on the binary image, determining the width and height of the black stripe pattern and the white stripe pattern, and obtaining a black stripe pattern area and a white stripe area; Determine whether the black bar pattern area and the white bar pattern area are bar code patterns in the bar code database according to the condition restriction calculation formula; If so, the total pixel sum of each black stripe pattern area is judged to obtain a judgment result, and based on the judgment result, it is judged whether each black stripe pattern area is abnormal. If it is abnormal, the barcode pattern does not meet the preset conditions.

[0009] As an implementable method, the conditional restriction calculation formula is determined by the following steps: Setting a plurality of restriction conditions for each black stripe pattern area and each white stripe area, and constructing a condition restriction calculation formula based on the plurality of restriction conditions; Based on the conditional restriction calculation formula, each black strip pattern area and white strip area is judged. If it exceeds the preset matching threshold, the corresponding area is abnormal; The conditional restriction calculation formula is as follows:

[0010] in, express under conditions 1 if the condition is true, Indicates The preset matching threshold of the restriction conditions of the area, Indicates the number of constraints.

[0011] As an implementable method, before preprocessing the barcode pattern, the method further includes the following method: The horizontal and vertical projection features of the barcode pattern are used to determine whether it is tilted. If it is tilted, correction is performed.

[0012] As an implementable method, the voting rights information, voting number and voter information correspond one to one.

[0013] A counting system based on barcode generation and detection includes an acquisition and judgment module, a pattern analysis module, a segmentation and addition module, and a comparison and verification module; The acquisition and judgment module is used to acquire the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; The pattern analysis module is configured to: if it meets the requirements, analyze the barcode pattern to obtain barcode information, wherein the barcode information includes voting number, voter information, voting time, voting category, digital signature, coding rules and identification mark; The segmentation and adding module is configured to: convert the barcode information into a barcode serial number string and segment it to obtain a check digit character and a non-check digit string, add a check digit to the barcode serial number based on a preset check digit generation function, and obtain a check barcode serial number; The comparison and verification module is used to compare the barcode serial number string and the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information and it is determined whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If it is valid, it is a valid ticket right and statistics are performed, wherein the ticket right information and the barcode information correspond one to one.

[0014] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the following method: Obtain the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; If it is in compliance, the barcode pattern is parsed to obtain the barcode information, wherein the barcode information includes the voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; The barcode information is converted into a barcode serial number string and segmented to obtain a check digit character and a non-check digit string, and a check digit is added to the barcode serial number based on a preset check digit generation function to obtain a check barcode serial number; The barcode serial number string is compared with the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information to determine whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If valid, it is a valid ticket right and is counted. The ticket right information and the barcode information correspond one to one.

[0015] A voting device based on barcode generation and detection comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements the following method when executing the computer program: Obtain the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; If it is in compliance, the barcode pattern is parsed to obtain the barcode information, wherein the barcode information includes the voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; The barcode information is converted into a barcode serial number string and segmented to obtain a check digit character and a non-check digit string, and a check digit is added to the barcode serial number based on a preset check digit generation function to obtain a check barcode serial number; The barcode serial number string is compared with the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information to determine whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If valid, it is a valid ticket right and is counted. The ticket right information and the barcode information correspond one to one.

[0016] The present invention has significant technical effects due to the adoption of the above technical solution: The present invention can quickly solve the problem of whether the vote is true and accurate during the counting process and can verify whether the voting right is obtained. The present invention generates and detects barcodes for counting, which not only improves the efficiency of comparing voting rights information and reduces the error rate, but also binds the ticket code to the voting information one by one, thereby ensuring the accuracy of the voting. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0018] Figure 1 It is a schematic flow diagram of the method of the present invention; Figure 2 It is a schematic diagram of the overall structure of the system of the present invention; Figure 3 It is a schematic diagram of the actual operation process of the present invention. DETAILED DESCRIPTION

[0019] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0020] Embodiment 1: A method for counting votes based on barcode generation and detection, such as Figure 1 As shown, the following steps are included: S100, obtaining a barcode pattern of a barcode to be identified in a ticket sample, identifying the barcode pattern, obtaining identification feature information, and verifying the identification feature information to determine whether the barcode pattern meets a preset condition, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; S200, if it is in compliance, the barcode pattern is parsed to obtain barcode information, wherein the barcode information includes voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; S300, converting the barcode information into a barcode serial number string and segmenting it to obtain a check digit character and a non-check digit string, adding a check digit to the barcode serial number based on a preset check digit generation function, and obtaining a check barcode serial number; S400. Compare the barcode serial number string and the verification barcode serial number. If they are the same, query the corresponding ticket right information in the database based on the identification identifier of the barcode information and determine whether the ticket right exists. If it exists, verify the validity of the ticket right information. If valid, it is a valid ticket right and statistics are taken. The ticket right information and the barcode information correspond one to one.

[0021] The present invention is applied to a ticketing system, which is suitable for voting at a general meeting of owners. Figure 3 As shown, the entire execution process is as follows: 1. The staff logs into the ticketing system and generates a paper ticket sample document, which contains a barcode pattern that corresponds to the ticket information; 2. The staff prints the ticket sample into paper tickets and distributes them to the owners to exercise their voting rights; 3. The owner fills in his / her voting options on the paper ballot and puts the paper ballot into the ballot box; 4. After the voting period ends, the staff will unseal the ballot box and take out the paper ballots for display under the witness of multiple parties; 5. The staff uses a barcode scanner to scan the barcode on the paper ticket. The ticketing system identifies the barcode information and checks whether the barcode information is correctly identified. If the barcode information is detected to be incorrect, the page prompts the staff "Invalid barcode". The staff can re-scan the barcode for identification. If the barcode is correct, proceed to the next step; 6. The ticketing system queries the ticket information bound to the barcode, determines whether it is valid ticket information, and returns the result to the front-end page.

[0022] 7. After being detected as a "valid vote" by the ticketing system, the staff will enter the voting results of the paper ballot into the ticketing system on the current vote counting page.

[0023] In actual use, the ticketing system can quickly solve whether the vote is true and accurate during the counting process and can verify whether the voting rights are obtained. The present invention generates and detects barcodes for counting, which not only improves the efficiency of comparing voting rights information and reduces the error rate, but also binds the ticket code to the voting information one by one, ensuring the accuracy of the vote.

[0024] In one embodiment, the barcode pattern is generated by: Determine whether the target barcode pattern exists in the barcode database, and if not, save the target barcode pattern to the database; Convert the non-check digit string into a byte array, and process the byte array according to a preset rule to obtain a check digit value; Determine whether the check digit value is the same as the check digit character. If they are the same, splice the non-check digit character string and the check digit character into a barcode serial number character string in a preset splicing method, and bind the barcode serial number character string to the voting right information, wherein the preset splicing method is that the voting number, voter information, voting time, voting category, digital signature and identification mark are arranged in any order and the identification mark is located at the last position; Convert the barcode serial number string into barcode information, generate a corresponding barcode pattern based on the barcode information, and add the barcode pattern to the ticket sample document.

[0025] In this embodiment, when actually calculating the check digit value, the byte array elements can be added to obtain the total value, and then the total value is divided by 95 to obtain the remainder, and then added to 32 to obtain the check digit value. In another embodiment, the splicing method can also be: splicing in the form of "serial number non-check digit string#check digit character" to finally obtain the barcode serial number.

[0026] Since the barcode is a black and white pattern, the step of generating the barcode pattern according to the barcode information includes the following steps: Obtain target barcode information of the barcode pattern to be generated; Combine the target barcode information with the identification feature information to obtain the voting number, voter information, voting time, voting category and the width of the black bar pattern corresponding to the digital signature, and calculate the width of each white bar pattern based on the encoding rules; The identification mark is calculated by the identification feature information to obtain the width of the identification stripe pattern corresponding to the identification mark; The black stripe pattern, the white stripe pattern and the identification stripe pattern are arranged according to a preset arrangement rule to obtain a barcode pattern, wherein the identification stripe pattern is also a black stripe pattern.

[0027] In this embodiment, the heights of the white stripe pattern and the black stripe pattern are consistent, so there is no limitation on the heights of the white stripe pattern and the black stripe pattern. The preset arrangement rule can be consistent with the order of the voting number, voter information, voting time, voting category and digital signature, and can also be changed according to user requirements.

[0028] Due to concerns about barcode forgery, the barcode pattern can be verified and identified to obtain identification feature information, and the identification feature information can be verified, including the following steps: Preprocessing the barcode pattern to obtain a preprocessed pattern, wherein the preprocessing includes at least one or more of image noise reduction, background separation, and image correction; Converting the preprocessed pattern into a binary image, performing edge detection based on the binary image, determining the width and height of the black stripe pattern and the white stripe pattern, and obtaining a black stripe pattern area and a white stripe area; Determine whether the black bar pattern area and the white bar pattern area are bar code patterns in the bar code database according to the condition restriction calculation formula; If so, the total pixel sum of each black stripe pattern area is judged to obtain a judgment result, and based on the judgment result, it is judged whether each black stripe pattern area is abnormal. If it is abnormal, the barcode pattern does not meet the preset conditions.

[0029] During the entire process, each area of ​​the barcode pattern is first checked to determine whether it matches the barcode pattern in the database, and then a secondary judgment is made through pixels. This ensures that counterfeiting of the barcode pattern is excluded.

[0030] This embodiment is a specific construction process of the conditional restriction calculation formula. First, multiple restriction conditions are set for each black strip pattern area and each white strip area, and the conditional restriction calculation formula is constructed based on the multiple restriction conditions. Based on the conditional restriction calculation formula, each black strip pattern area and white strip area is judged. If it exceeds the preset matching threshold, the corresponding area is abnormal; The conditional restriction calculation formula is as follows:

[0031] in, express under conditions 1 if the condition is true, Indicates The preset matching threshold of the restriction conditions of the area, Indicates the number of constraints.

[0032] Before making a judgment, since the scanned image is not a very regular image, the following methods are also included before preprocessing the barcode pattern: The horizontal and vertical projection features of the barcode pattern are used to determine whether it is tilted. If it is tilted, correction is performed. After correction, the structure can be judged more accurately.

[0033] Embodiment 2: A voting system based on barcode generation and detection, such as Figure 2 As shown, it includes an acquisition and judgment module 100, a pattern analysis module 200, a segmentation and addition module 300 and a comparison and verification module 400; The acquisition and judgment module 100 is used to acquire the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; The pattern analysis module 200 is configured to: if it meets the requirements, analyze the barcode pattern to obtain barcode information, wherein the barcode information includes voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; The segmentation and adding module 300 is configured to: convert the barcode information into a barcode serial number string and segment it to obtain a check digit character and a non-check digit string, add a check digit to the barcode serial number based on a preset check digit generation function, and obtain a check barcode serial number; The comparison and verification module 400 is used to compare the barcode serial number string and the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information and it is determined whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If valid, it is a valid ticket right and statistics are performed, wherein the ticket right information and the barcode information correspond one to one.

[0034] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0035] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0036] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0037] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0038] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0039] It should be noted that: The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0040] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for counting votes based on barcode generation and detection, characterized in that: The following steps are involved: Obtain the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; If it is in compliance, the barcode pattern is parsed to obtain the barcode information, wherein the barcode information includes the voting number, voter information, voting time, voting category, digital signature, encoding rules and identification mark; The barcode information is converted into a barcode serial number string and segmented to obtain a check digit character and a non-check digit string, and a check digit is added to the barcode serial number based on a preset check digit generation function to obtain a check barcode serial number; The barcode serial number string is compared with the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information to determine whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If valid, it is a valid ticket right and is counted. The ticket right information and the barcode information correspond one to one.

2. The method for counting votes based on barcode generation and detection according to claim 1, characterized in that: The barcode pattern is generated by the following method, including: Determine whether the target barcode pattern exists in the barcode database, and if not, save the target barcode pattern to the database; Convert the non-check digit string into a byte array, and process the byte array according to a preset rule to obtain a check digit value; Determine whether the check digit value is the same as the check digit character. If they are the same, splice the non-check digit character string and the check digit character into a barcode serial number character string in a preset splicing method, and bind the barcode serial number character string to the voting right information, wherein the preset splicing method is that the voting number, voter information, voting time, voting category, digital signature and identification mark are arranged in any order and the identification mark is located at the last position; Convert the barcode serial number string into barcode information, generate a corresponding barcode pattern based on the barcode information, and add the barcode pattern to the ticket sample document.

3. The method for counting votes based on barcode generation and detection according to claim 1, characterized in that: The step of generating a barcode pattern according to the barcode information comprises the following steps: Obtain target barcode information of the barcode pattern to be generated; Combine the target barcode information with the identification feature information to obtain the voting number, voter information, voting time, voting category and the width of the black bar pattern corresponding to the digital signature, and calculate the width of each white bar pattern based on the encoding rules; The identification mark is calculated by the identification feature information to obtain the width of the identification stripe pattern corresponding to the identification mark; The black stripe pattern, the white stripe pattern and the identification stripe pattern are arranged according to a preset arrangement rule to obtain a barcode pattern, wherein the identification stripe pattern is also a black stripe pattern.

4. The method for counting votes based on barcode generation and detection according to claim 1, characterized in that: Recognizing the barcode pattern, obtaining identification feature information, and verifying the identification feature information includes the following steps: Preprocessing the barcode pattern to obtain a preprocessed pattern, wherein the preprocessing includes at least one or more of image noise reduction, background separation, and image correction; Converting the preprocessed pattern into a binary image, performing edge detection based on the binary image, determining the width and height of the black stripe pattern and the white stripe pattern, and obtaining a black stripe pattern area and a white stripe area; Determine whether the black bar pattern area and the white bar pattern area are bar code patterns in the bar code database according to the condition restriction calculation formula; If so, the total pixel sum of each black stripe pattern area is judged to obtain a judgment result, and based on the judgment result, it is judged whether each black stripe pattern area is abnormal. If it is abnormal, the barcode pattern does not meet the preset conditions.

5. The method for counting votes based on barcode generation and detection according to claim 4, characterized in that: The conditional restriction calculation formula is determined by the following steps: Setting a plurality of restriction conditions for each black stripe pattern area and each white stripe area, and constructing a condition restriction calculation formula based on the plurality of restriction conditions; Based on the conditional restriction calculation formula, each black strip pattern area and white strip area is judged. If it exceeds the preset matching threshold, the corresponding area is abnormal; The conditional restriction calculation formula is as follows: in, express under conditions 1 if the condition is true, Indicates The preset matching threshold of the restriction conditions of the area, Indicates the number of restrictions.

6. The method for counting votes based on barcode generation and detection according to claim 4, characterized in that: Before the barcode pattern is preprocessed, the following method is also included: The horizontal and vertical projection features of the barcode pattern are used to determine whether it is tilted. If it is tilted, correction is performed.

7. The method for counting votes based on barcode generation and detection according to claim 1, characterized in that: The voting rights information, voting number and voter information correspond one to one.

8. A ticket counting system based on barcode generation and detection, characterized in that: It includes an acquisition and judgment module, a pattern analysis module, a segmentation and addition module, and a comparison and verification module; The acquisition and judgment module is used to acquire the barcode pattern of the barcode to be identified in the ticket sample, identify the barcode pattern, obtain identification feature information, and verify the identification feature information to determine whether the barcode pattern meets the preset conditions, wherein the barcode pattern includes a black bar pattern and a white bar pattern, and the identification feature information is the width corresponding to the black bar pattern and the white bar pattern; The pattern analysis module is configured to: if it meets the requirements, analyze the barcode pattern to obtain barcode information, wherein the barcode information includes voting number, voter information, voting time, voting category, digital signature, coding rules and identification mark; The segmentation and adding module is configured to: convert the barcode information into a barcode serial number string and segment it to obtain a check digit character and a non-check digit string, add a check digit to the barcode serial number based on a preset check digit generation function, and obtain a check barcode serial number; The comparison and verification module is used to compare the barcode serial number string and the verification barcode serial number. If they are the same, the corresponding ticket right information in the database is queried based on the identification identifier of the barcode information and it is determined whether the ticket right exists. If it exists, the validity of the ticket right information is verified. If it is valid, it is a valid ticket right and statistics are performed, wherein the ticket right information and the barcode information correspond one to one.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A voting device based on barcode generation and detection, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.