A method for generating data watermark and tracing watermark information
By adopting fragmentation and embedding technology in the data watermark generation method, appropriately encoded watermarks are generated for different data types, and the auxiliary bit fields and offset functions are used to perform encoding changes during traceability, the problems of poor watermark concealment and traceability errors in the existing technology are solved, and efficient and accurate data watermark generation and traceability are achieved.
Patent Information
- Application Number
- CN202311508415.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2043-11-13
AI Technical Summary
The existing data watermark generation methods fail to adopt appropriate encoding methods for different data types, resulting in poor concealment of watermarks and prone to errors during traceability.
By selecting watermark information from the pre-built watermark information pool, fragmenting the watermark information, and embeding the watermark into the data according to the structure of the real business data. The specific steps include disassembling the service data into multiple fields, selecting appropriate fields as fragment number and value fields, and using auxiliary bit fields and offset functions to perform encoding and change, and finally generating and embeding the target watermark.
This method can avoid traceability errors to the greatest extent, improve the concealment and accuracy of data watermarks, and is suitable for data tracking, digital copyright protection, anti-tampering and forgery, and data privacy protection.
Smart Images

Figure CN117786626B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for generating a data watermark and tracing the source of watermark information. Background Art
[0002] Data watermarking refers to the data processing process in which a watermark is embedded in the data through a certain method when sensitive data is exchanged from the original environment to the target environment, so that the data can identify factors such as the distributor, distribution object, distribution time, and distribution purpose, while retaining the data characteristics or content required by the target environment business.
[0003] At present, the existing watermark generation methods do not use different encoding methods to generate data watermarks according to the data type of the original data. Instead, they generally use a single encoding method to directly embed the watermark information into the original data, resulting in a certain difference between the data structure of the generated data watermark and the original data. The concealment of the data watermark is poor, and when tracing the watermark data, it is easy to have erroneous tracing results. Summary of the invention
[0004] In view of the above problems existing in the current data watermark generation and watermark information tracing, the present invention provides a method for generating a data watermark and tracing the watermark information.
[0005] In one aspect, the present invention provides a method for generating a data watermark, comprising:
[0006] Step 1: Select a watermark information from the pre-built watermark information pool;
[0007] Step 2: Specify the type of business data to which the target watermark to be generated belongs;
[0008] Step 3: Fragment the selected watermark information to form multiple watermark fragments, and record the fragment number and fragment value of each watermark fragment;
[0009] Step 4: Decompose the real business data into multiple second fields, select two of the second fields as the fragment number field and the fragment value field to store the fragment number and the fragment value respectively, and the remaining second fields are used as auxiliary bit fields;
[0010] Step 5: Use the auxiliary bit field value and the preset offset function to change the original fragment number and fragment value to obtain a new fragment number and fragment value, and reassemble the auxiliary bit, the new fragment number and fragment value according to the disassembly method to generate the target watermark;
[0011] Step 6: Embed the target watermark into the specified source data.
[0012] Furthermore, the type of business data to which the target watermark to be generated belongs is an ID card number or a mobile phone ID number.
[0013] Furthermore, it also includes building a watermark information pool, which specifically includes:
[0014] An identification field and a regular field are defined for each watermark information to construct a watermark information, wherein the identification field includes an id segment and a key segment, which are used to distinguish different watermark information; wherein the id segment is composed of an x-bit natural number, and the key segment is composed of a y-bit natural number; and the regular field is a user-defined field;
[0015] All constructed watermark information is persisted in the database, so that all watermark information is loaded from the database into the designated memory at startup, and the designated memory after all watermark information is loaded is recorded as a watermark information pool.
[0016] Furthermore, in step 3, the selected watermark information is fragmented to form a plurality of watermark fragments, specifically including:
[0017] Extract the id segment and key segment of the selected watermark information, and merge the id segment and key segment with the current time stamp to obtain a string;
[0018] Determine whether the lengths of the id segment, key segment, and time segment meet their respective preset character counts. If not, fill them with leading zeros to obtain a new string.
[0019] Taking m characters as a group, the new character string is divided into a plurality of watermark fragments in sequence.
[0020] Furthermore, in step 4, the real business data is decomposed into multiple second fields, and two of the second fields are selected as the fragment number field and the fragment value field, respectively, specifically including:
[0021] Performing semantic analysis on the real business data and decomposing the real business data into a plurality of second fields according to the semantics;
[0022] According to the value range of each second field, the second field whose value range can cover the fragment number is used as the fragment number field, and the second field whose value range can cover the fragment value is used as the fragment value field.
[0023] Furthermore, in step 6, the watermark embedding method includes pseudo-row watermark embedding and pseudo-column watermark embedding.
[0024] In another aspect, the present invention provides a data watermark information tracing method, comprising:
[0025] Identify the watermark algorithm used in the source data;
[0026] Obtain all target watermarks corresponding to the same watermark information from the source data;
[0027] Decomposing each target watermark according to the watermark algorithm to determine the fragment number field, the fragment value field and the auxiliary bit field; using the auxiliary bit field and the offset function to respectively change the fragment code and the fragment value stored in the fragment number field and the fragment value field to obtain the original fragment number and fragment value;
[0028] All fragment values are combined according to the fragment numbers to obtain the original watermark information.
[0029] Beneficial effects of the present invention:
[0030] The method of the present invention generates and traces data watermarks based on the data structure of real business data and the characteristics of watermark information, which can avoid erroneous traceability results to the greatest extent, and can achieve the purposes of data tracking and tracing, digital copyright protection, anti-tampering and forgery, and data privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a flow chart of a method for generating a data watermark provided by an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of constructing a watermark information pool provided by an embodiment of the present invention;
[0033] Figure 3 A schematic diagram of watermark information fragmentation provided by an embodiment of the present invention;
[0034] Figure 4 A schematic diagram of determining auxiliary bits, fragment number and fragment value fields provided by an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of an offset function provided by an embodiment of the present invention;
[0036] Figure 6 A schematic diagram of embedding a target watermark into source data in a pseudo-row manner provided by an embodiment of the present invention;
[0037] Figure 7 A schematic diagram of embedding a target watermark into source data in a pseudo-column manner provided by an embodiment of the present invention;
[0038] Figure 8 A flowchart of a method for tracing the origin of data watermark information provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Example 1
[0041] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a data watermark, comprising the following steps:
[0042] S101: Select a watermark information from a pre-built watermark information pool;
[0043] Specifically, watermark information can be understood as a string of characters with practical interpretation meaning; the actual interpretation meaning of this string is determined according to the actual business scenario, and generally at least can determine the object, distribution time, distributor and other information of data distribution, and can be dynamically deleted according to business needs. In actual business scenarios, you may want to share data with multiple objects, and need to add different watermark information, so multiple watermark information is maintained in the watermark information pool.
[0044] In this embodiment, Figure 2 As shown, the construction process of the watermark information pool is as follows: define an identification field and a regular field for each watermark information to construct a watermark information, the identification field includes an id segment and a key segment, which are used to distinguish different watermark information; wherein the id segment is composed of an x-bit natural number, and the key segment is composed of a y-bit natural number; the regular field is a user-defined field (it can be any type of field, or there can be any number of fields, such as content (content string), unit (unit), shareObject (shared object)..., etc.); all constructed watermark information is persisted to the database, so that all watermark information can be loaded from the database to the specified memory when starting, and the specified memory after all watermark information is loaded is recorded as the watermark information pool.
[0045] S102: Specify the type of business data to which the target watermark to be generated belongs; for example, an ID card number or a mobile phone ID number.
[0046] S103: fragmenting the selected watermark information to form multiple watermark fragments, and recording the fragment number and fragment value of each watermark fragment;
[0047] Specifically, watermark information fragmentation refers to cutting a single watermark information into watermark fragments according to the data of the single watermark information and the characteristics of the business data, and maintaining the orderly correspondence between the watermark fragments. The number of fragments formed by cutting is determined according to the actual situation.
[0048] For example, if the amount of a single watermark information is very small and a single business data can provide enough space to store it, then the watermark information does not need to be cut and is just a fragment. A simulated business data generated by the watermark information can contain the complete watermark information, and subsequently only one simulated business data is needed to complete the watermark traceability.
[0049] If a single watermark information is large and a single business data cannot provide enough space to store it, then the watermark information needs to be cut into multiple pieces based on the storage space that a single business data can actually provide. For example, if 10 pieces are required, the 10 simulated business data generated by the watermark information can contain the complete watermark information. Subsequently, at least 10 simulated business data are required to complete the watermark traceability.
[0050] In this embodiment, the selected watermark information is fragmented to form multiple watermark fragments, specifically including:
[0051] Extract the id segment and key segment of the selected watermark information, and merge the id segment and key segment with the current time stamp to obtain a string;
[0052] Determine whether the lengths of the id segment, key segment, and time segment meet their respective preset character counts. If not, fill them with leading zeros to obtain a new string.
[0053] Taking m characters as a group, the new character string is divided into a plurality of watermark fragments in sequence.
[0054] S104: Decomposing the real business data into a plurality of second fields, selecting two of the second fields as a fragment number field and a fragment value field to store the fragment number and the fragment value respectively, and the remaining second fields as auxiliary bit fields;
[0055] Specifically, semantic analysis is performed on the real business data and the real business data is decomposed into multiple second fields according to the semantics; according to the value range of each second field, the second field whose value range can cover the fragment number is used as the fragment number field, and the second field whose value range can cover the fragment value is used as the fragment value field. It should be noted that more auxiliary bits mean more variations in the final data.
[0056] S105: using the auxiliary bit field value and the preset offset function to respectively change the original fragment number and fragment value to obtain a new fragment number and fragment value, and recombining the auxiliary bit, the new fragment number and the fragment value according to the disassembly method, so as to generate a target watermark;
[0057] Specifically, this step uses a user-defined watermark algorithm (such as a name watermark algorithm, an ID card number watermark algorithm, and a mobile phone number watermark algorithm, etc.) to calculate and obtain a new fragment number and fragment value.
[0058] S106: Embed the target watermark into the specified source data (eg, a data table, database or document where the real business data is located). The watermark embedding method includes pseudo-row watermark embedding and pseudo-column watermark embedding.
[0059] In an embodiment of the present invention, a user can utilize a data watermark generation method to imitate the data structure of real business data to generate simulated data storing watermark information. By embedding the simulated data into the target source data, when the target source data information is leaked, the specific watermark information can be found in a timely manner by tracing the leaked data, thereby determining the data leakage object.
[0060] Example 2
[0061] On the basis of the above-mentioned embodiment 1, the embodiment of the present invention takes the ID card number as an example of a business data type to generate a data watermark of a composite ID card number data structure, thereby further illustrating the concept of the present invention.
[0062] S201: Select a watermark information;
[0063] In this embodiment, the field structure of the watermark information in the watermark information pool includes:
[0064] id: 6-digit natural number, ranging from 0-999999;
[0065] key: 9-digit natural number, value range 0-999999999;
[0066] content: text information;
[0067] shareObj: The sharing object embedded in the watermark; this object determines the specific person with whom the data is shared.
[0068] unit: watermark unit, the unit of the person in the shareObj field.
[0069] It should be noted that the length of the id segment and the key segment of the watermark information is customized according to needs.
[0070] Based on the above watermark information structure, the specific watermark information selected in this embodiment is as follows:
[0071] id:15312
[0072] key:654329050
[0073] content: This is a watermark message
[0074] shareObj: Zhang San
[0075] unit: Zhang San's unit
[0076] S202: Specifying that the business data type to which the target watermark to be generated belongs is the ID card number;
[0077] S203: Watermark information fragmentation
[0078] Specifically, the id and key of the selected watermark information are 15312 and 654329050 respectively; the timestamp time of the current time is set to 1691376846315. It is set that when the id segment does not meet 6 bits, the leading bit is padded with zero; when the key segment does not meet 9 bits, the leading bit is padded with zero; when the time segment does not meet 18 bits, the leading bit is padded with zero. In this way, here id: 15312, key: 654329050, time: 1691376846315 are padded with zeros and combined according to the above method to obtain the string 015312654329050001691376846315, and then the above string is fragmented in order with 3 numbers as a group to obtain 10 watermark fragments, which are fragmented in order. The fragment numbers and fragment values of the 10 watermark fragments are recorded, specifically: Wn[1]: 015, Wn[2]: 312, Wn[3]: 654, Wn[4]: 329, Wn[5]: 050, Wn[6]: 001, Wn[7]: 691, Wn[8]: 376, Wn[9]: 846, Wn
[10] : 315; Wn represents the fragment, and the i in Wn[i] represents the fragment number. It should be noted that the fragment numbers in this embodiment are encoded sequentially starting from 1. The fragment number can be calculated by Wn[((n-1) mod 10)], where n represents the fragment value taken for the nth time. The above process is as follows Figure 3 shown.
[0079] S204: Analyze the data structure of the real ID number and disassemble it;
[0080] By performing semantic analysis on the ID card number C, we can find that the length of C is fixed at 18 digits. Among them, the numbers in C[1-6] represent the administrative division, C[7-10] represent the year of birth, C[11-12] represent the month of birth, C[13-14] represent the day of birth, C[15-16] are the sequence numbers, C
[17] represent the gender, and C
[18] is the check code. The detailed data analysis is as follows:
[0081] C[1-6]: Administrative division Cac, representing the corresponding code value of province, city, county / district. This value has reasonable requirements and must meet the national administrative division number;
[0082] C[7-10]: Year of birth Cy, value range: from 1984 to the current year;
[0083] C[11-12]: Month of birth, value range: from 1 to 12;
[0084] C[13-14]: date of birth, with a uniform value range of 1-28;
[0085] C[15-16]: sequence number Cn, value range: 0-99;
[0086] C
[17] : Gender Cs, even number means female, odd number means male, value range: 0-9;
[0087] C
[18] : Check code Cvm, generated by bitwise operation of the first 17 bits using the fixed algorithm CTM.
[0088] Through the above analysis, the ID card number is finally broken down into 7 second fields.
[0089] At the same time, by analyzing the fragment value of the watermark, it is found that the minimum value is "001" and the maximum value is "846"; the value range of the fragment number is 1-10; combined with the value range of the above second fields, it can be found that: it is more appropriate to select the second field Cy as the fragment number field to store the fragment number; it is more appropriate to select the field formed by the combination of the two second fields Cn+Cs as the fragment value field to store the fragment value; the remaining fields (including Cac, Cy, Cd; Cvm has a special meaning and is excluded here) are used as auxiliary bit fields. The above process is as follows Figure 4 shown.
[0090] S205: Calculate new fragment numbers and fragment values through auxiliary bits and offset functions, and reassemble them to obtain a target watermark;
[0091] Specifically, the offset function used in this embodiment is fin=f(sta, end, cur, offset, enc); where sta and end are used to determine a linear interval, cur indicates the current position in the linear interval, offset indicates the amount of offset, and enc indicates whether the algorithm is shifting left or right in the linear interval, where lf is used to represent left shift and ri is used to represent right shift. The significance of the offset function is to map a value in the offset interval to another value in the same offset interval. Figure 5 shown.
[0092] The offset logic of the offset function: 1. When enc is equal to ri: fin = cur + offset; 2. When enc is equal to lf: fin = cur – offset;
[0093] Out-of-bounds processing of the offset function: When the value fin of cur after passing offset has exceeded the range of sta or end, the processing steps are divided into three cases: 1. When offset>(end-sta+1), recalculate the value of offset: offset=offset%(end-sta+1); 2. When enc is right shifted: fin=sta+(cur+offset-end-1); 3. When enc is left shifted: fin=end-((sta-(cur-of))-1).
[0094] Based on the above offset function, the present embodiment uses the auxiliary bit field value and the preset offset function to change the original fragment number and fragment value to obtain a new fragment number and fragment value, specifically including:
[0095] Auxiliary digit (Cac): Randomly select a code CRac from the list of administrative divisions, and then record the index of the code as rk1;
[0096] Auxiliary bit (Cy): Randomly select a number from the data between 1984 and the current year - 1, and temporarily record it as rk2, and then use the offset function fin (1984, current year - 1, rk2, rk1, ri) to get frk2;
[0097] Auxiliary bit (Cd): randomly select a number from the data between 1 and 28, and then record it as rk3, and then get frk3 through the offset function fin(1,28,rk3,rk1,ri);
[0098] Fragment number field (Cm): for the fragment number i of fragment Wn[i], perform operations, namely f(1,12,i,rk1,ri) to obtain the value i1 of the first offset, then perform operations again, f(1,12,i1,rk2,lf) to obtain the value i2 of the second offset, and then perform operations again, f(1,12,i2,rk3,ri) to obtain the value i3 of the third offset;
[0099] Fragment value field (Cn+Cs): For the fragment value Wn[i], it is calculated by f(0,999,Wn[i],rk1,ri) to obtain the value wn1 of the first offset, and then f(0,999,wn1,rk2,lf) is calculated again to obtain the value wn2 of the second offset, and then f(0,999,wn2,rk3,ri) is calculated again to obtain the value wn3 of the third offset;
[0100] According to the disassembly method of the ID card number, rk1, frk2, i3, frk3, wn3 are sequentially combined to obtain a 17-digit string; then, based on the 17-digit string, the CTM(x) algorithm is used to calculate the last check code, and the 17-digit string + the generated check code are combined to finally form a complete ID card number C, which is the simulation data that conforms to the ID card number data structure, that is, the target watermark carrying watermark information. Among them, the check code calculation formula is: CTM(x)=(∑ i=1 (x i × i ))mod 11, when the mod result is 10, the result is X, where W = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2].
[0101] In the embodiment of the present invention, since the amount of information in a single watermark is relatively large, while the amount of information that can be stored in a single ID card number is relatively small, one watermark information needs to generate 10 simulated ID card numbers for storage.
[0102] S206, data filling and watermark data embedding;
[0103] Specifically, the watermark is embedded into the two-dimensional data table in the form of pseudo rows or pseudo columns.
[0104] Pseudo-row: Select the ID card watermark algorithm for the ID card number field, and select the simulation algorithm for other fields. If the data table contains a primary key, select the integer maximum value + 1 or UUID according to the specific situation of the table. Then, insert it into the data table at a certain ratio. When the watermark fragment data is embedded in the pseudo-row method, and the watermark ratio is 10%, it is very likely that more than 100 data will be required to identify the watermark information, while 100% density only requires about 20 data to trace the watermark information. The specific pseudo-row watermark ratio depends on the importance of the data. When the data is important, use pseudo-row data and the ratio should be increased to meet the need for traceability with fewer items, or directly use the pseudo-column watermark method. For example Figure 6 shown.
[0105] Pseudo column: add a new field to the original database table and fill it with the watermark fragments generated in the previous step. Because for the data table, each record contains the watermark, so only 10 consecutive data are needed to trace the watermark information. Figure 7 shown.
[0106] In addition, in order to make the target watermark data more authentic, this step will also involve three additional algorithms, namely the primary key filling algorithm, the simulation algorithm, and the default value algorithm. Note that the default value algorithm is selected by default when the simulation algorithm is not configured, so that the field is assigned a default value so that the field is not NULL; at the same time, the simulation algorithm and the primary key filling algorithm are only for the newly generated target watermark, and the original data to be inserted in the table will not be changed.
[0107] Among them, the primary key filling algorithm is divided into two methods: one is UUID, which fills the field by generating a new UUID, and the other is the maximum integer value of the primary key in the current table + 1. The primary key filling algorithm does not need to take effect when exporting to a data table without a primary key constraint, because the primary key in the database cannot be an arbitrary value, otherwise it will cause data insertion failure. Because there are two types of primary keys, one is a numeric type and the other is a string type (mostly UUID), UUID and the maximum integer value + 1 can meet the primary key insertion in most cases.
[0108] Default value algorithm: Get the field type in the two-dimensional data table, and then automatically generate the default value type of the field type. For example, if it is a string type, an empty string is generated by default; if it is a numeric integer type, an integer 0 is generated by default; if it is a Boolean value, false is generated by default, etc.
[0109] Simulation algorithm: Through the built-in algorithm, some fake data can be generated, such as age, marital status, mobile phone number, etc.
[0110] Example 3
[0111] like Figure 8 As shown, an embodiment of the present invention provides a data watermark information tracing method, comprising the following steps:
[0112] S301: Identify the watermark algorithm used by the source data; for example, the name watermark algorithm, the ID card number watermark algorithm, and the mobile phone number watermark algorithm.
[0113] S302: Acquire all target watermarks corresponding to the same watermark information from the source data;
[0114] S303: Decomposing each target watermark according to the watermark algorithm to determine the fragment number field, the fragment value field and the auxiliary bit field; using the auxiliary bit field and the offset function to respectively change the fragment code and the fragment value stored in the fragment number field and the fragment value field to obtain the original fragment number and fragment value;
[0115] S304: Combine all fragment values according to the fragment numbers to obtain original watermark information.
[0116] The watermark information tracing method provided by the embodiment of the present invention can timely find the specific watermark information by tracing the leaked data after the document is leaked, so as to determine the leaked object of the data.
[0117] Example 4
[0118] Based on the above-mentioned embodiments 2 and 3, taking the ID card number watermark algorithm as an example, the embodiment of the present invention further illustrates the process of tracing the watermark information.
[0119] S401: Identify through regular matching that the watermark algorithm used by the source data is the ID card number watermark algorithm;
[0120] Specifically, the system may have built-in watermark algorithms for multiple data types, such as name watermark algorithms, ID card number watermark algorithms, and mobile phone number watermark algorithms, etc., and decide which watermark algorithms to use by identifying the corresponding types in the source data. For example, if there is a database table A, A contains the field id_card, and the corresponding watermark algorithm is identified by the data in this field, thereby excluding watermark algorithms that do not meet the requirements.
[0121] S402: Split target watermark
[0122] Specifically, first, obtain a target watermark WC, where WC represents the ID number embedded with the watermark, where W represents the watermark and C represents the ID number. Split the target watermark into the following 6 parts:
[0123] WCac(rk1):C[1-6]
[0124] WCy(frk2):C[7-10]
[0125] WCm(i3):C[11-12]
[0126] WCd(frk3):C[13-14]
[0127] WCn+Cs(wn3):C[15-17]
[0128] WCv: check bit; it does not need to be paid attention to for the traceability watermark, this bit is just to meet the data simulation characteristics.
[0129] Next, parse the auxiliary bit field, the fragment number field, and the fragment value field:
[0130] Auxiliary bit (Cac): take out Cac as rk1;
[0131] Auxiliary position (Cy): Take Cy as frk2, and then use the formula fin(1984, current year-1,frk2,rk1,lf) to get rk2;
[0132] Auxiliary bit (Cd): The random Cd is frk3, and then rk3 is obtained by the formula fin(1,28,frk3,rk2,lf);
[0133] Fragment number field (Cm): Take Cm as i3, and then calculate it through the three-step formula, namely f(1,12,i3,rk3,lf) to get the value i2, then calculate f(1,12,i2,rk2,ri) again to get the second offset value i1, and then calculate f(1,12,i1,rk1,lf) again to get the fragment number i;
[0134] Fragment value field (Cn+Cs): Take Cn+Cs as wn3, and then calculate it through the three-step formula, namely f(1,12,wn3,rk3,lf) to get the value wn2, then calculate f(1,12,wn2,rk2,ri) again to get the second offset value wn1, and then calculate f(1,12,wn1,rk1,lf) again to get the watermark fragment value Wn[i];
[0135] S404: Combined watermark
[0136] Specifically, the parsed fragments are temporarily stored, and the storage object contains the fragment number of i and the fragment value field Wn[i]. By continuously obtaining watermark fragments from the database, after collecting N data, the fragments with i being 1-10 are collected. At this time, the watermark fragments can be combined from 1-10 to obtain a complete string of watermark numbers Wn. If the current Wn has not been blacklisted (the string failed to be traced last time, then the string of numbers will be recorded and marked as blacklisted), continue with step 5, otherwise continue to read data.
[0137] S405: Analyzing watermark information
[0138] Specifically, the id information of the watermark information can be obtained by parsing Wn[1-2]. After finding the corresponding watermark information in the watermark information pool according to the id, it is necessary to compare whether the key of the watermark information corresponds to the value in Wn[3-5]. If not, the watermark is considered invalid. At the same time, the value in Wn[6-10] is parsed to restore it to a timestamp and converted into a time format. The pool data of the watermark information is queried by id+key, and the following watermark information can be obtained:
[0139] id:15312
[0140] key:654329050
[0141] time: 1691376846315(2023-08-07 10:54:06)
[0142] content: This is a watermark message
[0143] shareObj: Zhang San
[0144] unit: Zhang San's unit
[0145] It should be noted that if the watermark parsing fails at any time, it is necessary to return to step S404, blacklist the current Wn, and then read the remaining data and fill it into the Wn list again. If the data is not in the Wn blacklist, continue with step S405, otherwise continue to read the data.
[0146] The present invention embeds data and analyzes data through a series of steps, which can achieve the purposes of data tracking and tracing, digital copyright protection, anti-tampering and forgery, and data privacy protection.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a data watermark, characterized in that: include: Step 1: Select a watermark information from a pre-constructed watermark information pool; wherein, constructing the watermark information pool specifically includes: defining an identification field and a regular field for each watermark information to construct a watermark information, wherein the identification field includes an id segment and a key segment, which are used to distinguish different watermark information; wherein the id segment is composed of an x-bit natural number, and the key segment is composed of a y-bit natural number; the regular field is a user-defined field; persisting all constructed watermark information to a database, so that all watermark information can be loaded from the database to a designated memory at startup, and recording the designated memory after all watermark information is loaded as a watermark information pool; Step 2: Specify the type of business data to which the target watermark to be generated belongs; Step 3: Fragment the selected watermark information to form multiple watermark fragments, and record the fragment number and fragment value of each watermark fragment; Fragment the selected watermark information to form multiple watermark fragments, specifically including: extracting the id segment and key segment of the selected watermark information, and fusing the id segment and key segment with the timestamp time of the current time to obtain a string; respectively determine whether the lengths of the id segment, key segment and time segment meet their respective preset character numbers, and if not, use the leading zero padding method to supplement them, so as to obtain a new string; take m characters as a group, and divide the new string into multiple watermark fragments in order; Step 4: Decompose the real business data into multiple second fields, select two of the second fields as the fragment number field and the fragment value field to store the fragment number and the fragment value respectively, and the remaining second fields are used as auxiliary bit fields; wherein decomposing the real business data into multiple second fields, and selecting two of the second fields as the fragment number field and the fragment value field respectively, specifically includes: performing semantic analysis on the real business data and decomposing the real business data into multiple second fields according to the semantics; according to the value range of each second field, using the second field whose value range can cover the fragment number as the fragment number field, and using the second field whose value range can cover the fragment value as the fragment value field; Step 5: Use the auxiliary bit field value and the preset offset function to change the original fragment number and fragment value to obtain a new fragment number and fragment value, and reassemble the auxiliary bit, the new fragment number and fragment value according to the disassembly method to generate the target watermark; Step 6: Embed the target watermark into the specified source data.
2. A method for generating a data watermark according to claim 1, characterized in that: The business data type to which the target watermark to be generated belongs is the ID card number or the mobile phone ID number.
3. A method for generating a data watermark according to claim 1, characterized in that: In step 6, the watermark embedding method includes pseudo row watermark embedding and pseudo column watermark embedding.
4. A data watermark information tracing method corresponding to the data watermark generated in claim 1, characterized in that: include: Identify the watermark algorithm used in the source data; Obtain all target watermarks corresponding to the same watermark information from the source data; Decomposing each target watermark according to the watermark algorithm to determine the fragment number field, the fragment value field and the auxiliary bit field; using the auxiliary bit field and the offset function to respectively change the fragment code and the fragment value stored in the fragment number field and the fragment value field to obtain the original fragment number and fragment value; All fragment values are combined according to the fragment numbers to obtain the original watermark information.
Citation Information
Patent Citations
An electronic document processing method and device
CN109670281A
Watermark embedding method and device for data, electronic equipment and storage medium
CN116028902A