Dot matrix code generation and encryption method based on convolutional neural network and coding algorithm

By using a convolutional neural network to generate an invisible positioning point matrix and combining it with dynamic key encryption, the problems of existing dot code image technology being conspicuous, easy to imitate, and easy to crack are solved, and high-security and high-concealment dot code image generation and encryption are achieved, which is suitable for scenarios such as brand packaging and anti-counterfeiting labels.

CN120730002APending Publication Date: 2025-09-30GUANGZHOU HONGYI ANTI-COUNTERFEITING PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511055589.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing dot code image technology has problems such as obvious positioning features that are easy to copy or imitate, lack of information hiding capabilities, insufficient support for special identification scenarios, and easy to be reverse engineered and cracked. It cannot meet the application scenarios with high requirements such as data hiding, anti-counterfeiting identification and system closedness.

Method used

A convolutional neural network is used to generate an invisible positioning point matrix. Combined with error correction coding and dynamic key encryption methods, the convolution eigenvalues ​​extracted in real time by the convolutional neural network are used as dynamic keys to perform XOR encryption on the encoded data, and the encrypted data stream is embedded in the target image to form a dot code image with multi-layer encryption protection.

Benefits of technology

It improves the anti-counterfeiting and security of dot code images, enhances the concealment and robustness of data, realizes accurate identification and anti-counterfeiting verification in complex environments, supports high-density information storage and prevents information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120730002A_ABST
    Figure CN120730002A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information storage and identification, and discloses a dot matrix code generation and encryption method based on a convolutional neural network and a coding algorithm, and the method comprises a parameter initialization step, an invisible positioning construction step, a robustness coding step, a dynamic key encryption step, and a templated image synthesis step. According to the dot matrix code generation and encryption method based on the convolutional neural network and the coding algorithm, convolutional feature values are performed on an image through the convolutional neural network to generate positioning points of the image, and a positioning point matrix used for image alignment is generated based on the point size and the point distance; image positioning is achieved without depending on a traditional image frame or a positioning block, and the anti-counterfeiting performance and safety of the dot matrix code image are improved; and secondly, a convolutional feature value extracted by the convolutional neural network in real time is used as a dynamic key, and XOR encryption is performed on the dynamic key and the coded data, so that the original information cannot be recovered even if the dot matrix code image is copied.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information storage and recognition technology, and specifically to a dot matrix code generation and encryption method based on a convolutional neural network and a coding algorithm. Background Art

[0002] Currently, mainstream dot matrix image technologies include QR codes and DataMatrix codes. These code systems all utilize explicit positioning markers (such as large black squares in the corners of the image and L-shaped borders) and are recognized using standardized decoding algorithms. These technologies are widely used in industries such as industry, logistics, and identity recognition. They are characterized by standardized structures and can be decoded using publicly available algorithms. However, these technologies still have the following shortcomings: The positioning features are conspicuous and easily copied or imitated: The positioning patterns of existing code systems are very conspicuous in images, such as the three large positioning blocks of QR codes. This makes the code system easy to be captured by ordinary cameras and recognized by general decoding software, lacking security and specificity. Lack of information hiding capability: Due to the strong visual characteristics of the code system, the existing code system is difficult to integrate into product packaging, pictures or backgrounds. It is not suitable for scenarios that require the integration of pictures and texts and aesthetic designs (such as brand packaging and anti-counterfeiting labels); Insufficient support for specialized recognition scenarios: Existing code decoding relies on standard algorithms and cannot be linked with specialized systems, making it difficult to build closed-loop application systems with "white-box recognition" features. Easy to reverse engineer and crack: Open source decoding methods make existing code systems easy to analyze and lack security isolation capabilities.

[0003] Therefore, the existing dot code image technology has significant deficiencies in concealment, security and specificity, and cannot meet application scenarios with higher requirements for data hiding, anti-counterfeiting identification and system closure. Summary of the Invention

[0004] The purpose of this application is to provide a dot code generation and encryption method based on convolutional neural network and encoding algorithm to solve the technical problems raised in the background technology.

[0005] To achieve the above objectives, the present application discloses the following technical solution: a method for generating and encrypting a dot matrix code based on a convolutional neural network and an encoding algorithm, the method comprising the following steps: Parameter initialization: Set the code value to be embedded and, based on the target application requirements, set the dot code image resolution, dot size, and dot pitch, where the dot size defines the pixel value of a single dot, and the dot pitch defines the pixel spacing between adjacent dots, and the dot pitch satisfies the non-continuous arrangement condition; Invisible positioning construction: Based on the dot code image resolution, convolution feature value extraction is performed on the image through a convolutional neural network to generate positioning points, and a positioning point matrix for image alignment is generated based on the point size and the point spacing; Robust coding: converting the code value to be embedded into storable coded data through an error correction coding algorithm; Dynamic key encryption: using the convolution feature values ​​extracted in real time by the convolutional neural network as dynamic keys, the encoded data is subjected to bit-by-bit XOR encryption processing to form an encrypted data stream bound to the positioning features; Templated image synthesis: The encrypted data stream is written into the target image according to a preset topology template to generate a dot code image including a positioning point matrix and encrypted data, wherein the topology template is used to define the position mapping rules of the dot code image in the target image based on the resolution of the dot code image.

[0006] Preferably, in the step of stealth positioning construction, the positioning point matrix is ​​generated in at least three asymmetric areas of the target image.

[0007] Preferably, the convolution eigenvalues ​​of the positioning point matrix are used to generate a unique identifier through a hash algorithm.

[0008] Preferably, the dynamic key encryption further comprises: The encrypted data stream after XOR encryption is encrypted twice using the AES encryption algorithm to form an encrypted data stream with multi-layer encryption protection.

[0009] Preferably, the converting of the code value to be embedded into storable coded data by an error correction coding algorithm comprises: The embedded code value is error-corrected by the Reed-Solomon coding algorithm to generate robust hexadecimal coded data. Redundant check bits are embedded in the encoding process to enhance data recovery in the event of image corruption.

[0010] Preferably, the position mapping rule includes a plurality of dot code image layout positions, and the encrypted data stream is written into the target image according to the dot code image layout positions to form a single image or a dot code image integrated with multiple images.

[0011] Preferably, the layout position of the dot code image is dynamically adjusted according to real-time environmental parameters, and the real-time environmental parameters include light intensity and image resolution.

[0012] Preferably, the topology template is further used to dynamically generate according to user identity information or device identification, so that the same data can generate unique dot matrix code images on different users / devices.

[0013] Preferably, the character set supported by the dot code image includes numbers, uppercase and lowercase letters, and special symbols.

[0014] Preferably, the method further comprises: Anti-counterfeiting verification: The binding relationship between the convolutional eigenvalues ​​extracted by the convolutional neural network and the encrypted data stream is decoded and verified. If the convolutional eigenvalues ​​extracted in real time from the non-positioning point matrix during the image processing process by the correct convolutional neural network are not used as the key, the original data cannot be restored, and the hash value of the convolutional eigenvalue is stored in the distributed ledger through blockchain technology.

[0015] Beneficial effects: The dot code generation and encryption method based on convolutional neural network and encoding algorithm of the present application generates the positioning points of the image by performing convolutional neural network on the image's convolutional eigenvalues, and generates a positioning point matrix for image alignment based on the point size and dot pitch, thereby realizing image positioning without relying on traditional image borders or positioning blocks, thereby improving the anti-counterfeiting and security of the dot code image; secondly, the convolutional eigenvalues ​​extracted in real time by the convolutional neural network are used as dynamic keys and are XOR-encrypted with the encoded data, so that the original information cannot be restored even if the dot code image is copied. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 A flowchart of a dot code generation and encryption method based on a convolutional neural network and encoding algorithm provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following is a clear and complete description of the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] In this document, the term "comprising" is intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0020] This embodiment provides a Figure 1 The dot code generation and encryption method based on the convolutional neural network and the encoding algorithm shown includes the following steps: S1-Parameter initialization: Set the code value to be embedded (that is, the data to be embedded in the dot code image, usually a string of numbers or letters), and set the dot code image resolution, dot size and dot pitch according to the target application requirements, where the dot size defines the pixel value of a single dot, the dot pitch defines the pixel spacing between adjacent dots, and the dot pitch satisfies the non-continuous arrangement condition.

[0021] S2-Invisible positioning construction: Based on the dot code image resolution, convolutional feature values ​​of the image are extracted through a convolutional neural network to generate positioning points, and a positioning point matrix for image alignment is generated based on the point size and the point spacing. The generation of the positioning point matrix does not rely on geometric figures visible to the human eye (such as image borders and positioning blocks on the image).

[0022] S3-Robust Coding: The code value to be embedded is converted into storable coded data through an error correction coding algorithm.

[0023] S4-Dynamic key encryption: Using the convolution feature value extracted in real time by the convolutional neural network as a dynamic key, the encoded data is subjected to bit-by-bit XOR encryption processing to form an encrypted data stream bound to the positioning feature.

[0024] S5 - Templated Image Synthesis: The encrypted data stream is written into the target image according to a preset topology template to generate a dot code image comprising a positioning point matrix and the encrypted data. The topology template is used to define the mapping rules for the dot code image's position within the target image based on the dot code image's resolution. Advantageously, the dot code image supports a character set that includes numbers, uppercase and lowercase letters, and special symbols, resulting in higher encoding density and scalability compared to existing dot code images that only support numbers.

[0025] Specifically, in the parameter initialization step, the dot code image resolution is set to be consistent with the printer resolution, which determines the pixel density of the image. High-resolution images can provide finer pixel features, enabling the convolutional neural network to extract more accurate invisible positioning features (such as the pixel distribution of the 3×3 positioning point matrix) during convolution operations, avoiding blurred or overlapping positioning features due to insufficient resolution. For example, if the dot code image resolution is set to 300dpi, the convolutional neural network can calculate the convolution feature value based on denser pixel points when extracting the positioning points in the upper left area, thereby improving the uniqueness and anti-interference ability of the positioning point matrix. The dot size is set to a square matrix of 1×1 pixels or 2×2 pixels or larger, and the dot pitch is dynamically adjusted based on the dot size, so that the center-to-center spacing of adjacent dots is greater than the dot size pixel value to prevent the dots from forming connected lines due to insufficient spacing. The dot size and dot pitch jointly determine the physical distribution of pixels in the image. The generation of the positioning dot matrix must be based on the parameters of dot size and dot pitch, ensuring that the layout of the 3×3 positioning dot matrix on the image does not adhere to the data points and meets the non-continuous arrangement conditions (such as the center-to-center spacing of adjacent dots > the dot size pixel value) to avoid confusion between positioning feature values ​​and data points. Secondly, the dot code image resolution is set to be consistent with the printer resolution to ensure that the encoded data points will not be deformed (such as dot adhesion or blurring) due to resolution mismatch during printing. The calculation of the dynamic key (convolution eigenvalue) depends on the pixel distribution of the dot code image: higher resolution and greater pixel count lead to higher-dimensional and more random eigenvalues ​​extracted by the convolutional neural network, resulting in higher security when used as an XOR encryption key. The dot size determines the pixel range of a single data point (e.g., 2×2 pixels). The convolution kernel must cover the pixel values ​​within this range when calculating the eigenvalue. Different dot sizes result in different convolution results (eigenvalues), which in turn affects the dynamic nature of the encryption key. Furthermore, the dot spacing must meet the "non-contiguous arrangement" condition (e.g., the center-to-center distance between adjacent dots > dot size in pixels) to prevent overlap between the data points and the pixel regions of the positioning point matrix. This ensures that the positioning eigenvalues ​​extracted by the convolutional neural network are derived solely from the region where the positioning points are located and are independent of the pixel characteristics of the data points. This decouples the encryption key (positioning eigenvalue) from the data content, improving encryption randomness and attack resistance. Furthermore, the topology template defines the location mapping rules for data embedding, requiring the coordinates of the dot code image within the target image to be determined based on the dot code image resolution. For example, if the resolution of a dot code image is 600×600 pixels, the template may distribute multiple dot code images in the four corners of the image, with each dot code image occupying an area of ​​100×100 pixels. This ensures that the layout matches the resolution and prevents dot code images from exceeding the image boundaries or overlapping due to resolution differences.During templated image synthesis, the spacing between data points must be determined based on the dot pitch parameter initialized during parameter initialization to ensure discontinuity between adjacent points (for example, if the dot pitch is set to 3 pixels and the dot size is set to 2 pixels, the center-to-center distance between adjacent points is 3 pixels, satisfying the discontinuity condition). If the template layout does not adhere to the dot pitch parameter, the printed dot code image may become fused into lines, affecting positioning and feature extraction during subsequent decoding. Furthermore, during templated image synthesis, the dot code image resolution must be consistent with the printer resolution to ensure that the synthesized dot code image accurately reproduces the pixels when printed (for example, 1 pixel corresponds to 1 physical dot on the printer). Failure to consider the printer resolution during template synthesis may cause the dot code image to appear scaled or distorted after printing, further impacting the convolutional neural network's ability to identify positioning features and decrypt encrypted data. Therefore, parameter initialization serves as the starting point of the entire process. By setting basic parameters such as code value, resolution, dot size, and dot pitch, it provides physical constraints and algorithm input for subsequent steps. Resolution and printing machine adaptation: ensure consistent pixel accuracy in image generation, printing, and recognition; Point size and point spacing: define the physical form and spatial distribution of data points, affecting positioning feature extraction, encryption key generation, and template layout; Code value type: determines the input format and redundancy strategy of the encoding algorithm.

[0026] This parameter transfer relationship forms a closed-loop logic of initialization setting-core algorithm execution-result output, ensuring the overall optimization of the dot code image in terms of concealment, robustness, security and printing adaptability.

[0027] In one embodiment, in the step of stealth positioning construction, the positioning point matrix is ​​generated in at least three asymmetric areas of the target image, such as generating a 3×3 pixel matrix in the upper left, upper right and lower left areas of the target image respectively.

[0028] Furthermore, the convolution eigenvalues ​​of the positioning point matrix are used to generate a unique identifier through a hash algorithm, which is used to provide a reference identifier for subsequent anti-counterfeiting verification.

[0029] Specifically, during the invisible positioning construction step, existing technologies rely on visible geometric shapes (such as QR code corners and borders) for positioning. This step, however, uses a convolutional neural network to automatically extract the pixel feature distribution (such as specific grayscale values ​​and texture patterns) of image positioning points, generating a positioning point matrix. This matrix is ​​invisible to the naked eye and can only be identified by an algorithm. This addresses the drawback of existing positioning features, which are conspicuous and easily copied, allowing the dot code image to be integrated into scenes such as packaging and pictures without affecting the visual effect. Furthermore, the generation of the positioning point matrix relies on a convolutional neural network performing a convolution operation on a real-time image. Its feature values ​​dynamically change with the image content, rather than a fixed geometric shape. Even if the dot code image is copied, the positioning points cannot be resolved without the corresponding convolutional neural network model and operation logic, significantly improving anti-counterfeiting capabilities. Furthermore, by forming a triangular positioning structure using at least three positioning point matrices (top left, top right, and bottom left), combined with the feature extraction capabilities of the convolutional neural network, positioning accuracy can be maintained even when the image is rotated, scaled, or partially obscured, compared to the single visible marker used in existing technologies. This addresses the issue of unstable recognition in complex environments. Based on the determination of the positioning point matrix, the position of the positioning point matrix is ​​used as the coordinate origin. The hexadecimal data generated by the subsequent Reed-Solomon encoding needs to be embedded in the image according to the positioning reference to ensure that the relative position of the data area and the positioning area is fixed, avoiding decoding failure due to layout confusion. The positioning point matrix is ​​combined with the error correction capability of the Reed-Solomon code to form a dual guarantee of spatial positioning fault tolerance + data coding error correction. Even if part of the image is damaged, the data area position can still be retrieved and the information can be restored through the positioning point. The eigenvalues ​​of the positioning point matrix extracted by the convolutional neural network are directly used as the dynamic key for XOR encryption, which strongly binds the encryption rules to the positioning process. If the invisible positioning construction step does not generate the convolution eigenvalue, or the convolution eigenvalue is lost during transmission, decryption cannot be completed, forming a closed-loop security mechanism of positioning-encryption.

[0030] Therefore, the invisible positioning construction step obtains physical constraints through parameter initialization, generates positioning feature values ​​to drive encryption and encoding, and provides a spatial reference for image synthesis, forming a technical closed loop combining positioning, encryption and encoding, fundamentally solving the shortcomings of existing technologies in concealment, security and robustness.

[0031] A feasible convolutional neural network can perform convolution operations on real-time images as follows: 1) Input data definition (1) Set the convolution kernel K: 3×3 weight matrix to determine the feature extraction mode. The matrix is: ; (2) In the conversion from convolution eigenvalue to positioning point matrix, set the operation result threshold (such as ); 2) Convolution operation steps (1) According to the setting of the convolution kernel and the threshold of the operation result, the matrix of the positioning point is reversed. The core function of the operation logic is that the convolution kernel defines the feature pattern to be extracted (such as edges, corners, etc.). The area in the input image that matches the convolution kernel K will produce a higher convolution value (that is, the operation result). ), which is identified as the area where the positioning point is located. When the threshold is met, the corresponding 3×3 area is marked as a positioning point matrix.

[0032] (2) Convolution operation process: ,in, and are the row and column indices of the matrix, , ,like Represents the pixel value in row 2, column 3 of the convolution kernel matrix. Perform the convolution operation on the top left, top right, and bottom left regions of the image, generating three 3×3 positioning point matrices, forming a triangular positioning structure (similar to the three positioning blocks in a QR code, but with invisible pixel matrices).

[0033] (3) Example of positioning point matrix: When the smallest operation result is selected for calculation, A feasible positioning point matrix can be: a 3×3 pixel matrix, where the values ​​in the matrix represent the pixel grayscale values ​​(1 is a black dot, 0 is a white dot). The matrix is ; (4) Result verification: Cover the convolution kernel K in the 3×3 area in the upper left corner of the input image, multiply and accumulate the corresponding elements, and the result is: ( , the result of the operation This is the convolution feature value of the area, which represents the degree of match between the input image and the convolution kernel (the larger the value, the higher the match).

[0034] It should be noted that the operation result of the convolution kernel and the input image depends on the pixel distribution of the input image, and the input image is dynamically generated according to the actual image content (for example, the operation result and the convolution kernel are pre-set, and then the positioning point matrix is ​​generated based on the convolution kernel and the operation result). Therefore, the eigenvalues ​​of the positioning point matrix of different images are completely different.

[0035] In one embodiment, converting the code value to be embedded into storable coded data using an error correction coding algorithm includes: The embedded code value is error-corrected by the Reed-Solomon coding algorithm to generate robust hexadecimal coded data. Redundant check bits are embedded in the encoding process to enhance data recovery in the event of image corruption.

[0036] Specifically, during the robust coding step, the original data is processed using error-correcting coding algorithms such as Reed-Solomon. Redundant check bits (such as the check bytes in hexadecimal-encoded data) are embedded during the coding process, making the dot code image "partially recoverable from damage." For example, when some pixels in a dot code image are lost due to printing defects, transmission noise, or physical wear, the redundant check bits can be algorithmically inferred and the original data restored. While traditional dot code images (such as QR codes) have basic error correction capabilities, they often use fixed redundancy rules and have a low damage resistance threshold. This step significantly enhances robustness by dynamically adjusting the number of redundant check bits (based on data importance or application scenario) to increase damage resistance by over 30% (e.g., data with 30% pixel damage can be recovered). Secondly, if the original data has not been robustly encoded, once it is damaged by noise before encryption, the encrypted data will not be able to be correctly decrypted. This step ensures the integrity of the encrypted input data through error correction processing, avoiding the situation where erroneous data cannot be recovered after encryption. In addition, the encoded data format (hexadecimal) matches the rules of templated image synthesis. The embedding of redundant check bits does not affect the layout of the data in the template image, and can be embedded in the target image together with the dynamically encrypted data stream, forming a closed loop of encoding-encryption-synthesis.

[0037] Therefore, building a data reliability foundation through error correction coding algorithms is not only a functional extension of the upstream parameter setting and positioning mechanism, but also provides high-quality data raw materials for downstream encryption and synthesis, so that dot code images can still maintain high availability and security in complex application environments.

[0038] In one embodiment, the dynamic key encryption further includes: The encrypted data stream after XOR encryption is encrypted twice using the AES encryption algorithm to form an encrypted data stream with multi-layer encryption protection. The AES encryption algorithm can be any one of the existing technologies.

[0039] Specifically, in the dynamic key encryption step, existing technologies often use fixed encryption rules (such as preset keys or no encryption). This step, however, utilizes convolutional features extracted in real time by a convolutional neural network as a dynamic key. This key is directly linked to the invisible pixel features generated during the image positioning process. For example, each time a dot code image is generated, the key dynamically changes with the image content and convolution kernel parameters. Even if the dot code image is copied, the correct key cannot be retrieved if the features are not extracted using the same convolutional neural network. This fundamentally addresses the fixed and easily crackable nature of existing encryption methods. Secondly, the encrypted data stream is bound to the positioning features, meaning that decryption must simultaneously meet the requirements of "obtaining the correct positioning feature values" and "performing an exclusive-or operation." This deeply couples the encryption rules with the image's inherent invisible features, enhancing anti-counterfeiting capabilities. The exclusive-or (XOR) encryption algorithm leverages its reversibility to ensure security while ensuring that legitimate users can accurately restore the data using the same key. This property, combined with the error correction capabilities of Reed-Solomon coding, creates a dual guarantee of "encryption anti-crackability + error correction anti-corruption," enhancing the robustness of the encryption method. At the same time, the encrypted data stream is used as the input of templated image synthesis and embedded in the target image according to the topological template. Due to the binding of the encrypted data stream and the positioning features, the synthesized dot code image must rely on the same convolutional neural network positioning process to obtain the key when decoding, ensuring that the positioning-encryption-synthesis technical loop is formed. For example: in the synthesized dot code image, the position of the encrypted data is correlated with the distribution of the positioning point matrix. When decoding, it is necessary to first obtain the eigenvalue key through convolutional neural network positioning, and then decrypt the data to avoid loopholes in directly decoding the data area.

[0040] Therefore, the dynamic key encryption step not only independently improves the security level of the dot code image through the technical combination of "dynamic key generation-eigenvalue binding-XOR operation", but also constructs a complete technical chain of parameter initialization-invisible positioning-robust coding-dynamic encryption-template synthesis through logical linkage with upstream and downstream steps, fundamentally solving the shortcomings of existing technologies in terms of security, concealment and system closure.

[0041] In one embodiment, the position mapping rule includes a plurality of dot code image layout positions, and the encrypted data stream is written into the target image according to the dot code image layout positions to form a single image or a multi-image integrated dot code image.

[0042] It is feasible that the dot code image layout position is dynamically adjusted based on real-time environmental parameters, including light intensity and image resolution, to adapt to image generation requirements in different scenarios while avoiding dot matrix damage or decoding failures caused by environmental differences. This dynamic adjustment process can be implemented using any existing technology. The specific dynamic adjustment adopted in this embodiment is as follows: With respect to light intensity, the real-time light intensity value is obtained through an ambient light sensor or image grayscale statistics. When the light intensity exceeds a threshold (e.g., 5000 lux), the topology template automatically shifts the dot code image layout from a highlight area (e.g., a white background or a specular reflective surface) to a shadow or diffuse reflective area (e.g., a textured groove or non-smooth surface on a package) to avoid reflection interference. If the light intensity is below the threshold (e.g., 100 lux), the pixel contrast between the dot code image and the background is increased (e.g., by increasing the dot size from 1×1 pixel to 2×2 pixels), and the layout position is adjusted to an area directly exposed to the light source (e.g., the central bright area of ​​the label) to ensure that the pixel features are recognizable. In terms of image resolution, the resolution parameters of the shooting device or target output medium are obtained in real time (such as a printing press resolution of 300dpi and a camera resolution of 4000×3000 pixels). The topology template dynamically calculates the optimal dot pitch and layout density based on the resolution. In low-resolution scenarios (such as ≤200dpi), the spacing between adjacent dot code images is increased (such as from the default 100 pixels to 200 pixels) to avoid dot matrix adhesion into lines due to pixel compression. In high-resolution scenarios (such as ≥600dpi), the spacing is reduced and the number of layout positions is increased. More dot code images can be embedded in the same image area to improve data storage density (for example, the original layout can embed one group of dot code images, while three groups can be embedded at high resolution).

[0043] Specifically, during the templated image synthesis step, a preset topology template defines the location mapping rules for data embedding, resulting in a standardized layout of the encrypted dot code image within the target image. This addresses the decoding errors caused by the chaotic arrangement of dot code images in existing technologies. For example, in brand packaging scenarios, the template can embed the dot code image within the anchor points of the pattern texture, ensuring both an aesthetically pleasing fusion of image and text and a fixed relative position between the anchor points and the data area during decoding, thus improving recognition efficiency. Dynamic adjustment of the layout position (e.g., real-time optimization based on light intensity and image resolution) ensures that the dot code image remains legible across different printing devices (such as high-precision printers or inkjet printers) and media (such as paper and plastic), avoiding dot matrix adhesion or blurring caused by differences in environmental parameters and significantly improving the robustness of practical applications. Furthermore, the system supports the synthesis of multiple encrypted dot code images into a single, large-scale image based on the template, enabling the integrated storage of large amounts of data. For example, in logistics labeling scenarios, multiple sets of data such as product traceability information, anti-counterfeiting codes, and batch numbers can be encoded into dot matrix images through templated image synthesis and arranged on the label according to preset positions. Compared with the capacity limitations of single dot matrix images in existing technologies, data storage density is increased by at least 3 times. At the same time, when templated image synthesis is used, the binding relationship between the encrypted data stream and the invisible positioning features is solidified into the image layout. For example, the position of the positioning point matrix and the relative offset of the data area are determined by the template rules. If the dot matrix image is illegally copied or the layout is tampered with, the mapping relationship between the positioning features and the data area will be invalid during decoding, and the anti-counterfeiting verification will be impossible, further enhancing the anti-copying capability.

[0044] As a preferred implementation of this embodiment, the topology template is also used to dynamically generate based on user identity information or device identification, so that the same data can generate unique dot matrix code images on different users / devices, thereby improving the specificity and anti-copying ability of the dot matrix code image.

[0045] In this way, topology templates are dynamically generated using user identity information (such as account ID, permission level) or device identification (such as MAC address, hardware serial number). This ensures that dot code images generated for the same data on different users or devices have unique layout characteristics. For example, when the same product data is generated by different dealer devices, the dot matrix distribution and embedding position of the dot code image will vary due to different device identifications. This physically eliminates the risk of multiple code duplication and meets the brand's requirements for channel control and anti-counterfeiting traceability. Secondly, in the prior art, if a fixed topology template is used, attackers can reverse the generation rules by analyzing the dot code image layout and forge legitimate dot code images. However, the dynamic generation mechanism of the topology template in this application strongly binds the dot code image layout to the user / device identity. Even if the same data is generated multiple times, its dot matrix position and arrangement rules will vary due to changes in identity parameters. For example, after a hacker obtains a dot code image generated by a certain device, he cannot infer the template rules of other devices from this dot code image, effectively blocking the attack path of copying and forgery.

[0046] In one embodiment, the dot code generation and encryption method based on a convolutional neural network and an encoding algorithm of this embodiment further includes the following steps: S6-Anti-counterfeiting verification: Decoding and verification are performed based on the binding relationship between the convolutional eigenvalues ​​extracted by the convolutional neural network and the encrypted data stream. If the correct convolutional neural network is not used as the key to extract the convolutional eigenvalues ​​(as positioning eigenvalues) in real time from the positioning point matrix during image processing, the original data cannot be restored, thereby realizing anti-counterfeiting identification of the dot code image. The hash value of the convolutional eigenvalue is stored in the distributed ledger through blockchain technology to realize anti-tampering verification of the dot code image.

[0047] In detail, in the anti-counterfeiting verification step, the positioning feature value extracted by the convolutional neural network forms a key-ciphertext binding relationship with the encrypted data. The convolution feature value is derived from the pixel feature distribution of the image positioning point and is unique and dynamic. If the correct convolution feature value is not used, even if the dot code image is obtained, the original data cannot be restored through the XOR operation, which fundamentally eliminates the possibility of the dot code image being copied and forged, and avoids the defect that the positioning feature is conspicuous and easy to copy. The invisible positioning construction step provides the core key for anti-counterfeiting verification, namely the convolution feature value. This value serves as the key for XOR encryption and also becomes the decryption credential in the verification stage, forming a logical chain of positioning feature value-encryption key-verification key. The anti-counterfeiting verification result can be used as the basis for judging the validity of the dot code image. If the verification is passed, the hash value stored in the blockchain can be combined to further confirm that the convolution feature value has not been tampered with, forming a double verification mechanism. The convolutional eigenvalues ​​extracted by the convolutional neural network are used to generate unique identifiers through a hash algorithm and stored in the blockchain distributed ledger. Due to the consensus mechanism and cryptographic characteristics of the blockchain, the eigenvalue hash value cannot be tampered with once it is on the chain, ensuring that the key source used in the verification phase is tamper-proof and traceable, avoiding security vulnerabilities in which the eigenvalue may be maliciously modified. At the same time, blockchain evidence can be used as third-party credible evidence. When there is a dispute over the authenticity of the dot code image, judicial evidence can be quickly completed by comparing the on-chain hash value with the local eigenvalue.

[0048] Therefore, the anti-counterfeiting verification step deeply couples the three links of positioning, encryption, and verification through the combination of dynamic feature value binding + blockchain evidence storage, forming a dual guarantee of technical anti-counterfeiting and evidence storage, thereby improving security and reliability.

[0049] In summary, the dot code generation and encryption method based on convolutional neural network and encoding algorithm in this embodiment is as follows: A convolutional neural network is used to convolve the image's eigenvalues ​​to generate image positioning points, and a matrix of positioning points is generated within the image for image alignment. This achieves image positioning without relying on traditional image borders or positioning blocks, improving the anti-counterfeiting and security of dot code images. Secondly, the convolutional eigenvalues ​​extracted in real time by the convolutional neural network are used as a dynamic key and XOR-encrypted with the encoded data, making it impossible to restore the original information even if the dot code image is copied. Furthermore, the high robustness of Reed-Solomon coding and the embedding of redundant check bits in the encoding process enhance the data's resistance to damage, ensuring that data can be recovered even if part of the image is damaged; Furthermore, through secondary encryption, a multi-layer encrypted data stream is formed, so that even if the dot code image is copied, the original data cannot be decrypted without the correct positioning feature value. Furthermore, the dot code image resolution is matched to the target application, and the dot size and pitch are set according to non-continuous arrangement rules to prevent the dots from sticking together into lines. Furthermore, when synthesizing templated images, the layout position is dynamically adjusted based on real-time parameters such as light intensity and image resolution to ensure the clarity and readability of the dot code image under different printing devices and scenarios. Furthermore, the character set supported by the dot code image is approximately three times denser than the existing dot code image that only supports numbers. This allows more characters to be stored in the same space and can accommodate complex data such as English text and encryption keys. This makes it suitable for applications such as brand anti-counterfeiting and confidential information transmission. Furthermore, by storing the hash value of the positioning feature value on the blockchain, anti-tampering verification is achieved; at the same time, a unique template image is dynamically generated based on the user identity or device identification, so that the same data can generate a unique dot matrix code image on different users or devices, building a closed-loop system for white box recognition, solving the problem that existing technologies cannot be linked with dedicated systems.

[0050] In the embodiments provided herein, it should be understood that the embodiments described herein can be implemented using hardware, software, firmware, middleware, code, or any appropriate combination thereof. For hardware implementation, the processor may be implemented in one or more of the following: an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, or other electronic units designed to implement the functionality described herein, or any combination thereof. For software implementation, some or all of the processes of the embodiments may be performed by a computer program instructing the relevant hardware. During implementation, the program may be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media includes any medium that facilitates the transmission of a computer program from one location to another. The storage medium may be any available medium that can be accessed by a computer. Computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing the desired program code in the form of instructions or data structures and accessible by a computer.

[0051] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent replacements for some of the technical features therein. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A dot code generation and encryption method based on convolutional neural network and encoding algorithm, characterized in that: The method comprises the following steps: Parameter initialization: Set the code value to be embedded and, based on the target application requirements, set the dot code image resolution, dot size, and dot pitch, where the dot size defines the pixel value of a single dot, and the dot pitch defines the pixel spacing between adjacent dots, and the dot pitch satisfies the non-continuous arrangement condition; Invisible positioning construction: Based on the dot code image resolution, convolution feature value extraction is performed on the image through a convolutional neural network to generate positioning points, and a positioning point matrix for image alignment is generated based on the point size and the point spacing; Robust coding: converting the code value to be embedded into storable coded data through an error correction coding algorithm; Dynamic key encryption: using the convolution feature values ​​extracted in real time by the convolutional neural network as dynamic keys, the encoded data is subjected to bit-by-bit XOR encryption processing to form an encrypted data stream bound to the positioning features; Templated image synthesis: The encrypted data stream is written into the target image according to a preset topology template to generate a dot code image including a positioning point matrix and encrypted data, wherein the topology template is used to define the position mapping rules of the dot code image in the target image based on the resolution of the dot code image.

2. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 1, wherein: In the step of stealth positioning construction, the positioning point matrix is ​​generated in at least three asymmetric areas of the target image.

3. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 2, wherein: The convolution eigenvalues ​​of the positioning point matrix are used to generate a unique identifier through a hash algorithm.

4. The method for generating and encrypting a dot matrix code based on a convolutional neural network and a coding algorithm according to claim 1, wherein: The dynamic key encryption also includes: The encrypted data stream after XOR encryption is encrypted twice using the AES encryption algorithm to form an encrypted data stream with multi-layer encryption protection.

5. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 4, wherein: The step of converting the code value to be embedded into storable coded data by using an error correction coding algorithm includes: The embedded code value is error-corrected by the Reed-Solomon coding algorithm to generate robust hexadecimal coded data. Redundant check bits are embedded in the encoding process to enhance data recovery in the event of image corruption.

6. The method for generating and encrypting a dot code based on a convolutional neural network and a coding algorithm according to claim 1 or 5, characterized in that: The position mapping rule includes a plurality of dot code image layout positions, and the encrypted data stream is written into the target image according to the dot code image layout positions to form a single image or a dot code image integrated with multiple images.

7. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 6, wherein: The layout position of the dot code image is dynamically adjusted according to real-time environmental parameters, and the real-time environmental parameters include light intensity and image resolution.

8. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 1, wherein: The topology template is also used to dynamically generate according to user identity information or device identification, so that the same data can generate unique dot matrix code images on different users / devices.

9. The method for generating and encrypting dot codes based on a convolutional neural network and a coding algorithm according to claim 1, wherein: The character set supported by the dot matrix code image includes numbers, uppercase and lowercase letters, and special symbols.

10. The method for generating and encrypting a dot code based on a convolutional neural network and a coding algorithm according to any one of claims 1 to 9, characterized in that: The method further includes: Anti-counterfeiting verification: The binding relationship between the convolutional eigenvalues ​​extracted by the convolutional neural network and the encrypted data stream is decoded and verified. If the convolutional eigenvalues ​​extracted in real time from the positioning point matrix during image processing by the correct convolutional neural network are not used as the key, the original data cannot be restored, and the hash value of the convolutional eigenvalue is stored in the distributed ledger through blockchain technology.