A data table watermark embedding method
By grouping and processing data tables, combining Haar wavelet transform and singular value decomposition, the watermark embedding method is optimized, which solves the problems of high error rate and weak anti-attack ability in traditional methods, and achieves higher anti-attack ability and lower error rate.
Patent Information
- Application Number
- CN202510821587.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Traditional digital watermark embedding methods have high error rates when attacked, weak anti-attack capabilities, and cannot effectively protect the integrity of data tables.
By performing binary processing on the embedded watermark, the data table is divided into several groups according to the key value and primary key value of the target data table, and the predicted value and prediction error value of each column of data are calculated to determine the peak bucket value, adjust the data value to embed the watermark, and use Haar wavelet transform and singular value decomposition to optimize the image watermark processing.
The error rate of the watermark when it is attacked by deletion or addition is improved, the anti-attack capability is enhanced, and the error rate is reduced.
Smart Images

Figure CN120316749B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of watermark embedding, in particular to a data table watermark embedding method. Background Art
[0002] Digital watermarking technology, as a type of information hiding technology, is usually used in data tables. By embedding digital watermarks in data tables, the purpose of anti-counterfeiting and copyright protection is achieved. By extracting the digital watermark, it is possible to check whether the data information in the data table has been modified and to verify the integrity of the data information in the data table. The traditional digital watermark embedding method is to directly embed specific watermark information into the data table through a key combined with an information conversion algorithm. This watermark embedding method has a high error rate when subjected to watermark attacks and has weak anti-attack capabilities. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to one aspect of the present application, a data table watermark embedding method is provided, comprising the following steps:
[0005] Step S100: performing binary processing on the watermark to be embedded to obtain information to be embedded corresponding to the watermark to be embedded;
[0006] Step S200: Determine a number of table groups corresponding to the target data table based on the key value corresponding to the target data table, the primary key value corresponding to each table row in the target data table, and the length of the information to be embedded; each table group includes a number of table rows in the target data table;
[0007] Step S201: If there are decimal places in some data values in any table column within the target embedding area, then execute steps S202 to S203; otherwise, execute step S300;
[0008] Step S202: determining the maximum number of decimal places corresponding to a number of data values in the table column as the target number of decimal places;
[0009] Step S203, move the decimal point of each data value in the table column backward by the target number of digits, and execute step S300;
[0010] Step S300: performing data processing on each column of data in a target embedding area of a target data table to obtain a prediction value and a prediction error value corresponding to each column of data in the target embedding area; the target embedding area is the area to be embedded in the target data table where the watermark is to be embedded;
[0011] Step S400: Determine any table group as a target table group, and determine a target data value from the data of each table row of the target table group according to the key value, the primary key value corresponding to each table row of the target table group, and the number of columns in the target embedded area;
[0012] Step S500 , determining a peak bucket value corresponding to the target table group from the prediction error values corresponding to the target data values according to the prediction error value corresponding to each target data value of the target table group;
[0013] Step S600 , adjusting the target data value corresponding to each non-peak bucket value corresponding to the target table group according to each non-peak bucket value corresponding to the target table group and the predicted value corresponding to the non-peak bucket value;
[0014] Step S700 : adjusting the target data value corresponding to each peak bucket value in the target table group according to the target embedded data in the information to be embedded; the number of bits of the target embedded data in the information to be embedded is the group number corresponding to the target table group.
[0015] If the decimal places of the data values in any table column within the target embedded area are shifted backward, then after step S700 , step S801 is executed: the decimal point of the data values that have been shifted backward is shifted forward by the corresponding target number of places.
[0016] In an exemplary embodiment of the present application, step S100 includes:
[0017] Step S110: If the watermark to be embedded is text, execute step S120;
[0018] If the watermark to be embedded is a picture, then execute steps S130 to S150;
[0019] Step S120: performing binary processing on the characters corresponding to the watermark to be embedded to obtain the information to be embedded;
[0020] Step S130: Obtain low-frequency information to be embedded in the watermark through Haar wavelet transform;
[0021] Step S140: performing singular value decomposition on the low-frequency matrix corresponding to the low-frequency information to obtain a left singular matrix, a right singular matrix, and a diagonal matrix;
[0022] Step S150: perform binary processing on the diagonal matrix to obtain information to be embedded.
[0023] In an exemplary embodiment of the present application, step S200 includes:
[0024] Step S210: Obtain a preset key value D0;
[0025] Step S220: Obtain the primary key value corresponding to each table row in the target data table to obtain a first primary key value list D=(D1, D2, ..., D m ,...,D n ); where m=1,2,...,n; n is the number of rows in the target data table; D m The primary key value corresponding to the mth table row in the target data table;
[0026] Step S230, obtaining the length b of the information to be embedded;
[0027] Step S240: Determine the group number Q corresponding to the mth table row m =mod((Hash(D0+Hash(D0+D m ))),b); wherein, Hash() is the preset hash operation function; mod(,) is the preset remainder function;
[0028] Step S250 , traverse each table row in the target data table, and determine table rows corresponding to the same group number as the same table group, so as to determine a number of table groups corresponding to the target data table.
[0029] In an exemplary embodiment of the present application, step S300 includes:
[0030] Step S310: Get the data value of each table column in the target embedding area of the target data table to obtain a data value list set A=(A1, A2, ..., A i ,...,A j ); where i=1,2,...,j; j is the number of table columns in the target embedding area; A i is a list of data values corresponding to the i-th table column in the target embedding area;
[0031] A i =(A i1 ,A i2 ,...,A im ,...,A in );A im is the data value in the i-th table column and m-th table row within the target embedding area;
[0032] Step S320: Determine the predicted value B corresponding to the i-th table column in the target embedding area according to the data value list set A. i =Floor((MAX(A i )+MIN(A i )) / 2); wherein, MAX() is a preset maximum value determination function; MIN() is a preset minimum value determination function; Floor() is a preset floor rounding function;
[0033] Step S330: According to B i , determine the prediction error value corresponding to each data value in the i-th table column in the target embedding area to obtain the prediction error value list C corresponding to the i-th table column i =(C i1 ,C i2 ,...,C im ,...,C in ); among them, C im =A im -B i ; C im A im The corresponding prediction error value.
[0034] In an exemplary embodiment of the present application, step S400 includes:
[0035] Step S410: Determine any table group as a target table group, obtain the primary key value corresponding to each table row of the target table group, and obtain a second primary key value list R=(R1, R2, ..., R c ,...,R d ); where c = 1, 2, ..., d; d is the number of table rows in the target table group; R c The primary key value corresponding to the c-th table row in the target table group;
[0036] Step S420: Determine the number of columns E corresponding to the c-th table row in the target table group. c =mod((Hash(D0+R c )),j);
[0037] Step S430: The cth table row and the Eth c The data value in the cth table column is determined as the target data value corresponding to the cth table row in the target table group.
[0038] In an exemplary embodiment of the present application, step S420 further includes:
[0039] Step S421: If the cth table row and the Eth c The data value in the table column is the Eth column of the target data table. c If the maximum data value or the minimum data value in the table column is not found, then step S422 is executed; otherwise, step S430 is executed;
[0040] Step S422: Set E c =E c +1, and return to step S421.
[0041] In an exemplary embodiment of the present application, step S500 includes:
[0042] Step S510: Obtain the prediction error value corresponding to each target data value of the target table group to obtain a prediction error value list F=(F1, F2, ..., F c ,...,F d ); where F c is the prediction error value corresponding to the target data value of the c-th table row in the target table group;
[0043] Step S520: Take the absolute value of each prediction error value in the prediction error value list F to obtain the prediction error absolute value corresponding to each prediction error value, and determine the prediction error absolute value list G=(G1, G2, ..., G c ,...,G d ); where G c =|F c |, G c F c The corresponding absolute value of the prediction error;
[0044] Step S530: Perform frequency statistics on the absolute values of the prediction errors in the absolute value list of the prediction errors G to obtain a frequency list of the absolute value of the prediction errors I=(I1, I2, ..., I p ,...,I q ); where p = 1, 2, ..., q; q is the number of target prediction error absolute values obtained by performing frequency statistics on several prediction error absolute values in the prediction error absolute value list G; I p is the frequency of the absolute value of the p-th target prediction error in the prediction error absolute value list G;
[0045] Step S540: Determine the target prediction error absolute value corresponding to MAX(I) as the peak bucket value corresponding to the target table group.
[0046] In an exemplary embodiment of the present application, step S600 includes:
[0047] Step S610: Obtain each non-peak bucket value corresponding to the target table group to obtain a non-peak bucket value list J=(J1, J2, ..., J r ,...,J s ); where r = 1, 2, ..., s; s is the number of non-peak bucket values corresponding to the target table group; J r The rth non-peak bucket value corresponding to the target table group; the non-peak bucket value corresponding to the target table group is the absolute value of the prediction error that is not the peak bucket value among the absolute values of the prediction errors corresponding to the target table group;
[0048] Step S620: Get J r The predicted value L corresponding to the table column where the corresponding target data value is located r ;
[0049] Step S630, traverse the non-peak bucket value list J, if J r If the corresponding prediction error value is greater than the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and 1;
[0050] If J r If the corresponding prediction error value is less than the negative value of the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and -1;
[0051] Otherwise, J r Determined to be J r The corresponding prediction error value;
[0052] Step S640: J r The corresponding target data value is adjusted to L r +J r .
[0053] In an exemplary embodiment of the present application, step S700 includes:
[0054] Step S710, obtaining the group number t corresponding to the target table group;
[0055] Step S720: determining the t-th bit of data in the information to be embedded as target embedded data;
[0056] Step S730: Obtain the predicted value of each table column corresponding to the target table group, so as to obtain a predicted value list P=(P1, P2, ..., P e ,...,P f ); where e=1,2,...,f; f is the number of peak bucket values corresponding to the target table group; P e is the predicted value of the table column where the e-th peak bucket value corresponding to the target table group is located;
[0057] Step S740: If the target embedded data is 0, execute step S750;
[0058] If the target embedded data is 1, execute step S760;
[0059] Step S750: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, then adjust the target data value corresponding to the e-th peak bucket value corresponding to the target table group to Pe The sum of the peak bucket values corresponding to the target table group;
[0060] If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e The sum of the prediction error values corresponding to the peak bucket value;
[0061] Step S760: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, then adjust the target data value corresponding to the e-th peak bucket value corresponding to the target table group to P e +1 is the sum of the peak bucket values corresponding to the target table group;
[0062] If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e -1 is the sum of the prediction error values corresponding to the peak bucket value.
[0063] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by a processor to implement the aforementioned data table watermark embedding method.
[0064] According to one aspect of the present application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0065] The present invention has at least the following beneficial effects:
[0066] The data table watermark embedding method of the present invention performs binary processing on a watermark to be embedded to obtain information to be embedded corresponding to the watermark to be embedded, determines several table groups corresponding to the target data table based on a key value corresponding to the target data table, a primary key value corresponding to each table row in the target data table, and the length of the information to be embedded, and performs data processing on each column of data in a target embedding area of the target data table to obtain a predicted value and a predicted error value corresponding to each column of data in the target embedding area, determines any table group as a target table group, and then determines a target data value from each row of data in the target table group based on the key value, the primary key value corresponding to each table row in the target table group, and the number of columns in the target embedding area, determines a peak bucket value corresponding to the target table group from the predicted error values corresponding to each target data value in the target table group, adjusts the target data value corresponding to each non-peak bucket value corresponding to the target table group based on each non-peak bucket value corresponding to the target table group and the predicted value corresponding to the non-peak bucket value, and adjusts the target data value corresponding to each peak bucket value in the target table group based on the target embedded data in the information to be embedded. By analyzing the data of each table column and table row in the target embedding area, the predicted value and peak bucket value are obtained, and the watermark to be embedded is embedded into the target data table according to the predicted value and peak bucket value, so that the error rate of the watermark to be embedded when it is subjected to deletion attack or addition attack is lower than the error rate of the traditional watermark embedding method when it is subjected to watermark attack, thereby improving the anti-attack ability of the embedded watermark. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0068] Figure 1 This is a flow chart of a data table watermark embedding method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0070] This application proposes a data table watermark embedding method, such as Figure 1As shown, the following steps are included:
[0071] Step S100: performing binary processing on the watermark to be embedded to obtain information to be embedded corresponding to the watermark to be embedded;
[0072] The watermark to be embedded is a digital watermark that needs to be embedded, which can be a picture or text. By performing binary processing on the watermark to be embedded, binary information to be embedded is obtained, which facilitates the subsequent insertion of the watermark to be embedded into the target data table.
[0073] Furthermore, step S100 includes steps S110 to S150:
[0074] Step S110: If the watermark to be embedded is text, execute step S120;
[0075] If the watermark to be embedded is a picture, then execute steps S130 to S150;
[0076] Step S120: performing binary processing on the characters corresponding to the watermark to be embedded to obtain the information to be embedded;
[0077] Step S130: Obtain low-frequency information to be embedded in the watermark through Haar wavelet transform;
[0078] Step S140: performing singular value decomposition on the low-frequency matrix corresponding to the low-frequency information to obtain a left singular matrix, a right singular matrix, and a diagonal matrix;
[0079] Step S150: perform binary processing on the diagonal matrix to obtain information to be embedded.
[0080] Among them, the method for binary processing of characters to be embedded in watermarks adopts the existing text binary conversion method. When binary conversion is performed on the picture to be embedded in the watermark, not all pixels of the picture are embedded in the target data table (because if all pixels of the picture are embedded in the target data table, the information to be embedded after the watermark is embedded will become particularly long, which will affect the watermark embedding). Therefore, the low-frequency information of the watermark to be embedded is first obtained through Haar wavelet transform (Haar wavelet transform), and the high-frequency information of the watermark to be embedded is stored in the watermark extraction file. Then, the low-frequency matrix corresponding to the low-frequency information is subjected to singular value decomposition (SVD decomposition) to obtain a left singular matrix, a right singular matrix and a diagonal matrix. The left singular matrix and the right singular matrix are stored in the watermark extraction file, and then the diagonal matrix is binary processed to obtain the information to be embedded.
[0081] Step S200: determining a number of table groups corresponding to the target data table based on the key value corresponding to the target data table, the primary key value corresponding to each table row in the target data table, and the length of the information to be embedded;
[0082] Further, step S200 includes steps S210 to S250:
[0083] Step S210: Obtain a preset key value D0;
[0084] Step S220: Obtain the primary key value corresponding to each table row in the target data table to obtain a first primary key value list D=(D1, D2, ..., D m ,...,D n ); where m=1,2,...,n; n is the number of rows in the target data table; D m The primary key value corresponding to the mth table row in the target data table;
[0085] The key value and primary key value are values defined by the user based on the target data table or randomly set by the system.
[0086] Step S230, obtaining the length b of the information to be embedded;
[0087] Step S240: Determine the group number Q corresponding to the mth table row m =mod((Hash(D0+Hash(D0+D m ))),b);
[0088] Among them, Hash() is a preset hash operation function; mod(,) is a preset remainder function; the hash operation function adopts an existing function used to calculate the hash value or a user-defined hash operation function.
[0089] Step S250 , traverse each table row in the target data table, and determine table rows corresponding to the same group number as the same table group, so as to determine a number of table groups corresponding to the target data table.
[0090] Each table group includes several table rows of the target data table. Several table rows in the target data table are grouped to obtain several table groups. The group numbers corresponding to the several table rows in each table group are the same, and the number of table groups is the same as the binary length of the information to be embedded, that is, there are as many table groups as there are bits of the information to be embedded, so that each bit of data of the information to be embedded can be subsequently embedded into the data of the table group with the corresponding group number.
[0091] Step S300: performing data processing on each column of data in the target embedding region of the target data table to obtain a prediction value and a prediction error value corresponding to each column of data in the target embedding region;
[0092] The target embedding area is the area to be embedded in the target data table where the watermark is to be embedded.
[0093] Further, step S300 includes steps S310 to S330:
[0094] Step S310: Get the data value of each table column in the target embedding area of the target data table to obtain a data value list set A=(A1, A2, ..., A i ,...,A j ); where i=1,2,...,j; j is the number of table columns in the target embedding area; A i is a list of data values corresponding to the i-th table column in the target embedding area;
[0095] A i =(A i1 ,A i2 ,...,A im ,...,A in );A im is the data value in the i-th table column and m-th table row within the target embedding area;
[0096] Step S320: Determine the predicted value B corresponding to the i-th table column in the target embedding area according to the data value list set A. i =Floor((MAX(A i )+MIN(A i )) / 2); wherein, MAX() is a preset maximum value determination function; MIN() is a preset minimum value determination function; Floor() is a preset floor rounding function;
[0097] Step S330: According to B i , determine the prediction error value corresponding to each data value in the i-th table column in the target embedding area to obtain the prediction error value list C corresponding to the i-th table column i =(C i1 ,C i2 ,...,C im ,...,C in ); among them, C im =A im -B i ; C im A im The corresponding prediction error value.
[0098] Step S400: Determine any table group as a target table group, and determine a target data value from the data of each table row of the target table group according to the key value, the primary key value corresponding to each table row of the target table group, and the number of columns in the target embedded area;
[0099] After determining several table groups, watermarks are embedded into the data in each table group. To facilitate understanding of the solution of this application, steps S400 to S700 of this application only use one table group (i.e., the target table group) as an example to describe the watermark embedding method. After the watermark information of this table group is embedded, the watermark information of other table groups is embedded in turn. The watermark embedding method for all table groups is the same, so the watermark embedding method for other table groups will not be described in detail hereinafter.
[0100] Furthermore, step S400 includes steps S410 to S430:
[0101] Step S410: Determine any table group as a target table group, obtain the primary key value corresponding to each table row of the target table group, and obtain a second primary key value list R=(R1, R2, ..., R c ,...,R d ); where c = 1, 2, ..., d; d is the number of table rows in the target table group; R c The primary key value corresponding to the c-th table row in the target table group;
[0102] Step S420: Determine the number of columns E corresponding to the c-th table row in the target table group. c =mod((Hash(D0+R c )),j);
[0103] Step S430: The cth table row and the Eth c The data value in the cth table column is determined as the target data value corresponding to the cth table row in the target table group.
[0104] On the other hand, step S420 further includes steps S421 and S422:
[0105] Step S421: If the cth table row and the Eth c The data value in the table column is the Eth column of the target data table. c If the maximum data value or the minimum data value in the table column is not found, then step S422 is executed; otherwise, step S430 is executed;
[0106] Step S422: Set E c =E c +1, and return to step S421.
[0107] Traverse the data values in each table row and each table column of the target table group. If the data value is the maximum or minimum data value of the table column in the corresponding target data table, then in order to improve the accuracy of determining the target data value and enhance the anti-attack capability of the subsequently embedded watermark, the next table column corresponding to the table row is postponed, and the primary key value of the table row corresponding to the data value is recorded in the watermark extraction file (that is, the watermark extraction file mentioned in the above step S100, which is used to record various intermediate values generated by the watermark to be embedded in the embedding process (wherein the intermediate value includes the maximum value corresponding to each table column, the minimum value of the watermark to be embedded, and the maximum value of the watermark to be embedded). The target data value and the minimum data value are determined, as well as the primary key value of the table row where the data value that needs to be deferred when determining the target data value is located, and the peak bucket value determined below), so that the user can subsequently extract the watermark to be embedded from the target data table by viewing the various intermediate values recorded in the watermark extraction file). If the data value in the next table column is not the maximum or minimum data value in this table column, the data value is determined as the target data value corresponding to the table row; if the data value in the next table column is still the maximum or minimum data value in this table column, it continues to be deferred until the data value is not the maximum or minimum data value in the corresponding table column.
[0108] Step S500 , determining a peak bucket value corresponding to the target table group from the prediction error values corresponding to the target data values according to the prediction error value corresponding to each target data value of the target table group;
[0109] The peak bin value is an intermediate value set during the embedding process of the watermark to be embedded, and is used as a standard value to adjust the target data value to complete the embedding of the watermark to be embedded.
[0110] Furthermore, step S500 includes steps S510 to S540:
[0111] Step S510: Obtain the prediction error value corresponding to each target data value of the target table group to obtain a prediction error value list F=(F1, F2, ..., F c ,...,F d ); where F c is the prediction error value corresponding to the target data value of the c-th table row in the target table group;
[0112] Step S520: Take the absolute value of each prediction error value in the prediction error value list F to obtain the prediction error absolute value corresponding to each prediction error value, and determine the prediction error absolute value list G=(G1, G2, ..., G c ,...,G d ); where G c =|F c |, G c Fc The corresponding absolute value of the prediction error;
[0113] In order to effectively improve the embedding capacity of the watermark to be embedded, when determining the peak bucket value, the absolute value of each prediction error value is taken to increase the number of identical values of the prediction error absolute value, which can improve the accuracy of determining the peak bucket value.
[0114] Step S530: Perform frequency statistics on the absolute values of the prediction errors in the absolute value list of the prediction errors G to obtain a frequency list of the absolute value of the prediction errors I=(I1, I2, ..., I p ,...,I q ); where p = 1, 2, ..., q; q is the number of target prediction error absolute values obtained by performing frequency statistics on several prediction error absolute values in the prediction error absolute value list G; I p is the frequency of the absolute value of the p-th target prediction error in the prediction error absolute value list G;
[0115] Step S540: Determine the target prediction error absolute value corresponding to MAX(I) as the peak bucket value corresponding to the target table group.
[0116] Among them, a feasible embodiment of step S500 is: if several prediction error values in the prediction error value list F are -6, -5, -5, -3, 0, 1, 3, 5, 8; then the several prediction error absolute values in the prediction error absolute value list G are 6, 5, 5, 3, 0, 1, 3, 5, 8 in sequence; after performing frequency statistics on the several prediction error absolute values in the prediction error absolute value list G, the several target prediction error absolute values are 0, 1, 3, 5, 6, 8; then the frequencies of the several target prediction error absolute values are 1, 1, 2, 3, 1, 1 in sequence; since the frequency of the target prediction error absolute value with a value of 5 is the largest, 5 is determined as the peak bucket value.
[0117] Step S600 , adjusting the target data value corresponding to each non-peak bucket value corresponding to the target table group according to each non-peak bucket value corresponding to the target table group and the predicted value corresponding to the non-peak bucket value;
[0118] The non-peak bucket value corresponding to the target table group is the prediction error absolute value that is not the peak bucket value among the prediction error absolute values corresponding to the target table group (ie, in the embodiment of step S500 above, 6, 3, 0, 1, 3, and 8 are all non-peak bucket values).
[0119] Furthermore, step S600 includes steps S610 to S640:
[0120] Step S610: Obtain each non-peak bucket value corresponding to the target table group to obtain a non-peak bucket value list J=(J1, J2, ..., Jr ,...,J s ); where r = 1, 2, ..., s; s is the number of non-peak bucket values corresponding to the target table group; J r is the rth non-peak bucket value corresponding to the target table group;
[0121] Step S620: Get J r The predicted value L corresponding to the table column where the corresponding target data value is located r ;
[0122] Step S630, traverse the non-peak bucket value list J, if J r If the corresponding prediction error value is greater than the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and 1;
[0123] If J r If the corresponding prediction error value is less than the negative value of the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and -1;
[0124] Otherwise, J r Determined to be J r The corresponding prediction error value;
[0125] Taking the embodiment of step S500 as an example, step S600 is further described. The non-peak bucket values included in the non-peak bucket value list J are 6, 3, 0, 1, 3, and 8; the prediction error values corresponding to each non-peak bucket value in the non-peak bucket value list J are -6, -3, 0, 1, 3, and 8 respectively; the peak bucket value is 5;
[0126] Traverse each non-peak bucket value in the non-peak bucket value list J. The first non-peak bucket value in the non-peak bucket value list J is 6. The prediction error value corresponding to the first non-peak bucket value is -6. Since -6 is less than -5 (the negative value of the peak bucket value), the first non-peak bucket value is determined to be -7 (the sum of -6 and -1).
[0127] The second non-peak bucket value in the non-peak bucket value list J is 3, and the prediction error value corresponding to the second non-peak bucket value is -3. Since -3 is neither greater than 5 nor less than -5, the second non-peak bucket value is determined to be -3;
[0128] Similarly, the third, fourth, and fifth non-peak bucket values in the non-peak bucket value list J are determined to be 0, 1, and 3 respectively;
[0129] The sixth non-peak bucket value in the non-peak bucket value list J is 8, and the prediction error value corresponding to the sixth non-peak bucket value is 8. Since 8 is greater than 5, the sixth non-peak bucket value is determined to be 9 (the sum of 8 and 1).
[0130] Step S640: J r The corresponding target data value is adjusted to L r +J r .
[0131] Step S700: adjusting the target data value corresponding to each peak bucket value in the target table group according to the target embedded data in the information to be embedded;
[0132] The number of bits of the target embedded data in the information to be embedded is the group number corresponding to the target table group, that is, the target embedded data is the data located in the information to be embedded, at the group number corresponding to the target table group.
[0133] Furthermore, step S700 includes steps S710 to S760:
[0134] Step S710, obtaining the group number t corresponding to the target table group;
[0135] Step S720: determining the t-th bit of data in the information to be embedded as target embedded data;
[0136] For example, if the information to be embedded is 11001 and the group number t corresponding to the target table group is 3, then the target embedded data is the third bit of data in 11001, that is, 0.
[0137] Step S730: Obtain the predicted value of each table column corresponding to the target table group, so as to obtain a predicted value list P=(P1, P2, ..., P e ,...,P f ); where e=1,2,...,f; f is the number of peak bucket values corresponding to the target table group; P e is the predicted value of the table column where the e-th peak bucket value corresponding to the target table group is located;
[0138] Taking the embodiment of the above-mentioned step S500 as an example, step S730 is further explained. The number f of peak bucket values corresponding to the target table group is 3; therefore, the peak bucket value corresponding to the first predicted value in the predicted value list P is the peak bucket value corresponding to the first -5 in the predicted error value list F; the peak bucket value corresponding to the second predicted value in the predicted value list P is the peak bucket value corresponding to the second -5 in the predicted error value list F; the peak bucket value corresponding to the third predicted value in the predicted value list P is the peak bucket value corresponding to 5 in the predicted error value list F.
[0139] Step S740: If the target embedded data is 0, execute step S750;
[0140] If the target embedded data is 1, execute step S760;
[0141] Step S750: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, then adjust the target data value corresponding to the e-th peak bucket value corresponding to the target table group to P e The sum of the peak bucket values corresponding to the target table group;
[0142] If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e The sum of the prediction error values corresponding to the peak bucket value;
[0143] Step S760: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, then adjust the target data value corresponding to the e-th peak bucket value corresponding to the target table group to P e +1 is the sum of the peak bucket values corresponding to the target table group;
[0144] If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e -1 is the sum of the prediction error values corresponding to the peak bucket value.
[0145] In addition, after step S200, the present application further includes steps S201 to S203:
[0146] Step S201: If there are decimal places in some data values in any table column within the target embedding area, then execute steps S202 to S203; otherwise, execute step S300;
[0147] Step S202: determining the maximum number of decimal places corresponding to a number of data values in the table column as the target number of decimal places;
[0148] Step S203 , shift the decimal point of each data value in the table column backward by a target number of digits, and then execute step S300 .
[0149] On the other hand, if the decimal places of the data values in any table column within the target embedded area are shifted backward, then after step S700, step S801 is executed: the decimal point of the data values that have been shifted backward is moved forward by the corresponding target number of places.
[0150] As a feasible embodiment of step S201-step S203, if the target embedding area is the second to fifth columns of the target data table, the data values in the second and third columns are all integers, and the fourth and fifth columns include data values with decimal places. For example, the data values of the fourth column are 3.14, 5.26, 17.1, and 9, respectively. The target number of digits corresponding to the fourth column is 2, and the decimal places of each data value in the fourth column are shifted back by two places. Therefore, the data values of the fourth column become 314, 526, 1710, and 900, respectively; if the data values of the fifth column are 3.1, 5.2, 17.1, and 9, respectively, the target number of digits corresponding to the fifth column is 1, and the decimal places of each data value in the fifth column are shifted back by one place. Therefore, the data values of the fifth column become 31, 52, 171, and 90, respectively; then the peak bucket value is determined and the watermark is embedded. After the watermark embedding is completed, step S801 is executed again, that is, the transformed integer Then it is changed back to the original number of decimal places. The number of places the decimal point of the data value is moved forward is the same as the number of places the decimal point of the data value is moved back in step S203. For example, the data value of the fourth column mentioned above becomes 315, 526, 1711, and 900 after watermark embedding. Then after executing step S801 (moving the decimal place forward by two places), it becomes 3.15, 5.26, 17.11, and 9; and the number of places the decimal point of the data value of the fifth column is moved forward is 1 (the target number of places corresponding to the fifth column). Therefore, the watermark embedding method of the present application can be applied to the target data table storing decimals, which expands the application scenario. Although the existing data table watermark embedding method (such as other non-histogram shifting methods) can also embed watermarks into data containing decimal places, since the present application extends the histogram shifting algorithm to the field of non-integer tables, compared with the existing data table watermark embedding method, the distortion of the present application is smaller and the robustness is stronger.
[0151] The extraction of the watermark is the inverse operation of the watermark embedding method, so it will not be described here in detail.
[0152] The data table watermark embedding method of the present invention performs binary processing on a watermark to be embedded to obtain information to be embedded corresponding to the watermark to be embedded, determines several table groups corresponding to the target data table based on a key value corresponding to the target data table, a primary key value corresponding to each table row in the target data table, and the length of the information to be embedded, and performs data processing on each column of data in a target embedding area of the target data table to obtain a predicted value and a predicted error value corresponding to each column of data in the target embedding area, determines any table group as a target table group, and then determines a target data value from each row of data in the target table group based on the key value, the primary key value corresponding to each table row in the target table group, and the number of columns in the target embedding area, determines a peak bucket value corresponding to the target table group from the predicted error values corresponding to each target data value in the target table group, adjusts the target data value corresponding to each non-peak bucket value corresponding to the target table group based on each non-peak bucket value corresponding to the target table group and the predicted value corresponding to the non-peak bucket value, and adjusts the target data value corresponding to each peak bucket value in the target table group based on the target embedded data in the information to be embedded. By analyzing the data of each table column and table row in the target embedding area, the predicted value and peak bucket value are obtained, and the watermark to be embedded is embedded into the target data table according to the predicted value and peak bucket value, so that the error rate of the watermark to be embedded when it is subjected to deletion attack or addition attack is lower than the error rate of the traditional watermark embedding method when it is subjected to watermark attack.
[0153] An embodiment of the present invention further provides a computer program product comprising program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0154] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0155] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, mobile terminal, or network device) to execute the methods according to the embodiments of the present disclosure.
[0156] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0157] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as "circuits," "modules," or "systems."
[0158] The electronic device according to this embodiment of the present invention is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0159] The electronic device is implemented as a general-purpose computing device. Components of the electronic device may include, but are not limited to, the at least one processor, the at least one memory, and a bus connecting different system components (including the memory and the processor).
[0160] The storage stores program codes, which can be executed by the processor, so that the processor performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0161] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0162] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0163] The bus may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0164] An electronic device may also communicate with one or more external devices (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., a router, modem, etc.). This communication may occur via an input / output (I / O) interface. Furthermore, the electronic device may communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter.
[0165] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, on which is stored a program product capable of implementing the aforementioned methods of this specification. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0166] The program product may utilize any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0167] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0168] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0169] Program code for performing the operations of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0170] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0171] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0172] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A data table watermark embedding method, characterized in that: The steps include: Step S100: performing binary processing on the watermark to be embedded to obtain information to be embedded corresponding to the watermark to be embedded; Step S200: determining a plurality of table groups corresponding to the target data table based on the key value corresponding to the target data table, the primary key value corresponding to each table row in the target data table, and the length of the information to be embedded; each table group includes a plurality of table rows of the target data table; Step S300: performing data processing on each column of data in a target embedding area of the target data table to obtain a prediction value and a prediction error value corresponding to each column of data in the target embedding area; the target embedding area is the area to be embedded of the watermark in the target data table; Step S400: Determine any table group as a target table group, and determine a target data value from the data of each table row of the target table group according to the key value, the primary key value corresponding to each table row of the target table group, and the number of columns in the target embedded area; Step S500 , determining a peak bucket value corresponding to the target table group from the prediction error values corresponding to the target data values according to the prediction error value corresponding to each target data value of the target table group; Step S600 , adjusting a target data value corresponding to each non-peak bucket value corresponding to the target table group according to each non-peak bucket value corresponding to the target table group and a predicted value corresponding to the non-peak bucket value; Step S700: adjusting the target data value corresponding to each peak bucket value in the target table group according to the target embedded data in the information to be embedded; the number of bits of the target embedded data in the information to be embedded is the group number corresponding to the target table group; Wherein, the step S200 includes steps S210 to S250: Step S210: Obtain a preset key value D0; Step S220: Obtain the primary key value corresponding to each table row in the target data table to obtain a first primary key value list D=(D1, D2, ..., D m ,...,D n ); wherein m=1,2,...,n; n is the number of table rows in the target data table; D m The primary key value corresponding to the mth table row in the target data table; Step S230: Obtain the length b of the information to be embedded; Step S240: Determine the group number Q corresponding to the mth table row m =mod((Hash(D0+Hash(D0+D m ))),b); wherein, Hash() is the preset hash operation function; mod(,) is the preset remainder function; Step S250: traverse each table row in the target data table, and determine table rows corresponding to the same group number as the same table group, so as to determine a number of table groups corresponding to the target data table; Wherein, the step S300 includes steps S310 to S330: Step S310: Obtain the data value of each table column in the target embedding area of the target data table to obtain a data value list set A=(A1, A2, ..., A i ,...,A j ); where i=1,2,...,j; j is the number of table columns in the target embedding area; A i A list of data values corresponding to the i-th table column in the target embedding area; A i =(A i1 ,A i2 ,...,A im ,...,A in );A im The data value in the i-th table column and the m-th table row within the target embedding area; Step S320: Determine the predicted value B corresponding to the i-th table column in the target embedding area according to the data value list set A. i =Floor((MAX(A i )+MIN(A i )) / 2); wherein, MAX() is a preset maximum value determination function; MIN() is a preset minimum value determination function; Floor() is a preset floor rounding function; Step S330: According to B i , determine the prediction error value corresponding to each data value in the i-th table column within the target embedding area to obtain the prediction error value list C corresponding to the i-th table column i =(C i1 ,C i2 ,...,C im ,...,C in ); among them, C im =A im -B i ; C im A im The corresponding prediction error value; Wherein, the step S400 includes steps S410 to S430: Step S410: Determine any table group as a target table group, obtain the primary key value corresponding to each table row of the target table group, and obtain a second primary key value list R=(R1, R2, ..., R c ,...,R d ); where c=1,2,...,d; d is the number of table rows in the target table group; R c is the primary key value corresponding to the c-th table row in the target table group; Step S420: Determine the number of columns E corresponding to the c-th table row in the target table group. c =mod((Hash(D0+R c )),j); Step S430: The cth table row and the Eth table row in the target table group are c The data value in the cth table column is determined as the target data value corresponding to the cth table row in the target table group; Wherein, the step S500 includes steps S510 to S540: Step S510: Obtain the prediction error value corresponding to each target data value of the target table group to obtain a prediction error value list F=(F1, F2, ..., F c ,...,F d ); where F c is the prediction error value corresponding to the target data value of the c-th table row in the target table group; Step S520: Take the absolute value of each prediction error value in the prediction error value list F to obtain the prediction error absolute value corresponding to each prediction error value, and determine the prediction error absolute value list G=(G1, G2, ..., G c ,...,G d ); where G c =|F c |, G c F c The corresponding absolute value of the prediction error; Step S530: Perform frequency statistics on the absolute values of the prediction errors in the prediction error absolute value list G to obtain a prediction error absolute value frequency list I=(I1, I2, ..., I p ,...,I q ); wherein p=1,2,...,q; q is the number of target prediction error absolute values obtained by performing frequency statistics on a number of prediction error absolute values in the prediction error absolute value list G; I p is the frequency of the p-th target prediction error absolute value in the prediction error absolute value list G; Step S540: Determine the target prediction error absolute value corresponding to MAX(I) as the peak bucket value corresponding to the target table group; The step S600 includes steps S610 to S640: Step S610: Obtain each non-peak bucket value corresponding to the target table group to obtain a non-peak bucket value list J=(J1, J2, ..., J r ,...,J s ); where r=1,2,...,s; s is the number of non-peak bucket values corresponding to the target table group; J r The rth non-peak bucket value corresponding to the target table group; the non-peak bucket value corresponding to the target table group is the prediction error absolute value that is not the peak bucket value among the several prediction error absolute values corresponding to the target table group; Step S620: Get J r The predicted value L corresponding to the table column where the corresponding target data value is located r ; Step S630: traverse the non-peak bucket value list J. If J r The corresponding prediction error value is greater than the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and 1; If J r The corresponding prediction error value is less than the negative value of the peak bucket value corresponding to the target table group, then J r Determined to be J r The sum of the corresponding prediction error value and -1; Otherwise, J r Determined to be J r The corresponding prediction error value; Step S640: J r The corresponding target data value is adjusted to L r +J r ; The step S700 includes steps S710 to S760: Step S710, obtaining the group number t corresponding to the target table group; Step S720: determining the t-th bit of data in the information to be embedded as target embedded data; Step S730: Obtain the predicted value of each table column corresponding to the target table group, so as to obtain a predicted value list P=(P1, P2, ..., P e ,...,P f ); where e=1,2,...,f; f is the number of peak bucket values corresponding to the target table group; P e is the predicted value of the table column where the e-th peak bucket value corresponding to the target table group is located; Step S740: If the target embedded data is 0, execute step S750; If the target embedded data is 1, execute step S760; Step S750: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, then the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e The sum of the peak bucket values corresponding to the target table group; If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e The sum of the prediction error values corresponding to the peak bucket value; Step S760: If the e-th peak bucket value corresponding to the target table group is equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e +1 is the sum of the peak bucket values corresponding to the target table group; If the e-th peak bucket value corresponding to the target table group is not equal to the prediction error value corresponding to the peak bucket value, the target data value corresponding to the e-th peak bucket value corresponding to the target table group is adjusted to P e -1 and the sum of the prediction error values corresponding to the peak bucket value.
2. The method according to claim 1, characterized in that The step S100 includes: Step S110: If the watermark to be embedded is text, execute step S120; If the watermark to be embedded is a picture, then execute steps S130 to S150; Step S120: performing binary processing on the characters corresponding to the watermark to be embedded to obtain information to be embedded; Step S130: Obtain the low-frequency information to be embedded in the watermark through Haar wavelet transform; Step S140: performing singular value decomposition on the low-frequency matrix corresponding to the low-frequency information to obtain a left singular matrix, a right singular matrix, and a diagonal matrix; Step S150: performing binary processing on the diagonal matrix to obtain information to be embedded.
3. The method according to claim 1, characterized in that The step S420 further includes: Step S421: If the cth table row and the Eth c The data value in the table column is the Eth column of the target data table. c If the maximum data value or the minimum data value in the table column is not found, then step S422 is executed; otherwise, step S430 is executed; Step S422: Set E c =E c +1, and return to step S421.
4. The method according to claim 1, wherein After step S200, the method further includes: Step S201: If there are decimal places in some data values in any table column within the target embedding area, then execute steps S202 to S203; otherwise, execute step S300; Step S202: determining the maximum number of decimal places corresponding to a number of data values in the table column as the target number of decimal places; Step S203, move the decimal point of each data value in the table column backward by the target number of digits, and execute step S300; If the decimal places of the data values in any table column within the target embedded area are shifted backward, then after step S700, the method further includes: Step S801: Move the decimal point of the data value that has been subjected to the backward shift operation forward by the corresponding target number of digits.
Citation Information
Patent Citations
Table data extraction method and device, computer equipment and storage medium
CN120030162A
Method and Apparatus for Watermarking Stream Data
US20060277410A1