Deformed anti-counterfeiting QR code generation and recognition method and system based on AI image recognition

Through the deformed anti-counterfeiting QR code generation and identification method based on AI image recognition, the data simplification and fault tolerance range detection are used, and the hidden dot matrix algorithm solves the problem that ordinary QR codes are easily copied, and the QR code is realized Anti-counterfeiting function.

CN118297091BActive Publication Date: 2024-11-05SHENZHEN DINGXUN TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410388465.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2024-11-05
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

Ordinary QR codes on the market are easily regenerated after identifying the original data, resulting in damage to the interests of the original data provider and lack of anti-counterfeiting functions.

Method used

Using the deformed anti-counterfeiting QR code generation and identification method based on AI image recognition, the QR code is simplified and fault-tolerant range detection through the QR code generation tool, randomly select simplified dot matrix to determine the printing ink shrinkage rules, update the QR code, and Records are stored by the visual camera, and the authenticity of the QR code is determined during scanning.

Benefits of technology

By hiding the dot matrix algorithm in the QR code, printing points are reduced, and the original QR code data is eliminated and imitated after arbitrarily generated and imitated, improving the uniqueness and anti-counterfeiting ability of the QR code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118297091B_ABST
    Figure CN118297091B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of two-dimensional code encryption technology, and specifically discloses a method and system for generating and identifying a deformed anti-counterfeiting two-dimensional code based on AI image recognition, wherein the method comprises generating a two-dimensional code based on a two-dimensional code generation tool, simplifying the data of the two-dimensional code, and detecting in real time to determine the fault tolerance range; randomly selecting at least one simplified dot matrix within the fault tolerance range, determining the printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code; retaining and recording the updated two-dimensional code through a visual camera; and when scanning the two-dimensional code, comparing the two-dimensional code with the retained record to determine the authenticity of the two-dimensional code. When querying, the present invention can retrieve the image stored in the database through the two-dimensional code data to identify it. If the dot matrix algorithm and printing difference hidden in the two-dimensional code are identified, it is passed. If there are no above characteristics, it is a counterfeit two-dimensional code.
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 code encryption, and in particular to a method and system for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition. Background Art

[0002] QR code, also known as two-dimensional barcode, is a coding method that can store more information and represent more data types than traditional bar codes.

[0003] Ordinary QR codes on the market are easily regenerated and copied after the original data is identified, thereby damaging the interests of the original data provider. How to provide a QR code with anti-counterfeiting function is the technical problem that the technical solution of the present invention aims to solve. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition to solve the problems raised in the above-mentioned background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A method for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition, the method comprising:

[0007] Generate a QR code based on a QR code generation tool, simplify the QR code data, and perform real-time detection to determine the fault tolerance range;

[0008] Randomly selecting at least one simplified dot matrix within the error tolerance range, determining a printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code;

[0009] The updated QR code is recorded through a visual camera;

[0010] When scanning the QR code, compare the QR code with the retained records to determine the authenticity of the QR code.

[0011] As a further solution of the present invention: the steps of generating a QR code based on a QR code generation tool, simplifying the QR code data, and performing real-time detection to determine the fault tolerance range include:

[0012] Obtaining original data, and generating a QR code corresponding to the original data based on a QR code generation tool;

[0013] The QR code is divided into different sizes to obtain sub-blocks, and data of all sub-blocks is simplified;

[0014] The data-simplified QR code is detected by a recognizer;

[0015] When the test passes, update the data reduction process;

[0016] When the detection fails, the data simplification parameter is read as the fault tolerance boundary of the current segmentation size, and the fault tolerance range is determined by the fault tolerance boundary.

[0017] As a further solution of the present invention: the step of dividing the two-dimensional code into different sizes to obtain sub-blocks and simplifying the data of all sub-blocks includes:

[0018] Receive the initial split quantity input by the staff and construct a quantity group with a step size of 1;

[0019] Select a quantity in the quantity group, divide the QR code into sub-blocks;

[0020] Simplifying the data in the sub-blocks; the data simplification process includes frame extraction, blurring and lightening;

[0021] The frame extraction process is as follows:

[0022] Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements;

[0023] The fuzzy process is:

[0024] Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is:

[0025] Where H(i) is the grayscale value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, and both i and N are positive integers.

[0026] The dodge process is:

[0027] Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, M0 is the number of pixels with a grayscale value of 0, and M 255 is the number of pixels with a grayscale value of 255.

[0028] As a further solution of the present invention: when the detection is passed, the step of updating the data simplification process includes:

[0029] When the test passes, update the data reduction process;

[0030] When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns;

[0031] When the data simplification process is a fuzzy process, the updating process is to increase the extension length;

[0032] When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

[0033] As a further solution of the present invention: the step of randomly selecting at least one simplified dot matrix within the error tolerance range, determining the printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code includes:

[0034] Query the error tolerance range of different segmentation sizes, and combine a preset number of simplified dot matrices within the error tolerance range;

[0035] The printing ink shrinkage rule is determined based on the simplified dot matrix, and the two-dimensional code is updated.

[0036] As a further solution of the present invention: when scanning the QR code, the step of comparing the QR code with the retained record to determine the authenticity of the QR code includes:

[0037] When scanning a QR code, the illumination parameters are obtained, and the scanned QR code is corrected based on the illumination parameters to obtain a QR code in a standard state;

[0038] Based on the QR code traversal retention records under standard conditions, similarity is calculated in real time;

[0039] The maximum similarity is selected, and when the maximum similarity reaches the preset similarity threshold, the QR code is determined to be authentic.

[0040] The technical solution of the present invention also provides a deformed anti-counterfeiting two-dimensional code generation and recognition system based on AI image recognition, the system comprising:

[0041] A fault tolerance range determination module is used to generate a QR code based on a QR code generation tool, simplify the data of the QR code, and perform real-time detection to determine the fault tolerance range;

[0042] A two-dimensional code update module, used to randomly select at least one simplified dot matrix within a tolerance range, determine a printing ink shrinkage rule based on the simplified dot matrix, and update the two-dimensional code;

[0043] A data retention module is used to retain and record the updated QR code through a visual camera;

[0044] The authenticity determination module is used to compare the QR code with the retained records when scanning the QR code to determine the authenticity of the QR code.

[0045] As a further solution of the present invention: the fault tolerance range determination module includes:

[0046] A two-dimensional code generation unit, used to obtain the original data and generate a two-dimensional code corresponding to the original data based on a two-dimensional code generation tool;

[0047] A data simplification unit is used to divide the two-dimensional code into different sizes to obtain sub-blocks, and perform data simplification on all sub-blocks;

[0048] A detection unit, used for detecting the data-simplified two-dimensional code through an identifier;

[0049] An updating unit, used for updating the data reduction process when the detection passes;

[0050] The range generating unit is used to read the data reduction parameter as the fault tolerance boundary of the current segmentation size when the detection fails, and the fault tolerance range is determined by the fault tolerance boundary.

[0051] As a further solution of the present invention: the data reduction unit includes:

[0052] The quantity group building subunit is used to receive the initial split quantity input by the staff and build the quantity group with a step size of 1;

[0053] The segmentation sub-unit is used to select a quantity in the quantity group and segment the QR code to obtain sub-blocks;

[0054] An execution subunit, used for simplifying the data in the sub-block; the data simplification process includes frame extraction, blurring and lightening;

[0055] The frame extraction process is as follows:

[0056] Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements;

[0057] The fuzzy process is:

[0058] Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is:

[0059] Where H(i) is the grayscale value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, and both i and N are positive integers.

[0060] The dodge process is:

[0061] Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, M0 is the number of pixels with a grayscale value of 0, and M 255 is the number of pixels with a grayscale value of 255.

[0062] As a further solution of the present invention: the content of the update unit includes:

[0063] When the test passes, update the data reduction process;

[0064] When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns;

[0065] When the data simplification process is a fuzzy process, the updating process is to increase the extension length;

[0066] When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

[0067] Compared with the prior art, the beneficial effects of the present invention are as follows: when printing, the present invention reduces the printing dots in the QR code through the dot matrix method that can be identified by the fault tolerance of the QR code; at the same time, by adding a dot matrix algorithm when printing the QR code, the dot matrix algorithm and the QR code data are in a one-to-one correspondence, and the dot matrix is ​​hidden in the QR code through the shrinkage of the printing ink. After printing, the overall label is photographed and recorded by a visual camera; through the above two forms, the difference between the printed QR code and the QR code generated by the ordinary program is distinguished, and the printing counterfeiting after the QR code is randomly generated by the original QR code data is prevented. When querying, the image stored in the database can be retrieved through the QR code data to identify it. If the dot matrix algorithm hidden in the QR code and the printing difference are identified, it is passed. If there are no above characteristics, it is a counterfeit QR code. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.

[0069] Figure 1 A flowchart of a method for generating and identifying deformed anti-counterfeiting QR codes based on AI image recognition.

[0070] Figure 2 This is a flowchart of the first sub-process of a method for generating and identifying deformed anti-counterfeiting QR codes based on AI image recognition.

[0071] Figure 3 This is a flowchart of the second sub-process of the method for generating and identifying deformed anti-counterfeiting QR codes based on AI image recognition.

[0072] Figure 4 This is the third sub-process flowchart of the method for generating and identifying deformed anti-counterfeiting QR codes based on AI image recognition.

[0073] Figure 5 This is a structural block diagram of the deformation anti-counterfeiting QR code generation and recognition system based on AI image recognition. DETAILED DESCRIPTION

[0074] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0075] Figure 1 The flowchart of the method for generating and identifying a deformed anti-counterfeiting two-dimensional code based on AI image recognition is as follows. In an embodiment of the present invention, a method for generating and identifying a deformed anti-counterfeiting two-dimensional code based on AI image recognition is provided. The method comprises:

[0076] Step S100: Generate a QR code based on a QR code generation tool, simplify the data of the QR code, and perform real-time detection to determine the fault tolerance range;

[0077] The QR code generation tool can be a conventional tool, which essentially establishes the correspondence between the original data and the QR code, and the key is to ensure the uniqueness of the QR code. In practical applications, slightly distorted QR codes can also be recognized. Therefore, after obtaining the QR code, the application simplifies the data of the QR code and then recognizes it in real time to determine the distortion range within which the QR code can be recognized. The distortion range is the fault tolerance range in the above content.

[0078] Step S200: randomly selecting at least one simplified dot matrix within the error tolerance range, determining a printing ink shrinkage rule based on the simplified dot matrix, and updating the QR code;

[0079] At least one simplified dot matrix is ​​selected within the error tolerance range. The simplified dot matrix is ​​used to characterize the degree of distortion of the two-dimensional code. The printing process is controlled by the simplified dot matrix, and a two-dimensional code pointing to the same original data can be obtained.

[0080] Step S300: recording the updated QR code through a visual camera;

[0081] The number of simplified dot matrices is not unique. After the QR code is updated based on the simplified dot matrix, the updated QR code is photographed by a visual camera and then retained.

[0082] Step S400: When scanning the QR code, the QR code is compared with the retained record to determine the authenticity of the QR code;

[0083] When a user scans a QR code, if he wants to determine the authenticity of the QR code, he will compare it with the stored image. If the match is successful, it is judged to be authentic. If the match fails, it is judged to be fake.

[0084] In an example of the technical solution of the present invention, according to the fault tolerance law of two-dimensional code recognition and the adjustment of the printing method, when printing, the printing dots in the two-dimensional code are reduced by a dot matrix method that can be identified by the fault tolerance rate of the two-dimensional code; at the same time, by adding a dot matrix algorithm when printing the two-dimensional code, the dot matrix algorithm and the two-dimensional code data are in a one-to-one correspondence, and the dot matrix is ​​hidden in the two-dimensional code by shrinking the printing ink. After printing, the overall label is photographed and recorded by a visual camera; through the above two forms, the difference in the stroke of the printed two-dimensional code and the two-dimensional code generated by the ordinary program is distinguished, so as to prevent the two-dimensional code from being arbitrarily generated by the original data of the two-dimensional code and then printed and counterfeited; finally, when querying, the two-dimensional code data can be used to retrieve the image stored in the database for identification. If the dot matrix algorithm and printing difference hidden in the two-dimensional code are identified, it is passed. If there are no above characteristics, it is a counterfeit two-dimensional code.

[0085] It should be noted that the technical solutions of the present invention are all completed by computer equipment, and the connection between steps can be completed by AI. For example, after the fault tolerance range is determined, a simplified dot matrix is ​​selected, and AI uses the simplified dot matrix to control the corresponding printing equipment to update the QR code, and then AI controls the image acquisition device to retain the QR code; wherein the image acquisition device is also used to detect the QR code and determine the readability of the QR code.

[0086] Figure 2 The first sub-flow chart of the method for generating and identifying a deformed anti-counterfeiting QR code based on AI image recognition is as follows. The steps of generating a QR code based on a QR code generation tool, simplifying the QR code data, and performing real-time detection to determine the fault tolerance range include:

[0087] Step S101: obtaining original data, and generating a QR code corresponding to the original data based on a QR code generation tool;

[0088] Step S102: dividing the two-dimensional code into different sizes to obtain sub-blocks, and simplifying the data of all sub-blocks;

[0089] Step S103: detecting the data-simplified two-dimensional code through a recognizer;

[0090] Step S104: when the detection is passed, update the data simplification process;

[0091] Step S105: When the detection fails, the data reduction parameter is read as the fault tolerance boundary of the current segmentation size, and the fault tolerance range is determined by the fault tolerance boundary.

[0092] The above content specifically limits the process of determining the fault tolerance range. First, the original data is obtained, and a QR code corresponding to the original data is generated based on a QR code generation tool; then, a segmentation grid is determined, the QR code is partitioned, and then data simplification is performed on each sub-block. Each segmentation grid corresponds to a data simplification process; finally, the QR code after data simplification is detected. The detection process is very simple. The QR code can be identified by an identifier. Successful identification is considered as passed detection, and failed identification is considered as failed detection. When the detection is passed, the simplification degree of the data simplification process is increased until the detection fails. At this time, the simplification degree is used as the fault tolerance boundary, and the fault tolerance range can be determined by the fault tolerance boundary.

[0093] As a preferred embodiment of the technical solution of the present invention, the step of dividing the two-dimensional code into different sizes to obtain sub-blocks and simplifying the data of all sub-blocks includes:

[0094] Receive the initial split quantity input by the staff and construct a quantity group with a step size of 1;

[0095] Select a quantity in the quantity group, divide the QR code into sub-blocks;

[0096] Data reduction is performed on the data in the sub-block.

[0097] Receive the initial segmentation quantity input by the staff and continuously increase it to obtain a quantity group; select the quantity in turn as the segmentation number, segment the length and width of the QR code to obtain multiple sub-blocks; simplify the data in each sub-block.

[0098] In an example of the technical solution of the present invention, the process of data simplification includes frame extraction, blurring and lightening, wherein:

[0099] The frame extraction process is as follows:

[0100] Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements;

[0101] The fuzzy process is:

[0102] Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is:

[0103] Where H(i) is the grayscale value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, and both i and N are positive integers.

[0104] The dodge process is:

[0105] Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, N0 is the number of pixels with a grayscale value of 0, and M 255 is the number of pixels with a grayscale value of 255.

[0106] The principle of the frame extraction process is to remove elements of a row and a column. The more rows and columns are removed, the higher the degree of data simplification and the greater the degree of distortion.

[0107] The principle of the blurring process is to add some gray values ​​outside the boundary to make it more blurry. The closer to the boundary, the less gray value is added (blacker), and the farther from the boundary, the greater the gray value is added (whiter). The longer the extension length, the higher the degree of data simplification and the greater the degree of distortion. It should be noted that the function of the above logarithmic function is only to correct the result, and it can be replaced by other increasing functions to make the result smoother.

[0108] The principle of the lightening process is to continuously increase the grayscale value in the black area (making the black area white). If the black area accounts for a larger proportion in a sub-block, the increased grayscale value can be larger. On this basis, a correction coefficient is introduced to adjust the grayscale value increase process. The larger the correction coefficient, the higher the degree of data simplification and the greater the degree of distortion.

[0109] As a preferred embodiment of the technical solution of the present invention, when the detection is passed, the step of updating the data simplification process includes:

[0110] When the test passes, update the data reduction process;

[0111] When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns;

[0112] When the data simplification process is a fuzzy process, the updating process is to increase the extension length;

[0113] When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

[0114] The above content specifically limits the update process of the data simplification process, the purpose of which is to continuously increase the distortion degree of the QR code until it cannot be recognized.

[0115] It is worth mentioning that the frame extraction operation, blur operation and lightening operation can be superimposed on each other, based on the principles in the above content, and can be determined independently by the staff according to the situation.

[0116] Figure 3The second sub-flow chart of the method for generating and identifying a deformed anti-counterfeiting two-dimensional code based on AI image recognition is as follows: the step of randomly selecting at least one simplified dot matrix within the fault tolerance range, determining the printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code includes:

[0117] Step S201: querying the error tolerance range of different segmentation sizes, and combining a preset number of simplified dot matrices within the error tolerance range;

[0118] Step S202: Determine the printing ink shrinkage rule based on the simplified dot matrix and update the two-dimensional code.

[0119] A feasible data simplification scheme is selected within the fault tolerance range to simplify the two-dimensional code. The simplified two-dimensional code can still be recognized. The data simplification scheme represents the processing process of each pixel in the two-dimensional code. Therefore, it can be represented by a matrix, called a simplified dot matrix. The simplified dot matrix controls the printing process to obtain an updated two-dimensional code.

[0120] Figure 4 The third sub-flow diagram of the method for generating and identifying a deformed anti-counterfeiting QR code based on AI image recognition is shown in the figure. When scanning the QR code, the QR code is compared with the retained record to determine the authenticity of the QR code. The steps include:

[0121] Step S401: when scanning a QR code, obtaining illumination parameters, and correcting the scanned QR code based on the illumination parameters to obtain a QR code in a standard state;

[0122] Step S402: traversing the retained records based on the QR code in the standard state and calculating the similarity in real time;

[0123] Step S403: Select the maximum similarity, and when the maximum similarity reaches a preset similarity threshold, determine that the QR code is authentic.

[0124] In an example of the technical solution of the present invention, when authenticity needs to be determined, the QR code is scanned and compared with the QR code in the retained record to determine whether they match.

[0125] In the above scheme, the present application introduces an image correction process. Since the QR code acquisition process occurs under the standard state, the illumination parameters are acquired synchronously when scanning the QR code. The scanned QR code is converted to the standard state by the illumination parameters, which can improve the accuracy of the matching process.

[0126] Figure 5 The structure diagram of the deformed anti-counterfeiting two-dimensional code generation and recognition system based on AI image recognition is shown in the following figure. In an embodiment of the present invention, a deformed anti-counterfeiting two-dimensional code generation and recognition system based on AI image recognition is provided. The system 10 includes:

[0127] The fault tolerance range determination module 11 is used to generate a two-dimensional code based on a two-dimensional code generation tool, simplify the data of the two-dimensional code, and perform real-time detection to determine the fault tolerance range;

[0128] A two-dimensional code updating module 12, configured to randomly select at least one simplified dot matrix within a tolerance range, determine a printing ink shrinkage rule based on the simplified dot matrix, and update the two-dimensional code;

[0129] The data retention module 13 is used to retain and record the updated QR code through a visual camera;

[0130] The authenticity determination module 14 is used to compare the QR code with the retained records when scanning the QR code to determine the authenticity of the QR code.

[0131] Furthermore, the fault tolerance range determination module 11 includes:

[0132] A two-dimensional code generation unit, used to obtain the original data and generate a two-dimensional code corresponding to the original data based on a two-dimensional code generation tool;

[0133] A data simplification unit is used to divide the two-dimensional code into different sizes to obtain sub-blocks, and perform data simplification on all sub-blocks;

[0134] A detection unit, used for detecting the data-simplified two-dimensional code through an identifier;

[0135] An updating unit, used for updating the data reduction process when the detection passes;

[0136] The range generating unit is used to read the data reduction parameter as the fault tolerance boundary of the current segmentation size when the detection fails, and the fault tolerance range is determined by the fault tolerance boundary.

[0137] Specifically, the data reduction unit includes:

[0138] The quantity group building subunit is used to receive the initial split quantity input by the staff and build the quantity group with a step size of 1;

[0139] The segmentation sub-unit is used to select a quantity in the quantity group and segment the QR code to obtain sub-blocks;

[0140] An execution subunit, used for simplifying the data in the sub-block; the data simplification process includes frame extraction, blurring and lightening;

[0141] The frame extraction process is as follows:

[0142] Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements;

[0143] The fuzzy process is:

[0144] Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is:

[0145] Where H(i) is the grayscale value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, and both i and N are positive integers.

[0146] The dodge process is:

[0147] Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, M0 is the number of pixels with a grayscale value of 0, and M 255 is the number of pixels with a grayscale value of 255.

[0148] The content of the update unit includes:

[0149] When the test passes, update the data reduction process;

[0150] When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns;

[0151] When the data simplification process is a fuzzy process, the updating process is to increase the extension length;

[0152] When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

[0153] The functions that can be achieved by the deformed anti-counterfeiting QR code generation and identification method based on AI image recognition are all completed by a computer device, and the computer device includes one or more processors and one or more memories, and at least one program code is stored in the one or more memories. The program code is loaded and executed by the one or more processors to implement the deformed anti-counterfeiting QR code generation and identification method based on AI image recognition.

[0154] The processor takes out instructions from the memory one by one, analyzes the instructions, and then completes the corresponding operations according to the instruction requirements, generating a series of control commands, so that the various parts of the computer can automatically, continuously and coordinately move to become an organic whole, realize the input of programs, the input of data, and the calculation and output of results. The arithmetic operations or logical operations generated in this process are all completed by the operator; the memory includes a read-only memory (ROM), which is used to store computer programs, and a protection system is provided outside the memory.

[0155] Exemplarily, the computer program may be divided into one or more modules, one or more modules are stored in a memory and executed by a processor to implement the present invention. One or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in a terminal device.

[0156] Those skilled in the art will understand that the description of the above service equipment is merely an example and does not constitute a limitation on the terminal equipment. It may include more or fewer components than described above, or a combination of certain components, or different components, for example, it may include input and output devices, network access devices, buses, etc.

[0157] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire staff terminal.

[0158] The above-mentioned memory can be used to store computer programs and / or modules, and the above-mentioned processor realizes various functions of the above-mentioned terminal device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as an information collection template display function, a product information release function, etc.), etc.; the data storage area can store data created according to the use of the berth status display system (such as product information collection templates corresponding to different product types, product information that different product providers need to release, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0159] If the module / unit integrated in the terminal device 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 medium. Based on this understanding, the present invention implements all or part of the modules / units in the above-mentioned embodiment system, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable medium, and the computer program can realize the functions of the above-mentioned various system embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or system that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0160] It should be noted that, in this article, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0161] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for generating and identifying deformed anti-counterfeiting QR codes based on AI image recognition. It is characterized in that The method comprises: Generate a QR code based on a QR code generation tool, simplify the QR code data, and perform real-time detection to determine the fault tolerance range; Randomly selecting at least one simplified dot matrix within the error tolerance range, determining a printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code; The updated QR code is recorded by a visual camera; When scanning a QR code, compare the QR code with the retained records to determine the authenticity of the QR code; The steps of generating a two-dimensional code based on a two-dimensional code generation tool, simplifying the data of the two-dimensional code, and performing real-time detection to determine the fault tolerance range include: Obtaining original data, and generating a QR code corresponding to the original data based on a QR code generation tool; The QR code is divided into different sizes to obtain sub-blocks, and data of all sub-blocks is simplified; The data-simplified QR code is detected by a recognizer; When the test passes, update the data reduction process; When the detection fails, the data simplification parameter is read as the fault tolerance boundary of the current segmentation size, and the fault tolerance range is determined by the fault tolerance boundary; The steps of dividing the two-dimensional code into different sizes to obtain sub-blocks and simplifying the data of all sub-blocks include: Receive the initial split quantity input by the staff and construct a quantity group with a step size of 1; Select a quantity in the quantity group, divide the QR code into sub-blocks; Simplifying the data in the sub-blocks; the data simplification process includes frame extraction, blurring and lightening; The frame extraction process is as follows: Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements; The fuzzy process is: Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is: Where H(i) is the gray value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, i and N are both positive integers; The dodge process is: Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, and M 0 is the number of pixels with gray value 0, M 255 is the number of pixels with a grayscale value of 255; When the detection is passed, the step of updating the data reduction process includes: When the test passes, update the data reduction process; When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns; When the data simplification process is a fuzzy process, the updating process is to increase the extension length; When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

2. The method for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition according to claim 1, It is characterized in that The step of randomly selecting at least one simplified dot matrix within the error tolerance range, determining the printing ink shrinkage rule based on the simplified dot matrix, and updating the two-dimensional code includes: Query the error tolerance range of different segmentation sizes, and combine a preset number of simplified dot matrices within the error tolerance range; The printing ink shrinkage rule is determined based on the simplified dot matrix, and the two-dimensional code is updated.

3. The method for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition according to claim 1, It is characterized in that When scanning the QR code, the steps of comparing the QR code with the retained record and determining the authenticity of the QR code include: When scanning a QR code, the illumination parameters are obtained, and the scanned QR code is corrected based on the illumination parameters to obtain a QR code in a standard state; Based on the QR code traversal retention records under standard conditions, similarity is calculated in real time; The maximum similarity is selected, and when the maximum similarity reaches the preset similarity threshold, the QR code is determined to be authentic.

4. A deformed anti-counterfeiting QR code generation and recognition system based on AI image recognition, It is characterized in that The system is used to execute the method for generating and identifying a deformed anti-counterfeiting two-dimensional code based on AI image recognition as described in any one of claims 1 to 3, and the system comprises: A fault tolerance range determination module is used to generate a QR code based on a QR code generation tool, simplify the data of the QR code, and perform real-time detection to determine the fault tolerance range; A two-dimensional code update module, used to randomly select at least one simplified dot matrix within a tolerance range, determine a printing ink shrinkage rule based on the simplified dot matrix, and update the two-dimensional code; A data retention module is used to retain and record the updated QR code through a visual camera; The authenticity determination module is used to compare the QR code with the retained records when scanning the QR code to determine the authenticity of the QR code.

5. The system for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition according to claim 4, It is characterized in that The fault tolerance range determination module includes: A two-dimensional code generation unit, used to obtain the original data and generate a two-dimensional code corresponding to the original data based on a two-dimensional code generation tool; A data simplification unit is used to divide the two-dimensional code into different sizes to obtain sub-blocks, and perform data simplification on all sub-blocks; A detection unit, used for detecting the data-simplified two-dimensional code through an identifier; An updating unit, used for updating the data reduction process when the detection passes; The range generating unit is used to read the data reduction parameter as the fault tolerance boundary of the current segmentation size when the detection fails, and the fault tolerance range is determined by the fault tolerance boundary.

6. The system for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition according to claim 5, It is characterized in that The data reduction unit comprises: The quantity group building subunit is used to receive the initial split quantity input by the staff and build the quantity group with a step size of 1; The segmentation sub-unit is used to select a quantity in the quantity group and segment the QR code to obtain sub-blocks; An execution subunit is used to simplify the data in the sub-block; the data simplification process includes frame extraction, blurring and lightening; The frame extraction process is as follows: Randomly select a row and a column in each sub-block and remove the corresponding row elements and column elements; The fuzzy process is: Locate the boundary in each sub-block, and extend the black area based on the boundary; the black area is an area with a gray value of zero, and the extension rule is: Where H(i) is the gray value of the i-th point in the direction perpendicular to the boundary; i∈[1,N], N is the extension length, i and N are both positive integers; The dodge process is: Identify the black area in each sub-block and correct the grayscale value of the black area. The correction rule is: Where ΔH is the increase in the grayscale value of the black area, α is the correction coefficient, and M 0 is the number of pixels with gray value 0, M 255 is the number of pixels with a grayscale value of 255.

7. The system for generating and identifying deformed anti-counterfeiting two-dimensional codes based on AI image recognition according to claim 6, It is characterized in that The content of the update unit includes: When the test passes, update the data reduction process; When the data reduction process is frame extraction, the updating process is to increase the number of selected rows and columns; When the data simplification process is a fuzzy process, the updating process is to increase the extension length; When the data simplification process is a lightening process, the updating process is an increase in the correction factor.

Citation Information

Patent Citations

  • Information hiding method for matrix type two-dimensional code and false-proof method

    CN105224974A

  • Ink edge anti-counterfeiting method and ink edge anti-counterfeiting network identification system

    CN106096971A

  • Anti-counterfeiting method using anti-counterfeiting random marker

    CN112749773A

  • Intra-code isolated point sawtooth anti-counterfeiting method

    CN113326906A

  • Shrinkage ink type anti-counterfeit label and preparation method thereof

    CN115527435A