Database traceless watermarking method and system based on non-numerical attributes

By marking non-numeric attribute columns in the database and embedding traceless watermark values, the problem that existing technology cannot protect the security of non-numeric data is solved, and the copyright traceability and security improvement of non-numeric data are achieved.

CN118536092APending Publication Date: 2024-08-23SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410599330.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing database watermarking technology mainly targets numerical attribute columns and cannot effectively protect the security of non-numeric data, making it difficult to trace the copyright of non-numeric data after data leakage.

Method used

By traversing the attribute columns of the data table, mark the non-numeric attribute columns as watermark columns, use the hash function to calculate the subscript value of the watermark column, and embed the traceless watermark value into the non-numeric data based on the key and base bit. , forming a new string to achieve implicit watermarking and copyright traceability of data.

Benefits of technology

It improves the security of non-numeric data and can quickly trace the copyright information of the data after data leakage. The calculation of the traceless watermark value and embedding position relies on two keys and is difficult to modify, which enhances the reliability of the watermark.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536092A
    Figure CN118536092A
Patent Text Reader

Abstract

The invention provides a database traceless watermarking method and system based on non-numeric attributes, which can increase the security of non-numeric data. According to one aspect of the invention, the database traceless watermarking method based on the non-numeric attributes comprises the following steps: traversing attribute columns in a data table, and classifying all the attribute columns into a main key attribute column, a numeric attribute column and a non-numeric attribute column; marking all non-numeric attribute columns as watermark columns, and calculating subscript values of the watermark columns; obtaining the first secret key, the second secret key and the length of a character string needing to be watermarked in the watermark column; based on a preset system bit, converting the first secret key into a traceless watermark value; calculating an embedding position of a traceless watermark value based on the length of data needing to be watermarked in a watermark column and the second secret key; and according to the embedding position, embedding the traceless watermark value into a corresponding position in the watermark column to form a new character string.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database watermarking, and in particular to a database traceless watermarking method and system based on non-numerical attributes. Background Art

[0002] Relational databases are increasingly used in the computer field, especially with the rapid development of big data. The continuous enhancement of data collection and data processing technologies has made data an important information resource. However, with the development of network technology, data is circulated more frequently on the Internet, and data leakage has become a serious problem. When data is leaked, an effective way to ensure data ownership is to add data watermarks and trace the source of the data through some hidden watermark information.

[0003] Database watermarking technology is an important branch that has developed rapidly in the field of database security in recent years. Database watermarking technology refers to embedding some data information in certain locations of the database as the copyright identifier of the database to protect the copyright of the database. These copyright protection information cannot prevent the database data from being copied and illegally disseminated, but when the data is leaked, it can quickly identify the copyright ownership of the illegal copy.

[0004] The watermarking schemes in the existing technology are mostly aimed at numerical attribute columns. However, with the in-depth application of database technology in various industries, non-numeric attributes are also very important in databases. A large number of applications deal with businesses related to non-numeric data. Non-numeric data has completely different characteristics from numerical data. The watermarking schemes for numerical attribute columns cannot be applied to the protection of non-numeric data. Therefore, the security of non-numeric data is not guaranteed. Summary of the invention

[0005] In order to solve the above technical problems, the present invention is proposed. The embodiments of the present invention provide a database traceless watermark method and system based on non-numeric attributes, which can increase the security of non-numeric data.

[0006] According to one aspect of the present invention, a database seamless watermarking method based on non-numeric attributes is provided, comprising: traversing attribute columns in a data table, classifying all attribute columns into primary key attribute columns, numerical attribute columns and non-numeric attribute columns; marking all non-numeric attribute columns as watermark columns, and calculating the subscript value of the watermark column; wherein the watermark column represents the attribute column to which a watermark needs to be added; obtaining a first key, a second key and the length of a character string to be watermarked in the watermark column; based on a preset base, converting the first key into a seamless watermark value; calculating the embedding position of the seamless watermark value based on the length of the data to be watermarked in the watermark column and the second key; wherein the embedding position is located at any position in the character string to be watermarked; according to the embedding position, embedding the seamless watermark value into a corresponding position in the watermark column to form a new character string.

[0007] In one embodiment, the attribute columns in the data table are traversed, and all the attribute columns are classified into primary key attribute columns, numerical attribute columns, and non-numerical attribute columns, including: obtaining the first primary key key of each row of data; obtaining all the attribute lists in the data table, and recording the number of columns of all the attribute lists as M; wherein the set M does not include all the primary key columns; and forming the attribute columns without adding watermarks into a set, recorded as the R set: wherein the attribute columns without adding watermarks include primary key attribute columns and numerical attribute columns.

[0008] In one embodiment, all non-numeric attribute columns are marked as watermark columns, and the subscript value of the watermark column is calculated, including: using a hash function to obtain the value of the first primary key key of each row of data, and taking the modulus of M to obtain the subscript value of the watermark column; wherein the subscript value is greater than or equal to zero and less than M; if a numeric attribute column label is selected when calculating the subscript value of the watermark column, and the selected numeric attribute column label is not added to the R set, then the key of the selected numeric attribute column label and the corresponding column attribute name are added as a new key, M-1 is used as a new M value, and the selected numeric attribute column label is added to the R set; the subscript value of the watermark column is calculated with the new key and the corresponding M value until the result is a non-numeric attribute column, and the obtained non-numeric attribute column is the watermark column.

[0009] In one embodiment, a hash function is used to obtain the value of the first primary key key of each row of data, and modulo M to obtain the subscript value of the watermark column, including:

[0010] Col num = hash(key) mod(M)

[0011] In the formula, Col numIndicates the subscript value of the watermark column, key indicates the first primary key of each row of data, and M indicates the number of remaining columns in the data table excluding the attribute columns in the R set; num Greater than or equal to zero and less than M, when Col num When it is 0, it means that the watermark column is the first column after removing all columns in the R set.

[0012] In one embodiment, based on a preset base, converting the first key into a seamless watermark value includes: converting the string of the first key into an ASCII code, and calculating the sum of all ASCII codes corresponding to the first key, and recording the sum of the ASCII codes of the first key as K1 int ; K1 int Convert to a preset base digit to obtain first data; based on the preset base digit, set invisible characters corresponding to the number of base digits; replace the first data with the invisible characters to obtain a character string composed of invisible characters as the seamless watermark value.

[0013] In one embodiment, based on the length of the data to be watermarked in the watermark column and the second key, calculating the embedding position of the invisible watermark value includes: converting the string of the second key into ASCII code, and calculating the sum of all ASCII codes corresponding to the second key, and recording the sum of the ASCII codes of the second key as K2 int ; Get the length of the data to be watermarked in the watermark column, and record the length as L; K2 int Modulo L, the result is recorded as Index; wherein Index is greater than 0 and less than L; the invisible watermark value is embedded after the Index-th position of the character string to be watermarked.

[0014] In one embodiment, K2 int Modulo L, the result is recorded as Index, including:

[0015] Index = K2 int mod(L)

[0016] In the formula, Index represents the embedding position of the invisible watermark value, K2 int represents the sum of the ASCII codes corresponding to each character in the string of the second key, and L represents the length of the watermark data to be watermarked in the watermark column.

[0017] In one embodiment, the database seamless watermarking method based on non-numerical attributes also includes: obtaining the watermarked attribute column of the data to be traced, the third key and the fourth key of the copyright holder; extracting the seamless watermark value of the watermarked attribute column; determining the embedding position of the seamless watermark value according to the third key; if the seamless watermark value exists at the embedding position, extracting invisible characters starting from the embedding position of the seamless watermark value; if the seamless watermark value does not exist at the embedding position, tracing the data to be traced ends.

[0018] In one embodiment, if there is a traceless watermark value at the embedded position, after extracting invisible characters from the embedded position of the traceless watermark value, the database traceless watermark method based on non-numerical attributes also includes: based on a preset base, converting the extracted invisible characters into plain text to obtain preset base data of the ASCII code of the embedded traceless watermark value; calculating decimal data according to the preset base data of the ASCII code of the embedded traceless watermark value to obtain a calculation result; converting the character string of the fourth key into ASCII code, and calculating the sum of all ASCII codes corresponding to the fourth key; if the sum of all ASCII codes corresponding to the fourth key is the same as the calculation result, it is determined that the data to be traced has the copyright information of the copyright holder.

[0019] According to another aspect of the present invention, a database seamless watermark system based on non-numeric attributes is provided, comprising: a classification module, used to traverse the attribute columns in the data table, and classify all the attribute columns into primary key attribute columns, numerical attribute columns and non-numeric attribute columns; a marking module, used to mark all non-numeric attribute columns as watermark columns, and calculate the subscript value of the watermark column; wherein the watermark column represents the attribute column to which a watermark needs to be added; an acquisition module, used to obtain a first key, a second key and the length of a character string to be watermarked in the watermark column; a conversion module, used to convert the first key into a seamless watermark value based on a preset base; a calculation module, used to calculate the embedding position of the seamless watermark value based on the length of the data to be watermarked in the watermark column and the second key; wherein the embedding position is located at any position in the character string to be watermarked; an embedding module, used to embed the seamless watermark value into a corresponding position in the watermark column according to the embedding position to form a new character string; wherein the new character string includes a seamless watermark value.

[0020] The database seamless watermark method and system based on non-numerical attributes provided by the present invention realize the addition of seamless watermarks to the database of non-numerical attributes, and can quickly trace the copyright information of the data after the data is leaked. The seamless watermark value and the position of adding the watermark are calculated based on the first key and the second key. Even if one of the secret keys is leaked, the watermark is difficult to be modified, which improves the reliability of the watermark and thus improves the security of the non-numerical data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0022] Figure 1 It is a flowchart of a database seamless watermarking method based on non-numerical attributes provided by an exemplary embodiment of the present invention.

[0023] Figure 2 It is a flowchart of a database seamless watermarking method based on non-numerical attributes provided by another exemplary embodiment of the present invention.

[0024] Figure 3 It is a flowchart of a database seamless watermarking method based on non-numerical attributes provided by another exemplary embodiment of the present invention.

[0025] Figure 4 It is a structural schematic diagram of a database seamless watermark system based on non-numerical attributes provided by an exemplary embodiment of the present invention.

[0026] Figure 5 It is a structural schematic diagram of a database seamless watermark system based on non-numerical attributes provided by another exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0027] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.

[0028] Figure 1 FIG. 1 is a flow chart of a database traceless watermarking method based on non-numerical attributes provided by an exemplary embodiment of the present invention. Figure 1 As shown, the database seamless watermarking method based on non-numerical attributes includes:

[0029] Step 100: traverse the attribute columns in the data table, and classify all attribute columns into primary key attribute columns, numeric attribute columns, and non-numeric attribute columns.

[0030] Take the first primary key of each row of data in the data table as the primary key attribute column, distinguish between numeric attribute columns and non-numeric attribute columns, and only mark watermarks for non-numeric attribute columns, while primary key attribute columns do not add watermarks. Numeric attribute columns are used to store numeric data, such as integers, decimals, or floating-point numbers. These columns are usually used to store data that can be numerically calculated and compared. Numeric attribute columns can perform mathematical operations, aggregation operations (such as sum, average), and comparison operations (such as greater than, less than, equal to), etc. Numeric data can include: age, credits, and price, etc. Non-numeric attribute columns are used to store non-numeric data, such as text, date, Boolean values, etc. These columns are usually used to store descriptive data or identification data, which cannot be numerically calculated or compared. Non-numeric data can include names, titles, product descriptions, etc.

[0031] Step 200: Mark all non-numeric attribute columns as watermark columns, and calculate the subscript value of the watermark column, wherein the watermark column represents the attribute column to which a watermark needs to be added.

[0032] Select the column attributes that need to be watermarked, mark them as watermark columns, and add subscript values ​​to the watermark columns to distinguish the watermark columns from other columns, and provide an identification basis for adding watermarks later. You can traverse the attribute columns in the data table, classify all attribute columns, exclude all primary key attribute columns and numeric attribute columns, directly mark all non-numeric attribute columns as watermark columns, and calculate the subscript values ​​of these non-numeric attribute columns. You can also calculate the subscript value while excluding the numeric attribute columns in the calculation, and continue to calculate the subscript value after updating the numeric value.

[0033] Step 300: Obtain the first key, the second key and the length of the character string to be watermarked in the watermark column.

[0034] The first key and the second key can be provided by the user to generate targeted watermarks, which can increase the uniqueness of the watermark and be used to trace the source of the data. Setting the first key and the second key can improve the stability of the watermark. Even if one of the keys is leaked, the watermark is difficult to modify, which improves the security of the watermark.

[0035] Step 400: Based on a preset base, convert the first key into a seamless watermark value.

[0036] For example, the first key is converted through ASCII (American Standard Code for Information Interchange, a standard coding system for converting characters into numbers), and then invisible characters are set according to preset base digits to convert the first key into a seamless watermark value. The character string composed of invisible characters is used as the seamless watermark value. Because the added watermark value is seamless, it is imperceptible to the user and has little impact on the data quality. However, it can provide a basis for data traceability and ensure the security of non-numeric data.

[0037] Step 500: Based on the length of the data to be watermarked in the watermark column and the second key, the embedding position of the invisible watermark value is calculated, wherein the embedding position is located at any position in the character string to be watermarked.

[0038] The embedding position of the traceless watermark value is calculated according to the second key, which is targeted and unique, can prevent the watermark from being discovered and tampered with, and improves the concealment and security of the watermark.

[0039] Step 600: embed the invisible watermark value into the corresponding position in the watermark column according to the embedding position to form a new character string.

[0040] According to the embedding position calculated by the second key, the invisible watermark value calculated according to the first key is embedded to form a new string. The invisible watermark value and the embedding position are obtained by calculating the two secret keys. Even if one of the secret keys is leaked, the watermark is difficult to modify, which improves the security of the watermark. By selecting non-numeric attribute columns from all attribute columns, invisible watermarks can be added to non-numeric data in a targeted manner. After the data is leaked, the copyright information of the data can be quickly traced back to ensure the security of non-numeric data. In addition, the invisible watermark has little impact on data use, and can also prevent the watermark from being discovered and tampered with, with high data security.

[0041] In one embodiment, the above step 100 may include: obtaining the first primary key key of each row of data; obtaining all attribute lists in the data table, and recording the number of columns of all attribute lists as M; wherein the set M does not include all primary key columns; and forming the attribute columns that do not add watermarks into a set, recorded as the R set: wherein the attribute columns that do not add watermarks include primary key attribute columns and numeric attribute columns.

[0042] Get the first primary key of each row of data, and then get the number of all attribute columns in the data table, recorded as M, but M does not include all primary key columns, because primary key attribute columns do not add watermarks. The attribute columns that do not add watermarks form a set, recorded as R, and the expression of R is:

[0043] R = [key1, key2…]

[0044] R can contain primary key attribute columns and numeric attribute columns. After checking the numeric attribute columns in the future, they can be added to R for exclusion to prevent watermarking of numeric attribute columns. The attribute columns for adding watermarks are obtained based on the primary key. The watermark columns added to each row of data are different. Even if a column of data is damaged, the watermark can be traced through other attribute columns, which increases the robustness of the watermark.

[0045] Figure 2 is a flowchart of a database seamless watermarking method based on non-numerical attributes provided by another exemplary embodiment of the present invention. Figure 2 As shown, the above step 200 may include: Step 210: Use the hash function to obtain the value of the first primary key key of each row of data, and take the modulus of M to obtain the subscript value of the watermark column. The subscript value is greater than or equal to zero and less than M. Step 220: If a numeric attribute column label is selected when calculating the subscript value of the watermark column, and the selected numeric attribute column label is not added to the R set, then the key of the selected numeric attribute column label and the corresponding column attribute name are added as the new key, M-1 is used as the new M value, and the selected numeric attribute column label is added to the R set. Step 230: Use the new key and the corresponding M value to calculate the subscript value of the watermark column until the result is a non-numeric attribute column, and the non-numeric attribute column obtained is the watermark column.

[0046] Use the hash function to get the value of the key, get an integer, and take the modulus of M. Modulus usually refers to the remainder operation, also known as the modular operation. Modulus is a mathematical operation used to calculate the remainder after one number is divided by another. Suppose there are two integers a and b, where a is the dividend and b is the divisor. When calculating a divided by b, the modulus operation will return the remainder of a divided by b.

[0047] The formula for calculating the subscript value of the watermark column is as follows:

[0048] Col num = hash(key) mod(M)

[0049] In the formula, Col num Indicates the subscript value of the watermark column, key indicates the first primary key of each row of data, and M indicates the number of remaining columns in the data table excluding the attribute columns in the R set; num Greater than or equal to zero and less than M, when Col num When it is 0, it means that the watermark column is the first column after removing all the columns in the R set, and so on. M-1 means the last column after removing all the columns in the R set.

[0050] If there is a numeric attribute column in the subscript value of the watermark column calculated for the first time, the key in the first calculation and the obtained column attribute name are added as the new key, M-1 is used as the new M value, and the numeric attribute column is added to the R set. Then the new key and the new M value are substituted into the calculation formula for a second calculation until the result is a non-numeric attribute column. This column is the attribute column to which a watermark needs to be added. At this point, all non-numeric attribute columns are selected and subscript values ​​are calculated for all non-numeric attribute columns.

[0051] In one embodiment, the above step 400 may include: converting the string of the first key into an ASCII code, and calculating the sum of all ASCII codes corresponding to the first key, and recording the sum of the ASCII codes of the first key as K1 int ; K1 int Convert to a preset base digit to obtain first data; based on the preset base digit, set invisible characters corresponding to the number of base digits; replace the first data with the invisible characters to obtain a character string composed of invisible characters as a seamless watermark value.

[0052] Convert all characters in the string of the first key input by the user into ASCII (American Standard Code for Information Interchange, a standard encoding system for converting characters into numbers) codes, and add all the converted ASCII codes to obtain an integer data, recorded as K1 int , K1 int Convert to the system-set base. For example, if the system is set to quaternary, then K1 int Convert to quaternary, the converted quaternary K1 int Recorded as the first data. Set invisible characters, such as / u2028, / u2029, / u202a, / u202b... If the system is quaternary, then 4 invisible characters need to be set and replaced according to the following rules: / u2028 replaces 0, / u2029 replaces 1, / u202a replaces 2, / u202b replaces 3. If the system is quaternary, then set 4 invisible characters and replace the first data with invisible characters according to the preset replacement rules. For example, replace 0 in the first quaternary data with / u2028, replace 1 in the first quaternary data with / u2029, replace 2 in the first quaternary data with / u202a, and replace 3 in the first quaternary data with / u202b, and obtain a string composed of invisible characters as the seamless watermark value.

[0053] Figure 3is a flowchart of a database seamless watermarking method based on non-numerical attributes provided by another exemplary embodiment of the present invention. Figure 3 As shown, the above step 500 may include: Step 510: convert the string of the second key into ASCII code, and calculate the sum of all ASCII codes corresponding to the second key, and record the sum of the ASCII codes of the second key as K2 int ; Step 520: Get the length of the data to be watermarked in the watermark column, and record the length as L. Step 530: K2 int Modulo L, the result is recorded as Index, where Index is greater than 0 and less than L. Step 540: embed the invisible watermark value after the Indexth position of the character string to be watermarked.

[0054] After executing step 400, execute steps 510 to 540, that is, calculate the embedding position by using the second key. For example, convert all characters in the second key string into ASCII codes respectively, and add all the converted ASCII codes to obtain an integer data, which is recorded as K2 int , get the length of the data to be watermarked, denoted as L, K2 int Modulo L, get a value Index greater than 0 and less than L, as shown in the following formula. The watermark value needs to be embedded after the Index position in the string:

[0055] Index = K2 int mod(L)

[0056] In the formula, Index represents the embedding position of the invisible watermark value, K2 int represents the sum of the ASCII codes corresponding to each character in the string of the second key, and L represents the length of the watermark data to be watermarked in the watermark column.

[0057] In one embodiment, the above-mentioned database seamless watermarking method based on non-numerical attributes may also include: obtaining the watermarked attribute column of the data to be traced, the third key and the fourth key of the copyright holder; extracting the seamless watermark value of the watermarked attribute column; determining the embedding position of the seamless watermark value according to the third key; if the seamless watermark value exists at the embedding position, extracting invisible characters starting from the embedding position of the seamless watermark value; if the seamless watermark value does not exist at the embedding position, the tracing of the data to be traced ends.

[0058] The tracing process of the data to be traced is a reverse process of embedding the invisible watermark, which can be traced back to the copyright information of the data. In the tracing process of the data to be traced, the copyright holder who needs to be traced provides the third key and the fourth key. According to the method of step 100 and step 200, the watermarked column attributes of the data to be traced can be obtained, and the invisible watermark value can be extracted. According to the third key provided by the user, the watermark position is obtained, and starting from the watermark position, the invisible characters are extracted. If there is no invisible watermark value after the watermark position, the tracing ends, indicating that the copyright of the data to be traced does not belong to the user. On the contrary, if there is a invisible watermark value after the watermark position, the invisible watermark value is extracted.

[0059] In one embodiment, if there is a traceless watermark value at the embedded position, after extracting invisible characters from the embedded position of the traceless watermark value, the database traceless watermark method based on non-numerical attributes also includes: based on a preset base, converting the extracted invisible characters into plain text, and obtaining the preset base data of the ASCII code of the embedded traceless watermark value; calculating the decimal data according to the preset base data of the ASCII code of the embedded traceless watermark value, and obtaining the calculation result; converting the character string of the fourth key into ASCII code, and calculating the sum of all ASCII codes corresponding to the fourth key; if the sum of all ASCII codes corresponding to the fourth key is the same as the calculation result, it is determined that the data to be traced has the copyright information of the copyright holder.

[0060] If there is a traceless watermark value after the watermark position, extract the traceless watermark value, convert the extracted watermark value into plain text, and if the system uses quaternary, replace / u2028 in the watermark value with 0, / u2029 with 1, / u202a with 2, and / u202b with 3 to obtain the quaternary data of the ASCII code embedded with the watermark value, and then calculate the decimal data. Convert all characters in the string of the fourth key to ASCII code, calculate the sum of all ASCII codes of the fourth key, and compare the sum of all ASCII codes of the fourth key with the decimal calculation result. If they are the same, the data to be traced has the copyright information of the copyright holder, otherwise it does not have the copyright information of the copyright holder. In this way, the copyright information of the data can be identified, providing a basis for data protection.

[0061] Figure 4 FIG. 1 is a schematic diagram of a database seamless watermark system based on non-numerical attributes provided by an exemplary embodiment of the present invention. Figure 4As shown, according to another aspect of the present invention, a database seamless watermark system 6 based on non-numeric attributes is provided, including: a classification module 61, used to traverse the attribute columns in the data table, and classify all the attribute columns into primary key attribute columns, numerical attribute columns and non-numeric attribute columns; a marking module 62, used to mark all non-numeric attribute columns as watermark columns, and calculate the subscript value of the watermark column; wherein the watermark column represents the attribute column to which a watermark needs to be added; an acquisition module 63, used to obtain the first key, the second key and the length of the character string to be watermarked in the watermark column; a conversion module 64, used to convert the first key into a seamless watermark value based on a preset base; a calculation module 65, used to calculate the embedding position of the seamless watermark value based on the length of the data to be watermarked in the watermark column and the second key; wherein the embedding position is located at any position in the character string to be watermarked; an embedding module 66, used to embed the seamless watermark value into the corresponding position in the watermark column according to the embedding position to form a new character string; wherein the new character string includes a seamless watermark value.

[0062] The database seamless watermark system based on non-numerical attributes provided by the present invention realizes the addition of seamless watermarks to the database of non-numerical attributes, and can quickly trace the copyright information of the data after the data is leaked. The seamless watermark value and the position of adding the watermark are calculated based on the first key and the second key. Even if one of the keys is leaked, the watermark is difficult to be modified, which improves the reliability of the watermark and thus improves the security of the non-numerical data.

[0063] In one embodiment, the classification module 61 can be configured as follows: obtaining the first primary key key of each row of data; obtaining all attribute lists in the data table, and recording the number of columns of all attribute lists as M; wherein the set M does not include all primary key columns; grouping the attribute columns that do not add watermarks into a set, recorded as the R set: wherein the attribute columns that do not add watermarks include primary key attribute columns and numeric attribute columns.

[0064] Figure 5 FIG. 1 is a schematic diagram of a database seamless watermark system based on non-numerical attributes provided by another exemplary embodiment of the present invention. Figure 5 As shown, the marking module 62 may include:

[0065] The value taking unit 621 is used to take the value of the first primary key key of each row of data using a hash function, and take the modulus of M to obtain the subscript value of the watermark column. The subscript value is greater than or equal to zero and less than M. The selection unit 622 is used to select a numeric attribute column label when calculating the subscript value of the watermark column, and if the selected numeric attribute column label is not added to the R set, then add the key of the selected numeric attribute column label and the corresponding column attribute name as the new key, M-1 as the new M value, and add the selected numeric attribute column label to the R set. The first calculation unit 623 is used to calculate the subscript value of the watermark column with the new key and the corresponding M value until the result is a non-numeric attribute column, and the non-numeric attribute column obtained is the watermark column.

[0066] In one embodiment, the value obtaining unit 621 may be configured as follows:

[0067] Col num = hash(key) mod(M)

[0068] In the formula, Col num Indicates the subscript value of the watermark column, key indicates the first primary key of each row of data, and M indicates the number of remaining columns excluding the attribute columns in the R set; Col num Greater than or equal to zero and less than M, when Col num When it is 0, it means that the watermark column is the first column after removing all columns in the R set.

[0069] In one embodiment, the conversion module 64 may be configured to: convert the string of the first key into an ASCII code, and calculate the sum of all ASCII codes corresponding to the first key, and record the sum of the ASCII codes of the first key as K1. int ; K1 int Convert to a preset base digit to obtain first data; based on the preset base digit, set invisible characters corresponding to the number of base digits; replace the first data with the invisible characters to obtain a character string composed of invisible characters as a seamless watermark value.

[0070] In one embodiment, if Figure 5 As shown, the calculation module 65 may include: a second calculation unit 651, configured to convert the string of the second key into an ASCII code, and calculate the sum of all ASCII codes corresponding to the second key, and record the sum of the ASCII codes of the second key as K2 int ; Marking unit 652, used to obtain the length of the data to be watermarked in the watermark column, and record the length as L; modulus unit 653, used for K2 intModulo L, the result is recorded as Index, wherein Index is greater than 0 and less than L. The embedding unit 654 is used to embed the invisible watermark value after the Indexth position of the character string to be watermarked.

[0071] In one embodiment, the module taking unit 653 may be configured as follows:

[0072] Index = K2 int mod(L)

[0073] In the formula, Index represents the embedding position of the invisible watermark value, K2 int represents the sum of the ASCII codes corresponding to each character in the string of the second key, and L represents the length of the watermark data to be watermarked in the watermark column.

[0074] In one embodiment, the above-mentioned database seamless watermark system 6 based on non-numerical attributes can also be configured as: obtaining the watermarked attribute column of the data to be traced, the third key and the fourth key of the copyright holder; extracting the seamless watermark value of the watermarked attribute column; determining the embedding position of the seamless watermark value according to the third key; if there is a seamless watermark value at the embedding position, extracting invisible characters starting from the embedding position of the seamless watermark value; if there is no seamless watermark value at the embedding position, the tracing of the data to be traced is terminated.

[0075] In one embodiment, the above-mentioned database seamless watermark system 6 based on non-numerical attributes can also be configured as: based on a preset base digit, the extracted invisible characters are converted into plain text to obtain the preset base data of the ASCII code with the seamless watermark value embedded; according to the preset base data of the ASCII code with the seamless watermark value embedded, the decimal data is calculated to obtain the calculation result; the character string of the fourth key is converted into ASCII code, and the sum of all ASCII codes corresponding to the fourth key is calculated; if the sum of all ASCII codes corresponding to the fourth key is the same as the calculation result, it is determined that the data to be traced has the copyright information of the copyright holder.

[0076] The embodiment of the present invention provides a database traceless watermark system based on non-numerical attributes. The system embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, in addition to the CPU, memory, network interface, and non-volatile memory, the device in the embodiment where the device is located can generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, as a device in a logical sense, it is formed by the CPU of the device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.

[0077] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program for executing the database seamless watermarking method based on non-numerical attributes of any of the above embodiments.

[0078] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the database seamless watermarking method based on non-numerical attributes according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0079] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; and a processor for executing the database traceless watermarking method based on non-numerical attributes of any of the above embodiments.

[0080] In addition, an embodiment of the present invention may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the database seamless watermarking method based on non-numerical attributes according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A database watermarking method based on non-numerical attributes, It is characterized in that include: Traverse the attribute columns in the data table and classify all attribute columns into primary key attribute columns, numeric attribute columns, and non-numeric attribute columns; Mark all non-numeric attribute columns as watermark columns, and calculate the subscript value of the watermark column; wherein the watermark column represents the attribute column to which a watermark needs to be added; Get the length of the string to be watermarked in the first key, second key and watermark columns; Based on a preset base digit, converting the first key into a seamless watermark value; Based on the length of the data to be watermarked in the watermark column and the second key, the embedding position of the invisible watermark value is calculated; wherein the embedding position is located at any position in the character string to be watermarked; According to the embedding position, the invisible watermark value is embedded into the corresponding position in the watermark column to form a new character string.

2. According to claim 1, the database traceless watermarking method based on non-numerical attributes, It is characterized in that Traverse the attribute columns in the data table and classify all attribute columns into primary key attribute columns, numeric attribute columns, and non-numeric attribute columns, including: Get the first primary key of each row of data; Get all the attribute lists in the data table, and record the number of columns in all attribute lists as M; where set M does not include all primary key columns; The attribute columns without adding watermarks are grouped into a set, which is recorded as the R set: wherein the attribute columns without adding watermarks include primary key attribute columns and numeric attribute columns.

3. According to claim 2, the database traceless watermarking method based on non-numerical attributes, It is characterized in that Mark all non-numeric attribute columns as watermark columns and calculate the subscript value of the watermark column, including: Use the hash function to get the value of the first primary key key of each row of data, and take the modulus of M to obtain the subscript value of the watermark column; wherein the subscript value is greater than or equal to zero and less than M; If a numeric attribute column label is selected when calculating the subscript value of the watermark column, and the selected numeric attribute column label is not added to the R set, then the key of the selected numeric attribute column label and the corresponding column attribute name are added as the new key, M-1 is used as the new M value, and the selected numeric attribute column label is added to the R set; The subscript value of the watermark column is calculated using the new key and the corresponding M value until the result is a non-numeric attribute column. The non-numeric attribute column is the watermark column.

4. The database seamless watermarking method based on non-numerical attributes according to claim 3, It is characterized in that Use the hash function to get the value of the first primary key of each row of data, and take the modulus of M to obtain the subscript value of the watermark column, including: Col num =hash(key)mod(M) In the formula, Col num Indicates the subscript value of the watermark column, key indicates the first primary key of each row of data, and M indicates the number of remaining columns in the data table excluding the attribute columns in the R set; num Greater than or equal to zero and less than M, when Col num When it is 0, it means that the watermark column is the first column after removing all columns in the R set.

5. The database seamless watermarking method based on non-numerical attributes according to claim 1, It is characterized in that Based on a preset base number, converting the first key into a traceless watermark value comprises: Convert the string of the first key into ASCII code, and calculate the sum of all ASCII codes corresponding to the first key, and record the sum of the ASCII codes of the first key as K1 int ; K1 int Converting into a preset base number to obtain first data; Based on the preset base digits, setting invisible characters corresponding to the number of base digits; The first data is replaced by the invisible characters to obtain a character string consisting of invisible characters as the seamless watermark value.

6. The database seamless watermarking method based on non-numerical attributes according to claim 1, It is characterized in that Calculating the embedding position of the invisible watermark value based on the length of the data to be watermarked in the watermark column and the second key, including: Convert the string of the second key into ASCII code, and calculate the sum of all ASCII codes corresponding to the second key, and record the sum of the ASCII codes of the second key as K2 int ; Get the length of the data to be watermarked in the watermark column, and record the length as L; K2 int Modulo L, the result is recorded as Index; where Index is greater than 0 and less than L; The invisible watermark value is embedded after the Indexth position of the string of data to be watermarked.

7. The database seamless watermarking method based on non-numerical attributes according to claim 6, It is characterized in that K2 int Modulo L, the result is recorded as Index, including: Index=K2 int mod(L) In the formula, Index represents the embedding position of the invisible watermark value, K2 int represents the sum of the ASCII codes corresponding to each character in the string of the second key, and L represents the length of the watermark data to be watermarked in the watermark column.

8. The database seamless watermarking method based on non-numerical attributes according to claim 1, It is characterized in that The database traceless watermark method based on non-numerical attributes also includes: Obtain the watermarked attribute column of the data to be traced, the third key and the fourth key of the copyright holder; Extracting the invisible watermark value of the watermarked attribute column; Determining an embedding position of the seamless watermark value according to the third key; If there is a traceless watermark value at the embedding position, extracting invisible characters starting from the embedding position of the traceless watermark value; If there is no invisible watermark value at the embedding position, the tracing of the data to be traced is completed.

9. The database seamless watermarking method based on non-numerical attributes according to claim 8, It is characterized in that If there is a traceless watermark value at the embedding position, after extracting invisible characters from the embedding position of the traceless watermark value, the database traceless watermark method based on non-numerical attributes further includes: Based on a preset base digit, the extracted invisible characters are converted into plain text to obtain preset base data of the ASCII code in which the traceless watermark value has been embedded; Calculate decimal data according to preset base data of the ASCII code embedded with the invisible watermark value to obtain a calculation result; Convert the string of the fourth key into ASCII code, and calculate the sum of all ASCII codes corresponding to the fourth key; If the sum of all ASCII codes corresponding to the fourth key is the same as the calculation result, it is determined that the data to be traced has the copyright information of the copyright holder.

10. A database watermarking system based on non-numerical attributes. It is characterized in that include: The classification module is used to traverse the attribute columns in the data table and classify all attribute columns into primary key attribute columns, numerical attribute columns and non-numerical attribute columns; A marking module, used to mark all non-numeric attribute columns as watermark columns and calculate the subscript value of the watermark column; wherein the watermark column represents the attribute column to which a watermark needs to be added; An acquisition module, used for acquiring the first key, the second key and the length of the character string to be watermarked in the watermark column; A conversion module, used for converting the first key into a traceless watermark value based on a preset base digit; A calculation module, used for calculating the embedding position of the invisible watermark value based on the length of the data to be watermarked in the watermark column and the second key; wherein the embedding position is located at any position in the character string to be watermarked; The embedding module is used to embed the traceless watermark value into a corresponding position in the watermark column according to the embedding position to form a new character string; wherein the new character string includes a traceless traceless watermark value.