Grease production quality traceability method, system, and storage medium

By constructing a fingerprint feature vector of lubricating grease and a noise mask of the production process, and using chaotic mapping and Hilbert curve encryption to embed the production process features into the QR code, the problem of QR codes being easily cracked and copied in existing technologies is solved, and a highly secure anti-counterfeiting and traceability system for lubricating grease is achieved.

CN122175608APending Publication Date: 2026-06-09PUYANG XINYE SPECIAL LUBRICATING OIL & GREASE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PUYANG XINYE SPECIAL LUBRICATING OIL & GREASE CO LTD
Filing Date
2026-03-30
Publication Date
2026-06-09

Smart Images

  • Figure CN122175608A_ABST
    Figure CN122175608A_ABST
Patent Text Reader

Abstract

This invention relates to the field of quality traceability, specifically a method, system, and storage medium for quality traceability in lubricating grease production. Specifically, it involves acquiring raw material traceability information, cone penetration detection values, and infrared spectral characteristic peaks for each production batch; constructing a batch fingerprint feature vector through weighted fusion; initializing a multidimensional Logistic chaotic mapping using this vector as a seed; generating a keystream matrix and coordinate permutation sequence; performing block-based XOR encryption using the keystream; constructing a disordered mapping rule using the permutation sequence combined with a Hilbert curve; performing bit-level rearrangement on the encrypted payload; generating standard QR code structure data using Reed-Solomon coding; generating a Gaussian noise mask using real-time acoustic emission signals from a reactor; selectively flipping specific pixel modules within the error correction capacity range by calculating the local Hamming distance to the QR code data area; embedding the production process fingerprint into the QR code; generating a traceability code with anti-counterfeiting functionality; and establishing a database associated with the production batch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application pertains to the field of quality traceability, and in particular to a method, system, and storage medium for tracing the quality of lubricating grease production. Background Technology

[0002] As the lifeblood of machinery, lubricating grease's production quality directly impacts the operational stability and lifespan of high-end equipment. Therefore, establishing a comprehensive quality traceability system is crucial. Current technologies typically convert textual information such as raw material batches, production dates, and quality inspection reports directly into binary data streams, generating a black-and-white matrix graphic using standard QR code encoding rules. This graphic is then printed on product packaging for users to scan and verify. To enhance security, some solutions employ traditional symmetric encryption algorithms like AES and DES to encrypt plaintext information before data encoding, or combine physical anti-counterfeiting technologies such as holographic hot stamping and special anti-counterfeiting inks at the label level. However, standard QR code encoding and decoding algorithms are completely public, and error correction mechanisms are fixed. If the encryption key is leaked or brute-forced, attackers can easily forge legitimate traceability information. Existing anti-counterfeiting measures not only increase packaging costs but also fail to fundamentally prevent the complete copying or transfer of labels. Furthermore, existing QR code generation methods are usually based on computer-generated pseudo-random numbers or static keys, resulting in ciphertext data streams that are completely unrelated to the lubricating grease itself. A legitimate QR code label does not contain the unique characteristics of that batch of lubricating grease, resulting in a fundamental separation between the "code" and the "product." Counterfeiters can easily defraud genuine products by recycling old packaging or copying labels. Current technology also fails to utilize the error correction redundancy reserved in the QR code standard. Current technology cannot incorporate environmental noise from the production site as a hidden watermark into the QR code's pixel structure, nor can it achieve deep integration of product intrinsic fingerprints and random characteristics of the production process for anti-counterfeiting without altering the readability of the QR code standard. This makes it difficult to meet the anti-counterfeiting and traceability requirements of high-security lubricating grease products. Summary of the Invention

[0003] This invention proposes a method for tracing the production quality of lubricating grease, which addresses the problem that existing technologies fail to fully utilize the error correction redundancy space reserved in the QR code standard, making it difficult to meet the anti-counterfeiting and traceability requirements of high-security lubricating grease products. The method includes the following steps: Obtain the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the lubricating grease of the batch. The key stream matrix and coordinate permutation sequence are obtained using fingerprint feature vectors, and the enhanced payload is obtained using raw material traceability information; The enhanced payload is obtained by performing block XOR encryption operation on the key stream matrix. The disordered mapping rule is constructed by using coordinate permutation sequence and Hilbert curve. The encrypted payload is then rearranged into bits. The rearranged data stream is then encoded with Reed-Solomon error correction to generate an encoded data stream that conforms to the standard QR code structure. The encoded data stream is then filled into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image. A Gaussian random noise mask is constructed by collecting real-time acoustic emission signals during the production process of the grease reactor. The local Hamming distance between the Gaussian random noise mask and the data codeword area is calculated. When the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR codeword error rate is calculated in real time. Within the allowable range of the QR code error correction capacity, the pixel modules in the area are flipped to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

[0004] Optionally, the step of obtaining the keystream matrix and coordinate permutation sequence using fingerprint feature vectors, and obtaining the enhanced payload using raw material traceability information, specifically involves: A multidimensional Logistic chaotic mapping is initialized using fingerprint feature vectors as seed parameters. A chaotic real number sequence is generated through iterative operations, and the chaotic real number sequence is binarized and quantized to obtain a key stream matrix and a coordinate permutation sequence. The raw material traceability information is encoded to obtain the original binary data stream. The hash digest of the original binary data stream is calculated, and the hash digest is inserted into the preset anchor position of the original binary data stream to obtain the enhanced payload.

[0005] Optionally, fusing the cone penetration detection value and the infrared spectral characteristic peaks to construct the fingerprint feature vector of the batch of lubricating grease includes: The cone penetration detection value is mapped to the interval of 0 to 1 using the min-max normalization method. The wavenumbers of the three characteristic peaks with the lowest transmittance in the infrared spectrum are extracted as spectral features. The normalized cone penetration detection value and the three spectral feature wavenumbers are concatenated in sequence to generate a four-dimensional vector as the fingerprint feature vector of the batch of grease.

[0006] Optionally, the step of initializing the multidimensional Logistic chaotic mapping using fingerprint feature vectors as seed parameters and generating a chaotic real number sequence through iterative computation includes: The four components of the fingerprint feature vector are mapped to the initial variables and system control parameters of the multidimensional logistic mapping, respectively. The target number of iterations is dynamically set according to the required data capacity. The results of the first 500 iterations are discarded to eliminate transient effects, and the state values ​​generated by subsequent iterations of the same length as the data capacity are retained to form a chaotic real number sequence.

[0007] Optionally, the step of binarizing and quantizing the chaotic real number sequence to obtain the keystream matrix and coordinate permutation sequence includes: The arithmetic mean of the chaotic real number sequence is calculated as the quantization threshold. The chaotic real number sequence is traversed. When the value is greater than the quantization threshold, binary 1 is output, otherwise binary 0 is output. The generated binary sequence is filled row by row to form a key stream matrix with the same dimension as the QR code data codeword area. At the same time, the values ​​in the chaotic real number sequence are sorted in ascending order. The index position of the sorted value in the original sequence is recorded to form a coordinate permutation sequence.

[0008] Optionally, the step of constructing a randomized mapping rule using coordinate permutation sequences and Hilbert curves, performing bit-level randomized rearrangement of the encrypted payload, performing Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream conforming to the standard QR code structure, and filling the encoded data stream into the data codeword area of ​​the QR code according to standard rules to obtain the initial QR code image includes: Generate a standard Hilbert curve one-dimensional traversal path covering the length of the encrypted payload, and rearrange the indices on the Hilbert curve traversal path using a coordinate permutation sequence to establish a mapping relationship between the original data bits and the disordered data bits. The bits of the encrypted payload are rearranged according to the mapping relationship to obtain an out-of-order encrypted data stream. Reed-Solomon error correction coding is performed on the out-of-order encrypted data stream to calculate error correction codewords. The out-of-order encrypted data stream and error correction codewords are combined and filled into the data codeword area according to the mask rules and Z-shaped filling path of the standard QR code to generate the initial QR code image.

[0009] Optionally, the method of constructing a Gaussian random noise mask by collecting real-time acoustic emission signals during the production process of the lubricating grease reactor includes: Acoustic emission signals are acquired for five seconds at a fixed sampling frequency. The variance of the signal amplitude is calculated. The variance is used as the standard deviation of the Gaussian distribution to generate a random Gaussian distribution matrix with the same size as the codeword area of ​​the QR code data. Elements in the matrix with values ​​greater than zero or a threshold are set to binary 1, and elements with values ​​less than or equal to zero or a threshold are set to binary 0, thus obtaining a Gaussian random noise mask.

[0010] Optionally, when the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR code word error rate is calculated in real time, and the pixel modules in the area are flipped within the allowable range of QR code error correction capacity, including: Set the error correction level of the QR code and the corresponding maximum correctable codeword error rate. Use a 3×3 pixel sliding window to simultaneously traverse the data codeword region and Gaussian random noise mask of the initial QR code image and calculate the Hamming distance of the corresponding pixel values ​​within the window. When the Hamming distance is less than 3, the pixel value at the center of the sliding window in the initial QR code image is simulated to be flipped, and the code word error rate of the current image is calculated using the QR code decoding algorithm. If the current code word error rate is less than 90% of the set maximum correctable code word error rate, the flipping operation is confirmed to be executed; otherwise, the pixel is skipped until the traversal ends.

[0011] Furthermore, the present invention also relates to a grease production quality traceability system, comprising the following modules: The module is used to acquire the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the batch of lubricating grease. The computation module is used to obtain the key stream matrix and coordinate permutation sequence using fingerprint feature vectors, and to obtain the enhanced payload using raw material traceability information; The generation module is used to perform block XOR encryption operation on the enhanced payload using the key stream matrix to obtain the encrypted payload, construct the out-of-order mapping rule using the coordinate permutation sequence and Hilbert curve, perform bit-level out-of-order rearrangement on the encrypted payload, perform Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream that conforms to the standard QR code structure, and fill the encoded data stream into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image. A module is established to collect real-time acoustic emission signals during the production process of the grease reactor to construct a Gaussian random noise mask, calculate the local Hamming distance between the Gaussian random noise mask and the data codeword area, and when the local Hamming distance is less than a preset threshold, calculate in real time the impact of the flipping operation on the QR codeword error rate, and perform a flipping operation on the pixel modules in the area within the allowable range of QR code error correction capacity to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

[0012] Preferably, the step of obtaining the keystream matrix and coordinate permutation sequence using fingerprint feature vectors, and obtaining the enhanced payload using raw material traceability information, specifically involves: A multidimensional Logistic chaotic mapping is initialized using fingerprint feature vectors as seed parameters. A chaotic real number sequence is generated through iterative operations, and the chaotic real number sequence is binarized and quantized to obtain a key stream matrix and a coordinate permutation sequence. The raw material traceability information is encoded to obtain the original binary data stream. The hash digest of the original binary data stream is calculated, and the hash digest is inserted into the preset anchor position of the original binary data stream to obtain the enhanced payload.

[0013] Preferably, the step of fusing the cone penetration detection value and the infrared spectral characteristic peak to construct the fingerprint feature vector of the batch of lubricating grease includes: The cone penetration detection value is mapped to the interval of 0 to 1 using the min-max normalization method. The wavenumbers of the three characteristic peaks with the lowest transmittance in the infrared spectrum are extracted as spectral features. The normalized cone penetration detection value and the three spectral feature wavenumbers are concatenated in sequence to generate a four-dimensional vector as the fingerprint feature vector of the batch of grease.

[0014] Preferably, the step of initializing the multidimensional Logistic chaotic mapping using fingerprint feature vectors as seed parameters and generating a chaotic real number sequence through iterative computation includes: The four components of the fingerprint feature vector are mapped to the initial variables and system control parameters of the multidimensional logistic mapping, respectively. The target number of iterations is dynamically set according to the required data capacity. The results of the first 500 iterations are discarded to eliminate transient effects, and the state values ​​generated by subsequent iterations of the same length as the data capacity are retained to form a chaotic real number sequence.

[0015] Preferably, the step of binarizing and quantizing the chaotic real number sequence to obtain the keystream matrix and coordinate permutation sequence includes: The arithmetic mean of the chaotic real number sequence is calculated as the quantization threshold. The chaotic real number sequence is traversed. When the value is greater than the quantization threshold, binary 1 is output, otherwise binary 0 is output. The generated binary sequence is filled row by row to form a key stream matrix with the same dimension as the QR code data codeword area. At the same time, the values ​​in the chaotic real number sequence are sorted in ascending order. The index position of the sorted value in the original sequence is recorded to form a coordinate permutation sequence.

[0016] Preferably, the step of constructing a randomized mapping rule using coordinate permutation sequences and Hilbert curves, performing bit-level randomized rearrangement of the encrypted payload, performing Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream conforming to the standard QR code structure, and filling the encoded data stream into the data codeword area of ​​the QR code according to standard rules to obtain the initial QR code image includes: Generate a standard Hilbert curve one-dimensional traversal path covering the length of the encrypted payload, and rearrange the indices on the Hilbert curve traversal path using a coordinate permutation sequence to establish a mapping relationship between the original data bits and the disordered data bits. The bits of the encrypted payload are rearranged according to the mapping relationship to obtain an out-of-order encrypted data stream. Reed-Solomon error correction coding is performed on the out-of-order encrypted data stream to calculate error correction codewords. The out-of-order encrypted data stream and error correction codewords are combined and filled into the data codeword area according to the mask rules and Z-shaped filling path of the standard QR code to generate the initial QR code image.

[0017] Preferably, the method of constructing a Gaussian random noise mask by collecting real-time acoustic emission signals during the production process of the lubricating grease reactor includes: Acoustic emission signals are acquired for five seconds at a fixed sampling frequency. The variance of the signal amplitude is calculated. The variance is used as the standard deviation of the Gaussian distribution to generate a random Gaussian distribution matrix with the same size as the codeword area of ​​the QR code data. Elements in the matrix with values ​​greater than zero or a threshold are set to binary 1, and elements with values ​​less than or equal to zero or a threshold are set to binary 0, thus obtaining a Gaussian random noise mask.

[0018] Preferably, when the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR code word error rate is calculated in real time, and the pixel modules in the area are flipped within the allowable range of the QR code error correction capacity, including: Set the error correction level of the QR code and the corresponding maximum correctable codeword error rate. Use a 3×3 pixel sliding window to simultaneously traverse the data codeword region and Gaussian random noise mask of the initial QR code image and calculate the Hamming distance of the corresponding pixel values ​​within the window. When the Hamming distance is less than 3, the pixel value at the center of the sliding window in the initial QR code image is simulated to be flipped, and the code word error rate of the current image is calculated using the QR code decoding algorithm. If the current code word error rate is less than 90% of the set maximum correctable code word error rate, the flipping operation is confirmed to be executed; otherwise, the pixel is skipped until the traversal ends.

[0019] This invention constructs a fingerprint by extracting the cone penetration and infrared spectral features of lubricating grease, achieving an intrinsic binding between data encryption and product attributes, ensuring the uniqueness and non-portability of traceability information. Utilizing a chaotic keystream and Hilbert curve-based disordered rules, the payload is XOR-encrypted and rearranged at the bit level, eliminating statistical correlations between data and enhancing information confidentiality and anti-attack capabilities. Furthermore, a noise mask is constructed using acoustic emission signals from the production process. Within the fault tolerance range of the Reed-Solomon error correction coding, pixels are flipped based on local Hamming distances, embedding random features of the production site into the QR code. This method, combining fingerprint initialization and process noise embedding, ensures the readability of the QR code on standard devices while also providing anti-copying properties, constructing a highly secure anti-counterfeiting barrier. It solves the problem of traditional traceability codes being easily copied and tampered with in bulk, ensuring the authenticity and reliability of lubricating grease production quality data. Attached Figure Description

[0020] Figure 1 A flowchart of the first embodiment; Figure 2 This is a schematic diagram of the extraction of characteristic peaks from the physical fingerprint of infrared spectroscopy. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] In the first embodiment, the present invention proposes a method for tracing the quality of lubricating grease production, see [link to relevant documentation]. Figure 1 This includes the following steps: Step S1: Obtain the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the batch of lubricating grease.

[0023] Specifically, the supplier code, batch number, and warehousing time of raw materials are read from the enterprise ERP system as raw material traceability information. The cone penetration value of the lubricating grease sample is measured at a constant temperature of 25℃ using a standard cone penetration tester according to GB / T269 standard. The infrared spectrum of the sample is collected using a Fourier transform infrared spectrometer, and the absorbance value of the characteristic peak at wavenumber 2920 is extracted. The cone penetration value and absorbance value are normalized and mapped to the interval between 0 and 1. The cone penetration weight coefficient is set to 0.6 and the absorbance weight coefficient is set to 0.4. The weighted sum of the two is calculated as the feature value, or both are used as feature values. The binary hash value of the raw material traceability information is concatenated with the feature value to form a 128-bit fingerprint feature vector.

[0024] In another optional embodiment, fusing the cone penetration detection value and the infrared spectral characteristic peaks to construct the fingerprint feature vector of the batch of lubricating grease includes: The cone penetration detection value is mapped to the interval of 0 to 1 using the min-max normalization method. The wavenumbers of the three characteristic peaks with the lowest transmittance in the infrared spectrum are extracted as spectral features. The normalized cone penetration detection value and the three spectral feature wavenumbers are concatenated in sequence to generate a four-dimensional vector as the fingerprint feature vector of the batch of grease.

[0025] Obtain the cone penetration measurement value P of the grease, and set the standard working cone penetration range for this type of grease as follows: Using the formula Normalized values ​​are calculated, and if the measured values ​​exceed the range, they are truncated to the boundary value of 0 or 1. Simultaneously, spectral data are acquired using a Fourier transform infrared spectrometer. Within the fingerprint and functional group regions, a peak-finding algorithm is used to identify local minima of the transmittance curve, and the wavenumbers corresponding to the three characteristic peaks with the strongest absorbance are selected. , , ,like Figure 2 As shown, the above parameters are used to construct a four-dimensional fingerprint feature vector in sequence. The wavenumber can be pre-logarithmically scaled or normalized as needed to match the input magnitude of the chaotic system, thereby ensuring that the features can be transformed into the initial seed of the encryption system.

[0026] Step S2: Obtain the key stream matrix and coordinate permutation sequence using fingerprint feature vectors, and obtain the enhanced payload using raw material traceability information.

[0027] More specifically, a multidimensional Logistic chaotic mapping is initialized using fingerprint feature vectors as seed parameters, and a chaotic real number sequence is generated through iterative operations. The chaotic real number sequence is then binarized and quantized to obtain a key stream matrix and a coordinate permutation sequence. The raw material traceability information is encoded to obtain the original binary data stream. The hash digest of the original binary data stream is calculated, and the hash digest is inserted into the preset anchor position of the original binary data stream to obtain the enhanced payload.

[0028] Specifically, the fingerprint feature vector is segmented into three components and mapped to the initial state values ​​of a three-dimensional Logistic chaotic system. , , Set control parameters The value is 3.99. The chaotic system equation is run for 1000 pre-iterations to eliminate transient effects. Then, it continues to iterate to generate three chaotic real number sequences X, Y, and Z with a length equal to the QR code data capacity L. The mean of sequence X is calculated as a threshold. Elements in sequence X that are greater than the threshold are set to 1, and elements that are less than or equal to the threshold are set to 0, thereby generating a binary key stream matrix. At the same time, the element values ​​in sequence Y are sorted from smallest to largest, and the index position of the sorted elements in the original sequence is recorded to obtain an integer coordinate permutation sequence of length L.

[0029] The text information containing supplier code, batch number and production date is converted into a binary bit stream using UTF-8 encoding format. The SHA-256 algorithm is used to calculate the 256-bit hash digest of the binary bit stream. The beginning, end and middle quarter points of the binary bit stream are set as preset anchor points. The 256-bit hash digest is divided into four equal parts and inserted into the above three anchor points in sequence to form an enhanced payload with integrity verification data.

[0030] In an optional embodiment, the step of initializing the multidimensional Logistic chaotic mapping using fingerprint feature vectors as seed parameters and generating a chaotic real number sequence through iterative computation includes: The four components of the fingerprint feature vector are mapped to the initial variables and system control parameters of the multidimensional logistic mapping, respectively. The target number of iterations is dynamically set according to the required data capacity. The results of the first 500 iterations are discarded to eliminate transient effects, and the state values ​​generated by subsequent iterations of the same length as the data capacity are retained to form a chaotic real number sequence.

[0031] Using an improved one-dimensional or multi-dimensional logistic mapping model, the state equation can be expressed as: ,in For state variables, These are control parameters. During implementation, the four components of the fingerprint feature vector V are mapped to the initial values ​​of the chaotic system through modular arithmetic or linear transformation. and control parameters Within the range of values, for example, As The wavenumber components are mapped and adjusted to the chaotic region. An iterative computation process is initiated, executing 500 pre-iterations that discard data. To eliminate the transient influence of initial values ​​on the system trajectory, the program automatically discards the data generated in the first 500 iterations. Then, L valid iterations are performed, where L is the bit length required to enhance the payload. The system state values ​​generated in these subsequent L iterations are collected, forming a high-precision floating-point chaotic real-number sequence of length L. This sequence exhibits high pseudo-randomness and extreme sensitivity to fingerprints.

[0032] Calculate the retained chaotic real number sequence arithmetic mean As a dynamic threshold, perform binarization: if Then quantization bits =1, otherwise =0, the generated bitstream is padded according to the matrix specifications corresponding to the QR code version to generate a keystream matrix for XOR encryption. Simultaneously, to construct the spatial permutation rules, key-value pairs containing the original indices are created. The sequence S is sorted in ascending order using the quicksort algorithm, and the resulting original index sequence is... This is the coordinate permutation sequence. For example, if the original sequence is [0.7,0.2,0.9], and the sorted sequence is [0.2,0.7,0.9], then the corresponding coordinate permutation sequence is [2,1,3]. This sequence will be used later to shuffle the storage location of the data.

[0033] Step S3: Perform block XOR encryption operation on the enhanced payload using the key stream matrix to obtain the encrypted payload. Construct out-of-order mapping rules using coordinate permutation sequence and Hilbert curve. Perform bit-level out-of-order rearrangement on the encrypted payload. Perform Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream that conforms to the standard QR code structure. Fill the encoded data stream into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image.

[0034] Specifically, the enhanced payload is grouped into 8-bit sets and XORed with the corresponding bytes in the keystream matrix to obtain the encrypted payload. A Hilbert curve scanning path of the same order is generated based on the matrix dimension determined by the QR code version, resulting in a coordinate sequence H arranged according to spatial neighborhood. The indices of coordinate sequence H are scrambled using the aforementioned coordinate permutation sequence to obtain a scrambled mapping table. Each bit of the encrypted payload is placed in its new coordinate position according to the scrambled mapping table, completing the bit-level rearrangement. Subsequently, according to the ISO / IEC 18004 standard, in GF( On the Galois field, the error correction codewords of the rearranged data are calculated using the generator polynomial. The data codewords and error correction codewords are interleaved to form an encoded data stream, and combined with the functional graphics and version information, they are filled into the QR code matrix to generate the initial QR code image.

[0035] In an optional embodiment, the step of constructing a randomized mapping rule using coordinate permutation sequences and Hilbert curves, performing bit-level randomized rearrangement of the encrypted payload, performing Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream conforming to the standard QR code structure, and filling the encoded data stream into the data codeword area of ​​the QR code according to standard rules to obtain the initial QR code image includes: Generate a standard Hilbert curve one-dimensional traversal path covering the length of the encrypted payload, and rearrange the indices on the Hilbert curve traversal path using a coordinate permutation sequence to establish a mapping relationship between the original data bits and the disordered data bits. The bits of the encrypted payload are rearranged according to the mapping relationship to obtain an out-of-order encrypted data stream. Reed-Solomon error correction coding is performed on the out-of-order encrypted data stream to calculate error correction codewords. The out-of-order encrypted data stream and error correction codewords are combined and filled into the data codeword area according to the mask rules and Z-shaped filling path of the standard QR code to generate the initial QR code image.

[0036] Determine the order O of the Hilbert curve based on the length L of the encrypted payload, generate a space-filling curve path that can traverse all data nodes, and record the sequential index of the nodes on this path. Applying the coordinate permutation sequence Q generated above, the logical indices on the Hilbert path are permuted, meaning the i-th data bit is no longer placed in... Location, but mapped to The positions are determined to construct a dual disordered mapping table based on chaos and fractal geometry. This mapping table is then used to perform bit-level rearrangement of the XOR-encrypted binary payload. The rearranged data blocks serve as information codewords and are input into a Reed-Solomon encoder, such as a GF encoder. The domain, generating a polynomial according to the QR code standard, calculates the corresponding error correction codewords. The scrambled information codewords are concatenated with the generated error correction codewords. Strictly following the ISO / IEC 18004 standard, starting from the lower right corner of the QR code, a zigzag path is used to fill the code, avoiding functional graphic areas. An optimal mask graphic is applied for XOR processing to render and generate the initial QR Code image matrix. Specifically, the zigzag path filling starts at the lower right corner of the QR code matrix. Data is filled using columns two pixels wide as basic units. During the filling process, starting from the lower right corner, the code moves upwards, alternating left and right within a two-pixel wide column, presenting a right-left-upper-right-upper-left zigzag trajectory, placing bits one by one. When reaching the top boundary of the matrix or encountering a reserved graphic, the path shifts two columns to the left and changes its vertical direction downwards, continuing to place data using a zigzag trajectory. This alternating up and down movement is repeated continuously, automatically skipping vertical and horizontal positioning graphics in the middle of the matrix, until all binary data streams completely fill the valid data codeword area.

[0037] The method of constructing the scan path and out-of-order mapping rules using Hilbert curves specifically involves: calculating and constructing a minimum envelope that can fully accommodate the total bit length of the encrypted payload. A square virtual logical grid is used to map encrypted data sequentially into the grid. A standard Hilbert curve traversal path is generated on this perfect virtual logical grid to extract a new one-dimensional out-of-order data stream with scrambled spatial neighborhood relationships. This one-dimensional out-of-order data stream is then concatenated with Reed-Solomon error correction codewords, removed from the virtual grid, and sequentially filled into the effective data modules of the actual QR code according to a Z-shaped filling path that avoids functional areas such as position detection graphics and correction graphics in the standard QR code specification. This achieves deep spatial scrambling of data bits based on fractal geometry without destroying the irregular spatial structure of the standard QR code.

[0038] Step S4: Collect real-time acoustic emission signals during the production process of the grease reactor to construct a Gaussian random noise mask, calculate the local Hamming distance between the Gaussian random noise mask and the data codeword area, and when the local Hamming distance is less than a preset threshold, calculate in real time the impact of the flipping operation on the QR codeword error rate, and perform a flipping operation on the pixel modules in the area within the allowable range of the QR code error correction capacity to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

[0039] Specifically, a high-frequency acoustic emission sensor installed on the reactor wall records vibration signals during the production process. The variance of the signal amplitude is calculated, and a Gaussian white noise matrix with the same size as the QR code matrix and conforming to the variance is generated. The noise matrix is ​​binarized into a noise mask. Using a 3×3 pixel window as a sliding unit, the Hamming distance between the noise mask and the corresponding window of the QR code data area is calculated line by line. A threshold of 3 is set. When the Hamming distance of a certain window is less than 3, it is determined that the texture repetition of the area is too high. At this time, the center pixel of the window is selected to attempt to flip it, and the Reed-Solomon decoding algorithm is called in real time to calculate the number of error symbols in the current data block. If the number of error symbols after flipping does not exceed the maximum number of error corrections allowed by the error correction level, the flipping of the pixel is confirmed. Otherwise, the flipping is abandoned and the next window is scanned. The modified QR code image is saved, and the raw material information, feature values, and modification positions are recorded and stored in the anti-counterfeiting traceability database.

[0040] In an optional embodiment, the construction of a Gaussian random noise mask by acquiring real-time acoustic emission signals during the lubricating grease reactor production process includes: Acoustic emission signals are acquired for five seconds at a fixed sampling frequency. The variance of the signal amplitude is calculated. The variance is used as the standard deviation of the Gaussian distribution to generate a random Gaussian distribution matrix with the same size as the codeword area of ​​the QR code data. Elements in the matrix with values ​​greater than zero or a threshold are set to binary 1, and elements with values ​​less than or equal to zero or a threshold are set to binary 0, thus obtaining a Gaussian random noise mask.

[0041] During the saponification or cooling process of lubricating grease, a broadband acoustic emission sensor installed on the wall of the reactor is used, with the sampling frequency set to [value missing]. A time series signal A(t) with a duration of T = 5 seconds is acquired. The variance of the amplitude of this discrete signal segment is calculated. Using this variance as the generation parameter, the Box-Muller transform or Ziggurat algorithm is used to generate a value with a mean of 0 and a standard deviation of [missing value]. A two-dimensional Gaussian random distribution matrix G, wherein the dimension of the matrix is ​​consistent with the size of the data area of ​​the target QR code, for example... Pixels. Perform hard thresholding on matrix G: iterate through each element in the matrix. ,like If >0, then the corresponding mask bit is set to 1. If the value is ≤0, then it is set to 0. This process transforms random noise from the production site into a visualized binary noise mask, serving as a guide for the randomness of subsequent anti-counterfeiting texture embedding. Optionally, the variance of the acoustic emission signal can be utilized. Calculate dynamic threshold ,For example ,in This is a scaling factor; it is set to 1 if the matrix element is greater than Th, and 0 otherwise.

[0042] In an optional embodiment, when the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR code word error rate is calculated in real time, and the pixel modules in the area are flipped within the allowable range of QR code error correction capacity, including: Set the error correction level of the QR code and the corresponding maximum correctable codeword error rate. Use a 3×3 pixel sliding window to simultaneously traverse the data codeword region and Gaussian random noise mask of the initial QR code image and calculate the Hamming distance of the corresponding pixel values ​​within the window. When the Hamming distance is less than 3, the pixel value at the center of the sliding window in the initial QR code image is simulated to be flipped, and the code word error rate of the current image is calculated using the QR code decoding algorithm. If the current code word error rate is less than 90% of the set maximum correctable code word error rate, the flipping operation is confirmed to be executed; otherwise, the pixel is skipped until the traversal ends.

[0043] Determine the error correction level of the current QR code and set the security threshold. Using a 3×3 sliding window, the initial QR code image I and the Gaussian noise mask are scanned synchronously with a step size of 1 pixel. Calculate the Hamming distance between the corresponding pixels at each window position. .like If the value is less than 3, then the pixel at the center coordinates (x, y) of image window I is temporarily flipped. Before performing the actual modification, the fast RS decoding simulation algorithm is immediately invoked to calculate the bit error rate of the entire data stream after flipping this point. Only when Only when the flip operation is successful is it fixed into the image; otherwise, the modification at that point is abandoned and the window continues to move. This ensures that while the random fingerprint steganography from the production process is embedded into the QR code texture, standard equipment can still scan and recognize the QR code normally, achieving a balance between anti-counterfeiting and functionality.

[0044] In a second embodiment, the present invention also provides a grease production quality traceability system, comprising the following modules: The module is used to acquire the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the batch of lubricating grease. The computation module is used to obtain the key stream matrix and coordinate permutation sequence using fingerprint feature vectors, and to obtain the enhanced payload using raw material traceability information; The generation module is used to perform block XOR encryption operation on the enhanced payload using the key stream matrix to obtain the encrypted payload, construct the out-of-order mapping rule using the coordinate permutation sequence and Hilbert curve, perform bit-level out-of-order rearrangement on the encrypted payload, perform Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream that conforms to the standard QR code structure, and fill the encoded data stream into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image. A module is established to collect real-time acoustic emission signals during the production process of the grease reactor to construct a Gaussian random noise mask, calculate the local Hamming distance between the Gaussian random noise mask and the data codeword area, and when the local Hamming distance is less than a preset threshold, calculate in real time the impact of the flipping operation on the QR codeword error rate, and perform a flipping operation on the pixel modules in the area within the allowable range of QR code error correction capacity to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

[0045] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0046] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for tracing the quality of lubricating grease production, characterized in that, Includes the following steps: Obtain the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the lubricating grease of the batch. The key stream matrix and coordinate permutation sequence are obtained using fingerprint feature vectors, and the enhanced payload is obtained using raw material traceability information; The enhanced payload is obtained by performing block XOR encryption operation on the key stream matrix. The disordered mapping rule is constructed by using coordinate permutation sequence and Hilbert curve. The encrypted payload is then rearranged into bits. The rearranged data stream is then encoded with Reed-Solomon error correction to generate an encoded data stream that conforms to the standard QR code structure. The encoded data stream is then filled into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image. A Gaussian random noise mask is constructed by collecting real-time acoustic emission signals during the production process of the grease reactor. The local Hamming distance between the Gaussian random noise mask and the data codeword area is calculated. When the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR codeword error rate is calculated in real time. Within the allowable range of the QR code error correction capacity, the pixel modules in the area are flipped to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

2. The method according to claim 1, characterized in that, The process involves obtaining the keystream matrix and coordinate permutation sequence using fingerprint feature vectors, and then using raw material traceability information to obtain the enhanced payload, specifically as follows: A multidimensional Logistic chaotic mapping is initialized using fingerprint feature vectors as seed parameters. A chaotic real number sequence is generated through iterative operations, and the chaotic real number sequence is binarized and quantized to obtain a key stream matrix and a coordinate permutation sequence. The raw material traceability information is encoded to obtain the original binary data stream. The hash digest of the original binary data stream is calculated, and the hash digest is inserted into the preset anchor position of the original binary data stream to obtain the enhanced payload.

3. The method according to claim 1 or 2, characterized in that, The step of fusing the cone penetration detection value and the infrared spectral characteristic peak to construct the fingerprint feature vector of the batch of lubricating grease includes: The cone penetration detection value is mapped to the interval of 0 to 1 using the min-max normalization method. The wavenumbers of the three characteristic peaks with the lowest transmittance in the infrared spectrum are extracted as spectral features. The normalized cone penetration detection value and the three spectral feature wavenumbers are concatenated in sequence to generate a four-dimensional vector as the fingerprint feature vector of the batch of grease.

4. The method according to claim 2, characterized in that, The process of initializing a multidimensional Logistic chaotic mapping using fingerprint feature vectors as seed parameters and generating a chaotic real number sequence through iterative computation includes: The four components of the fingerprint feature vector are mapped to the initial variables and system control parameters of the multidimensional logistic mapping, respectively. The target number of iterations is dynamically set according to the required data capacity. The results of the first 500 iterations are discarded to eliminate transient effects, and the state values ​​generated by subsequent iterations of the same length as the data capacity are retained to form a chaotic real number sequence.

5. The method according to claim 2, characterized in that, The process of binarizing and quantizing the chaotic real number sequence to obtain the key stream matrix and coordinate permutation sequence includes: The arithmetic mean of the chaotic real number sequence is calculated as the quantization threshold. The chaotic real number sequence is traversed. When the value is greater than the quantization threshold, binary 1 is output, otherwise binary 0 is output. The generated binary sequence is filled row by row to form a key stream matrix with the same dimension as the QR code data codeword area. At the same time, the values ​​in the chaotic real number sequence are sorted in ascending order. The index position of the sorted value in the original sequence is recorded to form a coordinate permutation sequence.

6. The method according to any one of claims 4-5, characterized in that, The process involves constructing a randomized mapping rule using coordinate permutation sequences and Hilbert curves, performing bit-level randomization of the encrypted payload, applying Reed-Solomon error correction coding to the rearranged data stream to generate an encoded data stream conforming to the standard QR code structure, and filling the encoded data stream into the data codeword area of ​​the QR code according to standard rules to obtain the initial QR code image, including: Generate a standard Hilbert curve one-dimensional traversal path covering the length of the encrypted payload, and rearrange the indices on the Hilbert curve traversal path using a coordinate permutation sequence to establish a mapping relationship between the original data bits and the disordered data bits. The bits of the encrypted payload are rearranged according to the mapping relationship to obtain an out-of-order encrypted data stream. Reed-Solomon error correction coding is performed on the out-of-order encrypted data stream to calculate error correction codewords. The out-of-order encrypted data stream and error correction codewords are combined and filled into the data codeword area according to the mask rules and Z-shaped filling path of the standard QR code to generate the initial QR code image.

7. The method according to any one of claims 4-5, characterized in that, The method of constructing a Gaussian random noise mask by collecting real-time acoustic emission signals during the production process of the lubricating grease reactor includes: Acoustic emission signals are acquired for five seconds at a fixed sampling frequency. The variance of the signal amplitude is calculated. The variance is used as the standard deviation of the Gaussian distribution to generate a random Gaussian distribution matrix with the same size as the codeword area of ​​the QR code data. Elements in the matrix with values ​​greater than zero or a threshold are set to binary 1, and elements with values ​​less than or equal to zero or a threshold are set to binary 0, thus obtaining a Gaussian random noise mask.

8. The method according to any one of claims 4-5, characterized in that, When the local Hamming distance is less than a preset threshold, the impact of the flipping operation on the QR code error rate is calculated in real time, and the pixel modules in the area are flipped within the allowable range of QR code error correction capacity, including: Set the error correction level of the QR code and the corresponding maximum correctable codeword error rate. Use a 3×3 pixel sliding window to simultaneously traverse the data codeword region and Gaussian random noise mask of the initial QR code image and calculate the Hamming distance of the corresponding pixel values ​​within the window. When the Hamming distance is less than 3, the pixel value at the center of the sliding window in the initial QR code image is simulated to be flipped, and the code word error rate of the current image is calculated using the QR code decoding algorithm. If the current code word error rate is less than 90% of the set maximum correctable code word error rate, the flipping operation is confirmed to be executed; otherwise, the pixel is skipped until the traversal ends.

9. A grease production quality traceability system, characterized in that, Includes the following modules: The module is used to acquire the raw material traceability information, cone penetration test value and infrared spectral characteristic peak value of the lubricating grease production batch, and fuse the cone penetration test value and infrared spectral characteristic peak value to construct the fingerprint feature vector of the batch of lubricating grease. The computation module is used to obtain the key stream matrix and coordinate permutation sequence using fingerprint feature vectors, and to obtain the enhanced payload using raw material traceability information; The generation module is used to perform block XOR encryption operation on the enhanced payload using the key stream matrix to obtain the encrypted payload, construct the out-of-order mapping rule using the coordinate permutation sequence and Hilbert curve, perform bit-level out-of-order rearrangement on the encrypted payload, perform Reed-Solomon error correction coding on the rearranged data stream to generate an encoded data stream that conforms to the standard QR code structure, and fill the encoded data stream into the data codeword area of ​​the QR code according to the standard rules to obtain the initial QR code image. A module is established to collect real-time acoustic emission signals during the production process of the grease reactor to construct a Gaussian random noise mask, calculate the local Hamming distance between the Gaussian random noise mask and the data codeword area, and when the local Hamming distance is less than a preset threshold, calculate in real time the impact of the flipping operation on the QR codeword error rate, and perform a flipping operation on the pixel modules in the area within the allowable range of QR code error correction capacity to generate an anti-counterfeiting traceability QR code containing process fingerprints and establish a database linking the QR code with the production batch.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1-8.