Watermark insertion method and device, watermark extraction method and device, first equipment, second equipment, storage medium and computer program product
Through the method of segmenting watermark information and grouping it based on keys, multi-level insertion and extraction of watermark information in the database is realized, which solves the problem of insufficient single watermark coverage and multi-level traceability in the existing technology, and improves data security. and robustness.
Patent Information
- Application Number
- CN202410404845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, database watermarks can only be added once, which makes it impossible to achieve multi-level traceability of data. Moreover, when watermark information is inserted, it is easy to overwrite the original information, affecting data security.
By dividing the watermark information into multiple fragments, and grouping the authentication codes of the data records based on the key, and gradually inserting the pseudo data, the insertion and extraction of multi-level watermark information is realized, ensuring that each insertion does not overwrite the previous information.
It realizes the multi-level traceability capability of data, enhances the security and robustness of data in the sharing process, and avoids the problem of watermark information coverage.
Smart Images

Figure CN118797587A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and in particular to a watermark insertion method, extraction method, apparatus, first device, second device, storage medium and computer program product. Background Art
[0002] Database watermarking is a technical means to protect data copyright and trace data leakage. In related technologies, watermark information can only be added once at most, which makes it impossible to achieve multi-level traceability of data. Summary of the invention
[0003] In view of this, the embodiments of the present application hope to provide a watermark insertion method, extraction method, apparatus, first device, second device, storage medium and computer program product, which can realize multi-level traceability of data.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a watermark insertion method, which is applied to a first device, and the method includes:
[0006] Divide the watermark information into N watermark fragments, where N is an integer greater than or equal to 1;
[0007] Based on the key, determine the authentication code corresponding to the first primary key value of each data record in the data table; wherein the key corresponds to the data sender of the data table;
[0008] Based on the authentication code corresponding to the first primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups;
[0009] For each group, pseudo data is constructed, and N watermark fragments are sequentially inserted into the pseudo data corresponding to the multiple groups according to the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment.
[0010] In a second aspect, an embodiment of the present application provides a watermark extraction method, wherein the watermark includes one or more levels of watermarks and is applied to a second device, and the method includes:
[0011] For each level of watermark, based on the key, determine the authentication code corresponding to the third primary key value of each data record in the received data table; wherein the key corresponds to the data recipient of the received data table;
[0012] Based on the number N of authentication codes and watermark fragments corresponding to the third primary key value, grouping all data records contained in the data table to obtain multiple groups, where N is an integer greater than or equal to 1;
[0013] From each group, determine pseudo data corresponding to each group;
[0014] N watermark fragments are extracted from the pseudo data corresponding to each group, and multiple watermark fragments are combined to obtain watermark information.
[0015] In a third aspect, an embodiment of the present application provides a watermark insertion device, the watermark insertion device comprising:
[0016] A segmentation unit, used for segmenting the watermark information into N watermark fragments, where N is an integer greater than or equal to 1;
[0017] A first determining unit, configured to determine, based on a key, an authentication code corresponding to a first primary key value of each data record in a data table; wherein the key corresponds to a data sender of the data table;
[0018] A first grouping unit, configured to group all data records contained in the data table based on the authentication code corresponding to the first primary key value and the number N of watermark fragments to obtain a plurality of groups;
[0019] The inserting unit is used to construct pseudo data for each group, and insert N watermark fragments into the pseudo data corresponding to multiple groups in sequence according to the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment.
[0020] In a fourth aspect, an embodiment of the present application provides a watermark extraction device, wherein the watermark includes one or more levels of watermarks, and the watermark extraction device includes:
[0021] A second determination unit is used to determine, for each level of watermark, an authentication code corresponding to the third primary key value of each data record in the received data table based on a key; wherein the key corresponds to a data recipient of the received data table;
[0022] A second grouping unit is used to group all data records contained in the data table based on the authentication code corresponding to the third primary key value and the number N of watermark fragments to obtain multiple groups, where N is an integer greater than or equal to 1;
[0023] The second determining unit is further used to determine the pseudo data corresponding to each group from each group;
[0024] The combining unit is used to extract N watermark fragments from the pseudo data corresponding to each group, and combine multiple watermark fragments to obtain watermark information.
[0025] In a fifth aspect, an embodiment of the present application provides a first device, which includes: a first processor and a first memory; when the first processor executes a running program stored in the first memory, the above-mentioned watermark insertion method is implemented.
[0026] In a sixth aspect, an embodiment of the present application provides a second device, the second device comprising: a second processor and a second memory; the above-mentioned watermark extraction method is implemented when the second processor executes a running program stored in the second memory.
[0027] In a seventh aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which implements the above-mentioned watermark insertion method when executed by a processor, or implements the above-mentioned watermark extraction method when executed by a processor.
[0028] In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, wherein the computer program implements the above-mentioned watermark extraction method when executed by a processor, or the computer program implements the above-mentioned watermark extraction method when executed by a processor.
[0029] The embodiment of the present application provides a watermark insertion method, extraction method, apparatus, first device, second device, storage medium and computer program product, the method comprising: the first device divides the watermark information into N watermark fragments, N is an integer greater than or equal to 1; based on the key, determines the authentication code corresponding to the first primary key value of each data record in the data table; wherein the key corresponds to the data sender of the data table; based on the authentication code corresponding to the first primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups; for each group, constructs pseudo data, and adds the pseudo data corresponding to each of the multiple groups in the order of dividing the watermark fragments. The invention relates to a method for inserting N watermark fragments into the data in sequence; wherein one pseudo data is inserted into one watermark fragment; and the second device determines, for each level of watermark, based on the key, the authentication code corresponding to the third primary key value of each data record in the received data table; wherein the key corresponds to the data recipient of the received data table; based on the authentication code corresponding to the third primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups, where N is an integer greater than or equal to 1; from each group, the pseudo data corresponding to each group is determined; N watermark fragments are extracted from the pseudo data corresponding to each group, and the N watermark fragments are combined to obtain watermark information. With the above implementation scheme, since each data sender corresponds to a different key, the authentication code of the first primary key determined according to the key is different. When different data senders use the corresponding authentication code to group all the data records in the data table, the resulting groups are different. Therefore, when pseudo data is constructed for each group and the corresponding watermark fragment is inserted, the insertion position of the watermark fragment is different. Therefore, when the data table is forwarded, the watermark information inserted each time does not affect the watermark information inserted last time, and multi-level watermark information can be inserted. Therefore, when tracing the data, the watermark fragments inserted corresponding to the data recipient can be extracted from the pseudo data corresponding to different groups. Therefore, when the data table is received, the watermark information extracted each time corresponds to the data recipient, and multi-level data tracing can be performed step by step. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a watermark insertion method flow provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a process for adding watermark information step by step provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of grouping all data records provided in an embodiment of the present application Figure 1 ;
[0033] Figure 4 A schematic diagram of grouping all data records provided in an embodiment of the present application Figure 2 ;
[0034] Figure 5 A schematic diagram of a watermark extraction method provided in an embodiment of the present application
[0035] Figure 6 A schematic diagram of the structure of a watermark insertion device provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the composition structure of a first device provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of the composition structure of a watermark extraction device provided in an embodiment of the present application;
[0038] Fig. 9 A schematic diagram of the composition structure of a second device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the technical solution of the present application is further elaborated in detail below in combination with the drawings and specific embodiments of the specification. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0040] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art to which the present application belongs. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0041] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first / second / third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0042] Database watermarking is a technical means to protect data copyright and trace data leakage. Most of the database watermarking schemes in related technologies can only add watermark information once. If the watermark information is added repeatedly, the newly added watermark information will overwrite the original watermark information. For example, the newly added watermark information will be inserted into the position where the original watermark information was added, resulting in the inability to achieve multi-level traceability of the data through the added watermark information.
[0043] As data becomes a form of asset, in order to better maximize the value of data and avoid data island problems, there are more and more scenarios for structured data sharing. In the process of data sharing, it is necessary to add watermarks to protect the copyright of the publisher and to ensure that the publisher will not leak or resell the data to third parties when sharing it with them. However, the relevant technology can only achieve single watermark information addition, which makes it difficult to ensure data security.
[0044] In the related art, the following two methods of adding watermarks are taken as examples:
[0045] (1) A digital watermark copyright protection method for a numerical relational database is proposed in the related art, which belongs to the field of computer security and specifically provides a method for embedding and extracting and verifying a watermark for a numerical relational database. The method includes pattern and data analysis of a numerical relational database, digital watermark generation and embedding, and a digital watermark detection method. In view of the characteristics of a numerical relational database, the digital watermark information can be efficiently and dynamically injected into the data uniformly, and the digital watermark information can be extracted without the need for source data. The method adopts key encryption and anti-reordering technologies, which can effectively resist various types of watermark removal attacks and ensure that the watermark will not be lost when less than 50% of the rows are modified.
[0046] (2) A watermark processing and data tracing method is also proposed in the related art, which includes the following steps: database initialization step: automatically discover data according to the discovery rules, extract the specified data set, and generate a data subset; watermark processing step for the generated data subset: add pseudo row data and pseudo column data and embed the data watermark according to the field rule characteristics to generate data with watermark mark. This solution can improve the security protection capability in the data sharing process, realize the embedding of data watermarks and the tracing of leaked data, and has the characteristics of high security performance, small data loss and not easy to be destroyed, so it has a wide range of application scenarios in the field of database security.
[0047] The above two methods of adding watermarks have the following disadvantages:
[0048] In (1), the watermark information is inserted in 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 in (1) requires modifying the original data attribute value, which will affect the business to a certain extent. In the watermark algorithm proposed in (2), the watermark value is completely random, and it is necessary to record the randomly generated watermark for comparison during watermark extraction, which is less user-friendly. In both (1) and (2), it is impossible to insert a multi-level watermark.
[0049] To solve the above problems, the present application provides a watermark insertion method, such as Figure 1As shown, applied to a first device, the method may include:
[0050] S101. Divide the watermark information into N watermark fragments, where N is an integer greater than or equal to 1.
[0051] In the embodiment of the present application, the watermark insertion method mainly targets structured data as the data type. In structured data, a row of data is called a data record, and a column of data is called a data attribute.
[0052] In the embodiment of the present application, the first device may be a watermark insertion device, and the watermark insertion device may insert watermark information into structured data.
[0053] In the embodiments of the present application, the watermark insertion method can be applied to different roles, such as data owners, data users, data publishers, etc.
[0054] For example, Figure 2 As shown, after the data owner adds watermark information 1 to the data, the data with watermark information 1 is sent to data receiver 1. After receiving the data with watermark information 1, data receiver 1 continues to add watermark information 2 on the basis of the data with watermark information 1, and so on, until it is sent to data receiver n. Among them, watermark information 1 to n are different.
[0055] In the embodiment of the present application, assuming that for a data table T, table T contains a primary key and a numerical attribute, when adding watermark information to the data, the watermark information is first divided into N watermark fragments, where N is an integer greater than or equal to 1.
[0056] In the embodiment of the present application, taking the data owner adding watermark information to the data as an example, when the data owner sends the data to the data receiver 1, the data owner first adds the first-level watermark corresponding to the data owner. Specifically, the data owner first encodes the watermark information, and then uses the threshold secret sharing algorithm to divide the encoded watermark information into N watermark fragments. The N watermark fragments can be recorded as W0, ..., W N-1 , where the length of each watermark segment can be L.
[0057] In the embodiment of the present application, the threshold secret sharing algorithm may include but is not limited to the following algorithms: Shamir's secret sharing method, and a secret sharing method based on the Chinese remainder theorem.
[0058] S102: Determine, based on the key, the authentication code corresponding to the first primary key value of each data record in the data table.
[0059] The key corresponds to the data sender of the data table.
[0060] In the embodiment of the present application, different data transmissions correspond to different keys.
[0061] Exemplarily, when the data sender of the data table is the data owner, the key is the key corresponding to the data owner; when the data sender of the data table is data receiver 1, the key is the key corresponding to data receiver 1.
[0062] In the embodiment of the present application, the authentication code may be a hash-based message authentication code (Hash-based Message Authentication Code, HMAC).
[0063] In the embodiment of the present application, each data record in the data table T includes a first primary key value, and the first primary key value P of each data record is determined from the data table T.
[0064] It should be noted that if there is no primary key, a set of data attributes that can uniquely identify a data record is determined from each data record.
[0065] In the embodiment of the present application, the HMAC value of the first primary key P of each data record is calculated using the key corresponding to the data sender. The specific calculation method is shown in formula (1):
[0066] h = HMAC k (P) (1)
[0067] Among them, k is the key of the data sender. For example, if the data sender is the data owner, k is the key of the data owner. P is the first primary key value of each data record, and h is the HMAC value corresponding to the first primary key value of each data record.
[0068] S103: Group all data records included in the data table based on the authentication code corresponding to the first primary key value and the number N of watermark fragments to obtain multiple groups.
[0069] In the embodiment of the present application, when grouping all data records contained in the data table T, the authentication code corresponding to the first primary key value of each data record and the number of watermark fragments N are used for grouping. Specifically, all data records are grouped using formula (2), and formula (2) is as follows:
[0070] h mod N(2)
[0071] Wherein, N is the number of watermark fragments, and h is the HMAC value corresponding to the first primary key value of each data record.
[0072] In the embodiment of the present application, according to the calculation method of formula (2), all possible values of h mod N can be obtained, and the values can be 0, 1, 2, ..., N-1. All data records in the data table T are divided into N groups according to the values.
[0073] For example, Figure 3 As shown, from Figure 3 It can be seen that according to the modulo result of the HMAC value corresponding to the first primary key value P of each data record and the watermark fragment N, all data records are divided into N groups, and the corresponding hmod N values in each group of data records are the same.
[0074] S104. For each group, construct pseudo data, and insert N watermark fragments into the pseudo data corresponding to the plurality of groups in sequence according to the order of dividing the watermark fragments.
[0075] Among them, a dummy data is inserted into a watermark segment.
[0076] In the embodiment of the present application, each group corresponds to a line of dummy data. If the number of groups is N, there are N lines of dummy data.
[0077] In an embodiment of the present application, when N watermark fragments are inserted in sequence in the order of watermark fragments in a row of pseudo data corresponding to each group, the first watermark fragment can be inserted in the first group, the second watermark fragment can be inserted in the second group, and so on, until the N watermark fragments are inserted into the N groups.
[0078] In the embodiment of the present application, the watermark fragments inserted into each group are different, and the watermark fragments in each group can constitute a complete watermark information.
[0079] It can be understood that in a watermark insertion method provided in an embodiment of the present application, when inserting watermark information, since each data sender corresponds to a different key, the authentication code of the first primary key determined according to the key is different. When different data senders use the corresponding authentication code to group all the data records in the data table, the resulting groups are different. Therefore, when pseudo data is constructed for each group and the corresponding watermark fragment is inserted, the insertion position of the watermark fragment is different. Therefore, when the data table is forwarded, each time the watermark information is inserted, it will not affect the watermark information inserted last time, and multi-level watermark information can be inserted. Therefore, when tracing the data, multi-level traceability of the data can be performed step by step.
[0080] In one embodiment of the present application, the data table T contains a primary key and S numeric attributes. Then, a row of pseudo data constructed for each group can be the same as the number of numeric attributes in the data table T, and each row of pseudo data also contains S numeric attributes, where S is an integer greater than or equal to 1.
[0081] In an embodiment of the present application, when N watermark fragments are inserted sequentially into the pseudo data corresponding to multiple groups according to the order of the divided watermark fragments, the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes in the pseudo data corresponding to the group number i can be determined based on the group numbers i and S; where i∈[0, N-1]; the watermark fragment with sequence number i is inserted at the insertion position.
[0082] In the embodiment of the present application, each row of pseudo data is constructed to store W of N watermark fragments. i , that is, W0,…,W N-1 .
[0083] In the embodiment of the present application, the group number i may be a value of h mod N. For example, if h mod N=0, the group number i is 0.
[0084] In an embodiment of the present application, the value of i mod S is calculated, the position of the numerical attribute corresponding to the value of i mod S in each row of pseudo data is determined, and the lowest bit of the numerical attribute at the position is determined, and the watermark fragment with serial number i is inserted into the lowest bit of the numerical attribute.
[0085] Exemplarily, assuming that there are 5 groups, and the group numbers are 0, 1, 2, 3, and 4 respectively, when the group number i=0, S=6 (the numerical attribute number can be 0, 1, ..., 5), then i mod S=0, and the watermark fragment W0 with sequence number 0 in the N watermark fragments is inserted at the position in the row of pseudo data corresponding to the group number 0: the numerical attribute corresponding to the numerical attribute number i mod S=0, that is, the first numerical attribute, and the watermark fragment W0 with sequence number 0 is inserted in the lowest bit of the first numerical attribute.
[0086] By analogy, in a row of pseudo data corresponding to group number 1, a watermark fragment W1 with sequence number 1 is inserted into the lowest bit of the numerical attribute corresponding to the numerical attribute number i mod S=1, ..., until N watermark fragments are inserted into the corresponding positions of the corresponding row of pseudo data.
[0087] In an embodiment of the present application, the pseudo data further includes a primary key, and each primary key includes multiple data bits.
[0088] In the embodiment of the present application, among the S numerical attributes in each row, one numerical attribute is used to store the watermark fragment W. i , and each row of pseudo data stores watermark fragment W iIn addition to a numerical attribute, it also includes a primary key and S-1 numerical attributes. The construction of the primary key and S-1 numerical attributes can be adopted in the following manner: for the primary key, the first data is set in the first data bit among multiple data bits, and the first data is the same as the group number i; the second data is set in the remaining data bits except the first data bit, and the second data satisfies: the authentication code of the second primary key value corresponding to the primary key of the pseudo data is the same as the third data determined by the number N of watermark fragments and the group number i, and the second primary key value includes the first data and the second data.
[0089] For the numerical attributes in the pseudo data, based on the numbers j and group number i of the remaining numerical attributes except the numerical attribute with watermark fragment number i, the fourth data is determined, and the values of the remaining numerical attributes are set to the fourth data.
[0090] In an embodiment of the present application, each row of pseudo data includes a primary key, the primary key includes multiple data bits, the first data bit may be the lowest bit among the multiple data bits, and the remaining data bits are the data bits other than the lowest bit among the multiple data bits.
[0091] In the embodiment of the present application, the first data is the same as the group number i. For example, if the group number i is 0, then the first data is 0.
[0092] In an embodiment of the present application, if the group number i is 0, the lowest bit of the multiple data bits contained in the primary key in the constructed pseudo data is set to 0; if the group number i=1, the lowest bit of the multiple data bits contained in the primary key in the constructed pseudo data is set to 1, and so on.
[0093] In the embodiment of the present application, the remaining data bits contained in the primary key in the constructed pseudo data are set as the second data. The second data set by the remaining data bits may be randomly generated data, but the second data set by the remaining data bits must meet the following conditions:
[0094] It is necessary to ensure that the HMAC value of the second primary key value P' corresponding to the primary key of the pseudo data finally constructed is the same as the third data determined by N and the group number i. Specifically, as shown in formula (3):
[0095] HMAC k (P') mod N = i (3)
[0096] Among them, P' is the second primary key value in the constructed pseudo data, N is the number of watermark fragments, i is the group number, and k is the key.
[0097] Exemplarily, the second primary key value in the pseudo data constructed in each group includes the first data and the randomly generated second data. If the group number i is 1 and N is 6, the last generated second primary key value P' must satisfy that the HMAC value of P' mod the value of the watermark fragment is the same as 1.
[0098] In the embodiment of the present application, for the S numerical attributes, except for the storage watermark fragment W i Except for one numerical attribute, the remaining S-1 numerical attributes are used to set the fourth data. The fourth data is determined based on the numbers j and the grouping number i of the remaining numerical attributes. Specifically, the lowest bit of the numerical attribute numbered j is assigned to i mod j, that is, the fourth data corresponding to the S-1 numerical attributes is i mod j.
[0099] Exemplarily, if there are 5 numerical attributes, the corresponding numbers of the numerical attributes are 0, 1, 2, 3, and 4, and the group number i is 1, and the numerical attribute numbered 1 corresponding to the numerical attribute is inserted into the watermark fragment W1, then the remaining numerical attributes are numbered 0, 2, 3, and 4, and the fourth data needs to be set, then the value of j can be 0, 2, 3, and 4. According to the value of i mod j, the value of i mod j is set in the lowest bit of the numerical attribute corresponding to the corresponding numerical attribute number. For example, the value of 1 mod 2 is 1, then 1 is set in the lowest bit of the numerical attribute numbered 2.
[0100] It should be noted that the setting method in the dummy data corresponding to each group is the same, and the setting method in the above embodiment can be referred to, which will not be listed here one by one.
[0101] It should be noted that the remaining fields in the pseudo data constructed in the data table T, such as the unstructured data part, can be randomly generated according to the format in the data table T.
[0102] In the embodiment of the present application, in order to improve the robustness of the inserted watermark information, redundancy M can also be set when grouping to correct errors in the watermark information.
[0103] In one embodiment of the present application, based on the authentication code and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups, and redundancy can also be set; based on the authentication code, the number N of watermark fragments and redundancy, all data records contained in the data table are grouped to obtain multiple groups.
[0104] In the embodiment of the present application, the authentication code is the HMAC value corresponding to the first primary key value of each data record. The specific calculation can be based on the calculation process of the above formula (1), which will not be repeated here.
[0105] In the embodiment of the present application, when all data records are grouped, the specific process of grouping based on the HMAC value corresponding to the first primary key value and the number of watermark fragments N and the redundancy M can be calculated using formula (4), which is as follows:
[0106] h mod MN(4)
[0107] Among them, h is the HMAC value corresponding to the first primary key value of each data record, N is the number of watermark fragments, and M is the redundancy.
[0108] In the embodiment of the present application, according to the calculation method of formula (4), all possible values of h mod MN can be obtained, and the values may include 0, 1, 2, ..., MN-1. According to the value of h mod MN, all data records in the data table T can be divided into MN groups.
[0109] For example, Figure 4 As shown, from Figure 4 It can be seen that according to the HMAC value corresponding to the first primary key value P of each data record and the modulo of the watermark fragment N and the redundancy M, all data records are divided into MN groups, and the corresponding h mod MN values in each group of data records are the same.
[0110] In an embodiment of the present application, for each group in the MN group, when constructing pseudo data, the same type of groups can be determined from multiple groups based on rules; for each group in the same type of groups, the same pseudo data is constructed; wherein the same pseudo data is used to insert the same watermark fragment.
[0111] In the embodiment of the present application, the rules may be set in advance.
[0112] In the embodiment of the present application, taking M equal to 3 as an example, the rule may be to group the above according to the value of h mod MN and number the groups i, i+N, i+2N as the same type of groups, i∈[0, N-1].
[0113] For example, the value of h mod MN can be 0 to 11, that is, all data records are divided into 12 groups, and the group numbers are 0 to 11. When M is 3, 3 groups can be selected from the 12 groups as a classification, and 4 types of groups can be obtained. For example, three groups with group numbers i=0, i=N, and i=2N can be taken as one category. When M is 2, two groups can be selected from the 12 groups as one category, and 6 types of groups can be obtained.
[0114] In the embodiment of the present application, the same row of dummy data is constructed for each group in each type of group, and the dummy data corresponding to each group in each type of group is constructed to insert the same watermark fragment W. i .
[0115] For example, for group numbers i, i+N, i+2N, i∈[0, N-1], construct the same pseudo data to store the watermark fragment W i .
[0116] In the embodiment of the present application, the lowest bit of the primary key of the pseudo data is assigned to i, and the other bits are randomly generated, but it is necessary to ensure that the final randomly constructed second primary key value P' satisfies the HMAC k (P')mod MN=i.
[0117] In the embodiment of the present application, the watermark segment W i The setting method is to calculate the value of i mod s, and assign the lowest bit of the numerical attribute of i mod S to the watermark fragment W with sequence number i. i .
[0118] In an embodiment of the present application, the numerical attributes of the pseudo data are set as follows: except for one numerical attribute of the watermark fragment among the S numerical attributes, for the remaining S-1 numerical attributes, the lowest bit of the numerical attribute numbered j is assigned to i mod j, and the remaining fields are randomly generated according to the format of Table T.
[0119] It should be noted that the specific calculation method of the above process can refer to the above embodiment and will not be repeated here.
[0120] In the embodiment of the present application, after data recipient 1 receives data with the data owner's watermark information added thereto, when data recipient 1 needs to send the received data to data recipient 2, the above process of adding watermark information is repeated, and the watermark of data recipient 1 is added to the received data, and the data with the watermark information is sent to data recipient 2. The only difference in the watermarking process is that the key k used to calculate the h value in formula (1) is the key of data recipient 1.
[0121] Based on the above embodiments, the scheme for inserting multi-level watermarks into data involved in the embodiments of the present application can add multiple watermark information one by one to achieve the recording and tracing of the entire data flow chain, while having strong robustness and being able to resist attacks against watermarks.
[0122] The present application also provides a watermark extraction method, wherein the watermark includes one or more levels of watermarks, such as Figure 5 As shown, applied to the second device, the method may include:
[0123] S501. For each level of watermark, based on the key, determine the authentication code corresponding to the third primary key value of each data record in the received data table.
[0124] The key corresponds to the data receiver of the receiving data table.
[0125] In the embodiment of the present application, after watermark information is added to the structured data, when tracing the source of the data, a watermark extraction method can be used to extract the watermark information to determine the source of the data.
[0126] In the embodiment of the present application, the second device may be a watermark extraction device, which may be capable of extracting watermark information from structured data to which watermark information is added.
[0127] In the embodiment of the present application, since the data can be forwarded multiple times, each forwarding adds the watermark information corresponding to the data sender, so that one or more levels of watermark information can be added to the data.
[0128] Exemplarily, after the data owner adds the first-level watermark information to the data in the data table, the data owner sends the data table with the first-level watermark information to data recipient 1. Data recipient 1 adds the second-level watermark information to the data in the data table, and sends the data table with both the first-level watermark information and the second-level watermark information to data recipient 2.
[0129] When the data table with the first-level watermark information and the second-level water information is obtained by the data receiver 1, the data receiver 1 determines the authentication code corresponding to the third primary key value p of each data record in the received data table based on its own key.
[0130] It should be noted that the key used corresponds to the data recipient who receives the data table, and different data recipients have different keys. For example, when data recipient 1 receives the data table, the key used corresponds to data recipient 1; when the data owner receives the data table, the key used corresponds to the data owner.
[0131] In the embodiment of the present application, each data record in the data table contains a third primary key value, and the third primary key value P of each data record is determined from the data table.
[0132] It should be noted that if there is no primary key, a set of data attributes that can uniquely identify a data record is determined from each data record.
[0133] In the embodiment of the present application, the HMAC value of the third primary key value P of each data record is calculated using the key corresponding to the data recipient. The specific calculation method can be found in the calculation method of the aforementioned formula (1), which will not be repeated here.
[0134] S502: Group all data records included in the data table based on the authentication code corresponding to the third primary key value and the number N of watermark fragments to obtain multiple groups.
[0135] Wherein, N is an integer greater than or equal to 1.
[0136] It should be noted that the number N of watermark fragments is set when adding watermark information.
[0137] In the embodiment of the present application, when grouping all data records contained in the received data table, the HMAC value corresponding to the third primary key value of each data record and the number of watermark fragments N are used for grouping. The specific calculation method is shown in the following formula (5):
[0138] HMAC k1 (P)mod N(5)
[0139] Among them, N is the number of watermark fragments, k1 is the key corresponding to the data table receiver, and P is the third primary key value of each data record.
[0140] It should be noted that if the data table receiver and the data table sender are the same, the corresponding keys are the same.
[0141] In the embodiment of the present application, according to the calculation method of formula (5), HMAC can be obtained: k1 (P) mod all possible values of N, which can be 0, 1, 2, ..., N-1. All data records in the data table are divided into N groups according to the values.
[0142] It should be noted that all data records are divided into N groups, and the corresponding HMAC in each group of data records k1 (P)modN has the same value.
[0143] S503: Determine, from each group, the pseudo data corresponding to each group.
[0144] In an embodiment of the present application, each group corresponds to a row of pseudo data, each row of pseudo data includes a primary key and S numerical attributes, the primary key includes multiple data bits, where S is an integer greater than or equal to 1.
[0145] In an embodiment of the present application, when determining the pseudo data corresponding to each group from each group, in the data contained in each group, if the first data set of the first data bit of the primary key of the data in each group is the same as the group number i, and the values of other numerical attributes in the numerical attributes except the numerical attribute with sequence number i in the numerical attributes are fourth data, the data in each group is determined to be pseudo data.
[0146] In the embodiment of the present application, when determining a row of pseudo data corresponding to each group, the following conditions must be met: first, the first data set for the lowest bit of the primary key is the same as the group number, for example, if the group number i is 3, then the data record with the lowest bit of the primary key of 3 in the group is determined; second, for S numerical attributes (the numbers can be 0, 1, ..., S-1 in sequence), among the S numerical attributes, except for the numerical attribute with the numerical attribute number i, the fourth data set for the remaining numerical attributes is i mod j, where j represents the number of the remaining numerical attributes except for the numerical attribute number i in the numerical attribute number, for example, for each group, among the S numerical attributes, since the group number i is 3, except for the numerical attribute with the numerical attribute number 3, the fourth data set for the lowest bit of the numerical attribute with the numerical attribute number j=2 is 3mod2. A row of data records that can simultaneously meet the above two conditions is determined as a row of pseudo data corresponding to the group.
[0147] It should be noted that a row of pseudo data corresponding to each group is determined in the same manner.
[0148] S504: extract N watermark fragments from the pseudo data corresponding to each group, and combine the N watermark fragments to obtain watermark information.
[0149] In an embodiment of the present application, when watermark information is inserted, a watermark fragment is stored in each line of pseudo data. If the number of watermark fragments is N, all data records will be divided into N groups, and the final pseudo data will be N lines. After determining the N lines of pseudo data, one watermark fragment can be extracted from each line of pseudo data to form N watermark fragments. The extracted N watermark fragments are subjected to a fragmentation reorganization algorithm to form watermark information that identifies the data recipient.
[0150] It can be understood that in a watermark extraction method provided in an embodiment of the present application, when extracting watermark information, because each data recipient corresponds to a different key, the authentication code of the third primary key value determined according to the key is different. When different data recipients use the corresponding authentication code to group all the data records in the data table, the resulting groups are different, and the pseudo data corresponding to each group determined by different data recipients is different. Therefore, the watermark fragments inserted corresponding to the data recipient can be extracted from the pseudo data corresponding to different groups. Therefore, when the data table is received, the watermark information extracted each time corresponds to the data recipient, and the data can be traced back step by step.
[0151] In an embodiment of the present application, the data owner can extract the corresponding added watermark information using the above-mentioned implementation method, and the data receiver 1 can also repeat the above-mentioned watermark extraction steps to extract the corresponding added watermark information. The difference is that when extracting the watermark information, the data receiver 1 uses a different key from the data owner, and so on, until the watermark information of the entire data flow link is extracted.
[0152] In one embodiment of the present application, when extracting N watermark fragments from the pseudo data corresponding to each group, the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes in the pseudo data corresponding to the group number i can be determined based on the group numbers i and S, where i∈[0, N-1]; and the watermark fragment with sequence number i is extracted from the insertion position.
[0153] In the embodiment of the present application, the insertion position of the watermark fragment in the pseudo data corresponding to each group is determined by the group number i and S, and specifically, is determined based on the value of i mod S. For example, the watermark fragment N is 5, i=1, S=5, and the insertion position of the watermark fragment W1 with the sequence number 1 corresponds to a row of pseudo data corresponding to the group number 1. Since 1mod 5=1, the insertion position of W1 is in the lowest bit with the sequence number 1 among the 5 numerical attributes, where the sequence numbers of the 5 numerical attributes are 0 to 4, respectively, and the watermark fragment W1 is obtained from the lowest bit with the sequence number 1 among the 5 numerical attributes.
[0154] It should be noted that the other watermark fragments can be extracted from a row of pseudo data corresponding to each group in the same manner, which will not be described in detail here.
[0155] In the embodiment of the present application, in order to ensure the robustness of the added watermark information, redundancy is set when adding the watermark information. Correspondingly, the following method can be used when extracting the watermark information.
[0156] In one embodiment of the present application, all data records contained in the data table are grouped based on the authentication code corresponding to the third primary key value and the number N of watermark fragments to obtain multiple groups. Alternatively, all data records contained in the data table may be grouped based on the authentication code corresponding to the third primary key value, the number N of watermark fragments and redundancy to obtain multiple groups.
[0157] In the embodiment of the present application, when grouping all data records with watermark information added to the received data table, the HMAC value corresponding to the third primary key value of each data record, the number of watermark fragments N, and the redundancy M are used for grouping. The HMAC value corresponding to the third primary key value of each data record is first calculated, and then grouping is performed according to the following formula (6):
[0158] HMAC k1(P)mod MN(6)
[0159] Among them, N is the number of watermark fragments, k1 is the key corresponding to the data table receiver, P is the third primary key value of each data record, and M is the redundancy.
[0160] In the embodiment of the present application, according to the calculation method of formula (6), HMAC can be obtained: k1 (P)mod All possible values of MN, which can be 0, 1, 2, ..., MN-1. All data records in the data table are divided into MN groups according to the values.
[0161] It should be noted that all data records are divided into MN groups, and the corresponding HMAC in each group of data records k1 (P)modMN has the same value.
[0162] Correspondingly, when determining the pseudo data corresponding to each group from each group, the same type of groups can be determined from multiple groups according to the rules; and the pseudo data corresponding to each group in the same type of groups can be determined.
[0163] In the embodiment of the present application, the rules may be set in advance.
[0164] In the embodiment of the present application, taking M equal to 3 as an example, the rule may be to convert the above into HMAC k1 After the values of (P)mod MN are grouped, the groups are numbered i, i+N, i+2N and are determined to be the same type of groups, i∈[0, N-1].
[0165] For example, HMAC k1 (P)mod MN can be a value of 0 to 11, that is, all data records are divided into 12 groups, and the group numbers are 0 to 11. When M is 3, 3 groups can be selected from the 12 groups as a classification, and 4 types of groups can be obtained. For example, three groups with group numbers i=0, i=N, and i=2N can be taken as one category. When M is 2, two groups can be selected from the 12 groups as one category, and 6 types of groups can be obtained.
[0166] In the embodiment of the present application, for groups i, i+N, i+2N (i∈[0-N-1]) in the same class, data records satisfying the following two conditions are determined from the data records contained in the groups i, i+N, i+2N respectively:
[0167] (1) The value of the lowest bit of the primary key is the same as the group number i.
[0168] (2) For a numerical attribute j in a group, if j≠i(i+N, i+2N), it means that except for the numerical attribute of the watermark fragment, the lowest bit of other attribute bits is equal to i mod j.
[0169] It should be noted that j≠i(i+N, i+2N) can be understood as j≠i, or j≠i+N, or j≠i+2N.
[0170] In the embodiment of the present application, if data records satisfying the above two conditions are determined in the same type of grouping, the data records satisfying the above two conditions in the same type of grouping are determined as pseudo data.
[0171] It should be noted that each group in the same category has the same row of dummy data corresponding to it. For example, groups i, i+N, and i+2N in the same category have the same row of dummy data corresponding to them.
[0172] In the embodiment of the present application, since the pseudo data set for the packets i, i+N, and i+2N in the same category are the same, when extracting watermark fragments, multiple watermark fragments set can be extracted for the same category of packets. Since all packets are divided into multiple categories of packets, the data receiver (such as the data owner) can pre-set N arrays, namely R0[], R1[], ..., R N-1 [ ].
[0173] In an embodiment of the present application, when N watermark fragments are extracted from the pseudo data corresponding to each group, for the same type of groups, multiple watermark fragments are extracted from the pseudo data corresponding to each group in the same type of groups, and the watermark fragment with the highest frequency of occurrence among the multiple watermark fragments corresponding to the same type of groups is determined as the watermark fragment of the same type of groups.
[0174] In the embodiment of the present application, for each group of each type of group, the pseudo data set is extracted, and the lowest L bits of the numerical attribute corresponding to the value of the numerical attribute numbered i mod S in the pseudo data are put into the array R i For example, in the pseudo data corresponding to the groups i, i+N, and i+2N in the same category, the watermark fragment inserted in the lowest bit of the numerical attribute corresponding to the value of i mod S is put into the array R i []middle.
[0175] In the embodiment of the present application, for arrays R0[], R1[], ..., R N-1 [], take out the value with the highest frequency in each array to form N watermark fragments, and finally execute the watermark fragment reorganization algorithm to form the watermark information that identifies the data receiver.
[0176] In an embodiment of the present application, when redundancy is set, the data owner can use the above-mentioned implementation method to extract the corresponding added watermark information, and the data receiver 1 can also repeat the above-mentioned watermark extraction steps to extract the corresponding added watermark information. The difference is that when extracting the watermark information, the data receiver 1 uses a different key from the data owner, and so on, until the watermark information added to the entire data flow link is extracted.
[0177] Compared with the technical solutions in the related art, the watermark insertion method proposed in the embodiment of the present application has stronger robustness. In the related art, when adding a watermark, the least significant bit of a certain attribute of the data is usually modified, and the watermark is inserted into the least significant bit of the attribute. This method has poor robustness, that is, if the least significant bit of the data is deleted, the watermark will be invalid, and the insertion of the watermark does not support the insertion of multi-level watermark information. The watermark embedded later will cover the watermark information embedded last time. The watermark insertion method in the embodiment of the present application supports multi-level watermark embedding, and each time the watermark information is written, it will not affect the watermark information of the last time. At the same time, a redundancy mechanism is designed in the embodiment of the present application to improve the robustness of the watermark algorithm.
[0178] Based on the above embodiment, in another embodiment of the present application, a watermark insertion device 1 is provided. Figure 6 As shown, the watermark insertion device 1 comprises:
[0179] The segmentation unit 10 is used to segment the watermark information into N watermark fragments, where N is an integer greater than or equal to 1.
[0180] The first determining unit 11 is used to determine the authentication code corresponding to the first primary key value of each data record in the data table based on the key; wherein the key corresponds to the data sender of the data table.
[0181] The first grouping unit 12 is used to group all data records contained in the data table based on the authentication code corresponding to the first primary key value and the number N of watermark fragments to obtain multiple groups.
[0182] The inserting unit 13 is used to construct pseudo data for each group, and insert N watermark fragments into the pseudo data corresponding to the multiple groups in sequence according to the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment.
[0183] In one embodiment, the pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1.
[0184] In one embodiment, the first determining unit 11 is further used to determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes of the pseudo data corresponding to the group number i based on the group number i and S; wherein i∈[0, N-1].
[0185] The inserting unit 13 is further used to insert the watermark fragment with sequence number i into the inserting position.
[0186] In one embodiment, the dummy data further includes a primary key, and the primary key includes a plurality of data bits.
[0187] In one embodiment, the watermark inserting device 1 may further include: a setting unit,
[0188] The setting unit is used to set first data in the first data bit among multiple data bits for the primary key, the first data is the same as the group number i; set second data in the remaining data bits except the first data bit, the second data satisfies: the authentication code of the second primary key value corresponding to the primary key of the pseudo data is the same as the third data determined by the number N of watermark fragments and the group number i, and the second primary key value includes the first data and the second data; for the numerical attributes in the pseudo data, based on the numbers j of the remaining numerical attributes except the numerical attributes of the inserted watermark fragment number i and the group number i, determine the fourth data, and set the values of the remaining numerical attributes to the fourth data.
[0189] In one embodiment, the watermark inserting device 1 may further include: a construction unit,
[0190] The setting unit is also used to set the redundancy.
[0191] The first grouping unit 12 is further used to group all data records contained in the data table based on the authentication code, the number N of watermark fragments and the redundancy to obtain multiple groups.
[0192] The first determining unit 11 is further configured to determine the same type of groups from the multiple groups according to a rule.
[0193] The construction unit is used to construct the same pseudo data for each group in the same type of group; wherein the same pseudo data is used to insert the same watermark fragment.
[0194] The embodiment of the present application provides a watermark insertion device, which divides the watermark information into N watermark fragments, where N is an integer greater than or equal to 1; based on a key, determines the authentication code corresponding to the first primary key value of each data record in the data table; wherein the key corresponds to the data sender of the data table; based on the authentication code corresponding to the first primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups; for each group, constructs pseudo data, and sequentially inserts N watermark fragments into the pseudo data corresponding to the multiple groups in the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment, thus it can be seen that the present application A watermark insertion device proposed in an embodiment, when inserting watermark information, because each data sender corresponds to a different key, the authentication code of the first primary key determined according to the key is different. When different data senders use the corresponding authentication code to group all the data records in the data table, the obtained groups are different. Therefore, when pseudo data is constructed for each group and the corresponding watermark fragment is inserted, the insertion position of the watermark fragment is different. Therefore, when the data table is forwarded, the watermark information inserted each time will not affect the watermark information inserted last time, and multi-level watermark information can be inserted. Therefore, when tracing the data, multi-level traceability of the data can be performed step by step.
[0195] Figure 7 This is a schematic diagram of the composition structure of a first device 2 provided in an embodiment of the present application. In practical applications, based on the same disclosed concept of the above embodiments, Figure 7 As shown, the first device 2 of the embodiment of the present application includes a first processor 20, a first memory 21 and a first communication bus 22.
[0196] In the specific implementation process, the above-mentioned segmentation unit 10, the first determination unit 11, the first grouping unit 12, the insertion unit 13, the setting unit, and the construction unit can be implemented by the first processor 20 located on the first device 2, and the above-mentioned first processor 20 can be at least one of an application-specific integrated circuit (ASIC, Application Specific Integrated Circuit), a digital signal processor (DSP, Digital Signal Processor), a digital signal processing image processing device (DSPD, Digital Signal Processing Device), a programmable logic image processing device (PLD, Programmable Logic Device), a field programmable gate array (FPGA, Field Programmable Gate Array), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiments of the present application are not specifically limited.
[0197] In the embodiment of the present application, the first communication bus 22 is used to realize the connection and communication between the first processor 20 and the first memory 21; when the first processor 20 executes the running program stored in the first memory 21, the following watermark insertion method is implemented:
[0198] The watermark information is divided into N watermark fragments, where N is an integer greater than or equal to 1; based on the key, the authentication code corresponding to the first primary key value of each data record in the data table is determined; wherein the key corresponds to the data sender of the data table; based on the authentication code corresponding to the first primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups; for each group, pseudo data is constructed, and N watermark fragments are sequentially inserted into the pseudo data corresponding to the multiple groups in the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment.
[0199] In one embodiment, the pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1.
[0200] In one embodiment, the first processor 20 is further used to determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes of the pseudo data corresponding to the group number i based on the group numbers i and S; where i∈[0, N-1]; and insert the watermark fragment with sequence number i into the insertion position.
[0201] In one embodiment, the dummy data further includes a primary key, and the primary key includes a plurality of data bits.
[0202] In one embodiment, the above-mentioned first processor 20 is also used to set the first data in the first data bit among the multiple data bits for the primary key, and the first data is the same as the group number i; set the second data in the remaining data bits except the first data bit, and the second data satisfies: the authentication code of the second primary key value corresponding to the primary key of the pseudo data is the same as the third data determined by the number N of watermark fragments and the group number i, and the second primary key value includes the first data and the second data; for the numerical attributes in the pseudo data, based on the numbers j and the group number i of the remaining numerical attributes except the numerical attributes of the inserted watermark fragment number i, determine the fourth data, and set the values of the remaining numerical attributes to the fourth data.
[0203] In one embodiment, the first processor 20 is further configured to set redundancy; based on the authentication code, the number N of watermark fragments and the redundancy, all data records included in the data table are grouped to obtain multiple groups.
[0204] In one embodiment, the first processor 20 is further used to determine the same type of groups from multiple groups according to a rule; construct the same pseudo data for each group in the same type of groups; wherein the same pseudo data is used to insert the same watermark fragment.
[0205] Based on the above embodiment, in another embodiment of the present application, a watermark extraction device 3 is provided, such as Figure 8 As shown, the watermark extraction device 3 includes:
[0206] The second determination unit 30 is used to determine, for each level of watermark, an authentication code corresponding to the third primary key value of each data record in the received data table based on a key; wherein the key corresponds to a data recipient of the received data table.
[0207] The second grouping unit 31 is used to group all data records contained in the data table based on the authentication code corresponding to the third primary key value and the number N of watermark fragments to obtain multiple groups, where N is an integer greater than or equal to 1.
[0208] The second determining unit 30 is further configured to determine, from each group, dummy data corresponding to each group.
[0209] The combining unit 32 is used to extract N watermark fragments from the pseudo data corresponding to each group, and combine the N watermark fragments to obtain watermark information.
[0210] In one embodiment, the pseudo data includes a primary key and S numerical attributes, where S is an integer greater than or equal to 1.
[0211] In one embodiment, the second determination unit 30 is further used to determine the data in each group as pseudo data if the first data bit of the primary key of the data in each group is set to be the same as the group number i, and the values of other numerical attributes in the numerical attributes except the numerical attribute with sequence number i in the numerical attributes are fourth data.
[0212] In one embodiment, the pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1.
[0213] In one embodiment, the second determining unit 30 is further used to determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes of the pseudo data corresponding to the group number i based on the group number i and S, where i∈[0,N-1].
[0214] The combining unit 32 is further configured to extract the watermark fragment with sequence number i from the insertion position.
[0215] In one embodiment, the second grouping unit 31 is further used to group all data records included in the data table based on the authentication code corresponding to the third primary key value, the number N of watermark fragments and the redundancy to obtain multiple groups.
[0216] In one embodiment, the second determining unit 30 is further configured to determine the same type of groups from the multiple groups according to a rule; and determine the pseudo data corresponding to each group in the same type of groups.
[0217] In one embodiment, the combination unit 32 is further used to extract multiple watermark fragments from the pseudo data corresponding to each group in the same type of grouping, and determine the watermark fragment with the highest frequency among the multiple watermark fragments corresponding to the same type of grouping as the watermark fragment of the same type of grouping.
[0218] The embodiment of the present application provides a watermark extraction device, for one or more levels of watermarks, based on a key, determining the authentication code corresponding to the third primary key value of each data record in the received data table; wherein the key corresponds to the data recipient of the received data table; based on the authentication code corresponding to the third primary key value and the number N of watermark fragments, all data records contained in the data table are grouped to obtain multiple groups, where N is an integer greater than or equal to 1; from each group, pseudo data corresponding to each group is determined; N watermark fragments are extracted from the pseudo data corresponding to each group, and the N watermark fragments are combined to obtain watermark information. It can be seen that the present invention The application embodiment provides a watermark extraction device. When extracting watermark information, since each data recipient corresponds to a different key, the authentication code of the third primary key value determined according to the key is different. When different data recipients use the corresponding authentication code to group all the data records in the data table, the resulting groups are different. The pseudo data corresponding to each group determined by different data recipients is different, so that the watermark fragments inserted corresponding to the data recipient can be extracted from the pseudo data corresponding to different groups. Therefore, when the data table is received, the watermark information extracted each time corresponds to the data recipient, and the data can be traced back level by level.
[0219] Fig. 9 This is a schematic diagram of the composition structure of a second device 4 provided in an embodiment of the present application. In practical applications, based on the same disclosed concept of the above embodiments, Fig. 9 As shown, the second device 4 of the embodiment of the present application includes a second processor 40 , a second memory 41 and a second communication bus 42 .
[0220] In the specific implementation process, the second determination unit 30, the second grouping unit 31, and the combination unit 32 can be implemented by a second processor 40 located on the second device 4, and the second processor 40 can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that for different devices, the electronic device used to implement the above processor function can also be other, and the embodiment of the present application does not make specific limitations.
[0221] In the embodiment of the present application, the second communication bus 42 is used to realize the connection and communication between the second processor 40 and the second memory 41; when the second processor 40 executes the running program stored in the second memory 41, the following watermark extraction method is implemented:
[0222] For each level of watermark, based on the key, determine the authentication code corresponding to the third primary key value of each data record in the received data table; wherein the key corresponds to the data recipient of the received data table; based on the authentication code corresponding to the third primary key value and the number N of watermark fragments, group all data records contained in the data table to obtain multiple groups, where N is an integer greater than or equal to 1; from each group, determine the pseudo data corresponding to each group; extract N watermark fragments from the pseudo data corresponding to each group, and combine the N watermark fragments to obtain watermark information.
[0223] In one embodiment, the pseudo data includes a primary key and S numerical attributes, where S is an integer greater than or equal to 1.
[0224] In one embodiment, the above-mentioned second processor 40 is also used to determine the data in each group as pseudo data if the first data bit of the primary key of the data in each group is set to the same data as the group number i, and the values of other numerical attributes in the numerical attributes except the numerical attribute with sequence number i in the numerical attributes are fourth data.
[0225] In one embodiment, the pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1.
[0226] In one embodiment, the second processor 40 is further used to determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes of the pseudo data corresponding to the group number i based on the group numbers i and S, where i∈[0, N-1]; and extract the watermark fragment with sequence number i from the insertion position.
[0227] In one embodiment, the second processor 40 is further configured to group all data records contained in the data table based on the authentication code corresponding to the third primary key value, the number N of watermark fragments, and the redundancy to obtain a plurality of groups.
[0228] In one embodiment, the second processor 40 is further configured to determine the same type of groups from a plurality of groups according to a rule; and determine the pseudo data corresponding to each group in the same type of groups.
[0229] In one embodiment, the second processor 40 is further used to extract multiple watermark fragments from the pseudo data corresponding to each group in the same type of groups, and determine the watermark fragment with the highest frequency of occurrence among the multiple watermark fragments corresponding to the same type of groups as the watermark fragment of the same type of groups.
[0230] Based on the above embodiments, the embodiments of the present application provide a storage medium on which a computer program is stored. The above computer-readable storage medium stores one or more programs. The above one or more programs can be executed by one or more processors and are applied to a first device, where the computer program implements the watermark insertion method as described above, or are applied to a second device, where the computer program implements the watermark extraction method as described above.
[0231] Based on the above embodiments, the embodiments of the present application provide a computer program product, including a computer program, which can be executed by one or more processors and is applied to a first device, where the computer program implements the watermark insertion method as described above, or is applied to a second device, where the computer program implements the watermark extraction method as described above.
[0232] It should be noted that in the embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0233] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for an image display device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the method described in each embodiment of the embodiment of the present application.
[0234] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A watermark insertion method, characterized in that: Applied to a first device, the method includes: Divide the watermark information into N watermark fragments, where N is an integer greater than or equal to 1; Determine, based on a key, an authentication code corresponding to a first primary key value of each data record in a data table; wherein the key corresponds to a data sender that sends the data table; Based on the authentication code and the number N of watermark fragments corresponding to the first primary key value, grouping all data records contained in the data table to obtain multiple groups; For each group, pseudo data is constructed, and the N watermark fragments are sequentially inserted into the pseudo data corresponding to the plurality of groups respectively according to the order in which the watermark fragments are divided; wherein one pseudo data is inserted into one watermark fragment.
2. The method according to claim 1, characterized in that The pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1; and the N watermark fragments are sequentially inserted into the pseudo data corresponding to the plurality of groups respectively in the order of dividing the watermark fragments, including: Based on the group number i and S, determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes in the pseudo data corresponding to the group number i; wherein i∈[0, N-1]; Insert the watermark fragment with sequence number i into the insertion position.
3. The method according to claim 2, characterized in that The pseudo data further includes a primary key, wherein the primary key includes a plurality of data bits, and the method further includes: For the primary key, setting first data in a first data bit among the plurality of data bits, wherein the first data is the same as the group number i; Second data is set in the remaining data bits except the first data bit, and the second data satisfies: the authentication code of the second primary key value corresponding to the primary key of the pseudo data and the third data determined by the number N of watermark fragments are the same as the group number i, and the second primary key value includes the first data and the second data; For the numerical attributes in the pseudo data, based on the numbers j of the remaining numerical attributes except the numerical attribute inserted with the watermark fragment number i and the group number i, the fourth data is determined, and the values of the remaining numerical attributes are set to the fourth data.
4. The method according to claim 1, characterized in that: The authentication code corresponding to the first primary key value and the number N of watermark fragments are grouped to obtain multiple groups for all data records contained in the data table, including: Set redundancy; Based on the authentication code, the number N of watermark fragments and the redundancy, grouping all data records contained in the data table to obtain a plurality of groups; Correspondingly, constructing pseudo data for each group includes: According to the rule, determining the same type of groups from the multiple groups; For each group in the same type of group, the same pseudo data is constructed; wherein the same pseudo data is used to insert the same watermark fragment.
5. A watermark extraction method, characterized in that: The watermark includes one or more levels of watermarks, which are applied to the second device, and the method includes: For each level of watermark, based on a key, determining an authentication code corresponding to the third primary key value of each data record in the received data table; wherein the key corresponds to a data recipient receiving the data table; Based on the number N of authentication codes and watermark fragments corresponding to the third primary key value, grouping all data records contained in the data table to obtain multiple groups, where N is an integer greater than or equal to 1; From each group, determining pseudo data corresponding to each group; N watermark fragments are extracted from the pseudo data corresponding to each group, and the N watermark fragments are combined to obtain watermark information.
6. The method according to claim 5, characterized in that The pseudo data includes a primary key and S numerical attributes, where S is an integer greater than or equal to 1, and the primary key includes a plurality of data bits. Determining the pseudo data corresponding to each group from each group includes: In the data contained in each group, if the first data set in the first data bit of the primary key of the data in each group is the same as the group number i, and the values of other numerical attributes in the numerical attributes except the numerical attribute with sequence number i in the numerical attributes are fourth data, the data in each group is determined to be pseudo data.
7. The method according to claim 5, characterized in that The pseudo data includes S numerical attributes, where S is an integer greater than or equal to 1, and extracting N watermark fragments from the pseudo data corresponding to each group includes: Based on the group number i and S, determine the insertion position of the watermark fragment with sequence number i among the N watermark fragments in the S numerical attributes in the pseudo data corresponding to the group number i, where i∈[0,N-1]; A watermark fragment with sequence number i is extracted from the insertion position.
8. The method according to claim 5, characterized in that The authentication code corresponding to the third primary key value and the number N of watermark fragments are grouped to obtain multiple groups for all data records contained in the data table, including: Based on the authentication code corresponding to the third primary key value, the number N of watermark fragments and the redundancy, all data records contained in the data table are grouped to obtain multiple groups; Correspondingly, determining the pseudo data corresponding to each group from each group includes: According to the rule, determining the same type of groups from the multiple groups; Determine pseudo data corresponding to each group in the same type of group; The extracting N watermark fragments from the pseudo data corresponding to each group includes: For the same type of groups, multiple watermark fragments are extracted from the pseudo data corresponding to each group in the same type of groups, and the watermark fragment with the highest appearance frequency among the multiple watermark fragments corresponding to the same type of groups is determined as the watermark fragment of the same type of groups.
9. A watermark insertion device, characterized in that: The watermark inserting device comprises: A segmentation unit, used for segmenting the watermark information into N watermark fragments, where N is an integer greater than or equal to 1; A first determining unit, configured to determine, based on a key, an authentication code corresponding to a first primary key value of each data record in a data table; wherein the key corresponds to a data sender that sends the data table; A first grouping unit, configured to group all data records contained in the data table based on the authentication code corresponding to the first primary key value and the number N of watermark fragments to obtain a plurality of groups; The inserting unit is used to construct pseudo data for each group, and insert the N watermark fragments into the pseudo data corresponding to the multiple groups in sequence according to the order of dividing the watermark fragments; wherein one pseudo data is inserted into one watermark fragment.
10. A watermark extraction device, characterized in that: The watermark includes one or more levels of watermarks, and the watermark extraction device includes: A second determination unit is used to determine, for each level of watermark, an authentication code corresponding to the third primary key value of each data record in the received data table based on a key; wherein the key corresponds to a data recipient receiving the data table; A second grouping unit, configured to group all data records contained in the data table based on the number N of authentication codes and watermark fragments corresponding to the third primary key value to obtain a plurality of groups, where N is an integer greater than or equal to 1; The second determining unit is further used to determine, from each group, pseudo data corresponding to said each group; The combining unit is used to extract N watermark fragments from the pseudo data corresponding to each group, and combine the multiple watermark fragments to obtain watermark information.
11. A first device, characterized in that: The first device includes: a first processor and a first memory; when the first processor executes the running program stored in the first memory, the method according to any one of claims 1 to 4 is implemented.
12. A second device, characterized in that: The second device comprises: a second processor and a second memory; when the second processor executes the running program stored in the second memory, the method according to any one of claims 5 to 8 is implemented.
13. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented; or, when the computer program is executed by a processor, the method according to any one of claims 5 to 8 is implemented.
14. A computer program product comprising a computer program, characterized in that The computer program implements the method according to any one of claims 1 to 4 when executed by a processor, or implements the method according to any one of claims 5 to 8 when executed by a processor.
