A multi-level compliance code method and system for data binding

By using data binding multi -level compliance codes in digital watermark technology, traceability compound cells are embedded into data by data watermark, solving the problem of inability to bind data and traceability labels in existing technology, and realize Effective traceability and compliance management of data.

CN118627036BActive Publication Date: 2025-01-24GUIZHOU DATABAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411092117.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2025-01-24
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

The existing digital watermarking technology cannot be updated by itself, and it is impossible to deeply bind data and traceability tags in each transaction link, resulting in the inability to effectively realize data traceability and compliance management.

Method used

Adopt data binding multi -level compliance codes and systems, embed the traceability and components of each link of the transaction into the data by data watermark, build a traceable information compliance code tag through a dissipation function, and use two -dimensional two -dimensional two -dimensional dimension. The code technology and watermark embedded algorithm implement the in -depth binding of data and traceability labels.

Benefits of technology

The in -depth binding of the data of each trading link and the traceability label to ensure the traceability and compliance of the data, can verify the data violations of the data, evaluate the credibility of the data, and provide data traceability information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627036B_ABST
    Figure CN118627036B_ABST
Patent Text Reader

Abstract

The present application relates to the field of database management, and specifically discloses a data-bound multi-level compliance code method and system, which includes four parts: information preprocessing, watermark generation, watermark embedding and watermark extraction. The information preprocessing is to use a hash function to construct a traceability information compliance code label; the watermark generation algorithm is used to construct a two-dimensional code watermark to ensure that multiple watermark information cannot interfere with each other; the watermark embedding algorithm is an image-based watermark embedding, which embeds the watermark information into the digital attribute, using the least significant bit; the watermark extraction algorithm uses the same key as the seed, uses bit decoding to reconstruct the embedded watermark and restore the original database relationship, and uses a majority voting mechanism to find the final watermark information. This method has high robustness and can withstand certain deletion attacks, insertion attacks, and modification attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database management, and in particular to a multi-level compliance code method and system for data binding. Background Art

[0002] Digital watermarking technology is to embed some identification information (i.e. digital watermark) directly into digital carriers (including multimedia, documents, software, etc.), but it does not affect the use value of the original carrier, and it is not easy to be perceived or noticed by the human perceptual system (such as the visual or auditory system). Through this information hidden in the carrier, it can be used to confirm the content creator, purchaser, transmit secret information, or determine whether the carrier has been tampered with. Digital watermarking is an effective way to protect information security, achieve anti-counterfeiting traceability, and copyright protection. It is an important branch and research direction in the field of information hiding technology research.

[0003] At present, the original watermark information basically used in the existing digital watermark algorithms is a binary watermark image, which is suitable for embedding the digital watermark into the carrier once. For the situation with multiple data intermediaries and adding new data in each data flow process, the traceability compliance code of each link of the transaction needs to be embedded into the data in the form of a data watermark. The existing digital watermark cannot be updated by itself, and it is impossible to achieve in-depth binding of data and traceability labels at each link. Therefore, a data-binding multi-level compliance code method and system are proposed. Summary of the invention

[0004] The present invention provides a multi-level compliance code method and system for data binding, so that the traceability compliance code of each link of the transaction needs to be embedded in the data in the form of a data watermark, so as to achieve in-depth binding of data and traceability labels at each link.

[0005] To solve the above purpose, the technical solution adopted by the present invention is as follows: a multi-level compliance code method for data binding,

[0006] S100: Acquire data information and construct an m-th level traceability information compliance code label using a hash function, where m=m+1 after each acquisition of data information;

[0007] S200: when m=1, a two-dimensional code with a fixed pixel capacity is established according to actual needs, each pixel is initialized, and a traceability compliance code label is written into the pixel starting from the first pixel; when m≠1, enter S300;

[0008] S300: writing the m-th level traceability compliance code label into the pixel starting from the first pixel that has not been initialized, and generating a watermark QR code image;

[0009] S400: according to the watermark embedding algorithm, the watermark two-dimensional code image is converted into watermark information and embedded into the digital attribute of the target database;

[0010] S500: extracting embedded watermark information from the target database according to a majority voting mechanism, and converting the watermark information into a watermark QR code image;

[0011] S600: After scanning the watermark QR code image, a traceability compliance code label is obtained.

[0012] The basic principle of this scheme is: the traceability compliance code of each link of the transaction needs to be embedded into the data in the form of a data watermark, so as to achieve in-depth binding of data and traceability labels at each link. The present invention uses a data watermark algorithm to design a multi-level compliance code method and system for data binding. The system takes the database as the data protection object, and in each link of the transaction, by embedding the compliance code label into the data in the form of a data watermark, the in-depth binding of the compliance code and the data is achieved, that is, during the data flow process, multiple middlemen embed their compliance codes into the data in the form of watermarks, which is equivalent to using multiple watermarks to bind the same data with the traceability information of different middlemen.

[0013] The beneficial effects of this solution are: 1. Verify illegal data caching, illegal sale and illegal acquisition; 2. Verify whether private data has been tampered with and evaluate the credibility of data; 3. Data traceability. The traceability compliance code includes the data transaction time, upstream data trader unit, current data trader unit, downstream data trader or data user unit, data validity period, etc. To this end, the traceability compliance code of each link of the transaction needs to be embedded in the data in the form of a data watermark, so that the data and traceability tags are deeply bound at each link.

[0014] Further, S100 includes the following steps:

[0015] S101: Obtain a key from a trusted center;

[0016] S102: XOR the key and ipad to form a bit sequence ipadkey related to the key; ipad is a sequence of 00110110 that is continuously cycled until the hash function packet length is reached;

[0017] S103: combining the ipadkey with the data message so that the ipadkey is attached to the beginning of the data message;

[0018] S104: Calculate a hash value, input the result of S103 into a one-way hash function, and output the hash value;

[0019] S105: XOR the key with opad, and the bit sequence opadkey related to the key is formed by the XOR operation; opad is a sequence of 01011100 that is continuously cycled until the length of the single hash function group is reached;

[0020] S106: Add the hash value calculated and outputted in S104 after opadkey;

[0021] S107: Input the result of S106 into the hash function, and the obtained hash value is the content of the traceability information compliance code label.

[0022] Hash algorithms and keys can be used to encrypt data information to generate compliance code labels.

[0023] Further, S101 includes the following steps:

[0024] S1011: Determine whether the key length is consistent with the length of the group of the hash function;

[0025] S1012: If the key length is shorter than the block length of the hash function, fill the end of the key with 0 until the key length reaches the block length of the one-way hash function;

[0026] S1013: If the key length is longer than the block length of the hash function, the hash function is used to calculate the hash value of the key, and then the hash value is used as the new key.

[0027] Standardize the keys issued by the trusted center.

[0028] Furthermore, S200 also includes the following steps:

[0029] S201: Determine the capacity of the QR code according to actual application requirements and generate an initial QR code;

[0030] S202: Allocate space for data information of each stage in the initial QR code. When data information of a new stage is merged, the contents of the first letter and the same length in the QR code will be replaced in sequence to keep the watermark length unchanged and generate multiple QR codes.

[0031] Allocate capacity space for data information at different traceability stages, and store traceability compliance labels in order of stages.

[0032] Furthermore, S200 also includes the following steps:

[0033] S203: Eliminate the position detection patterns in the multiple two-dimensional codes in the current stage.

[0034] The position detection pattern is used to determine the rotation angle of the QR code. During the data transmission stage, it can be omitted to reduce the amount of information transmitted.

[0035] Furthermore, S300 also includes the following steps:

[0036] S301: The pixel with intensity y in the image and the watermark position i to be embedded, convert the multiple two-dimensional code images into bit stream information W = {W(i)|W(i)∈{0,1},0≤i<(m×n)-1} of 0 and 1, and embed it into the digital attribute, where m, n are the width and height of the image;

[0037] S302: Data set R is a relational database, which can be formalized as R(P, A0, A1, …, A α-1 ), where P is the primary key, A0, A1, ..., A α-1 Let α be the attributes of R, and let η be the number of tuples in R. The embedded key K is K=H(ID||DB name||version||…), where H() is a one-way hash function, ID is the database owner identifier, || indicates concatenation, DB name is the database name, and version is the database version;

[0038] S303: In the prediction error p e When watermark position i is embedded in the pixel, the predictor operates on the neighborhood of pixel y and predicts its intensity y^. The prediction error p e For p e =yy^, using binary format to represent p e =b l-1 b l-2 …b0, shift it left by one bit and add the watermark bit i to the missing least significant bit;

[0039] S304: New prediction error p' e =b l-1 b l-2 ...b0i=2*p e +i, calculate the embedded pixel intensity y' (ie, watermark value), where y' = y^ + p' e =yp e +p' e =y+p e +i, we can finally get y=y'-p e -i, let each pixel have two intensities, the original intensity y and the predicted intensity y', y is the fractional part of any digital attribute to be watermarked, and y^ is any value associated with the tuple known during encoding and decoding;

[0040] S305: Load watermark information W[0,…,L-1]=Loadwatermark(W), the size of the watermark bit stream is L;

[0041] S306: Randomize watermark information Randomize (W[0, ..., L-1]);

[0042] S307: Select some tuples in a pseudo-random manner for watermark insertion. For each tuple t in R i , d = H(t i· P||K), if d mod γ = 0, mark the tuple, attribute index j = d mod α, watermark bit index idx = d mod L;

[0043] S308: Bit encryption algorithm Bit_encoding(K,w[idx],t i· A j ) updates field j of tuple i. The integer part of the value corresponding to attribute j of tuple i is int. When the fractional part frac is greater than 0, let diff = frac-LSB(H(t i· P||K), get newdiff = to_integer(bin(diff)||w[idx]), that is, convert diff into binary and convert it to integer again on the least significant bit string, and then get the last updated value newval = int||"."||(newdiff+LSB(H(t i· P||K)).

[0044] Furthermore, S400 also includes the following steps:

[0045] S401: extract multiple watermarks from tuples in the relational database according to the embedded keys K, γ, and α in S300 and in the order of the watermark insertion algorithm, each watermark belonging to the value of a certain attribute of a certain correct tuple;

[0046] S402: Use the majority voting mechanism to find the watermark information. For each marked bit, calculate the number of its values ​​0 or 1 respectively, and then take the higher one as the final value of the bit, and obtain a binary sequence containing relational data R information;

[0047] S403: Convert the binary sequence back to watermark information, that is, the two-dimensional code watermark image W.

[0048] Furthermore, S401 further includes the following steps:

[0049] S4011: For the relation RW containing watermark information, traverse each tuple t i , select the tuple used in the watermark insertion algorithm;

[0050] S4012: Bit decryption algorithm Bit_decoding(K,b,t i· A j), b is the decoded watermark bit. Take the fractional part newfrac and the integer part int of the value of attribute j of tuple i. Similarly, if newfrac>0, newdiff=newfrac–LSB(H(t i· P||K)), b=LSB(bin(newdiff)), diff=Floor(newdiff / 2), newval=int||"."||(newfrac–diff–b). The obtained newval is the new t i· A j ;

[0051] S4013: De-randomize the watermark information Rerandomize (W[0,…,L-1]);

[0052] The S402 further includes the following steps:

[0053] S4021: Use majority voting mechanism, for each extracted watermark bit W[0,…,L-1], if w[i]=0, black[i]=black[i]+1, otherwise white[i]=white[i]+1. Then update the vote W[0,…,L-1], that is, if black[i]>white[i], W[i]=0, otherwise W[i]=1;

[0054] S4022: Convert the vote W[] into a two-dimensional code image of size m×n.

[0055] Furthermore, a data-bound multi-level compliance code system is proposed, which includes a label generation module, a watermark generation module, a watermark insertion module, and a watermark extraction module;

[0056] The label generation module is used to obtain data information and use hash functions to generate traceability compliance code labels;

[0057] A watermark generation module is used to generate a QR code watermark image for the traceability compliance code label;

[0058] A watermark insertion module is used to convert the two-dimensional code watermark image into bit stream information, and embed the bit stream into the digital attribute of the target database according to the embedding key;

[0059] The watermark extraction module is used to extract the bit stream information from the target database according to the embedded key and convert the bit stream information back into a two-dimensional code watermark image.

[0060] Further, the label generation module includes a key filling module, an XOR module, and a hash function calculation module;

[0061] A key filling module is used to determine the key length and generate a filling key with the same length as the one-way hash function group;

[0062] an XOR module, for performing XOR of the padded key with ipad to generate ipadkey; and for performing XOR of the padded key with opad to generate opadkey; the ipad is a sequence of 00110110 that is continuously cycled until the length of the single-term hash function packet is reached, and the opad is a sequence of 01011100 that is continuously cycled until the length of the single-term hash function packet is reached;

[0063] The hash function calculation module is used to combine the ipadkey with the data information to generate a first hash value, and is also used to combine the opadkey with the first hash value to generate a traceability compliance code label. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 To build a traceability compliance code label flow chart;

[0065] Figure 2 Embedding flow chart for multiple watermarks;

[0066] Figure 3 Flowchart for multiple watermark extraction

[0067] Figure 4 Flowchart of this method. DETAILED DESCRIPTION

[0068] The following is further described in detail through specific implementation methods:

[0069] The embodiment is basically as shown in the attached Figure 1 To Attachment Figure 4 As shown:

[0070] The first step: information preprocessing.

[0071] Construct traceability compliance code labels, including data transaction time, upstream data trader unit, current data trader unit, downstream data trader or data user unit, data validity period, etc. In order to ensure the integrity of data information, that is, "the message has not been tampered with", at the same time, satisfy the data information belongs to a certain middleman, that is, the data cannot be sent by other merchants pretending to be the sender.

[0072] The process of generating labels is as follows Figure 1 , details are as follows.

[0073] (1) Key padding. If the key length is shorter than the block length of the one-way hash function, 0s need to be padded at the end until the key length reaches the block length of the one-way hash function. If the key is longer than the block length, the one-way hash function needs to be used to calculate the hash value of the key, and then this hash value is used as the new key;

[0074] (2) The padded key is XORed with ipad. The bit sequence related to the key formed by the XOR operation is called ipadkey. ipad is a sequence of 00110110 that is continuously cycled until the length of the single hash function block is reached;

[0075] (3) Combine with data message. Combine ipadkey with the message, that is, attach ipadkey to the beginning of the message.

[0076] (4) Calculate the hash value. Input the result of (3) into the one-way hash function and output the hash value.

[0077] (5) The padded key is XORed with opad. The bit sequence related to the key formed by the XOR operation is called opadkey. opad is a sequence of 01011100 that is continuously cycled until the length of the single hash function block is reached;

[0078] (6) Combine with the hash value. Put the hash value of (4) after opadkey.

[0079] (7) Calculate the hash value. Input the result of (6) into the one-way hash function, and the resulting hash value is the final tag content.

[0080] Among them, the one-way hash function can use SHA-I or MD5, the key can be distributed by a trusted center to ensure that the data information is not tampered with, and the tag verification can ensure the legitimacy of the data.

[0081] Step 2: Watermark generation

[0082] When multiple watermarks are embedded into the same data information, it is difficult to ensure the independence of each watermark data. In addition, when the watermark capacity increases, there is less redundant space in the data, and the robustness of the watermark scheme is weakened. In order to keep the watermark length unchanged as the watermark capacity increases, a container of data information, i.e., a fixed-capacity QR code watermark, is first established, and multiple intermediary data information is combined in a non-overlapping manner to generate watermark data.

[0083] The steps for watermark generation details are as follows:

[0084] (1) Generate the required QR code, determine the capacity of the QR code according to the actual application requirements, and use several initial contents to fill its content. Assume that the size of the generated QR code is D×D (unit: pixel), and the number of calculations for the QR code initialization is D 2 .

[0085] (2) Allocate space for each stage of data information in the QR code. When a new stage of copyright information is merged, the content in the QR code of the same length as the first letter will be replaced to keep the watermark length unchanged.

[0086] (3) Generate multiple QR codes. The i-th level of the QR code is actually generated based on the information of the previous i stages, and the size of a multiple QR code is the same in each stage.

[0087] (4) Eliminate the position detection pattern in the current stage of the QR code to further shorten the length of the final generated watermark data. For each stage of the QR code, the number of calculations for pattern elimination is 192 times.

[0088] The third step is watermark insertion.

[0089] The QR code image is converted into a bit stream of 0 and 1 W = {W(i)|W(i)∈{0,1},0≤i<(m×n)-1} (m, n are the width and height of the image), and embedded into the digital attribute, that is, to prove the authenticity of the relational database traceability compliance code information, and its value change is within an acceptable range and will not affect the authenticity of the data. The data set R is a relational database, which can be formalized as R(P,A0,A1,…,A α-1 ), where P is the primary key, A0, A1, ..., A α-1 Let α be the attributes of R, and let η be the number of tuples in R. The embedded key K is selected as K=H(ID||DB name||version||…), where H() is a one-way hash function, ID is the database owner identifier, || indicates concatenation, DB name is the database name, and version is the database version.

[0090] Consider a pixel of intensity y in the image and a watermark position i to be embedded. The predictor operates on the neighborhood of pixel y and predicts its intensity y^. The prediction error p e For p e =yy^. In the prediction error p e When embedding watermark bit i in , use binary format to represent p e =b l-1 b l-2 …b0, shift it left by one bit, and add the watermark bit i to the missing least significant bit. The new prediction error p' e =b l-1 b l-2 ...b0i=2*p e +i. Combined to calculate the embedded pixel intensity y' (ie, watermark value), where y' = y^ + p' e =yp e +p' e =y+p e +i. Finally, we get y=y'-p e-i. Let each pixel have two intensities, the original intensity y and the predicted intensity y', where y is the fractional part of any digital attribute to be watermarked and y^ is any value associated with the tuple known during encoding and decoding, such as LSB(H(t i· P||K)). Subtract y from y^ to get the difference, and then embed the watermark bit obtained after the difference expansion.

[0091] The specific watermark insertion algorithm (Watermark W, R, K, γ, α) is as follows.

[0092] (1) Load watermark information W[0,…,L-1]=Loadwatermark(W), where the size of the watermark bit stream is L.

[0093] (2) Randomize the watermark information: Randomize(W[0,…,L-1]).

[0094] (3) Select some tuples in a pseudo-random manner for watermark insertion. For each tuple t in R i , d = H(t i· P||K), d is the difference, if d mod γ = 0, then mark the tuple, γ is the part of the marked tuple, attribute index j = d mod α, α is the attribute number to be marked, and watermark bit index idx = d mod L.

[0095] (4) Bit encryption algorithm Bit_encoding(K,w[idx],t i· A j ) updates field j of tuple i. The integer part of the value corresponding to attribute j of tuple i is int. When the fractional part frac is greater than 0, let diff = frac-LSB(H(t i· P||K), LSB means the least significant bit, t i· Representing the i-th tuple of the data set R, we get newdiff = to_integer(bin(diff)||w[idx]), that is, convert diff into binary and convert it to integer again on the least significant bit string, and then get the last updated value newval = int||"."||(newdiff+LSB(H(t i· P||K)).

[0096] The fourth step is watermark extraction.

[0097] In order to extract watermarks from a relational database, the embedding keys K, γ, and α need to be known in advance. Since the hash function has the same distribution when using the same key as the seed, the order of the selected tuples is the same as the order in the watermark insertion algorithm. Using the bit decryption algorithm Bit_dencoding, the embedded watermark can be reconstructed and the original database relation can be restored. After completing the extraction process, multiple watermarks are obtained, each of which belongs to the value of a certain attribute of a correct tuple.

[0098] The final watermark information is found using the majority voting mechanism. For each marked bit, the number of values ​​0 or 1 is calculated, and the higher value is used as the final value of the bit. The detection result is a binary sequence that contains the information of the relational data R. Therefore, the binary sequence is converted back to watermark information, that is, the watermark image W[]. The holder can use the detected watermark image to scan the code to understand the traceability compliance code information.

[0099] The specific watermark extraction algorithm Watermark Extraction Algorithm (RW, K, γ, α) is as follows:

[0100] (1) For the relation RW containing watermark information, traverse each tuple t i , selects the tuple used in the watermark insertion algorithm.

[0101] (2) Bit decryption algorithm Bit_decoding(K,b,t i· A j ), b is the decoded watermark bit. Take the fractional part newfrac and the integer part int of the value of attribute j of tuple i. Similarly, if newfrac>0, newdiff=newfrac–LSB(H(t i· P||K)), b=LSB(bin(newdiff)), diff=Floor(newdiff / 2), newval=int||"."||(newfrac–diff–b). The obtained newval is the new t i· A j .

[0102] (3) Rerandomize the watermark information (W[0,…,L-1])

[0103] (4) Using the majority voting mechanism, for each extracted watermark bit W[0,…,L-1], if w[i]=0, black[i]=black[i]+1, otherwise white[i]=white[i]+1. Then update the vote W[0,…,L-1], that is, if black[i]>white[i], W[i]=0, otherwise W[i]=1.

[0104] (5) Convert the vote W[] into a QR code image of size m×n

[0105] (6) Scan the QR code to obtain the traceability compliance code information.

[0106] This embodiment also provides a data-bound multi-level compliance code system, including a label generation module, a watermark generation module, a watermark insertion module, and a watermark extraction module;

[0107] The label generation module is used to obtain data information and use hash functions to generate traceability compliance code labels;

[0108] A watermark generation module is used to generate a QR code watermark image for the traceability compliance code label;

[0109] A watermark insertion module is used to convert the two-dimensional code watermark image into bit stream information, and embed the bit stream into the digital attribute of the target database according to the embedding key;

[0110] The watermark extraction module is used to extract the bit stream information from the target database according to the embedded key and convert the bit stream information back into a two-dimensional code watermark image.

[0111] Among them, the label generation module includes a key filling module, an XOR module, and a hash function calculation module;

[0112] A key filling module is used to determine the key length and generate a filling key with the same length as the one-way hash function group;

[0113] an XOR module, for performing XOR of the padded key with ipad to generate ipadkey; and for performing XOR of the padded key with opad to generate opadkey; the ipad is a sequence of 00110110 that is continuously cycled until the length of the single-term hash function packet is reached, and the opad is a sequence of 01011100 that is continuously cycled until the length of the single-term hash function packet is reached;

[0114] The hash function calculation module is used to combine the ipadkey with the data information to generate a first hash value, and is also used to combine the opadkey with the first hash value to generate a traceability compliance code label.

[0115] The above is only an embodiment of the present invention, and the common knowledge such as the known specific structure and characteristics in the scheme is not described in detail here. It should be pointed out that for those skilled in the art, several deformations and improvements can be made without departing from the structure of the present invention, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A multi-level compliance code method for data binding, characterized by: S100: Acquire data information and construct an m-th level traceability information compliance code label using a hash function, where m=m+1 after each acquisition of data information; S200: when m=1, a two-dimensional code with a fixed pixel capacity is established according to actual needs, each pixel is initialized, and a traceability compliance code label is written into the pixel starting from the first pixel; When m≠1, enter S300; S300: writing the m-th level traceability compliance code label into the pixel starting from the first pixel that has not been initialized, and generating a watermark QR code image; S301: Eliminate the position detection pattern in the current stage QR code; S400: according to the watermark embedding algorithm, the watermark two-dimensional code image is converted into watermark information and embedded into the digital attribute of the target database; S401: The pixel with intensity y in the image and the watermark position i to be embedded, convert the two-dimensional code image into a bit stream information W = {W(i)|W(i)∈{0,1}, 0≤i<(m×n)-1} of 0 and 1, and embed it into the digital attribute, where m, n are the width and height of the image; S402: Data set R is a relational database, which can be formalized as R(P, A0, A1, ..., A α-1 ), where P is the primary key, A0, A1, ..., A α-1 Let α be the attributes of R, and let η be the number of tuples in R. The embedded key K is K=H(ID||DB name||version||...), where H() is a one-way hash function, ID is the database owner identifier, || indicates concatenation, DB name is the database name, and version is the database version; S403: In the prediction error p e When watermark position i is embedded in the pixel, the predictor operates on the neighborhood of pixel y and predicts its intensity y^. The prediction error p e For p e =yy^, using binary format to represent p e =b l-1 b l-2 ...b0, shift it left by one bit and add the watermark bit i to the vacant least significant bit; S404: New prediction error p′ e =b l-1 b l-2 ...b0i=2*p e +i, calculate the embedded pixel intensity y', where y' = y^+p' e =yp e +p′ e =y+p e +i, we can finally get y=y′-p e -i, let each pixel have two intensities, the original intensity y and the predicted intensity y', y is the fractional part of any digital attribute to be watermarked, and y^ is any value associated with the tuple known during encoding and decoding; S405: Load watermark information W[0, ..., L-1] = Loadwatermark(W), the size of the watermark bit stream is L; S406: Randomize watermark information Randomize (W[0, ..., L-1]); S407: Select some tuples in a pseudo-random manner for watermark insertion; for each tuple t in R i , d = H(t i· P||K), d is the difference, if d mod γ = 0, then mark the tuple, γ is the part of the marked tuple, attribute index j = d mod α, α is the attribute number to be marked, watermark bit index idx = d mod L; S408: Bit encryption algorithm Bit_encoding(K, w[idx], t i· A j ) Update field j of tuple i; the integer part of the value corresponding to attribute j of tuple i is int. When the fractional part frac is greater than 0, let diff = frac-LSB(H(t i· P||K), LSB means the least significant bit, t i· Representing the i-th tuple of the data set R, we get newdiff = to_integer(bin(diff)||w[idx]), that is, convert diff into binary and convert it to integer again on the least significant bit string, and then get the last updated value newval = int||″.”||(newdiff+LSB(H(t i· P||K)); S500: extracting embedded watermark information from the target database according to a majority voting mechanism, and converting the watermark information into a watermark QR code image; The S500 includes the following steps: S501: extract multiple watermarks from tuples in a relational database according to the embedded keys K, γ, and α in S400 and in the order of the watermark insertion algorithm, each watermark belonging to the value of a certain attribute of a certain correct tuple; S501 also includes the following steps: S5011: For the relation RW containing watermark information, traverse each tuple t i , select the tuple used in the watermark insertion algorithm; S5012: Bit decryption algorithm Bit_decoding (K, b, t i· A j ), b is the decoded watermark bit; take the fractional part newfrac and the integer part int of the value of attribute j of tuple i; similarly, if newfrac>0, newdiff=newfrac-LSB(H(t i· P||K)), b=LSB(bin(newdiff)), diff=Floor(newdiff / 2), newval=int||″.”||newfrac-diff-b); the obtained newval is the new t i· A j ; S5013: De-randomize the watermark information Rerandomize (W[0, ..., L-1]); S502: Use the majority voting mechanism to find the watermark information. For each marked bit, calculate the number of its values ​​0 or 1 respectively, and then use the higher one as the final value of the bit to obtain a binary sequence containing relational data R information; The S502 further includes the following steps: S5021: Use majority voting mechanism, for each extracted watermark bit W[0, ..., L-1], if w[i] = 0, black[i] = black[i] + 1, otherwise white[i] = white[i] + 1; then update the vote W[0, ..., L-1], that is, if black[i] > white[i], W[i] = 0, otherwise W[i] = 1; S5022: Convert the vote W[] into a two-dimensional code image of size m×n; S503: converting the binary sequence back to watermark information, i.e., the two-dimensional code watermark image W; S600: After scanning the watermark QR code image, a traceability compliance code label is obtained.

2. A data binding multi-level compliance code system implementing the data binding multi-level compliance code method according to claim 1, characterized in that: It includes a label generation module, a watermark generation module, a watermark insertion module, and a watermark extraction module; The label generation module is used to obtain data information and use hash functions to generate traceability compliance code labels; A watermark generation module is used to generate a QR code watermark image for the traceability compliance code label; A watermark insertion module is used to convert the two-dimensional code watermark image into bit stream information, and embed the bit stream into the digital attribute of the target database according to the embedding key; The watermark extraction module is used to extract the bit stream information from the target database according to the embedded key and convert the bit stream information back into a two-dimensional code watermark image.

3. A data binding multi-level compliance code system according to claim 2, characterized in that: The label generation module includes a key filling module, an XOR module, and a hash function calculation module; A key filling module is used to determine the key length and generate a filling key with the same length as the one-way hash function group; an XOR module, for performing XOR of the padded key with ipad to generate ipadkey; and for performing XOR of the padded key with opad to generate opadkey; the ipad is a sequence of 00110110 that is continuously cycled until the length of the single-term hash function packet is reached, and the opad is a sequence of 01011100 that is continuously cycled until the length of the single-term hash function packet is reached; The hash function calculation module is used to combine the ipadkey with the data information to generate a first hash value, and is also used to combine the opadkey with the first hash value to generate a traceability compliance code label.

Citation Information

Patent Citations

  • Bill voucher anti-counterfeiting detection method and device based on intelligent equipment

    CN111612963A

  • Database watermark embedding method and device, equipment and medium

    CN118296575A