Machine bar code anti-copying method, system and device for ink-jet equipment
By collecting and comparing barcode images and scanning device parameters, and dynamically adjusting anti-copying parameters, the problem of barcodes being easily copied in inkjet printing is solved, improving the anti-copying capability and adaptability of barcodes, making them suitable for various industrial scenarios.
Patent Information
- Application Number
- CN202511559174.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2025-12-26
AI Technical Summary
In existing inkjet printing technologies, the methods for preventing the copying of machine barcodes have limitations such as static parameters being easily cracked, inability to be dynamically adjusted, poor adaptability, and difficulty in balancing security and readability. As a result, barcodes are easily copied in different scanning environments, affecting production efficiency and security.
By collecting barcode images and scanning device parameters, and comparing them with historical databases, the anti-copying parameters are dynamically adjusted, including initial parameter determination, feature extraction, and similarity calculation, to achieve adaptive anti-copying measures.
It improves the barcode's anti-copying capabilities, adapts to different scanning scenarios, reduces the risk of misjudgment, maintains the barcode's readability and usability, and is suitable for various industrial scenarios.
Smart Images

Figure CN121200577A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of inkjet printing control technology, specifically to a method, system, and apparatus for preventing machine barcode duplication in inkjet equipment. Background Technology
[0002] In the field of inkjet printing technology, machine barcodes are widely used in product identification, tracking, and management. Machine barcodes typically carry critical information such as production date, batch number, and serial number, which plays a crucial role in ensuring product authenticity, traceability, and preventing counterfeiting. With the widespread adoption of inkjet printing technology, barcode copying and counterfeiting have become increasingly frequent, causing significant economic losses and security risks to businesses and society. Existing anti-copying methods primarily rely on static anti-counterfeiting features, such as using special inks, embedding microtext, or designing complex patterns. While these methods increase the difficulty of copying to some extent, they also have significant limitations.
[0003] Static anti-copying parameters are easily captured and copied by high-precision scanning equipment. Attackers can use high-resolution scanners to acquire barcode images and then reconstruct the barcode using image processing software, generating visually indistinguishable copies. Because the parameters are fixed, once cracked, all barcodes using the same parameters will be at risk. Furthermore, static parameters lack adaptability and cannot be dynamically adjusted according to different scanning environments or device types. Differences in the optical characteristics, resolution, and decoding algorithms of different scanning devices can cause the same barcode to exhibit different image features on different devices. Traditional methods ignore these variables, making barcodes easier to copy under specific scanning conditions. For example, some scanning devices automatically enhance image contrast or reduce noise, which may unintentionally weaken the effectiveness of anti-copying features.
[0004] Current technologies suffer from insufficient utilization of historical data. Anti-copying systems often lack continuous learning and adaptation mechanisms, making them ill-equipped to counter new attack methods. As attack techniques evolve, static systems cannot update parameters in a timely manner, leading to a gradual decline in security. While advanced methods such as digital watermarking or encrypted barcodes can improve security, they typically require dedicated decoders, increasing cost and complexity. Furthermore, these methods are mostly implemented statically, failing to dynamically respond to environmental changes. In high-speed inkjet printing scenarios, barcode generation and anti-copying processing must be completed within milliseconds; otherwise, production efficiency will be affected. Existing methods are often computationally intensive and unable to meet real-time requirements.
[0005] Another challenge is balancing security and readability. Overly complex anti-copying features can reduce barcode scanning success rates, especially in low-light or high-speed mobile scanning environments. Existing methods often struggle to balance both, either sacrificing security for readability or vice versa, impacting practical value. In critical industries such as logistics and pharmaceuticals, barcode anti-copying is directly related to cargo safety and patient health; counterfeiting barcodes can lead to serious consequences. Therefore, the industry urgently needs a dynamic, adaptive anti-copying method that can adjust parameters in real time to improve anti-copying capabilities while maintaining barcode readability and usability.
[0006] To address the aforementioned shortcomings, this invention proposes a machine barcode anti-copying method based on dynamic parameter adjustment. This method intelligently adjusts anti-copying parameters by collecting barcode image data and scanning device parameters, and comparing them with a historical database. This effectively solves the rigidity problem of static methods and improves the system's adaptability and security. Summary of the Invention
[0007] The purpose of this invention is to provide a method, system, and apparatus for preventing machine barcode duplication in inkjet equipment, so as to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides a method, system, and apparatus for preventing machine barcode copying in inkjet equipment, the method comprising: Collect barcode image data of machine barcodes printed by inkjet equipment, and determine initial anti-copying parameters based on the barcode image data; Collect scanning parameter data of the scanning device used to scan the machine barcode, and determine whether to adjust the initial anti-copying parameters based on the scanning parameter data; When it is determined that the initial anti-copying parameters need to be adjusted, detailed image data of all barcode areas of the machine barcode are collected, and anti-copying feature data is obtained by feature extraction from the detailed image data. Anti-copying feature value of each barcode area is calculated based on the anti-copying feature data. All anti-copying feature values are compared with historical anti-copying feature data in the historical database, and the initial anti-copying parameters are adjusted based on the comparison results to obtain the adjusted anti-copying parameters. When no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, the similarity between all anti-copying feature values and historical anti-copying feature data is calculated, and the initial anti-copying parameters are adjusted according to the similarity.
[0009] Preferably, the process of determining the initial anti-copying parameters includes: The system acquires the barcode contrast characteristics, barcode width fluctuation characteristics, and barcode color saturation characteristics of the machine barcode in real time; it generates a baseline contrast parameter based on the barcode contrast characteristics, a width tolerance parameter based on the barcode width fluctuation characteristics, and a color gamut protection parameter based on the barcode color saturation characteristics; and it dynamically fuses the baseline contrast parameter, width tolerance parameter, and color gamut protection parameter to generate the initial anti-copying parameters.
[0010] Preferably, the processing of the scanning parameter data includes: Extract the scanning accuracy feature value and scanning angle offset feature value of the scanning device; construct a virtual scanning model that includes the standard scanning accuracy range and the standard scanning angle range; perform matching analysis between the scanning accuracy feature value and the standard scanning accuracy range, and calculate the offset between the scanning angle offset feature value and the standard scanning angle range; generate the scanning feature value difference based on the matching analysis result and the offset calculation result.
[0011] Preferably, determining whether to adjust the initial anti-copying parameters based on the scan parameter data includes: Establish a mapping relationship between the difference in scan feature values and the dynamic threshold; when the difference in scan feature values exceeds the upper limit of the dynamic threshold, trigger the anti-copying parameter adjustment mechanism; when the difference in scan feature values is within the tolerance range of the dynamic threshold, maintain the current anti-copying parameter configuration.
[0012] Preferably, the calculation process of the anti-copying feature value includes: The texture details and color gradient features of the barcode micro-pattern are obtained by high-frequency image sampling; the texture details are analyzed by multi-scale feature extraction algorithm to obtain the pattern complexity level and texture distribution density; the color gradient features are processed by pixel-level analysis method to obtain the color transition smoothness and color difference variation coefficient; the pattern complexity level, texture distribution density, color transition smoothness and color difference variation coefficient are weighted and fused to generate anti-copying feature values.
[0013] Preferably, when no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, the similarity between all anti-copying feature values and historical anti-copying feature data is calculated, and the initial anti-copying parameters are adjusted according to the similarity, including: Construct a multidimensional feature space for anti-copying feature values; perform a nearest neighbor search in the feature space in the historical database. If a matching record with a feature distance less than a threshold exists, use the adjustment parameters of that record as the benchmark; if multiple matching records exist, calculate the cluster center values of the adjustment parameters of these matching records; if no matching record exists, start feature space interpolation to generate new adjustment parameters.
[0014] Preferably, the application process of the cluster center value includes: The adjustment levels are determined based on the distribution density of cluster center values in the feature space; a gradual adjustment strategy is adopted when the cluster center values are in a high-density region; a segmented adjustment strategy is adopted when the cluster center values are in a medium-density region; and an adaptive adjustment strategy is adopted when the cluster center values are in a low-density region.
[0015] Preferably, the feature space interpolation calculation process includes: Establish a Delaunay triangular mesh in the feature space to prevent the duplication of eigenvalues; calculate the centroid coordinate weights of the eigenvalues to be processed and the mesh vertices; perform linear interpolation on the historical adjustment parameters based on the weight coefficients to generate new adjustment parameters; The construction process of the Delon triangular mesh includes: Uniformly distributed eigenvalues from the historical database are selected as grid vertices; the optimality of the triangular grid is ensured by checking the empty circle criterion; and the topological connection relationship between eigenvalues and grid vertices is established to form the basic framework for interpolation calculation.
[0016] The present invention also includes a machine barcode anti-copying system for inkjet equipment, used to implement the above-described method for preventing machine barcode copying in inkjet equipment, the system comprising: The data acquisition module is used to acquire barcode image data of machine barcodes printed by inkjet equipment and scanning parameter data of scanning equipment used to scan the machine barcodes; An initial parameter determination module is used to determine initial anti-copying parameters based on the barcode image data; The judgment module is used to determine whether to adjust the initial anti-copying parameters based on the scan parameter data; The feature extraction module is used to collect detailed image data of all barcode areas of the machine barcode when the judgment module determines that the initial anti-copying parameters should be adjusted, and to extract features from the detailed image data to obtain anti-copying feature data. The calculation module is used to calculate the anti-copying feature value of each barcode area based on the anti-copying feature data; The historical database is used to store historical anti-copying feature data; The comparison module is used to compare all anti-copying feature values with the historical anti-copying feature data in the historical database. The parameter adjustment module is used to adjust the initial anti-copying parameters according to the comparison results of the comparison module, so as to obtain the adjusted anti-copying parameters; When there is no historical anti-copying feature data with the same anti-copying feature value in the historical database, the parameter adjustment module calculates the similarity between all anti-copying feature values and historical anti-copying feature data, and adjusts the initial anti-copying parameters according to the similarity.
[0017] The present invention also includes a machine barcode anti-copying device for inkjet equipment, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described method for preventing machine barcode copying for inkjet equipment.
[0018] Compared with the prior art, the beneficial effects of the present invention are: By collecting barcode image data and scanning parameter data, this method can dynamically assess anti-copying requirements, avoiding the rigidity caused by relying on fixed settings. The initial anti-copying parameters are determined based on actual printed output, making the parameter settings closer to real-world conditions and reducing recognition failures due to environmental changes. When the scanning device parameters indicate the need for adjustment, the system automatically triggers detailed image acquisition and feature extraction. This process enhances the uniqueness of the barcode because the microscopic features of each barcode area are quantified and used for comparison. This feature-based adjustment makes the anti-copying parameters more personalized and adaptable, capable of handling different scanning scenarios. The introduction of a historical database further improves the reliability of the method. By comparing the current anti-copying feature values with historical data, the system can identify duplicate or suspicious patterns, thereby optimizing parameters in a timely manner. In the case of missing historical data, similarity calculation provides a flexible approach, avoiding the impact of insufficient data on anti-copying effectiveness. This method reduces the risk of false positives because similarity analysis allows for a degree of variation rather than a strict match, which is very practical in real-world applications, such as when the barcode is deformed due to slight wear or contamination, the system can still maintain effective protection.
[0019] Another key advantage is the method's adaptability. It does not rely on external networks or complex hardware, adjusting parameters solely through software algorithms. This results in lower deployment costs and easier integration into existing inkjet equipment. By considering specific scanning device parameters, such as resolution or light intensity, anti-copying measures can be customized to the actual device used, thus maintaining consistency across different user environments.
[0020] The feature extraction and comparison process enhances the anti-counterfeiting layer of the barcode. By analyzing detailed image data of the barcode area, the system captures subtle features generated during the printing process that are difficult to simulate by copying devices. This not only increases the difficulty of counterfeiting but also improves the authentication accuracy of the barcode. Overall, this method promotes the security and reliability of inkjet barcodes and is suitable for various industrial scenarios, such as logistics tracking or anti-counterfeiting label printing. Its self-learning mechanism is continuously optimized through the accumulation of historical data, and its effectiveness becomes more significant with long-term use. Attached Figure Description
[0021] Figure 1This is a schematic diagram illustrating the working principle of the machine barcode anti-copying method for inkjet equipment described in this invention. Figure 2 A comparison chart of the performance of feature space distribution density and parameter adjustment strategies; Figure 3 This is a comparison chart of the error rate and computation time for the feature space interpolation method. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Please see Figure 1 This invention provides a method, system, and apparatus for preventing the copying of machine barcodes on inkjet equipment. The method first acquires barcode image data of the machine barcode printed by the inkjet equipment and determines initial anti-copying parameters based on this data. Subsequently, it acquires scanning parameter data of the scanning equipment used to scan the machine barcode and determines whether the initial anti-copying parameters need to be adjusted based on this data; the scanning parameter data reflects the operating status of the scanning equipment and environmental factors.
[0024] When it is determined that the initial anti-copying parameters need to be adjusted, detailed image data of all barcode areas on the machine is further collected. Feature extraction is performed on this detailed image data to obtain anti-copying feature data. Then, the anti-copying feature value for each barcode area is calculated based on the anti-copying feature data. The calculation of the anti-copying feature value involves advanced image processing technology capable of capturing the microscopic features of the barcode. Next, all anti-copying feature values are compared with historical anti-copying feature data in the historical database. Based on the comparison results, the initial anti-copying parameters are adjusted to obtain the adjusted anti-copying parameters.
[0025] If no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, calculate the similarity between all anti-copying feature values and historical anti-copying feature data, and adjust the initial anti-copying parameters according to the similarity.
[0026] Example 1: During the initial determination of anti-copying parameters, the barcode contrast characteristics, barcode width fluctuation characteristics, and barcode color saturation characteristics of the machine barcode are acquired in real time. For barcode contrast characteristics, image segmentation technology is used to divide the complete machine barcode image into several regular sub-regions. The difference in average grayscale values between bright and dark pixels within each sub-region is calculated as the local contrast value. Subsequently, statistical analysis is performed on the local contrast values of all sub-regions, and the median is taken as the final representation value of the barcode contrast characteristic. For barcode width fluctuation characteristics, an edge detection algorithm is applied to accurately identify the left and right boundaries of each black and white block in the barcode. The pixel distance between adjacent boundaries is calculated as the physical width of the barcode element. The ratio of the standard deviation to the average width of all barcode elements in the entire barcode sequence is recorded to generate the barcode width fluctuation characteristic value. For barcode color saturation characteristics, the machine barcode image is converted from the RGB color space to the HSV color space, the saturation component channel is separated, and the mean and variance of all pixels in this channel are calculated and combined to form the barcode color saturation feature vector.
[0027] The process of generating baseline contrast parameters based on barcode contrast features involves establishing a contrast threshold model. Barcode contrast feature values are input into a predefined piecewise function. The function output is normalized and mapped to an integer range of 0-100, serving as the standard value for the baseline contrast parameters. The process of generating width tolerance parameters based on barcode width fluctuation features analyzes the correlation between barcode width fluctuation feature values and printing accuracy. By consulting a predefined correspondence table, the fluctuation feature values are converted into an allowable width deviation percentage. This percentage is rounded to the nearest integer and used as the actual value for the width tolerance parameter. The process of generating color gamut protection parameters based on barcode color saturation features employs color space mapping technology. The barcode color saturation feature vector is projected onto a standard color gamut coordinate system. The Euclidean distance between the feature vector and the standard color gamut boundary is calculated, and the intensity level of the color gamut protection parameter is determined based on the distance. The process of dynamically fusing baseline contrast parameters, width tolerance parameters, and color gamut protection parameters to generate initial anti-copying parameters employs a multi-parameter weighted fusion algorithm. Each parameter is assigned a dynamic weight coefficient, which is dynamically adjusted based on the real-time reliability of the parameter value. The weight of the baseline contrast parameter is calculated based on its numerical stability, the weight of the width tolerance parameter considers vibration factors in the current printing environment, and the weight of the color gamut protection parameter is corrected in conjunction with ambient light intensity. During the weighted fusion calculation, each of the three parameters is multiplied by its corresponding dynamic weight coefficient, summed, and then divided by the sum of the weight coefficients to obtain the original value of the initial anti-copying parameter. This original value is then smoothed and filtered to eliminate the influence of accidental fluctuations. The final output initial anti-copying parameter is stored in floating-point form, retaining two decimal places of precision. Multiple quality verification mechanisms are integrated into the real-time acquisition of machine barcode features. After each acquisition of barcode contrast features, data validity is immediately checked. Verification methods include checking the uniformity of local contrast value distribution and removing abnormally abrupt data points to ensure the reliability of the barcode contrast features. The measurement of barcode width fluctuation features synchronously records the measurement timestamp and ambient temperature data. When the ambient temperature exceeds the set range, a temperature compensation algorithm is automatically activated to correct for thermal expansion and contraction errors in the measurement results. The extraction process of barcode color saturation features uses a standard color chart as a reference. Before each extraction, the standard color chart is sampled to calibrate the white balance settings of the color acquisition device, ensuring the accuracy of the color data.
[0028] The algorithm for generating the baseline contrast parameter incorporates an adaptive adjustment function. When the contrast feature values of multiple consecutive barcodes show a trend change, it automatically adjusts the threshold range of the piecewise function to adapt to the actual situation of the printhead gradually aging. The generation of the width tolerance parameter incorporates a historical data reference mechanism, comparing the difference between the current barcode width fluctuation feature value and recent historical values. When the difference exceeds the warning line, the tolerance range is automatically widened to avoid misjudging normal fluctuations. The generation of the color gamut protection parameter combines ink characteristic curves. Based on the currently used ink model, it queries a preset ink characteristic database and adjusts the generation formula of the color gamut protection parameter to better suit the specific ink's color performance characteristics. The dynamic fusion process uses a sliding window mechanism to manage weight coefficients, recording the weight change trend of each parameter in the most recent fusion calculations. When the weight of a parameter continuously deviates from the normal range, a weight recalibration procedure is triggered. The output format of the initial anti-copying parameter adopts a structured data design, including fields such as parameter value, generation time, data version number, and checksum, facilitating data integrity verification in subsequent processing stages. The entire parameter determination process runs in an independent processing thread, executing in parallel with the machine barcode printing process. Double buffering technology is used to avoid data read / write conflicts and ensure the system's real-time response capability.
[0029] The image segmentation technology in the feature acquisition stage employs an adaptive threshold algorithm, dynamically calculating the segmentation threshold based on the local illumination conditions of each sub-region to avoid feature distortion caused by the assumption of uniform illumination. The edge detection algorithm combines the Sobel and Canny operators; the Sobel operator is used to initially locate edge points, followed by the Canny operator for precise edge connection, balancing detection accuracy and computational efficiency. Color space conversion uses an integer arithmetic optimization algorithm, converting floating-point operations to fixed-point operations to improve computational speed while maintaining accuracy, meeting real-time processing requirements. The piecewise function design for the baseline contrast parameter is based on extensive experimental data, with optimized breakpoint locations to ensure high sensitivity within the common value range of barcode contrast features. The correspondence table for width tolerance parameters is updated regularly, adjusting the correspondence based on the actual usage time of the printing equipment to accommodate the natural wear and tear of the equipment's mechanical parts. The intensity level division of the color gamut protection parameters considers human visual characteristics, setting denser level intervals in visually sensitive areas to improve the precision of anti-copying protection. The dynamic fusion weight coefficient calculation incorporates fuzzy logic control, transforming input variables such as parameter reliability, environmental factors, and equipment status into fuzzy sets. Optimal weight allocation is determined through fuzzy inference rules. The initial anti-copying parameters are smoothed using a Kalman filter algorithm, leveraging the time-series characteristics of parameter values for optimal estimation, effectively suppressing random noise interference. The entire parameter determination system possesses self-diagnostic capabilities, periodically checking the operational status of each processing module and automatically switching to a backup processing flow when an anomaly is detected, ensuring system robustness.
[0030] The real-time acquisition mechanism includes a data caching design, storing the most recent feature data in a circular buffer for historical comparison and trend analysis. The quality verification mechanism incorporates multiple verification steps, including data range checks, data continuity checks, and data consistency checks, ensuring the quality of the feature data. All critical values and thresholds during parameter generation are stored in a configurable parameter file, supporting online adjustment without modifying the program code, thus improving system adaptability.
[0031] The baseline contrast parameter generation takes into account the surface characteristics of the printing material, loading different parameter generation configuration files for different printing surfaces. Width tolerance parameter generation incorporates a machine learning prediction model, predicting the normal range of barcode width fluctuations based on historical data, thus improving the foresight of parameter generation. Color gamut protection parameter generation is compatible with multiple color standards, supporting automatic recognition and switching between different color spaces such as sRGB, AdobeRGB, and CMYK. The dynamic fusion algorithm reserves an extension interface, supporting the addition of new feature parameters without changing the existing fusion framework. The digital signature mechanism for the initial anti-copying parameters uses a hash algorithm to calculate the verification value of the parameter data, preventing parameters from being tampered with during transmission. The execution time of the entire parameter determination process has been rigorously tested and optimized to ensure that all processing steps are completed within the specified time limit, meeting the real-time requirements of high-speed printing scenarios.
[0032] Example 2: The processing of scanning parameter data begins with extracting the scanning accuracy feature value and scanning angle offset feature value of the scanning device. The extraction of the scanning accuracy feature value involves acquiring raw scanning data through the built-in optical sensor of the scanning device, analyzing the number of pixels per unit length in the scanned image, and calculating the actual accuracy deviation in conjunction with the nominal resolution of the scanning device. The calculation of the scanning accuracy feature value uses a multiple sampling averaging method, acquiring multiple sets of scanning data within a continuous time interval, removing outliers, and taking the arithmetic mean as the final result of the scanning accuracy feature value. The measurement of the scanning angle offset feature value utilizes the three-dimensional spatial coordinate data output by the scanning device's attitude sensor to calculate the angle between the projection of the scanning beam and the normal vector of the barcode plane. This angle is then converted into a standardized angular offset through geometric transformation. The processing of the scanning angle offset feature value includes temperature compensation and vibration compensation. The compensation algorithm dynamically adjusts the angle calculation parameters based on real-time sensor readings to eliminate the interference of environmental factors on the measurement results.
[0033] Constructing a virtual scanning model that includes standard scanning accuracy and standard scanning angle ranges requires establishing digital reference standards. The standard scanning accuracy range is derived from the technical specifications provided by the scanning equipment manufacturer, combined with the accuracy tolerance requirements defined in industry standards, to form closed intervals for minimum and maximum accuracy thresholds. The standard scanning angle range is derived from an optical model based on ideal scanning conditions. Considering the tolerance of barcode recognition algorithms to angular deviations, reasonable variation ranges for horizontal and vertical skew angles are set. The virtual scanning model is implemented using a parametric modeling method, storing the standard range values as a configurable parameter table, supporting the dynamic loading of corresponding standard range values based on different scanning equipment models.
[0034] The process of matching the scanning accuracy feature value with the standard scanning accuracy range employs a difference calculation method. This involves calculating the algebraic difference between the scanning accuracy feature value and the upper and lower boundaries of the standard scanning accuracy range, and taking the difference with the smaller absolute value as the matching analysis result. The matching analysis algorithm includes multi-level judgment logic. When the scanning accuracy feature value falls within the standard scanning accuracy range, the matching analysis result is marked as normal. When the scanning accuracy feature value exceeds the standard scanning accuracy range, it is recorded as a positive or negative deviation depending on the direction of the deviation, along with the specific numerical value of the deviation. The offset calculation of the scanning angle offset feature value with the standard scanning angle range uses a spherical geometry algorithm. This maps the two-dimensional angle offset to a unit spherical coordinate system, calculating the shortest arc distance between the actual angle and the boundary of the standard angle range as the offset.
[0035] To generate the scan feature value difference based on the matching analysis results and offset calculation results, a unified quantitative index system needs to be established. The calculation of the scan feature value difference adopts the weighted sum of squares method, which normalizes the matching analysis results and offset calculation results to the same dimension, multiplies them by the corresponding weighting coefficients, and then calculates the sum of squares. The weighting coefficients are determined based on the degree of influence of scanning parameters on barcode recognition accuracy. The weighting coefficient for scanning accuracy feature values is usually greater than the weighting coefficient for scanning angle offset feature values. The output format of the scan feature value difference is a dimensionless numerical value, and the magnitude of the value directly reflects the comprehensive deviation between the current state of the scanning device and the standard state.
[0036] The correlation between scan feature value differences and dynamic thresholds is established by creating a threshold mapping table. This table contains multiple scan feature value difference intervals, each corresponding to a dynamic threshold value. The dynamic threshold is calculated using a sliding window statistical method, analyzing the distribution characteristics of scan feature value differences in real time and dynamically adjusting the threshold based on the mean and standard deviation of the difference sequence. The update mechanism of the correlation mapping is synchronized with the usage frequency of the scanning equipment; when scanning operations are frequent, the statistical window size is automatically shortened to improve the sensitivity of threshold adjustment. When the scan feature value difference exceeds the upper limit of the dynamic threshold, the anti-copying parameter adjustment mechanism is triggered. The upper limit is set based on the percentile value of historical statistical data, typically taking the 95th percentile of the scan feature value difference distribution as the upper limit boundary. The triggering condition of the anti-copying parameter adjustment mechanism includes delayed judgment logic; only when the scan feature value difference exceeds the upper limit multiple times consecutively is it confirmed as a persistent abnormal state. The activation process of the adjustment mechanism includes preprocessing steps, including verifying the current working status of the scanning equipment to confirm that the abnormal difference is not caused by a temporary fault. When the difference in scanned feature values falls within the tolerance range of the dynamic threshold, the current anti-copying parameter configuration is maintained. The tolerance range is defined using a symmetrical distribution model, centered on the median of the dynamic threshold, expanding outwards to both sides with an equal width. The width of the tolerance range is dynamically adjusted according to the accuracy level of the scanning equipment; high-precision scanning equipment corresponds to a smaller tolerance range width, while ordinary-precision scanning equipment corresponds to a larger tolerance range width. While maintaining the current anti-copying parameter configuration, a monitoring and recording operation is performed to record the duration and fluctuation of the scanned feature value difference within the tolerance range, providing data support for subsequent adjustments to the dynamic threshold.
[0037] The extraction process of scanning accuracy feature values includes a device calibration step. This calibration step uses a standard accuracy test chart as a reference, calculating the actual accuracy correction coefficient of the scanning device by comparing the ratio of the scanning results to the known dimensions of the chart. The execution frequency of the calibration step is set according to the usage intensity of the scanning device; the calibration frequency is increased under high-intensity usage scenarios to ensure the accuracy of the scanning accuracy feature values. The calculation of scanning angle offset feature values integrates a multi-sensor data fusion algorithm, fusing measurement data from accelerometers, gyroscopes, and magnetometers, and employing a complementary filtering method to improve the stability and anti-interference capability of angle measurements. The parameterized storage of the virtual scanning model adopts a hierarchical data structure: the top layer stores the device model identifier, the middle layer stores standard range values, and the bottom layer stores version information and update timestamps. Access to model data is achieved through a unified interface, supporting both remote updates and local caching. The matching analysis algorithm presets different tolerance strategies for different types of scanning devices; industrial-grade scanning devices use strict matching standards, while commercial-grade scanning devices use relatively lenient matching standards.
[0038] The coordinate transformation in the offset calculation process uses quaternion representation to avoid the gimbal lock problem of Euler angle representation and improve the numerical stability of angle calculation. The weighted sum of squares calculation of scan feature value differences introduces an adaptive weight adjustment mechanism, automatically increasing the weight coefficient when a feature value is consistently abnormal, enhancing the problem-specificity of the difference representation. The sliding window statistical method for dynamic thresholds uses an exponentially weighted moving average algorithm, assigning higher weight to recent data, enabling the threshold to quickly track the changing trends of the scanning device status. The maintenance of the associated mapping relationship includes an anomaly handling mechanism; when a sudden change occurs in the scan feature value difference, the mapping relationship verification process is automatically initiated to prevent erroneous triggering of anti-copying parameter adjustments. The triggering setting of the anti-copying parameter adjustment mechanism includes a multi-level confirmation process, including difference verification, device status review, and historical data comparison, avoiding system oscillations caused by accidental triggering. The symmetrical distribution model of the tolerance interval supports asymmetrical adjustment; when the distribution of scan feature value differences becomes skewed, the center position of the interval is automatically adjusted to maintain the effectiveness of the tolerance interval.
[0039] The acquisition of scanning accuracy feature values synchronously records ambient light intensity data. When the ambient light intensity exceeds the set range, a light compensation algorithm is automatically activated to correct the impact of light changes on accuracy measurement. The measurement of scanning angle offset feature values is combined with barcode plane detection results, and a plane fitting algorithm is used to improve the accuracy of angle calculation. The standard range values of the virtual scanning model are periodically synchronized with the cloud-based standard database to ensure that the model data is consistent with the latest industry standards.
[0040] The matching analysis results are output using structured coding, incorporating multiple information dimensions such as status identifier, deviation direction, and deviation degree. Offset calculation results are stored in a time-series database, supporting trend analysis and pattern recognition of historical offset data. The calculation process for the difference in scanned feature values includes data validity checks; when input data is missing or abnormal, a data repair procedure is automatically activated, using nearest neighbor interpolation to fill in missing values.
[0041] The dynamic threshold update algorithm includes a smoothing process, employing a Kalman filter to eliminate random fluctuations during the threshold update process. Query optimization for relational mappings utilizes hash indexing technology to improve query efficiency when dealing with a large number of mapping records. The anti-copying parameter adjustment mechanism includes a manual overwrite function for trigger settings, allowing operators to manually intervene in the activation conditions of the adjustment mechanism under special circumstances.
[0042] Monitoring data within the tolerance range is stored using a circular buffer. When the buffer is full, it automatically overwrites the oldest data, maintaining efficient use of storage space. The entire scan parameter data processing flow runs in a dedicated embedded processor, communicating with the main control system via a high-speed data bus to ensure the real-time performance and reliability of parameter processing. The various modules in the processing flow employ a loosely coupled design, supporting independent module upgrades and replacements, thus improving the ease of system maintenance.
[0043] Example 3: The calculation process of anti-copying feature values involves acquiring the texture details and color gradient features of the barcode's microstructure through high-frequency image sampling. High-frequency image sampling uses a linear CMOS sensor to capture barcode surface images at a rate of 2000 frames per second, covering the entire barcode area with each sampling point having a resolution of 5 micrometers × 5 micrometers. Texture detail feature extraction targets the grayscale distribution characteristics of the barcode surface microstructure, while color gradient feature acquisition analyzes the continuous variation pattern of the barcode pattern in the RGB color space. During high-frequency image sampling, environmental temperature and humidity parameters are recorded simultaneously, and a correspondence table between the sampling data and environmental parameters is established for subsequent feature correction.
[0044] A Gaussian pyramid image representation is constructed by employing a multi-scale feature extraction algorithm to analyze texture detail features. The barcode image is sequentially half-sampled to generate image sequences at multiple scales. At each scale level, a local binary pattern histogram is calculated, and the distribution probability of texture directions is statistically analyzed. The quantification of pattern complexity levels is achieved by calculating image information entropy, using the following formula: Where E represents the pattern complexity level. Let represent the probability of the i-th gray level appearing in the image, and n represent the total number of gray levels. Texture distribution density is measured using morphological processing methods, applying structuring elements of different sizes to dilate the binarized image and counting the number of texture elements per unit area.
[0045] The image is converted to the CIELAB uniform color space using a pixel-level analysis method to process color gradient features. Color difference values between adjacent pixels are calculated in each of the Lab* components. Color transition smoothness is evaluated by calculating the average magnitude of the color gradient vector, and the color difference between the center pixel and its surrounding pixels is calculated within an 8-connected neighborhood. The coefficient of variation (COP) is obtained using statistical methods, calculating the COP of all pixel color difference values within the barcode area, which is the ratio of the standard deviation to the mean of the color difference values.
[0046] A feature normalization process is established to generate anti-copying feature values by weighted fusion of pattern complexity level, texture distribution density, color transition smoothness, and color difference coefficient of variation. The four feature values are mapped to the [0,1] interval. The weighting coefficients are determined through feature importance evaluation: the weighting coefficient for pattern complexity level is set to 0.3, for texture distribution density to 0.25, for color transition smoothness to 0.25, and for color difference coefficient of variation to 0.2. The weighted fusion calculation uses a linear weighted summation formula, and the output result is multiplied by 1000 and rounded to the nearest integer to generate the final anti-copying feature value.
[0047] The high-frequency image sampling hardware configuration employs a specialized optical system, including a coaxial illumination device and polarizing filters, to eliminate interference from surface reflections on the sampling process. The driving timing of the linear CMOS sensor is synchronized with the movement of the inkjet printhead, ensuring spatiotemporal consistency between the sampled image and the printed pattern. Preprocessing of the sampled data includes dark field correction and flat field correction; dark field correction eliminates the sensor's background noise, and flat field correction compensates for illumination inhomogeneities.
[0048] The analysis of texture detail features employs a multi-channel processing strategy, extracting texture features in the horizontal, vertical, and diagonal directions respectively. The calculation of local binary patterns uses a circular neighborhood template, supporting flexible configuration of different radii and sampling points. The calculation of pattern complexity levels incorporates spatial distribution considerations, dividing the image into multiple sub-regions, calculating the information entropy for each sub-region, and then statistically analyzing the dispersion of the information entropy in each sub-region.
[0049] The processing of color gradient features incorporates a human visual system model, adjusting the weighting coefficients of color difference calculation based on the CIE color matching function. The evaluation of color transition smoothness includes directional analysis, calculating color gradients in both the horizontal and vertical directions to identify anisotropic transition characteristics. The calculation of the color difference coefficient of variation employs a sliding window method, moving the calculation window across the entire image to obtain a distribution map of the color difference coefficient of variation.
[0050] The feature normalization process employs an improved min-max normalization method, setting a dynamic normalization range to avoid the influence of extreme values. The determination of weight coefficients is verified using principal component analysis to ensure that the weight allocation is consistent with the feature variance contribution rate. A consistency check is added to the weighted fusion calculation; when a feature value deviates abnormally, a backup weight scheme is automatically activated.
[0051] The output format of the anti-copying feature value is designed as a 32-bit integer, with the high 16 bits storing the basic feature value and the low 16 bits storing the verification information. The time performance of the feature value calculation process has been optimized, adopting a parallel pipeline architecture, with image sampling, feature extraction, and fusion calculation steps being executed in an overlapping manner.
[0052] The number of pyramid layers for multi-scale feature extraction is adaptively determined based on the image size, with the maximum number of layers ensuring that the top layer image is no smaller than 16×16 pixels. The statistical analysis of the local binary pattern histogram uses uniform pattern encoding, merging 256 original patterns into 59 uniform patterns to reduce feature dimensionality. The calculation of pattern complexity levels incorporates multi-resolution analysis, calculating information entropy at different scales and weighted summation.
[0053] The memory access pattern for pixel-level color analysis has been optimized, employing row-block caching technology to improve data locality. Color gradient calculation uses Sobel operator convolution to calculate the gradient values of the L, a, and b* components separately. Statistical analysis of the color difference coefficient of variation excludes edge regions, focusing on the color stability assessment of the barcode's internal regions.
[0054] The dynamic range of feature normalization is adjusted based on historical data, and the normalization parameters are updated weekly. Weight coefficients are stored in non-volatile memory to prevent data loss in case of power failure. Overflow protection is added to the weighted fusion calculation, automatically scaling the result when it exceeds the specified range.
[0055] The verification information for the anti-copying feature value is calculated using a cyclic redundancy check (CRC) code to ensure the integrity of the feature value transmission. Resource usage throughout the entire calculation process is monitored in real time, and garbage collection is automatically initiated when memory usage exceeds a threshold.
[0056] The trigger signal for high-frequency image sampling is synchronized with the printing completion signal to ensure accurate acquisition timing. Extraction of texture detail features enhances quality assessment; re-acquisition occurs when image blur exceeds a threshold. Color gradient feature acquisition is performed under standard lighting conditions, using a D65 standard light source as a reference.
[0057] The scale factor for multi-scale feature extraction adopts a square root of 2 to maintain the continuity of scale changes. Rotation invariance is improved in the calculation of local binary patterns, and the minimum uniform pattern value is used to enhance robustness. A 256-level grayscale histogram is used to calculate the information entropy of the pattern complexity level to ensure computational accuracy.
[0058] Pixel-level color analysis utilizes a lookup table method for accelerated color space conversion, with the conversion table pre-calculated and stored in memory. The evaluation of color transition smoothness incorporates a local adaptive threshold to avoid false positives due to noise. The color difference coefficient of variation is calculated using an unbiased estimate, with Bessel correction applied to calculate the standard deviation.
[0059] The parameter updates for feature normalization are performed incrementally to avoid abrupt parameter changes that could affect system stability. Weight coefficients are validated monthly to ensure the rationality of weight allocation. Intermediate results for weighted fusion calculations are obtained using double-precision floating-point numbers to avoid accumulating computational errors.
[0060] The storage of copy-protected feature values utilizes a distributed database, supporting multi-node backup and fast retrieval. The fault tolerance mechanism for the computation process includes anomaly detection and automatic recovery, automatically switching to a backup module when one computation module fails.
[0061] Lossless compression algorithms are used for high-frequency image sampling data compression to reduce storage space usage. Texture detail feature extraction incorporates multimodal fusion, combining grayscale and gradient features. Color gradient feature analysis includes temporal tracking to compare color change patterns between consecutive frames.
[0062] The pyramid generation for multi-scale feature extraction uses Gaussian kernel convolution, with standard deviation increasing according to scale level. Statistical analysis of local binary pattern histograms employs block-based processing to enhance spatial location information. The evaluation of pattern complexity levels incorporates frequency domain analysis, combining spatial and frequency domain features.
[0063] The sampling interval for pixel-level color analysis is optimized by increasing the sampling density in areas of rapid color change. Curve fitting is incorporated into the calculation of color transition smoothness, using a quadratic function to evaluate transition continuity. Robust statistical methods are employed for the color difference coefficient of variation, using the median absolute deviation instead of the standard deviation.
[0064] The range of feature normalization is defined based on statistical quantiles to avoid the influence of outliers. The dynamic adjustment mechanism of weight coefficients takes into account the correlation between features and uses the covariance matrix to optimize weight allocation. The parallelization of weighted fusion calculation is implemented using the SIMD instruction set to improve computational efficiency.
[0065] The transmission of anti-copying signatures employs an encryption protocol to prevent data theft or tampering. The entire computing system's energy management utilizes dynamic voltage and frequency adjustment, regulating power consumption based on the computing load.
[0066] Example 4: When no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, constructing a multi-dimensional feature space for the anti-copying feature value requires defining the mathematical representation of the feature vector. Each anti-copying feature value consists of a four-dimensional vector composed of four components: pattern complexity level, texture distribution density, color transition smoothness, and color difference variation coefficient. The coordinate system of the multi-dimensional feature space uses these four feature components as an orthogonal basis, and each point in the space corresponds to a historical anti-copying feature data record. The construction process of the multi-dimensional feature space includes data standardization, which normalizes feature components with different dimensions to the same numerical range, eliminating the influence of feature scale differences on spatial distance calculation. Nearest neighbor search in the feature space is performed in the historical database using an improved kd-tree index structure. The kd-tree is constructed using the standardized feature vector as input data, and a binary search tree is formed by recursively partitioning the feature space. The nearest neighbor search algorithm uses a priority queue to manage candidate nodes, calculates the distance between the query point and the hyperplane of the kd-tree node, and prioritizes searching subspaces that may contain nearest neighbors. The feature distance is calculated using a weighted Euclidean distance formula, and the weight of each feature component is dynamically adjusted according to its importance in anti-copying judgment. If a matching record exists with a feature distance less than a threshold, the adjusted parameters of that matching record are used as the benchmark. The threshold is set based on the statistical distribution characteristics of the feature values, taking the fifth percentile of the historical feature distance distribution as the initial threshold. The matching record search employs a two-way verification mechanism, requiring both that the feature distance be less than the threshold and that the timestamp difference between the matching and query records be within a reasonable range. The adjustment parameter selection process includes parameter smoothing, calculating a moving average of the adjusted parameters for multiple matching records to eliminate interference from parameter abrupt changes. If multiple matching records exist, the cluster centers of the adjusted parameters for these matching records are calculated. The k-means clustering algorithm is used to divide the matching records into multiple clusters according to their density distribution in the feature space. The cluster center of each cluster is obtained by calculating the arithmetic mean of the adjusted parameters of all records within the cluster. The number of clusters is determined using the elbow rule, finding the inflection point of the sum of squared errors curve within each cluster. The validity of the cluster centers is verified through silhouette coefficient analysis to evaluate the compactness and separation of each cluster. If no matching record exists, feature space interpolation is initiated to generate new adjustment parameters. The interpolation calculation is based on a radial basis function (RBF) network model, using historical feature values as input nodes and the corresponding adjustment parameters as output nodes. The RBF network learning process uses orthogonal least squares to determine network weights, and the activation function of the hidden layers is a Gaussian kernel function. The generation of new adjustment parameters includes uncertainty assessment, calculating the standard error of the interpolation results. When the error exceeds a warning value, a manual review process is initiated. The application of cluster center values is based on the distribution density of cluster center values in the feature space, classifying adjustment levels. The distribution density is calculated using kernel density estimation, constructing a high-dimensional sphere with each cluster center as the center and a fixed radius, and counting the number of data points within the sphere.The adjustment levels are divided using a ternary method, sorting the distribution density values by size and dividing them into three equal intervals, corresponding to high-density, medium-density, and low-density regions. When the cluster center value is in the high-density region, a gradual adjustment strategy is adopted, with a small parameter update step size, changing only 5% to 10% of the current parameter in each adjustment. The adjustment direction of the gradual adjustment strategy is based on trend analysis of historical adjustment records, using a linear regression model to predict the optimal adjustment direction. The execution cycle of the gradual adjustment strategy is set to a fixed time interval to avoid excessively frequent parameter changes. When the cluster center value is in the medium-density region, a segmented adjustment strategy is adopted, dividing the adjustment process into a preparation phase, a transition phase, and a stabilization phase. In the preparation phase, parameter sensitivity analysis is performed to determine the range of variation for each adjustment parameter. In the transition phase, different adjustment step sizes are used, initially using larger step sizes to quickly approach the target value, and later using smaller step sizes for fine-tuning. In the stabilization phase, parameter changes are locked, allowing only minor fluctuations. When cluster centers are located in low-density regions, an adaptive adjustment strategy is employed. The adjustment step size of this strategy is negatively correlated with the distribution density; the lower the density, the larger the step size. A genetic algorithm is used to explore the direction of the adaptive adjustment strategy, generating multiple candidate adjustment schemes for parallel evaluation, and selecting the optimal scheme for implementation. The evaluation cycle of the adaptive adjustment strategy is dynamically adjusted, with a higher evaluation frequency for lower densities. The table below shows the correspondence between adjustment levels and adjustment strategies:
[0067] The radius of the high-dimensional sphere used for density calculation was determined through cross-validation, and the impact of different radius values on the adjustment effect was tested on historical datasets. The Epanechnikov kernel was chosen as the kernel function for kernel density estimation, as it is continuously differentiable at the boundaries and suitable for density estimation. The interval boundaries of the ternary method were dynamically adjusted according to the data distribution to ensure that each interval contained a sufficient number of sample points. The small step size design of the incremental adjustment strategy prevented system oscillations, and the effect was evaluated after each adjustment; only after confirming the effectiveness of the adjustment did the next adjustment proceed. Trend analysis of the incremental adjustment strategy used a time series forecasting algorithm, considering the seasonal and periodic characteristics of parameter changes. The fixed time interval of the incremental adjustment strategy was synchronized with the equipment operating cycle to avoid conflicts with equipment maintenance time. The three-stage division of the segmented adjustment strategy was based on parameter convergence characteristics: the preparation stage accounted for 20% of the total adjustment time, the transition stage for 50%, and the stabilization stage for 30%. The step size of the segmented adjustment strategy adopted an exponential decay model, with each step size being 0.9 times the previous step size. The segmented adjustment strategy's parameter locking mechanism includes anomaly unlocking conditions, automatically unlocking when environmental parameters mutate. The adaptive adjustment strategy's genetic algorithm population is set to fifty individuals, each representing a set of adjustment parameters. The genetic algorithm's fitness function comprehensively considers anti-copying effectiveness and system stability, assigning 70% weight to anti-copying effectiveness and 30% weight to system stability. The adaptive adjustment strategy's high evaluation frequency configuration supports real-time response, and the evaluation process uses a lightweight detection algorithm to reduce system load. The density interval boundaries for adjustment level divisions are recalculated weekly to adapt to changes in data distribution. The bandwidth parameter for kernel density estimation is automatically calculated according to Scott's rule to ensure unbiased density estimation. The ternary method is implemented using a fast selection algorithm to improve computational efficiency in large sample cases. The small step size values for the incremental adjustment strategy are stored in a configuration file and can be modified online. The linear regression model for trend analysis is retrained monthly, updating the regression coefficients. The fixed-time interval adjustment strategy is associated with the equipment operation log to avoid adjustments during equipment failures. The stage division ratio of the segmented adjustment strategy is adjusted according to equipment type, with extended transition phase time for high-precision equipment. The decay factor of the exponential decay model is configurable to adapt to different convergence requirements. Anomaly detection using a parameter-locking mechanism employs multi-sensor data fusion to improve detection accuracy.
[0068] The adaptive adjustment strategy uses a genetic algorithm with a crossover rate of 0.8 and a mutation rate of 0.1. The weight coefficients of the fitness function are dynamically adjusted based on business needs. The lightweight detection algorithm's execution time is controlled in milliseconds, ensuring no impact on system real-time performance. Cross-validation for distribution density calculation employs 10-fold cross-validation, randomly dividing historical data into ten parts, using nine parts for training and one for testing in rotation. Linear interpolation is used for interval boundary adjustment in the ternary method to ensure smooth boundary changes. The effectiveness evaluation of the progressive adjustment strategy uses hypothesis testing to compare the difference in anti-copying success rate before and after adjustment. Time series prediction for trend analysis includes residual analysis to detect model goodness of fit. The fixed-time-interval adjustment strategy supports manual pause functionality for easy equipment maintenance. The parameter sensitivity analysis of the segmented adjustment strategy uses Sobol sequence sampling for efficient exploration of the parameter space. The lower limit of the step size for the exponential decay model is set to 1%, avoiding slow convergence due to excessively small step sizes. The unlocking conditions for the parameter locking mechanism include multiple environmental parameter thresholds such as temperature, humidity, and vibration. The genetic algorithm's elite retention strategy in the adaptive adjustment strategy retains the five best individuals from each generation. The anti-copying effect of the fitness function is quantified through simulated attack tests, and system stability is evaluated by the magnitude of parameter fluctuations. Resource monitoring of the lightweight detection algorithm includes CPU utilization and memory usage detection. The entire process of adjusting levels and selecting strategies runs within a decision engine, which employs a modular design to support flexible expansion of adjustment strategies. The decision engine's input interface receives feature space data and cluster center values, while its output interface sends adjustment strategy instructions. The decision engine's execution log records detailed parameters for each decision, used for subsequent analysis and optimization.
[0069] See Figure 2 This figure focuses on the performance of parameter adjustment strategies in machine barcode anti-copying technology. The horizontal axis represents the feature space distribution density, while the vertical axis presents two core indicators: average step size and adjustment success rate. In the technical logic, the average step size reflects the aggressiveness of parameter adjustment; a larger step size results in a more significant adjustment, while a smaller step size leads to more refined adjustments. The adjustment success rate measures the effectiveness of the strategy in a corresponding density scenario. In low-density areas, due to sparse historical data, an adaptive adjustment strategy is adopted, using large step sizes to quickly explore the parameter space and adapt to new scenarios while ensuring a certain success rate. In medium-density areas, with moderate data, a segmented adjustment strategy is adopted, with moderate step sizes and improved success rate through phased adjustments. In high-density areas, with abundant data, a gradual adjustment strategy is adopted, using small step sizes to finely optimize parameters, thus achieving the highest success rate. This performance demonstrates the adaptability of strategy to data density: by dynamically adjusting the step size and strategy type, the efficiency and reliability of adjustment are balanced under different feature space densities. This provides a quantitative decision basis for the intelligent adjustment of anti-copying parameters of machine barcodes based on historical databases, ensuring that the system can efficiently optimize anti-copying parameters in both sparse and dense data scenarios, thereby improving the anti-copying capability of barcodes.
[0070] Example 5: Feature Space Interpolation Calculation Process. A Delaunay triangular mesh for anti-copying feature values is established in the feature space. The anti-copying feature values consist of four dimensions: pattern complexity level, texture distribution density, color transition smoothness, and color difference variation coefficient. The construction of the Delaunay triangular mesh maps each historical anti-copying feature data point to a mesh vertex, and connects these vertices using a triangulation algorithm to form a series of non-overlapping triangular units. The construction process selects uniformly distributed feature values from the historical database as mesh vertices. The uniformity of distribution is evaluated using the minimum distance maximization principle, ensuring that the Euclidean distance between any two vertices is greater than a preset threshold, thus avoiding excessively dense vertices that could lead to mesh distortion.
[0071] The vertex selection algorithm iteratively scans the feature value records in the historical database, calculates the minimum distance between each candidate vertex and the selected vertices, and prioritizes adding the vertex with the largest distance to the vertex set until the number of vertices reaches the target value or covers the entire feature space. The optimality of the triangular mesh is ensured by the empty circle criterion, which requires that the circumcircle of each triangle does not contain any other vertices. The verification process uses an incremental flipping algorithm. After the initial triangulation, the circumcircle of each triangle is checked. If a triangle violating the empty circle criterion is found, its shared edges are flipped and adjacent triangles are reconnected until all triangles satisfy the empty circle condition. The computational optimization of the empty circle criterion verification adopts a local search strategy, checking only the triangular regions around newly added vertices to reduce the computational overhead of global verification. The convergence of the verification algorithm is guaranteed by monitoring the number of flips, and a maximum number of iterations is set to prevent infinite loops. A topological connection relationship between feature values and mesh vertices is established to form the basic framework for interpolation calculations. The topological connection relationship is stored using a half-edge data structure, where each triangle records the indices of three vertices and pointers to adjacent triangles, facilitating fast traversal and querying. The construction of topological connections employs a triangulation algorithm, such as the Bowyer-Watson algorithm, inserting vertices point by point and updating the triangular mesh while maintaining the Delaunay property of the mesh. Verification of topological connections includes integrity checks, ensuring that each edge is shared by two triangles and that there are no isolated edges or overlapping triangles. The centroid coordinate weights of the eigenvalues to be processed and the mesh vertices are calculated. These centroid coordinate weights represent the relative position of the point to be processed within its triangle. The calculation process solves a system of linear equations, representing the coordinates of the point to be processed as a linear combination of the coordinates of the triangle vertices, with the weight coefficients summing to 1. The calculation of the centroid coordinate weights uses the area ratio method, connecting the point to be processed to the triangle vertices to form three sub-triangles. The ratio of the area of each sub-triangle to the area of the original triangle is the weight of the corresponding vertex. Weight calculation includes numerical stability handling, automatically switching to nearest-neighbor interpolation when a triangle degenerates or is close to degenerate. New adjustment parameters are generated by linear interpolation of historical adjustment parameters based on the weight coefficients. Linear interpolation multiplies the historical adjustment parameters of each vertex by its corresponding weight coefficient and sums the results to obtain an estimate of the new adjustment parameters. The adjustment parameters include multiple components such as the baseline contrast parameter, width tolerance parameter, and color gamut protection parameter, each of which is interpolated independently. The linear interpolation process incorporates boundary handling; when the point to be processed is located at the feature space boundary, virtual vertices are automatically expanded to avoid extrapolation errors.
[0072] The Delaunay triangular mesh dynamic update mechanism periodically checks for new records in the historical database. When the number of new eigenvalues reaches a threshold, mesh reconstruction is triggered, vertices are reselected, and the triangular mesh is updated. The trigger condition for mesh reconstruction is based on the data density change in the feature space, calculating the average distance between new points and existing meshes. When the distance exceeds the threshold, reconstruction is initiated. The dynamic update process uses an incremental algorithm, updating only the affected local regions, reducing the frequency of global reconstruction. The calculation of barycentric coordinate weights is optimized using the vector cross product formula, avoiding explicit solution of linear equations and improving computational efficiency. The vector cross product formula is based on triangle area calculation, directly deriving the weight coefficients. Precision control of weight calculation uses double-precision floating-point arithmetic to prevent the accumulation of rounding errors. Range checks of weight coefficients ensure that each weight is between 0 and 1; otherwise, it is corrected to the nearest vertex. Parameter smoothing for linear interpolation applies a moving average filter to post-process the interpolation results, eliminating abnormal fluctuations. The window size of the moving average filter is adjusted according to the historical variability of the parameters; the greater the variability, the smaller the window. Parameter smoothing is performed immediately after interpolation calculation to avoid delays. The vertex count configuration of the Delaunay triangulation mesh is determined based on the dimension of the feature space. For a four-dimensional feature space, a vertex count between 50 and 100 is recommended to balance mesh accuracy and computational complexity. An automatic vertex count adjustment algorithm monitors interpolation errors; it increases the vertex count when the error remains consistently high and decreases it when the error is low.
[0073] Vertex distribution optimization employs the Lloyd relaxation algorithm, iteratively adjusting vertex positions to achieve a more uniform mesh. Acceleration techniques for the empty circle criterion check utilize spatial index structures, such as quadtrees or octrees, to quickly locate triangles that may violate the criterion. The construction of the spatial index is synchronized with the triangular mesh update, maintaining the consistency of spatial partitioning. Parallelization of the check process leverages multi-core processors, simultaneously checking multiple triangles to improve check speed. Persistent storage of topological connectivity relationships uses a custom binary format containing vertex lists, triangle lists, and adjacency information, supporting fast loading and saving. Version management of the persistent format allows for backward compatibility, enabling upgrades from older mesh versions to the new format. Integrity verification of topological connectivity is performed on each load, automatically repairing corrupted data. Anomaly handling for barycentric coordinate weights detects triangle degradation; when three vertices are collinear or nearly collinear, weight calculation falls back to nearest-neighbor interpolation. Degradation detection is achieved by calculating the triangle area; anomaly handling is triggered when the area is less than a threshold. Detailed parameters are logged for anomaly handling for subsequent analysis. Multi-parameter coordination of linear interpolation considers the correlation between parameters, using multivariate interpolation methods to maintain these relationships. Multivariate interpolation is based on the covariance matrix of eigenvalues, adjusting interpolation weights to reflect parameter dependencies. Verification of multi-parameter coordination is performed through simulation testing to check the rationality of parameter combinations. The Deloitte triangulation visualization tool supports real-time monitoring of the mesh status, visually displaying vertex distribution and triangle shapes. The visualization tool integrates debugging functions, allowing interactive modification of mesh parameters. A mesh monitoring alarm system notifies the administrator when abnormal meshes are detected. A caching mechanism for barycentric coordinate weights stores recently calculated weight values, avoiding duplicate calculations of weights for the same points. The cache size is limited using an LRU eviction policy to maintain memory efficiency. Cache consistency is maintained synchronously with mesh updates, clearing the cache when the mesh changes. Error estimation for linear interpolation calculates the uncertainty of the interpolation results, using a Kriging variance model to estimate the error range. The error estimate output is appended to the adjustment parameters for subsequent decision-making. An error range threshold setting triggers manual review; automatic adjustment is paused when the error is too large. The Deloitte triangulation construction algorithm compares various triangulation methods, such as divide-and-conquer or incremental algorithms, selecting the optimal algorithm based on the data scale. The algorithm's performance is tested by measuring build time and mesh quality to ensure real-time requirements are met. Resource management during the build process monitors memory and CPU usage to prevent resource exhaustion. The robustness of the empty circle criterion is addressed by handling numerical precision issues and using a high-precision arithmetic library to avoid floating-point errors. Robustness-enhancing tests cover extreme cases, such as concurrent or ultra-thin triangles. The algorithm's fault tolerance is tested to allow for a small number of triangles violating the criterion, but this is logged.
[0074] The query interface for topological connectivity provides fast point location functionality, finding the triangle containing a given point. The point location algorithm uses a walking algorithm or grid indexing to optimize the query path. Concurrency support in the query interface allows multiple threads to access the grid simultaneously. The extended application of barycentric coordinate weights supports high-dimensional feature spaces, using generalized barycentric coordinates to handle non-triangular elements. The mathematical foundation of the high-dimensional extension is based on simplex geometry, with similar weight calculations. The complexity of the extended implementation is controlled to limit the dimension to no more than 10. Adaptive adjustment of linear interpolation adjusts the interpolation strategy based on interpolation history, such as switching to nonlinear interpolation. The adaptive adjustment decision is based on statistical learning of interpolation errors, with the error model trained to predict the optimal strategy. Smooth transitions in the adjustment strategy avoid abrupt changes. Distributed construction of the Delaunay triangular mesh supports large-scale historical databases, partitioning the feature space and constructing sub-mesh in parallel. A coordinator for distributed construction manages the merging of sub-mesh, ensuring global consistency. Conflict resolution during the merging process handles boundary inconsistencies. Incremental updates for the empty circle criterion test only examine the local area affected by newly added points, reducing the testing scope. The trigger for incremental updates is a point addition event, immediately executing the test. Differential updates of test results only modify the changed parts. Compressed storage of topological connectivity reduces storage space by using differential encoding to compress adjacency information. Decompression speed optimization of the compression algorithm supports fast loading. Storage efficiency is regularly reported by monitoring the compression ratio. Approximate calculation of barycentric coordinate weights uses simplified formulas, sacrificing accuracy for speed, when real-time requirements are high. Error analysis of approximate calculations ensures errors are within acceptable limits. Switching between approximation methods is based on computational load. Post-processing optimization of linear interpolation uses machine learning models to correct interpolation biases; the model is trained on historical interpolation data. The post-processing model learns online to adapt to changes in data distribution. The frequency of model updates is adjusted based on performance degradation. The construction of the Delaunay triangular mesh and interpolation calculations are integrated into an anti-copy parameter adjustment system. The system workflow is pipelined from eigenvalue input to parameter adjustment output. Modular design of system components allows for independent upgrades and maintenance. System performance benchmarking is performed regularly to ensure processing latency requirements are met. Detailed operation records are logged throughout the entire interpolation calculation process, supporting auditing and debugging.
[0075] See Figure 3This figure focuses on the key performance indicators of feature space interpolation calculation in machine barcode anti-copying technology. The horizontal axis shows four typical interpolation methods: linear interpolation, triangular mesh interpolation, radial basis function interpolation, and nearest neighbor interpolation. The left vertical axis represents the interpolation error rate, reflecting the degree of deviation between the interpolation result and the true value, which directly affects the accuracy of anti-copying parameter adjustment. The right vertical axis represents the computation time, reflecting the real-time performance of the method and relating to the system response efficiency in high-speed inkjet printing scenarios. In the practical application of machine barcode anti-copying, these indicators are crucial: the interpolation error rate determines the reliability of anti-copying parameter adjustment; excessively high errors can easily lead to a decrease in barcode anti-counterfeiting capabilities; computation time constrains the real-time performance of the system in high-speed printing scenarios, and exceeding the time limit will affect production efficiency. This figure clearly shows the balance between accuracy and speed of different interpolation methods, providing a basis for decision-making in technology implementation. If high accuracy is desired, triangular grid interpolation can be given priority. If real-time performance is emphasized, nearest neighbor interpolation can be considered. Linear interpolation is a general solution that takes both into account. Ultimately, it helps the system to ensure the barcode's anti-copying capability while meeting the efficiency requirements of industrial production when dynamically adjusting anti-copying parameters.
[0076] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for preventing machine barcode duplication in inkjet equipment, characterized in that, include: Collect barcode image data of machine barcodes printed by inkjet equipment, and determine initial anti-copying parameters based on the barcode image data; Collect scanning parameter data of the scanning device used to scan the machine barcode, and determine whether to adjust the initial anti-copying parameters based on the scanning parameter data; When it is determined that the initial anti-copying parameters need to be adjusted, detailed image data of all barcode areas of the machine barcode are collected, and anti-copying feature data is obtained by feature extraction from the detailed image data. Anti-copying feature value of each barcode area is calculated based on the anti-copying feature data. All anti-copying feature values are compared with historical anti-copying feature data in the historical database, and the initial anti-copying parameters are adjusted based on the comparison results to obtain the adjusted anti-copying parameters. When no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, the similarity between all anti-copying feature values and historical anti-copying feature data is calculated, and the initial anti-copying parameters are adjusted according to the similarity.
2. The method for preventing machine barcode duplication in inkjet equipment according to claim 1, characterized in that, The process of determining the initial anti-copying parameters includes: The system acquires the barcode contrast characteristics, barcode width fluctuation characteristics, and barcode color saturation characteristics of the machine barcode in real time; it generates a baseline contrast parameter based on the barcode contrast characteristics, a width tolerance parameter based on the barcode width fluctuation characteristics, and a color gamut protection parameter based on the barcode color saturation characteristics; and it dynamically fuses the baseline contrast parameter, width tolerance parameter, and color gamut protection parameter to generate the initial anti-copying parameters.
3. The method for preventing machine barcode duplication in inkjet equipment according to claim 1, characterized in that, The processing of the scan parameter data includes: Extract the scanning accuracy feature value and scanning angle offset feature value of the scanning device; construct a virtual scanning model that includes the standard scanning accuracy range and the standard scanning angle range; perform matching analysis between the scanning accuracy feature value and the standard scanning accuracy range, and calculate the offset between the scanning angle offset feature value and the standard scanning angle range; generate the scanning feature value difference based on the matching analysis result and the offset calculation result.
4. The method for preventing machine barcode duplication in inkjet equipment according to claim 3, characterized in that, The step of determining whether to adjust the initial anti-copying parameters based on the scan parameter data includes: Establish a mapping relationship between the difference in scan feature values and the dynamic threshold; when the difference in scan feature values exceeds the upper limit of the dynamic threshold, trigger the anti-copying parameter adjustment mechanism; when the difference in scan feature values is within the tolerance range of the dynamic threshold, maintain the current anti-copying parameter configuration.
5. The method for preventing machine barcode duplication in inkjet equipment according to claim 1, characterized in that, The calculation process for the anti-copying feature value includes: The texture details and color gradient features of the barcode micro-pattern are obtained by high-frequency image sampling; the texture details are analyzed by multi-scale feature extraction algorithm to obtain the pattern complexity level and texture distribution density; the color gradient features are processed by pixel-level analysis method to obtain the color transition smoothness and color difference variation coefficient; the pattern complexity level, texture distribution density, color transition smoothness and color difference variation coefficient are weighted and fused to generate anti-copying feature values.
6. The method for preventing machine barcode duplication in inkjet equipment according to claim 1, characterized in that, When no historical anti-copying feature data with the same anti-copying feature value exists in the historical database, the similarity between all anti-copying feature values and historical anti-copying feature data is calculated, and the initial anti-copying parameters are adjusted based on the similarity, including: Construct a multidimensional feature space for anti-copying feature values; perform a nearest neighbor search in the feature space in the historical database. If a matching record with a feature distance less than a threshold exists, use the adjustment parameters of that record as the benchmark; if multiple matching records exist, calculate the cluster center values of the adjustment parameters of these matching records; if no matching record exists, start feature space interpolation to generate new adjustment parameters.
7. The method for preventing machine barcode duplication in inkjet equipment according to claim 6, characterized in that, The application process of the cluster center value includes: The adjustment levels are determined based on the distribution density of cluster center values in the feature space; a gradual adjustment strategy is adopted when the cluster center values are in a high-density region; a segmented adjustment strategy is adopted when the cluster center values are in a medium-density region; and an adaptive adjustment strategy is adopted when the cluster center values are in a low-density region.
8. The method for preventing machine barcode duplication in inkjet equipment according to claim 6, characterized in that, The feature space interpolation calculation process includes: Establish a Delaunay triangular mesh in the feature space to prevent the duplication of eigenvalues; calculate the centroid coordinate weights of the eigenvalues to be processed and the mesh vertices; perform linear interpolation on the historical adjustment parameters based on the weight coefficients to generate new adjustment parameters; The construction process of the Delon triangular mesh includes: Uniformly distributed eigenvalues from the historical database are selected as grid vertices; the optimality of the triangular grid is ensured by checking the empty circle criterion; and the topological connection relationship between eigenvalues and grid vertices is established to form the basic framework for interpolation calculation.
9. A machine barcode anti-copying system for inkjet equipment, used to implement the machine barcode anti-copying method for inkjet equipment as described in any one of claims 1 to 8, characterized in that, include: The data acquisition module is used to acquire barcode image data of machine barcodes printed by inkjet equipment and scanning parameter data of scanning equipment used to scan the machine barcodes; An initial parameter determination module is used to determine initial anti-copying parameters based on the barcode image data; The judgment module is used to determine whether to adjust the initial anti-copying parameters based on the scan parameter data; The feature extraction module is used to collect detailed image data of all barcode areas of the machine barcode when the judgment module determines that the initial anti-copying parameters should be adjusted, and to extract features from the detailed image data to obtain anti-copying feature data. The calculation module is used to calculate the anti-copying feature value of each barcode area based on the anti-copying feature data; The historical database is used to store historical anti-copying feature data; The comparison module is used to compare all anti-copying feature values with the historical anti-copying feature data in the historical database. The parameter adjustment module is used to adjust the initial anti-copying parameters according to the comparison results of the comparison module, so as to obtain the adjusted anti-copying parameters; When there is no historical anti-copying feature data with the same anti-copying feature value in the historical database, the parameter adjustment module calculates the similarity between all anti-copying feature values and historical anti-copying feature data, and adjusts the initial anti-copying parameters according to the similarity.
10. A machine barcode anti-copying device for inkjet equipment, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for preventing machine barcode copying for inkjet equipment as described in any one of claims 1 to 8.