Watermark insertion method, extraction method and device

By using the threshold secret sharing algorithm and Bloom filter to embed watermark information in structured data, the problem of insufficient watermark robustness in the existing technology is solved, efficient copyright protection and concealment of structured data are achieved, and the data is ensured to be shared. It will not be leaked or resold during the process.

CN114722360BActive Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110001452.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-04
Publication Date
2024-10-18
Estimated Expiration
2041-01-04

AI Technical Summary

Technical Problem

The existing technology is not robust enough in watermarking solutions for structured data, making it difficult to effectively protect data copyright and prevent data leakage or reselling. Especially in data sharing scenarios, there is a risk of identifying and destroying watermarks.

Method used

The threshold secret sharing algorithm is used to divide the watermark information into multiple fragments, and the HMAC value and Bloom filter are used to embed the watermark information in the structured data. It is stored and extracted through pseudo data records and numerical attributes to ensure the transparency of the watermark information. Stickiness and stealth.

Benefits of technology

The robustness of the watermark algorithm is improved. Even if the watermark information is partially lost, it can be extracted by the number of valid rows reaching the threshold value, which enhances the protection ability and concealment of the data and avoids the risk of the watermark being identified and destroyed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114722360B_ABST
    Figure CN114722360B_ABST
Patent Text Reader

Abstract

The present invention provides a watermark insertion method, extraction method and device, belonging to the field of data security technology. The watermark insertion method includes: encoding to obtain watermark information, using a threshold secret sharing algorithm to divide the watermark information into N watermark fragments; selecting a numerical attribute m of structured data to be added with watermark information to store the watermark information; setting a Bloom filter B, randomly generating a pseudo data record with a unique primary key value, replacing the numerical attribute m of the pseudo data record with the jth watermark fragment, writing the pseudo data record into the Bloom filter B, and adding the pseudo data record to the structured data. The technical solution of the present invention can improve the robustness of the watermark algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to a watermark inserting method, extracting method and device. Background Art

[0002] Digital watermarking is a technical means of copyright protection. There are already mature watermarking solutions for data such as pictures, videos, and audio, but there are relatively few watermarking solutions for structured data. As data becomes a form of enterprise asset, in order to better maximize the value of data and avoid data island problems, there are more and more scenarios where structured data is shared within and outside the enterprise. In the process of data sharing, watermarking is needed to protect the copyright of the publisher and to ensure that the data shared with third parties will not be leaked or resold by third parties. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a watermark insertion method, extraction method and device, which can improve the robustness of the watermark algorithm.

[0004] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

[0005] In one aspect, a watermark insertion method is provided, comprising:

[0006] Encode to obtain watermark information, and use a threshold secret sharing algorithm to divide the watermark information into N watermark fragments, where the threshold value is t, N, t is an integer greater than 1, and t is less than or equal to N;

[0007] Selecting a numerical attribute m of the structured data to be added with watermark information to store the watermark information;

[0008] Set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and perform the following steps:

[0009] Processing steps: randomly generate a pseudo data record with a unique primary key value, and calculate the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N;

[0010] The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process;

[0011] The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, go to the processing step.

[0012] In some embodiments, if the structured data does not include a numerical attribute, the method further includes:

[0013] A column of numerical attributes m is randomly constructed in the structured data.

[0014] In some embodiments, A is equal to 2.

[0015] In some embodiments, it also includes:

[0016] Calculate the HMAC value of the primary key P1 of each row of data record in the structured data, h1 = HMAC k (P1), then divide all data records into N groups according to the value of h1 mod N;

[0017] Adding the dummy data record to the structured data includes:

[0018] The dummy data record is added to the corresponding data group j in the structured data according to the value of j.

[0019] An embodiment of the present invention further provides a watermark extraction method, comprising:

[0020] Set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data from which watermark information is to be extracted, and perform the following steps to update the two-dimensional array L:

[0021] Determine whether the row of data records is in Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N;

[0022] Extraction step: extract the value M of the numeric attribute m of the row data record j ;

[0023] Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0024] After the two-dimensional array L is updated, a one-dimensional array s is set, and the two-dimensional array L is traversed row by row. If the number of non-zero elements in one row is A, and the values ​​of the non-zero elements are all equal, the values ​​of the non-zero elements are added to the one-dimensional array s;

[0025] If the number of data in the one-dimensional array s is not less than t, the data in the one-dimensional array s is fragmented and reassembled using the threshold secret sharing algorithm to obtain watermark information.

[0026] An embodiment of the present invention further provides a watermark insertion device, comprising:

[0027] The encoding module is used to encode the watermark information and divide the watermark information into N watermark fragments using a threshold secret sharing algorithm, where the threshold value is t, N, where t is an integer greater than 1 and t is less than or equal to N;

[0028] A selection module, used for selecting a numerical attribute m of the structured data to be added with watermark information to store the watermark information;

[0029] A processing module is used to set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and performs the following steps: a processing step, randomly generating a pseudo data record with a unique primary key value, and calculating the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = hmod N; the first judgment step, judge whether the first array is empty, if not, turn to the second judgment step, if yes, end the process; the second judgment step, judge whether j belongs to the first array, if yes, delete one j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, turn to the processing step.

[0030] In some embodiments, if the structured data does not include a numerical attribute, the apparatus further includes:

[0031] A construction module is used to randomly construct a column of numerical attributes m in the structured data.

[0032] In some embodiments, A is equal to 2.

[0033] In some embodiments, the processing module is further used to calculate the HMAC value of the primary key P1 of each row of data record in the structured data, where h1 = HMAC k (P1, then divide all data records into N groups according to the value of h1 mod N; add the dummy data record to the corresponding data group j in the structured data according to the value of j.

[0034] An embodiment of the present invention further provides a watermark extraction device, comprising:

[0035] The first processing module is used to set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data to be extracted watermark information, and perform the following steps to update the two-dimensional array L: a judgment step to determine whether the row of data records is in the Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N; extraction step, extract the value M of the numeric attribute m of the row data record j ; Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0036] A second processing module is used to set a one-dimensional array s after updating the two-dimensional array L, traverse the two-dimensional array L row by row, and if the number of non-zero elements in one row is A and the values ​​of the non-zero elements are all equal, add the values ​​of the non-zero elements to the one-dimensional array s;

[0037] The reorganization module is used to reorganize the data in the one-dimensional array s by using a threshold secret sharing algorithm if the number of data in the one-dimensional array s is not less than t, so as to obtain watermark information.

[0038] An embodiment of the present invention further provides a watermark insertion device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the program, the watermark insertion method described above is implemented.

[0039] The processor is used to encode to obtain watermark information, use a threshold secret sharing algorithm to divide the watermark information into N watermark fragments, the threshold value is t, N, t is an integer greater than 1, and t is less than or equal to N; select a numerical attribute m of structured data to be added with watermark information to store the watermark information; set a first array and a Bloom filter B, the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], A is an integer greater than 1, and perform the following steps:

[0040] Processing steps: randomly generate a pseudo data record with a unique primary key value, and calculate the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N;

[0041] The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process;

[0042] The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, go to the processing step.

[0043] In some embodiments, if the structured data does not include a numerical attribute, the processor is further configured to randomly construct a column of numerical attributes m in the structured data.

[0044] In some embodiments, A is equal to 2.

[0045] In some embodiments, the processor is further configured to calculate the HMAC value of the primary key P1 of each row of data record in the structured data, where h1 = HMAC k (P1, then divide all data records into N groups according to the value of h1 mod N; add the dummy data record to the corresponding data group j in the structured data according to the value of j.

[0046] An embodiment of the present invention further provides a watermark extraction device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the program, the watermark extraction method described above is implemented.

[0047] The processor is used to set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of data records of structured data to be extracted watermark information, and perform the following steps to update the two-dimensional array L:

[0048] Determine whether the row of data records is in Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N;

[0049] Extraction step: extract the value M of the numeric attribute m of the row data record j ;

[0050] Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0051] After the two-dimensional array L is updated, a one-dimensional array s is set, and the two-dimensional array L is traversed row by row. If the number of non-zero elements in one row is A, and the values ​​of the non-zero elements are all equal, the values ​​of the non-zero elements are added to the one-dimensional array s;

[0052] If the number of data in the one-dimensional array s is not less than t, the data in the one-dimensional array s is fragmented and reassembled using the threshold secret sharing algorithm to obtain watermark information.

[0053] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the watermark insertion method or the steps in the watermark extraction method described above are implemented.

[0054] The embodiments of the present invention have the following beneficial effects:

[0055] In the above scheme, the watermark information is inserted into the structured data in the form of data rows according to a certain algorithm, which is not easy to be identified and deleted; at the same time, the watermark information is fragmented using threshold technology. Even if some watermark rows are lost, as long as the number of valid rows reaches the set threshold value, the watermark information can still be extracted, thereby improving the robustness of the watermark algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 Schematic diagram of adding watermarks to data publishers;

[0057] Figure 2 A schematic diagram of a watermark insertion method according to an embodiment of the present invention;

[0058] Figure 3 Schematic diagram of the process of watermark extraction method according to an embodiment of the present invention;

[0059] Figure 4 It is a schematic diagram of the structure of a watermark insertion device according to an embodiment of the present invention;

[0060] Figure 5 It is a schematic diagram of the structure of a watermark extraction device according to an embodiment of the present invention;

[0061] Figure 6 It is a schematic diagram of the composition of a watermark insertion device according to an embodiment of the present invention;

[0062] Figure 7 It is a schematic diagram of the composition of a watermark extraction device according to an embodiment of the present invention; DETAILED DESCRIPTION

[0063] In order to make the technical problems, technical solutions and advantages to be solved by the embodiments of the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0064] In some watermark processing schemes of related technologies, watermark information is inserted into the least significant bit of the data attribute. If the least significant bit is deleted, the watermark will become invalid. In addition, the insertion of the watermark requires modifying the original data attribute value, which will affect the business to a certain extent. In other watermark processing schemes of related technologies, the watermark value is completely random, and no watermark encoding is performed, which is not intuitive enough. In addition, the generated random watermark needs to be recorded for comparison during watermark extraction, which is less user-friendly. In addition, the multiple pseudo-rows inserted are the same, and the watermark is easy to be identified and destroyed.

[0065] The embodiments of the present invention provide a watermark insertion method, an extraction method and an apparatus, which can improve the robustness of a watermark algorithm.

[0066] The data type targeted by this embodiment is structured data. A row of structured data is a data record, and a column of data is a data attribute. This embodiment implements the function of data watermark by adding a special form of data record to the data, such as Figure 1 As shown, this embodiment involves three roles: data owner, data user, and data publisher.

[0067] The embodiment of the present invention provides a watermark insertion method, such as Figure 2 As shown, including:

[0068] Step 101: Encode to obtain watermark information, and use a threshold secret sharing algorithm to divide the watermark information into N watermark fragments, where the threshold value is t, N, t is an integer greater than 1, and t is less than or equal to N;

[0069] Specifically, a threshold secret sharing algorithm is used, which is not limited to Shamir's secret sharing scheme, a secret sharing scheme based on the Chinese remainder theorem, etc., to divide the watermark information into N watermark fragments, and the threshold value is t;

[0070] Step 102: Select a numerical attribute m of the structured data to which watermark information is to be added to store the watermark information;

[0071] Determine the primary key of the structured data. If there is no primary key, find the data attribute set that can uniquely identify a data record, and find the numerical attribute set; select some of the numerical attributes m to store watermark information. If there is no numerical attribute in the structured data, you need to first randomly construct a column of numerical attributes in the data set.

[0072] Step 103: Set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and perform the following steps:

[0073] Processing steps: randomly generate a pseudo data record with a unique primary key value, and calculate the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N;

[0074] The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process;

[0075] The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, go to the processing step.

[0076] In a specific example, taking A equal to 2 as an example, the HMAC value of the primary key P1 of each row of data record in the structured data is calculated, h1 = HMAC k (P1), then divide all data records into N groups according to the value of h1 mod N (0, 1, 2, ..., N-1);

[0077] Set array l = [0, 0, 1, 1, ..., N-1, N-1], Bloom filter B, and perform the following operations:

[0078] 1) Randomly generate a pseudo data record to ensure that the primary key value is unique, and calculate the primary key HMAC value h = HMAC k (P), calculate j=h mod N.

[0079] 2) If j belongs to array l, first delete j from the array, then replace the m attribute of the record with the jth fragment of the watermark, write the pseudo data record into the Bloom filter B according to the Bloom filter rules, and finally add the pseudo data to the original data set. Specifically, add the pseudo data record to the corresponding data group j in the structured data according to the value of j.

[0080] 3) If j does not belong to array l, restart step 1.

[0081] 4) Execute the above steps until the array l becomes an empty set.

[0082] Sometimes, there may be judgment errors in the Bloom filter. By constructing the first array, it is possible to confirm A times whether the data record exists in the Bloom filter, thereby avoiding the judgment errors of the Bloom filter.

[0083] In this embodiment, the watermark information is inserted into the structured data in the form of data rows according to a certain algorithm, and is not easily identified and deleted. At the same time, the watermark information is fragmented using threshold technology. Even if some watermark rows are lost, the watermark information can still be extracted as long as the number of valid rows reaches the set threshold value, thereby improving the robustness of the watermark algorithm.

[0084] The embodiment of the present invention also provides a watermark extraction method, such as Figure 3 As shown, including:

[0085] Step 201: setting a two-dimensional array L, initializing the two-dimensional array L, traversing each row of structured data from which watermark information is to be extracted, and executing the following steps to update the two-dimensional array L:

[0086] Determine whether the row of data records is in Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N;

[0087] Extraction step: extract the value M of the numeric attribute m of the row data record j ;

[0088] Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0089] Specifically, initializing the two-dimensional array L may be setting the initial values ​​of the elements of the two-dimensional array L to all 0s.

[0090] Step 202: after the two-dimensional array L is updated, a one-dimensional array s is set, and the two-dimensional array L is traversed row by row. If the number of non-zero elements in a row is A, and the values ​​of the non-zero elements are all equal, the values ​​of the non-zero elements are added to the one-dimensional array s;

[0091] Step 203: If the number of data in the one-dimensional array s is not less than t, the data in the one-dimensional array s is reassembled by using a threshold secret sharing algorithm to obtain watermark information.

[0092] In a specific example, taking A=2 as an example, a two-dimensional array L is set, and each row of structured data after adding watermark information is traversed, and the following operations are performed:

[0093] 1) Determine whether the data record is in Bloom filter B. If so, calculate the primary key HMAC value h=HMAC of the data record. k (P), j = h mod N;

[0094] 2) Extract the value M of the data record attribute m j;

[0095] 3) Read the j-th row element L[j] of the two-dimensional array. The number of elements in the one-dimensional array L[j] is recorded as n j , L[j][n j ] is assigned to M j .

[0096] Afterwards, set a one-dimensional array s, and traverse the two-dimensional array L row by row. Each row of the two-dimensional array L is represented as a one-dimensional array L[i]. If the number of non-zero data in L[i] is 2 and the values ​​of the non-zero data are equal, add the values ​​of the non-zero data to the array s; if the number of data in the array s is not less than t, then reassemble these data pieces according to the threshold secret sharing algorithm to obtain the watermark value.

[0097] After the watermark information is inserted into the structured data using the watermark insertion method of the above embodiment, the watermark information in the structured data can be extracted using the watermark extraction method of this embodiment. In this embodiment, even if some watermark rows are lost, the watermark information can still be extracted as long as the number of valid rows reaches the set threshold value, thereby improving the robustness of the watermark algorithm.

[0098] The embodiment of the present invention also provides a watermark insertion device, such as Figure 4 As shown, including:

[0099] The encoding module 31 is used to encode the watermark information and divide the watermark information into N watermark fragments using a threshold secret sharing algorithm, where the threshold value is t, N, where t is an integer greater than 1 and t is less than or equal to N;

[0100] A selection module 32, used for selecting a numerical attribute m of the structured data to be added with watermark information to store the watermark information;

[0101] The processing module 33 is used to set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and performs the following steps: a processing step, randomly generating a pseudo data record with a unique primary key value, and calculating the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N; the first judgment step, judge whether the first array is empty, if not, turn to the second judgment step, if yes, end the process; the second judgment step, judge whether j belongs to the first array, if yes, delete one j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, turn to the processing step.

[0102] In some embodiments, if the structured data does not include a numerical attribute, the apparatus further includes:

[0103] A construction module is used to randomly construct a column of numerical attributes m in the structured data.

[0104] In some embodiments, A is equal to 2.

[0105] In some embodiments, the processing module 33 is further used to calculate the HMAC value of the primary key P1 of each row of data record in the structured data, where h1=HMAC k (P1), then divide all data records into N groups according to the value of h1 mod N; and add the dummy data record to the corresponding data group j in the structured data according to the value of j.

[0106] The embodiment of the present invention also provides a watermark extraction device, such as Figure 5 As shown, including:

[0107] The first processing module 41 is used to set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data to be extracted watermark information, and perform the following steps to update the two-dimensional array L: a judgment step to determine whether the row of data records is in the Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h=HMAC k (P), calculate j = h mod N; extraction step, extract the value M of the numeric attribute m of the row data record j ; Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0108] A second processing module 42 is used to set a one-dimensional array s after updating the two-dimensional array L, traverse the two-dimensional array L row by row, and if the number of non-zero elements in a row is A and the values ​​of the non-zero elements are all equal, add the values ​​of the non-zero elements to the one-dimensional array s;

[0109] The reorganization module 43 is used to reorganize the data in the one-dimensional array s by using a threshold secret sharing algorithm to obtain watermark information if the number of data in the one-dimensional array s is not less than t.

[0110] The embodiment of the present invention also provides a watermark insertion device, such as Figure 6 As shown, it includes a memory 51, a processor 52, and a computer program stored in the memory 51 and executable on the processor 52; when the processor 52 executes the program, the watermark insertion method as described above is implemented.

[0111] The processor 52 is used to encode and obtain watermark information, and use a threshold secret sharing algorithm to divide the watermark information into N watermark fragments, where the threshold value is t, N, t is an integer greater than 1, and t is less than or equal to N; select a numerical attribute m of the structured data to be added with watermark information to store the watermark information; set a first array and a Bloom filter B, where the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], A is an integer greater than 1, and perform the following steps:

[0112] Processing steps: randomly generate a pseudo data record with a unique primary key value, and calculate the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N;

[0113] The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process;

[0114] The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; if not, go to the processing step.

[0115] In some embodiments, if the structured data does not include a numerical attribute, the processor is further configured to randomly construct a column of numerical attributes m in the structured data.

[0116] In some embodiments, A is equal to 2.

[0117] In some embodiments, the processor 52 is further configured to calculate the HMAC value of the primary key P1 of each row of data record in the structured data, where h1=HMAC k (P1), then divide all data records into N groups according to the value of h1 mod N; and add the dummy data record to the corresponding data group j in the structured data according to the value of j.

[0118] The embodiment of the present invention also provides a watermark insertion and extraction device, such as Figure 7 As shown, it includes a memory 61, a processor 62, and a computer program stored in the memory 61 and executable on the processor 62; when the processor 62 executes the program, the watermark extraction method as described above is implemented.

[0119] The processor 62 is used to set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data from which watermark information is to be extracted, and perform the following steps to update the two-dimensional array L:

[0120] Determine whether the row of data records is in Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N;

[0121] Extraction step: extract the value M of the numeric attribute m of the row data record j ;

[0122] Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ;

[0123] After the two-dimensional array L is updated, a one-dimensional array s is set, and the two-dimensional array L is traversed row by row. If the number of non-zero elements in one row is A, and the values ​​of the non-zero elements are all equal, the values ​​of the non-zero elements are added to the one-dimensional array s;

[0124] If the number of data in the one-dimensional array s is not less than t, the data in the one-dimensional array s is fragmented and reassembled using the threshold secret sharing algorithm to obtain watermark information.

[0125] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the watermark insertion method or the steps in the watermark extraction method described above are implemented.

[0126] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage terminal devices to be detected or any other non-transmission media that can be used to store information that can be accessed by the computer terminal device to be detected. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carriers.

[0127] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A watermark insertion method, characterized in that: include: Encode to obtain watermark information, and use a threshold secret sharing algorithm to divide the watermark information into N watermark fragments, where the threshold value is t, N, t is an integer greater than 1, and t is less than or equal to N; Selecting a numerical attribute m of the structured data to be added with watermark information to store the watermark information; Set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and perform the following steps: Processing steps: randomly generate a pseudo data record with a unique primary key value, and calculate the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N; The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process; The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; If not, go to the processing step.

2. The watermark insertion method according to claim 1, characterized in that: If the structured data does not include a numerical attribute, the method further includes: A column of numerical attributes m is randomly constructed in the structured data.

3. The watermark insertion method according to claim 1, characterized in that: A is equal to 2.

4. The watermark insertion method according to claim 1, characterized in that: Also includes: Calculate the HMAC value of the primary key P1 of each row of data record in the structured data, h1 = HMAC k (P1), then divide all data records into N groups according to the value of h1mod N; Adding the dummy data record to the structured data includes: The dummy data record is added to the corresponding data group j in the structured data according to the value of j.

5. A watermark extraction method, characterized in that: include: Set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data from which watermark information is to be extracted, and perform the following steps to update the two-dimensional array L: Determine whether the row of data records is in Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N; Extraction step: extract the value M of the numeric attribute m of the row data record j ; Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ; After the two-dimensional array L is updated, a one-dimensional array s is set, and the two-dimensional array L is traversed row by row. If the number of non-zero elements in one row is A, and the values ​​of the non-zero elements are all equal, the values ​​of the non-zero elements are added to the one-dimensional array s; If the number of data in the one-dimensional array s is not less than t, the data in the one-dimensional array s is fragmented and reassembled using the threshold secret sharing algorithm to obtain watermark information.

6. A watermark insertion device, characterized in that: include: The encoding module is used to encode the watermark information and divide the watermark information into N watermark fragments using a threshold secret sharing algorithm, where the threshold value is t, N, where t is an integer greater than 1 and t is less than or equal to N; A selection module, used for selecting a numerical attribute m of the structured data to be added with watermark information to store the watermark information; A processing module is used to set a first array and a Bloom filter B, wherein the first array includes A groups of identical elements, each group of elements includes [0, 1, 2, ..., N-1], and A is an integer greater than 1, and performs the following steps: a processing step, randomly generating a pseudo data record with a unique primary key value, and calculating the HMAC value of the primary key P of the pseudo data record: h = HMAC k (P), calculate j = h mod N; The first judgment step is to judge whether the first array is empty. If not, turn to the second judgment step. If yes, end the process; The second judgment step is to judge whether j belongs to the first array. If so, delete j from the first array, replace the numerical attribute m of the pseudo data record with the jth watermark fragment, write the pseudo data record into the Bloom filter B, and add the pseudo data record to the structured data; If not, go to the processing step.

7. A watermark extraction device, characterized in that: include: The first processing module is used to set a two-dimensional array L, initialize the two-dimensional array L, traverse each row of structured data to be extracted watermark information, and perform the following steps to update the two-dimensional array L: a judgment step to determine whether the row of data records is in the Bloom filter B. If so, calculate the HMAC value of the primary key P of the row of data records: h = HMAC k (P), calculate j = h mod N; extraction step, extract the value M of the numeric attribute m of the row of data records j ; Assignment step, assign the first non-initialized value element in the j-th row of the two-dimensional array L to M j ; A second processing module is used to set a one-dimensional array s after updating the two-dimensional array L, traverse the two-dimensional array L row by row, and if the number of non-zero elements in one row is A and the values ​​of the non-zero elements are all equal, add the values ​​of the non-zero elements to the one-dimensional array s; The reorganization module is used to reorganize the data in the one-dimensional array s by using a threshold secret sharing algorithm if the number of data in the one-dimensional array s is not less than t, so as to obtain watermark information.

8. A watermark insertion device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the watermark insertion method according to any one of claims 1 to 4 is implemented.

9. A watermark extraction device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the watermark extraction method as claimed in claim 5 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the watermark insertion method according to any one of claims 1 to 4 or the steps of the watermark extraction method according to claim 5 are implemented.

Citation Information

Patent Citations

  • Genetic data in transactions

    GB201913142D0

  • Electronic information processing method and device, and recording medium

    JP2008070872A