Random information box selection type data processing anti-counterfeiting method and system, medium and equipment
Through the random information box selection data processing method, random anti-counterfeiting plain codes and passwords are generated, solving the problem of predictability of the anti-counterfeiting label generation process in the prior art, and improving the security strength and effect of the anti-counterfeiting label.
Patent Information
- Application Number
- CN202510305186.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-24
AI Technical Summary
The anti-counterfeiting label generation process in existing commodity anti-counterfeiting technology has certain regularity or predictability, and is easily cracked by forgers through analysis and reverse engineering, resulting in poor anti-counterfeiting effect.
By using the random information box selection data processing method, randomly printed randomly printed data sets are obtained, and data processing is performed using the box selection and preset number selection rules of industrial cameras to generate a random first data set and a second data set, which are respectively related to information as anti-counterfeiting codes and anti-counterfeiting passwords.
The security strength of the anti-counterfeiting label is improved, the anti-counterfeiting effect is enhanced, and it avoids being predicted and cracked. By increasing randomness, complexity and unpredictability, the anti-counterfeiting strength is improved.
Smart Images

Figure CN120198137A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of anti-counterfeiting technology, and particularly to an anti-counterfeiting method, system, medium and device for random information box selection-based data processing. Background Art
[0002] With the development of the market economy and the increasing frequency of commodity circulation, commodity anti-counterfeiting technology has become an important means to protect brands and consumer rights. Traditional commodity anti-counterfeiting technologies include, but are not limited to, watermarks, holograms, special inks, and physical tags, etc. These technologies play important roles in their respective application scenarios.
[0003] In the field of commodity anti-counterfeiting, anti-counterfeiting labels usually include visible plain codes and invisible hidden codes. The plain codes can be in the form of numbers, characters, or graphics, etc., for consumers to identify and check; the hidden codes are displayed in the form of encrypted or encoded two-dimensional codes, and specific devices or conditions are required to identify them, so as to further verify the authenticity of the commodity. Although the existing anti-counterfeiting technologies provide a certain degree of security protection, the generation process of anti-counterfeiting labels in the existing technologies often has a certain regularity or predictability, enabling counterfeiters with professional knowledge to copy or crack the anti-counterfeiting labels through analysis and reverse engineering means, resulting in poor anti-counterfeiting effects. Summary of the Invention
[0004] This application provides an anti-counterfeiting method, system, medium and device for random information box selection-based data processing, which can improve the anti-counterfeiting effect.
[0005] In a first aspect, this application provides an anti-counterfeiting method for random information box selection-based data processing, and the method includes: Obtain a randomly sprayed unstructured data set; Use an industrial camera to box select the unstructured data set to obtain a box-selected data set; Select the box-selected data set according to a preset data extraction rule to obtain a first data set; Perform operations on the first data set according to a preset operation rule to obtain a second data set; Convert the first data set into an anti-counterfeiting plain code, use the second data set as an anti-counterfeiting hidden code, and associate the information of the anti-counterfeiting plain code and the anti-counterfeiting hidden code.
[0006] By adopting the above technical solution, an irregular data set randomly printed is obtained, and then a random first data set and a second data set are generated through the frame selection and rule-based processing of an industrial camera, and are associated as an anti-counterfeiting plain code and an anti-counterfeiting secret code respectively. Among them, the random printing of the irregular data set destroys the data regularity, improves the randomness and unpredictability; the frame selection of the industrial camera introduces the uncertainty of the random frame selection position; the rule-based processing of the frame-selected data set increases the data processing complexity; the second data set after the preset operation further improves the data randomness; finally, the dual verification of the anti-counterfeiting plain code and the anti-counterfeiting secret code improves the anti-counterfeiting strength. The entire anti-counterfeiting code generation process increases the randomness, complexity and unpredictability, improves the security strength of the anti-counterfeiting label, avoids being predicted and cracked, and enhances the anti-counterfeiting effect.
[0007] Optionally, the obtaining of the irregular data set randomly printed includes: obtaining a printed image randomly printed by an inkjet printer on a target medium; preprocessing the printed image to obtain a preprocessed printed image; determining a region of interest of the preprocessed printed image, and identifying the numbers in the region of interest to obtain an irregular data set.
[0008] By adopting the above technical solution, through the combination of steps such as the digital image randomly printed by the inkjet printer, preprocessing the printed image to improve the quality, positioning the region of interest, and identifying the numbers in the region, high-quality numbers with randomness can be obtained, making the printing process uncontrollable, enhancing the data randomness, the preprocessing improves the subsequent recognition accuracy, and the positioning of the region of interest improves the recognition efficiency. Finally, an irregular data set with high-quality random numbers is obtained. This provides a reliable data source guarantee for the subsequent frame selection extraction and anti-counterfeiting coding.
[0009] Optionally, the frame selection of the irregular data set by the industrial camera to obtain a frame-selected data set includes: obtaining the current frame selection template of the industrial camera, where the frame selection template is composed of multiple cells; performing frame selection on the irregular data set according to the frame selection template to obtain the frame selection results corresponding to each cell, and using the frame selection results corresponding to each cell as the frame-selected data set.
[0010] By adopting the above technical solution, through the frame selection template of the industrial camera, the standardized processing of the irregular data set is realized, the randomly distributed numbers are framed into fixed cells, and a standardized data set containing the frame selection results is obtained, improving the structural degree of data processing and providing data support for the subsequent anti-counterfeiting coding.
[0011] Optionally, the selection of the boxed dataset according to the preset data extraction rule to obtain the first dataset includes: identifying the boxed numbers of each cell in the boxed dataset to obtain the identification results of each cell; determining whether there are empty numbers in the identification results of each cell; if there are empty numbers in the identification results of each cell, setting the numbers of the cells with empty numbers to 0; if there are no empty numbers in the identification results of each cell, selecting the identification results of each cell according to the preset data extraction rule to obtain the first dataset.
[0012] By adopting the above technical solution, the digital recognition technology is used to process the box selection result, so that the numbers can be accurately obtained and the situation of empty numbers can be judged, ensuring the integrity of the first dataset; then, on the premise of not destroying the integrity, the random extraction rule mechanism is introduced, effectively improving the unpredictability and anti-statistical attack ability of the result data, and enhancing the security strength of the first dataset. By combining the two means of digital recognition and random rule extraction, both the data integrity and the randomness are ensured, and a complete and reliable first dataset containing randomly extracted numbers can be effectively obtained.
[0013] Optionally, if there are no empty numbers in the identification results of each cell, the selection of the identification results of each cell according to the preset data extraction rule to obtain the first dataset includes: if there are no empty numbers in the identification results of each cell, obtaining the target digital information in the identification results of each cell, where the target digital information includes the proportion of each number in the cell; based on the proportion of each number in the cell, selecting the identification results of each cell to obtain the first dataset.
[0014] By adopting the above technical solution, the digital recognition technology is used to determine whether there are empty numbers in the box selection result, ensuring the integrity of the digital recognition in the cell. Then, the proportion information of each number in the cell is collected, and the numbers with better recognition effects are judged according to the proportion. The recognized numbers are extracted according to the preset rules to form the first dataset, making full use of the digital proportion information. Without affecting the recognition integrity, the numbers with better recognition effects can be selected, ensuring the reliability of the first dataset and avoiding errors caused by directly using the recognition results.
[0015] Optionally, selecting the recognition results of each of the cells based on the proportion of each digit in the cell to obtain a first data set, including: taking the digits with a proportion greater than a preset proportion in the cell as complete digits; obtaining the number of complete digits in each of the cells; when the number of complete digits is greater than or equal to two, selecting the target digit corresponding to each cell from the complete digits based on a preset digit selection rule; when the number of complete digits is one, taking the complete digit as the target digit corresponding to each cell; and taking the target digits corresponding to each of the cells as the first data set.
[0016] By adopting the above technical solution, a digital proportion threshold is set, and the digits with a proportion greater than the threshold are extracted as complete digits. Then, the number of complete digits in the cell is counted. If there is more than one complete digit in the cell, selection is made from the complete digits according to the preset rule. If there is only one complete digit, the digit is directly taken. In this way, the digital proportion information and rule extraction can be effectively combined to obtain a reliable first data set on the premise of ensuring the digital recognition quality, fully considering the reliability of the recognition result, extracting high-quality digits by proportion, and then introducing rules according to different situations to avoid directly using the digits that may be misrecognized, thus improving the quality of the first data set.
[0017] Optionally, the operation on the first data set according to a preset operation rule to obtain a second data set further includes: operating the first data set according to a preset operation rule to obtain an operated data set; and performing mapping conversion on the operated data set according to a preset character mapping table to obtain the second data set.
[0018] By adopting the above technical solution, the first data set is processed according to the preset mathematical operation and logical operation rules to generate an intermediate data set after operation. Then, a preset character mapping table is loaded, and character replacement is performed on the intermediate data set after operation according to the mapping relationship, and finally the converted second data set is output. The two conversion means of operation rule and character mapping are fully utilized. First, the operation rule is used to disrupt the first data set and destroy its regularity, and then character mapping is performed to further change the data form, enhancing the uncertainty and anti-statistical analysis ability of the result data. By combining operation processing and character mapping conversion, the complexity of data transformation can be effectively increased, the security strength of the result data set can be enhanced, and the anti-counterfeiting effect can be improved.
[0019] In the second aspect of the present application, an anti-counterfeiting system for random information box selection type data processing is provided, and the system includes: A data set acquisition module, configured to acquire a randomly sprayed irregular data set; A data box selection module, configured to use an industrial camera to box select the irregular data set to obtain a box selected data set; A data selection module, configured to select the dataset after the box selection according to a preset data selection rule, so as to obtain a first dataset; A data operation module, configured to operate on the first dataset according to a preset operation rule, so as to obtain a second dataset; A data association module, configured to convert the first dataset into an anti-counterfeiting plain code, use the second dataset as an anti-counterfeiting cipher code, and perform information association on the anti-counterfeiting plain code and the anti-counterfeiting cipher code.
[0020] In a third aspect of the present application, a computer storage medium is provided. The computer storage medium stores multiple instructions, and the instructions are adapted to be loaded and executed by a processor to perform the above method steps.
[0021] In a fourth aspect of the present application, an electronic device is provided, including: a processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded and executed by the processor to perform the above method steps.
[0022] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. In the present application, by obtaining a randomly spray-printed irregular dataset, and then through the box selection of an industrial camera and rule-based processing to generate random first and second datasets, which are used as anti-counterfeiting plain codes and anti-counterfeiting cipher codes for association respectively. Among them, the randomly spray-printed irregular dataset destroys the data regularity, improving randomness and unpredictability; the box selection of the industrial camera introduces the uncertainty of the random box selection position; the rule-based processing of the box-selected dataset increases the data processing complexity; the second dataset after preset operation further improves the data randomness; finally, the generation of anti-counterfeiting plain codes and anti-counterfeiting cipher codes for dual verification improves the anti-counterfeiting strength. The entire anti-counterfeiting code generation process increases randomness, complexity and unpredictability, improves the security strength of the anti-counterfeiting label, avoids being predicted and cracked, and enhances the anti-counterfeiting effect; 2. In the present application, through the box selection template of the industrial camera, the standardized processing of the irregular dataset is realized, the randomly distributed numbers are box-selected into fixed cells, and a standardized dataset containing the box selection result is obtained, improving the structural degree of data processing and providing data support for subsequent anti-counterfeiting coding; 3. The present application processes the first data set according to preset mathematical operation and logical operation rules to generate an intermediate data set after the operation. Then, a preset character mapping table is loaded, and character replacement is performed on the intermediate data set after the operation according to the mapping relationship. Finally, the converted second data set is output. By making full use of two conversion means, namely operation rules and character mapping, the first data set is first disrupted by the operation rules to destroy its regularity, and then character mapping is performed to further change the data form, enhancing the uncertainty of the result data and the anti-statistical analysis ability. By combining operation processing and character mapping conversion, the complexity of data transformation can be effectively increased, the security strength of the result data set can be enhanced, and the anti-counterfeiting effect can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic flowchart of an anti-counterfeiting method for random information box selection-based data processing provided by an embodiment of the present application; Figure 2 is a schematic diagram of a digital box selection provided by an embodiment of the present application; Figure 3 is a schematic diagram of the module of an anti-counterfeiting system for random information box selection-based data processing provided by an embodiment of the present application; Figure 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
[0024] Description of the reference numerals: 400, electronic device; 401, processor; 402, communication bus; 403, user interface; 404, network interface; 405, memory. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.
[0026] In the description of the embodiments of the present application, words such as "for example" or "for illustration" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "for example" or "for illustration" is intended to present relevant concepts in a specific manner.
[0027] In the description of the embodiments of the present application, the term "plurality" means two or more. For example, a plurality of systems means two or more systems, and a plurality of screen terminals means two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the technical features indicated. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.
[0029] Please refer to Figure 1 , and a flowchart of an anti-counterfeiting method for random information box selection-based data processing is specifically proposed. This method can be implemented relying on a computer program, can be implemented relying on a single-chip microcomputer, or can run on an anti-counterfeiting system for random information box selection-based data processing. This computer program can be integrated in an intelligent control device or can run as an independent tool-type application. Specifically, this method includes steps 10 to 40, and the above steps are as follows: Step 10: Obtain a randomly printed irregular data set.
[0030] The embodiments of the present application can be applied to various scenarios that require anti-counterfeiting. The main application scenarios include but are not limited to the field of commodity anti-counterfeiting, etc., and are not limited here. For example, it can be applied to commodities and products that require anti-counterfeiting identification, such as high-value consumer goods, luxury goods, drugs, etc. Anti-counterfeiting marks can be set on their packaging or the product itself to distinguish genuine and fake commodities. Compared with traditional anti-counterfeiting coding technologies, the present application generates a double anti-counterfeiting code with strong randomness through box selection of irregularities and rule operations, improving the unpredictability and security strength of the anti-counterfeiting mark.
[0031] An irregular data set refers to a set of random elements where the distribution of numbers or characters has no regularity or predictability. The elements in this irregular data set can be of different sizes. For example, the printed elements can be large or small, and the size is random; the printing positions of the elements are also random and have no pattern; a coding machine can be used for random printing, and the printing content of the coding machine is a randomly generated combination of numbers or characters.
[0032] Specifically, the purpose of obtaining a randomly printed irregular data set is to obtain a data set with strong randomness and unpredictability as the input for subsequent anti-counterfeiting code generation, so as to improve the non-forgeability of the finally generated anti-counterfeiting code. The specific implementation can be to obtain random and irregular printing on the target medium by the inkjet printer. The printed content can be a randomly generated combination of numbers or characters. By controlling parameters such as the spraying frequency and route of the inkjet printer, randomness is introduced, so that the finally printed elements show an irregular distribution, without predictable patterns and regularities, thereby obtaining a random and irregular data set. After the numbers in this irregular data set are subsequently framed and processed according to rules, anti-counterfeiting clear codes and anti-counterfeiting hidden codes can be generated. The step of this randomly printed irregular data set destroys the predictability of the data set, which is a key step to improve the randomness and unpredictability of the entire anti-counterfeiting code generation process, enhances the strength of the finally generated anti-counterfeiting code, and improves the effectiveness of the anti-counterfeiting technology.
[0033] Based on the above embodiments, as an alternative embodiment, the step of obtaining a randomly printed irregular data set may further include the following steps: Step 101: Obtain the printed image randomly printed by the inkjet printer on the target medium.
[0034] Specifically, select the inkjet printer as the printing device, which has a sufficient number of nozzles and can control the spraying frequency; select the target medium that needs to set the anti-counterfeiting mark, determine the printing parameters according to the target medium area, write the printing code, and set the random change range of the spraying frequency and path; control the inkjet printer to print on the target medium, and the printed content is a randomly generated number or character or pattern; through the random distribution of the nozzles of the inkjet printer, the spraying frequency, and the path, an irregular printing result is obtained on the medium. Finally, an irregularly distributed printed image is obtained on the target medium as the initial source data for subsequent processing. Its randomness ensures the unpredictability of anti-counterfeiting code generation and improves the anti-counterfeiting effect.
[0035] Step 102: Preprocess the printed image to obtain the preprocessed printed image.
[0036] Specifically, perform denoising processing on the printed image to filter out noises such as breakpoints and inkjet stains, and reduce recognition obstacles; then, perform color correction to eliminate color deviations caused by lighting differences and standardize the image color; then, perform size transformation and scale it to an appropriate recognition resolution; finally, perform filtering processing to smooth the image and clear the font edges. After the above preprocessing, the recognizability of the printed image can be greatly improved, recognition errors such as repetition and omission can be reduced, and accurate acquisition of the irregular data set can be ensured in the subsequent process. This preprocessing link can effectively improve the accuracy of digital recognition by eliminating various noises, correcting color differences, and adjusting the resolution, etc., provide high-quality source data for subsequent anti-counterfeiting code generation, and enhance the reliability of the entire anti-counterfeiting technology solution.
[0037] Step 103: Determine the region of interest (ROI) of the pre-processed inkjet image, identify the numbers in the ROI, and obtain an irregular data set.
[0038] Specifically, determining the ROI of the pre-processed inkjet image and identifying the numbers in the region is to extract the irregular digital data set we need from the entire pre-processed inkjet image. The specific approach can be to first detect the image and determine the region containing digital information as the ROI, that is, the region where the inkjet numbers are located, to avoid identifying non-digital elements in the image; then, segment and calibrate the significantly interesting region to accurately locate the digital range; next, for the determined digital region, use optical character recognition technology to identify the numbers in it, and the recognition algorithm should be selected to be adaptable to various font sizes, colors, tilts, etc. to correctly obtain the digital information; finally, extract and identify all the numbers from the ROI, and these randomly distributed numbers constitute the irregular data set we need.
[0039] Step 20: Use an industrial camera to frame the irregular data set to obtain the framed data set.
[0040] Specifically, using an industrial camera to frame the irregular data set is to obtain randomly sampled data from it to generate anti-counterfeiting codes. An industrial camera with sufficient resolution, anti-shake, and clear imaging can be selected and installed above a bracket with an adjustable optical axis, and the camera should maintain an appropriate distance from the medium of the irregular data set; according to the data volume requirement for subsequent anti-counterfeiting code generation, determine the framing template of the camera, and multiple information framing units are set in the template; control the industrial camera to frame the randomly inkjet irregular data set, and the camera automatically frames all the information framing units in the template through an image processing algorithm; obtain the framed digital image data in each cell, and these framed numbers constitute the framed data set. This step introduces the randomness of the sampled data through random framing, and combined with the initial randomness of the irregular data set, makes the framed data more unpredictable, provides a guarantee for subsequent anti-counterfeiting code generation, and enhances the anti-counterfeiting effect.
[0041] Based on the above embodiments, as an alternative embodiment, the step of using an industrial camera to frame the irregular data set to obtain the framed data set may further include the following steps: Step 201: Obtain the current framing template of the industrial camera, and the framing template consists of multiple cells.
[0042] Specifically, obtaining the selection template of the industrial camera is a preparatory work before selection, which is to define the data range for random extraction. The amount of data to be selected and extracted can be determined according to the generation requirements of the anti-counterfeiting code; then a selection template is designed, which contains multiple cells for information selection, and the number and size of the cells support subsequent data extraction requirements; the designed selection template is input into the control system of the industrial camera, and the template is detected and read through the image processing algorithm of the camera; in this way, the industrial camera obtains the information of the selection template, including the number, size, position distribution, etc. of the cells. The camera can perform matching selection according to the template to ensure that each selection is carried out within the predetermined cell. This step defines the range for random selection, and the design of the template can also improve the selection efficiency. The entire process ensures clear imaging within each cell, meets the extraction requirements, and improves the quality of the selected data set.
[0043] Step 202: Select the irregular data set according to the selection template to obtain the selection results corresponding to each cell, and use the selection results corresponding to each cell as the selected data set.
[0044] Specifically, selecting the irregular data set according to the selection template is a key step to obtain the selected data set. The specific operation is as follows: The industrial camera loads the defined selection template, which contains multiple cells for information selection; the irregular data set to be printed is placed within the shooting range of the camera; the camera is controlled to scan the data set image, and the optical axis is dynamically adjusted during the scanning process to ensure clear imaging of all cells; the system automatically identifies the position and range of the template cells and accurately matches and selects the images within each cell; after processing, the digital image data selected within each cell is obtained, and these selection results constitute the selected data set. In this way, selecting the irregular data according to the predetermined template not only achieves the effect of random data extraction but also improves the operation efficiency through template selection. Finally, a selected data set with high quality and containing multiple groups of digital image data is obtained, providing reliable source data for subsequent data extraction and anti-counterfeiting code generation.
[0045] Step 30: Select the selected data set according to the preset data extraction rule to obtain the first data set.
[0046] Specifically, for the dataset after being box-selected, digital recognition is first performed to obtain the digital information in each cell. Then, according to the pre-set number extraction rules, selection is made among the recognized numbers, such as extracting specific digits according to the cell serial number, extracting numbers in a certain interval sequence, etc. After rule extraction, the required digital subset extracted from the box-selected dataset is the first dataset. Setting the number extraction rules increases the random difficulty of data processing and combats predictability, and finally obtains the first dataset that meets expectations and contains the numbers required for the anti-counterfeiting code. This step re-extracts the box-selected data by applying the preset rules, improving the complexity and security of data processing and providing a reliable data source for generating personalized anti-counterfeiting codes.
[0047] Based on the above embodiments, as an optional embodiment, the step of obtaining the first dataset by selecting the box-selected dataset according to the pre-set number extraction rules may further include the following steps: Step 301: Recognize the box-selected numbers in each cell of the box-selected dataset to obtain the recognition results of each cell.
[0048] Specifically, recognizing the box-selected numbers in each cell of the box-selected dataset is the first step to obtain the first dataset. The specific method is as follows: Load the box-selected dataset, which contains digital images of multiple cells; for each cell, extract the digital image area therein; then process the digital image, including denoising, enhancing contrast, etc., to improve the recognition effect; then, for the processed digital image, use the trained optical character recognition model to recognize the numbers, and the recognition algorithm should be able to adapt to different fonts, inclinations, adjacent numbers, etc.; finally, obtain the digital recognition results in each cell. In this way, by recognizing the numbers in the box-selected results, the digital information of each cell is obtained, providing the original digital source for subsequent extraction of the first dataset according to the rules. The recognition accuracy of this step directly affects the quality of the subsequent dataset and is the basis of data extraction.
[0049] Step 302: Determine whether there are empty numbers in the recognition results of each cell.
[0050] Step 303: If there are empty numbers in the recognition results of each cell, set the numbers in the cells with empty numbers to 0.
[0051] Specifically, load the optical character recognition results, i.e., the numbers in each cell; set the parameters for judging emptiness, such as the number of numeric characters, etc.; traverse the recognized numbers in each cell, and detect whether there are empty numbers in each number according to the emptiness judgment parameters; if it is found that there are empty numbers, that is, it is determined that the numbers are not successfully recognized, then directly assign the number 0 to the recognized numbers in that cell; after the above emptiness judgment process, ensure that all cells have numeric values for subsequent extraction. Setting the cells with empty numbers to 0 realizes the special processing for the cells with recognition failures, avoids the anomalies in subsequent operations, this step improves the digital integrity of the boxed dataset, ensures the reliability of the subsequent extracted data, and enhances the security of the anti-counterfeiting code. Step 304: If there are no empty numbers in the recognition results of each cell, select the recognition results of each cell according to the preset number selection rules to obtain the first dataset.
[0052] Specifically, in the case of high-quality recognition results, further generate the operation of the required dataset. First, load the recognition results, that is, the numbers corresponding to each cell; then detect whether the numbers in all cells are complete. If the numbers are complete, enter the selection process according to the rules; according to the preset number selection rules, such as when there are multiple complete numbers, take the largest number or take the average value, and so on; extract the required digital subset from the entire recognition result dataset according to the preset number selection rules; finally, obtain the digital combination extracted according to specific rules, that is, the first dataset. On the premise of ensuring the integrity and reliability of the recognition results, by adding rule extraction, the difficulty of obtaining the required dataset is increased, the uncertainty of the results is improved, and the random anti-predictability of the anti-counterfeiting code is enhanced. Finally, a reliable first dataset is obtained, providing data support for the subsequent generation of anti-counterfeiting clear codes.
[0053] Based on the above embodiments, as an optional embodiment, if there are no empty numbers in the recognition results of each cell, the step of selecting the recognition results of each cell according to the preset number selection rules to obtain the first dataset may further include the following steps: Step 3041: If there are no empty numbers in the recognition results of each cell, obtain the target digital information in the recognition results of each cell, and the target digital information includes the proportion of each number in the cell.
[0054] Specifically, if there are no empty numbers in the recognition results of each cell, load all the cell numbers in the recognition results; segment and recognize the digital images in each cell to obtain specific digital character information; then count the proportion of each digital character in the cell, including information such as character size and position; extract the recognition results of each digital character and its proportion in the cell and other information to form the target digital information of the number. The target digital information can also include the number of digits, etc. In this way, by counting the proportion and extracting information for each number, quality indicators of the digital recognition results, such as size and position information, can be provided, which helps to screen the number with the best recognition effect and improve the recognition accuracy. Finally, by obtaining the target digital information, the number with the optimal recognition effect can be selected for subsequent dataset extraction, further improving the quality and reliability of the first dataset.
[0055] Step 3042: Based on the proportion of each number in the cell, select the recognition results of each cell to obtain the first dataset.
[0056] Specifically, obtain the digital recognition results in each cell and count the proportion information of each digital character; then, set a recognition quality threshold. For example, if the display proportion of the number in the cell is greater than 80%, it is determined as a valid recognition; according to the threshold requirements, sequentially traverse the digital recognition results of each cell, extract the digital results with a proportion exceeding the threshold, and define the numbers greater than the threshold as complete numbers, that is, the recognized valid numbers. Then, count the number of complete numbers in each cell and judge the number of complete numbers in the cell: when the number of complete numbers in the cell is greater than or equal to two, it means that there are multiple valid numbers in the cell. Then, based on a preset number selection rule, select the target number of the cell from the complete numbers. The preset number selection rule refers to the rule for extracting the first dataset from the dataset after frame selection. For example, the number selection rule can be: when there are numbers in the cell, preferentially select the number in the middle or the largest number according to the position of the number in the cell, etc. When the number of complete numbers in the cell is only 1, directly take this number as the target number. Finally, obtain the target numbers of each cell according to the above method, and gather the target numbers of all cells to form the first dataset.
[0057] Please refer to Figure 2 , Figure 2 as a schematic diagram of digital frame selection.
[0058] Exemplarily, in combination with Figure 2 (a), it can be seen that Figure 2 (a) is an exemplary unstructured dataset, in which the sizes and positions of the numbers are different and random. Figure 2(b) is a dataset after being box-selected by an exemplary industrial camera. Assume that the box-selection template consists of 4*4 cells, and the irregular dataset is box-selected. Figure 2 (b) can be a schematic diagram during box-selection. Assume that each cell is numbered. For example, the cell in the first row and the first column is numbered 1, then the target number corresponding to cell 1 is 1, the target number corresponding to cell 2 is 3, the target number corresponding to cell 3 is 7, the target number corresponding to cell 4 is 0... the target number corresponding to cell 16 is 5. Collect the target numbers of all cells to form the first dataset.
[0059] Step 40: Perform operations on the first dataset according to a preset operation rule to obtain a second dataset.
[0060] Specifically, after obtaining the first dataset, the first dataset contains numbers extracted from the box-selection result according to a preset number-taking rule; then, according to the anti-counterfeiting requirements, corresponding dataset operation rules are set. These rules can include mathematical operations such as the four arithmetic operations and taking the remainder, and can also include logical operations, etc. Use the first dataset as the input according to the preset operation rule, and output the result after operation processing. Finally, take the output operation result as the second dataset. There is a corresponding relationship between the second element set and the first element set, but after the operation conversion, it is no longer exactly the same as the first element set. Through the preset operation processing, the first element set can be further disrupted to generate a second element set that is related to and different from the first element set. This provides complex associated combinations for subsequent generation of light and dark codes, greatly enhancing the anti-counterfeiting difficulty.
[0061] Exemplarily, assume that the operation rule is addition and subtraction. For Figure 2 the first dataset finally box-selected, assume that the preset operation rule is: add the numbers corresponding to the first row and the second row to obtain the first data subset, subtract the numbers corresponding to the third row and the fourth row to obtain the second data subset, and then subtract the corresponding data of the second data subset and the first data subset to obtain the second dataset. The preset operation rule is not limited here and can be modified according to the actual situation. After the operation, the numbers in the first dataset are changed, the original dataset rule is destroyed, and the relationship between the data is more complex. In this way, the second dataset has stronger unpredictability and the ability to resist statistical analysis.
[0062] Based on the above embodiments, as an optional embodiment, the step of performing operations on the first dataset according to a preset operation rule to obtain a second dataset may further include the following steps: Step 401: Perform operations on the first dataset according to a preset operation rule to obtain an operation-processed dataset.
[0063] Step 402: Perform mapping conversion on the calculated data set according to a preset character mapping table to obtain a second data set.
[0064] Specifically, calculate the data set according to preset mathematical operation and logical operation rules, and use the calculated data set as an intermediate data set. Assume the intermediate data set is {1, 4, 8, 7}. Then, referring to the anti-counterfeiting code generation requirements, preset a character mapping table. For example, use the AES encryption algorithm to generate the mapping relationship, or directly customize a character mapping table. Assume that 1 is represented by A, 4 is represented by!, 8 is represented by H, and 7 is represented by G. Then perform mapping conversion on the calculated data set according to the preset character mapping table to obtain the second data set as {A,!, H, G}. Through combined operations and mapping conversion, the regularity of the first data set can be effectively broken, the complexity of data transformation can be increased, and the unpredictability of the result data can be enhanced.
[0065] Step 50: Convert the first data set into an anti-counterfeiting plain code, use the second data set as the anti-counterfeiting cipher code, and associate the information of the anti-counterfeiting plain code and the anti-counterfeiting cipher code.
[0066] Specifically, after obtaining the second data set, the first data set and the second data set need to be further processed. In this embodiment, directly use the first data set as the plain code part of the anti-counterfeiting label, which is represented in plain text form. This plain code can be displayed in the form of a two-dimensional code. And use the second data set with complex conversion as the cipher code part corresponding to this label, which is covered with silver scraping. At the same time, add the corresponding relationship information between the first data set and the second data set to the label to establish the information association between the plain code and the cipher code. In this way, when verifying anti-counterfeiting, it is necessary to calculate the first data set of the plain code and pair it with the matching second data set to pass the verification, which increases the difficulty of anti-counterfeiting.
[0067] Please refer to Figure 3 , which is a schematic diagram of an anti-counterfeiting system module for random information box selection type data processing provided by an embodiment of the present application. The anti-counterfeiting system for random information box selection type data processing may include: a data set acquisition module, a data box selection module, a data selection module, and a data operation module, where: The data set acquisition module is used to acquire a randomly printed irregular data set; The data box selection module is used to box the irregular data set by using an industrial camera to obtain a boxed data set; The data selection module is used to select the boxed data set according to a preset data selection rule to obtain a first data set; The data operation module is used to perform operations on the first data set according to preset operation rules to obtain a second data set; A data association module, configured to convert the first data set into an anti-counterfeiting plain code, use the second data set as an anti-counterfeiting secret code, and perform information association on the anti-counterfeiting plain code and the anti-counterfeiting secret code.
[0068] Optionally, the data set acquisition module is further configured to acquire a spray printing image randomly spray printed by a spray printer on a target medium; preprocess the spray printing image to obtain a preprocessed spray printing image; determine a region of interest of the preprocessed spray printing image, and identify the numbers in the region of interest to obtain an irregular data set.
[0069] Optionally, the data frame selection module is further configured to acquire a current frame selection template of an industrial camera, where the frame selection template is composed of multiple cells; frame the irregular data set according to the frame selection template to obtain frame selection results corresponding to each cell, and use the frame selection results corresponding to each cell as a framed data set.
[0070] Optionally, the data selection module is further configured to identify the frame selection numbers of each cell in the framed data set to obtain the identification results of each cell; determine whether there are empty numbers in the identification results of each cell; if there are empty numbers in the identification results of each cell, set the numbers of the cells with empty numbers to 0; if there are no empty numbers in the identification results of each cell, select the identification results of each cell according to a preset number selection rule to obtain a first data set.
[0071] Optionally, the data selection module is further configured to, if there are no empty numbers in the identification results of each cell, acquire target digital information in the identification results of each cell, where the target digital information includes the proportion of each number in the cell; select the identification results of each cell based on the proportion of each number in the cell to obtain a first data set.
[0072] Optionally, the data selection module is further configured to use the numbers with a proportion in the cell greater than a preset proportion as complete numbers; acquire the number of the complete numbers in each cell; when the number of the complete numbers is greater than or equal to two, select the target numbers corresponding to each cell from the complete numbers based on a preset number selection rule; when the number of the complete numbers is one, use the complete number as the target number corresponding to each cell; use the target numbers corresponding to each cell as a first data set.
[0073] Optionally, the data operation module is further configured to operate on the first data set according to a preset operation rule to obtain an operation result data set; perform mapping conversion on the operation result data set according to a preset character mapping table to obtain a second data set.
[0074] It should be noted that: when the system provided in the above embodiments realizes its functions, only the division of the above function modules is used for illustration. In actual applications, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept. For the specific implementation process, please refer to the method embodiments, which will not be elaborated here.
[0075] The embodiment of the present application also provides a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded and executed by a processor to execute an anti-counterfeiting method for random information box selection type data processing in the above embodiment. The specific execution process can refer to the specific description in the above embodiment and will not be elaborated here.
[0076] Please refer to Figure 4 , the present application also discloses an electronic device. Figure 4 FIG. is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application. The electronic device 400 may include: at least one processor 401, at least one network interface 404, a user interface 403, a memory 405, and at least one communication bus 402.
[0077] Among them, the communication bus 402 is used to realize the connection and communication between these components.
[0078] Among them, the user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may further include a standard wired interface and a wireless interface.
[0079] Among them, the network interface 404 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0080] Among them, the processor 401 may include one or more processing cores. The processor 401 connects various parts within the entire server through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 405, and by calling the data stored in the memory 405, it executes various functions of the server and processes data. Optionally, the processor 401 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 401 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 401 and may be implemented separately by a single chip.
[0081] Among them, the memory 405 may include random access memory (RAM) and may also include read-only memory. Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 405 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 405 may also be at least one storage device located far from the aforementioned processor 401. Refer to Figure 4 , in the memory 405 as a computer storage medium, there may be included an operating system, a network communication module, a user interface module, and an application program for an anti-counterfeiting method of random information box selection type data processing.
[0082] In Figure 4In the electronic device 400 shown, the user interface 403 is mainly used to provide an interface for the user to input and obtain the data input by the user; and the processor 401 can be used to call the application program stored in the memory 405 for a random information box selection type data processing anti-counterfeiting method. When executed by one or more processors 401, the electronic device 400 is caused to execute one or more of the methods as described in the foregoing embodiments. It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be adopted in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0083] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] In several implementation manners provided by this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some service interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0085] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit exists physically alone, or two or more units are integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0087] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard disks, magnetic disks, or optical discs.
[0088] The above are only exemplary embodiments of the present disclosure and should not be used to limit the scope of the present disclosure. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. Those skilled in the art will easily think of other implementation schemes of the present disclosure after considering the specification and the disclosure of the practical truth.
[0089] This application aims to cover any variations, uses, or adaptive changes of the present disclosure. These variations, uses, or adaptive changes follow the general principles of the present disclosure and include well-known common knowledge or conventional technical means in the technical field not recorded in the present disclosure. The specification and the embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. An anti-counterfeiting method for random information frame selection data processing, characterized in that: The method comprises: Obtain a random, irregular data set of prints; Get the current frame selection template of the industrial camera, where the frame selection template consists of multiple cells; Select the irregular data set according to the selection template to obtain a selection result corresponding to each cell, and use the selection result corresponding to each cell as the selected data set; Identify the selected number of each cell in the selected data set to obtain the identification result of each cell; Determine whether there is an empty number in the recognition result of each of the cells; If there is an empty number in the recognition result of each of the cells, the number of the cell with the empty number is set to 0; If there is no empty number in the recognition result of each cell, the recognition result of each cell is selected according to a preset number selection rule to obtain a first data set; Performing operations on the first data set according to a preset operation rule to obtain a second data set; The first data set is converted into an anti-counterfeiting plain code, and the second data set is used as an anti-counterfeiting secret code, and the anti-counterfeiting plain code and the anti-counterfeiting secret code are informationally associated.
2. The anti-counterfeiting method of random information frame selection data processing according to claim 1, characterized in that: The step of obtaining a randomly printed irregular data set includes: Obtain the printing image randomly printed by the inkjet printer on the target medium; Preprocessing the printing image to obtain a preprocessed printing image; The region of interest of the preprocessed printing image is determined, and the numbers in the region of interest are identified to obtain an irregular data set.
3. The anti-counterfeiting method of random information frame selection data processing according to claim 1, characterized in that: If there is no empty number in the recognition result of each cell, the recognition result of each cell is selected according to a preset number extraction rule to obtain a first data set, including: If there are no empty numbers in the recognition results of each of the cells, then obtaining target number information in the recognition results of each of the cells, the target number information including the proportion of each number in the cell; Based on the proportion of each number in the cell, the recognition results of each cell are selected to obtain a first data set.
4. The anti-counterfeiting method of random information frame selection data processing according to claim 3, characterized in that: The selecting of the recognition results of each cell based on the proportion of each number in the cell to obtain a first data set includes: Treat the number whose proportion in the cell is greater than the preset proportion as a complete number; Get the number of complete numbers in each of the cells; When the number of the complete numbers is greater than or equal to two, the target numbers corresponding to the cells are selected from the complete numbers based on a preset number selection rule; When the number of the complete number is one, the complete number is used as the target number corresponding to each cell; The target numbers corresponding to the cells are used as the first data set.
5. The anti-counterfeiting method of random information frame selection data processing according to claim 1, characterized in that: The performing operation on the first data set according to a preset operation rule to obtain a second data set further includes: Calculating the first data set according to a preset calculation rule to obtain a calculated data set; The calculated data set is mapped and converted according to a preset character mapping table to obtain a second data set.
6. An anti-counterfeiting system for random information frame selection data processing, characterized in that: The system comprises: A data set acquisition module, used to acquire a random printed irregular data set; A data frame selection module, used to frame the irregular data set using an industrial camera to obtain a framed data set; A data selection module is used to obtain the current frame selection template of the industrial camera, wherein the frame selection template is composed of multiple cells; frame the irregular data set according to the frame selection template to obtain the frame selection results corresponding to each cell, and use the frame selection results corresponding to each cell as the framed data set; identify the frame selection numbers of each cell in the framed data set to obtain the recognition results of each cell; determine whether there are empty numbers in the recognition results of each cell; if there are empty numbers in the recognition results of each cell, set the numbers of the cells with empty numbers to 0; if there are no empty numbers in the recognition results of each cell, select the recognition results of each cell according to the preset number extraction rules to obtain the first data set; A data operation module, used for operating the first data set according to a preset operation rule to obtain a second data set; The data association module is used to convert the first data set into an anti-counterfeiting plain code, use the second data set as an anti-counterfeiting secret code, and perform information association between the anti-counterfeiting plain code and the anti-counterfeiting secret code.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-5.