CN110866858A - Watermark embedding method, watermark embedding device, query data providing device, and data processing method - Google Patents

Watermark embedding method, watermark embedding device, query data providing device, and data processing method Download PDF

Info

Publication number
CN110866858A
CN110866858A CN201810980650.5A CN201810980650A CN110866858A CN 110866858 A CN110866858 A CN 110866858A CN 201810980650 A CN201810980650 A CN 201810980650A CN 110866858 A CN110866858 A CN 110866858A
Authority
CN
China
Prior art keywords
watermark
query data
data
query
copied
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810980650.5A
Other languages
Chinese (zh)
Other versions
CN110866858B (en
Inventor
刘永亮
范航宇
郑杰骞
陆哲明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201810980650.5A priority Critical patent/CN110866858B/en
Publication of CN110866858A publication Critical patent/CN110866858A/en
Application granted granted Critical
Publication of CN110866858B publication Critical patent/CN110866858B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a watermark embedding method, which comprises the following steps: obtaining query data according to the data query request; judging whether the query data meets the condition of triggering watermark embedding; if so, copying the query data to obtain copied query data; and embedding the watermark into the copied query data to obtain the query data embedded with the watermark. By adopting the method, the problem of source data pollution when the watermark information is embedded into the source data of the database in the prior art is solved.

Description

Watermark embedding method, watermark embedding device, query data providing device, and data processing method
Technical Field
The present application relates to digital watermark embedding technology, and in particular, to a watermark embedding method and apparatus, an electronic device, and a storage device. The application also relates to a query data providing method and device, electronic equipment and storage equipment. The application relates to two data processing methods simultaneously.
Background
The modern era is an information era and a big data era, and more database data are stored and forwarded through a network. The accumulation inside enterprises creates a large amount of data resources with huge values. Copyright protection and traceability tracking of these important data resources are two major issues in the modern times. Digital watermarking technology is an effective technology for realizing file copyright protection. By embedding meaningful watermark information into the database, the copyright protection of the database can be realized, the data is prevented from being illegally stolen, and if the data is discovered to be leaked, the tracing can be realized, and the purpose of tracing responsibility can be achieved.
In the prior art, some schemes for embedding watermark information in a database already exist, but the schemes in the prior art generally embed the watermark information in source data of the database, and the problem of source data pollution is easy to occur.
Disclosure of Invention
The application provides a watermark embedding method, a watermark embedding device, electronic equipment and storage equipment, and aims to solve the problem that source data pollution occurs when watermark information is embedded into source data of a database in the prior art.
The application provides a watermark embedding method, which comprises the following steps:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
Optionally, the determining whether the query data meets the condition for triggering watermark embedding includes at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
Optionally, the copied query data is query data in a table form;
the method further comprises the following steps:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the method further includes:
when the column number of the copied query data is larger than or equal to a preset column number threshold value, embedding the watermark into the copied query data in a mode of adding row data and/or column data for implicitly representing the watermark into the copied query data;
and when the column number of the copied query data is smaller than a preset column number threshold value, modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character string type watermark; hash value field watermark.
Optionally, the method further includes:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
Optionally, the determining, according to the type of the copied query data, the type of the watermark embedded in the copied query data includes:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
Optionally, the watermark type is a numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set;
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set;
and according to the new numerical value sub-sequence values and the sequence of the sub-sequences, obtaining the numerical value corresponding to each new numerical value sub-sequence, and taking the numerical value set as the numerical value type watermark.
Optionally, the numerical watermark is an integer numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set { SSN1, SSN2, …, SSNn };
generating different random numbers r for each subsequence, calculating new subsequence numerical values SSN and the sequence i thereof by a function f (SSNi, r, i) ═ (SSNi + a) (r + b) × 1000+ r × 100+ i, and obtaining values { Y1, Y2, …, Yn } which are numerical watermarks; where Yi ═ f (SSNi, r, i);
wherein a, b, n, r and i are positive integers.
Optionally, the numeric watermark is a floating-point numeric watermark, and the floating-point numeric watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to generate a new value subsequence set of { SSN1, SSN2, …, SSNn };
calculating the new numerical subsequence and the sequence i thereof through an equation f (SSNi, i) ═ SSNi +0.01 × i, and obtaining a value { Y1, Y2, …, Yn } which is a floating point numerical watermark; wherein i is a positive integer.
Optionally, the string-type watermark is obtained by:
connecting the watermark information with a random character to generate watermark information with the length being a preset length;
and performing AES encryption on the watermark information with the length being the preset length to obtain encrypted information, and taking the encrypted information as the character string type watermark.
Optionally, the hash value field watermark is obtained by:
presetting a field for verifying the integrity;
taking out the field content of the integrity verification in the data record bar to be embedded with the watermark information, and arranging and connecting the field content according to a specific mode to obtain first information;
and connecting the first information with the watermark information to obtain second information, and performing hash mapping on the second information to obtain a hash value as the hash value field watermark.
The application also provides a method for providing query data, which comprises the following steps:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
Optionally, the determining whether the query data meets the condition for triggering watermark embedding includes at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
Optionally, the copied query data is query data in a table form;
the method further comprises the following steps:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character-type watermark; hash value field watermark.
Optionally, the method further includes:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
The present application further provides a watermark embedding apparatus, comprising:
the query data obtaining unit is used for obtaining query data according to the data query request;
a trigger condition judging unit, configured to judge whether the query data satisfies a condition for triggering watermark embedding;
the query data copying unit is used for copying the query data to obtain copied query data when the output of the trigger condition judging unit is yes;
and the watermark embedding unit is used for embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
The present application additionally provides an electronic device comprising:
a processor; and
a memory for storing a program of a watermark embedding method, the apparatus performing the following steps after being powered on and running the program of the watermark embedding method by the processor:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
The present application further provides a storage device,
a program storing a watermark embedding method, the program being executed by a processor to perform the steps of:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
The present application further provides an apparatus for querying data provision, comprising:
the query request receiving unit is used for receiving a database query request;
the query data obtaining unit is used for obtaining query data according to the database query request;
a trigger condition judging unit, configured to judge whether the query data satisfies a condition for triggering watermark embedding;
the query data copying unit is used for copying the query data to obtain copied query data when the output of the trigger condition judging unit is yes;
a watermark embedding unit, configured to embed a watermark into the copied query data to obtain the query data embedded with the watermark;
and the query data returning unit is used for returning the query data embedded with the watermark.
The present application additionally provides an electronic device comprising:
a processor; and
a memory for storing a program of a method for providing query data, the apparatus performing the following steps after being powered on and running the program of the method for providing query data through the processor:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
The present application further provides a storage device,
a program storing a method for querying data provision, the program being executed by a processor to perform the steps of:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
The present application further provides a data processing method, which is characterized by including:
receiving a data query request from a requester;
acquiring first query data from a database according to the data query request;
determining that the query request meets a preset condition;
copying the first query data into second query data;
embedding the watermark into the second query data to obtain third query data embedded with the watermark;
feeding back the third query data to the requestor.
The present application further provides a data processing method, including:
sending a data query request to a server;
receiving inquiry data which is returned by a server and is embedded with the watermark; the watermark-embedded query data is obtained by the following method:
inquiring first inquiry data from a database according to the data inquiry request;
determining that the query request meets a preset condition;
copying the first query data to obtain second query data;
and embedding the watermark into the second query data to obtain the query data embedded with the watermark.
Compared with the prior art, the method has the following advantages:
according to the watermark embedding method, the watermark embedding device, the electronic equipment and the storage equipment, firstly, the query data are copied to obtain copied query data, and then the watermark is embedded into the copied query data to obtain the query data embedded with the watermark; in addition, the watermark embedding is carried out only when the condition of triggering the watermark embedding is met, and the data security is improved.
Drawings
Fig. 1 is a flowchart of a watermark embedding method according to a first embodiment of the present application.
Fig. 2 is a flowchart of a method for querying data provision according to a second embodiment of the present application.
Fig. 3 is a schematic diagram of a watermark embedding apparatus according to a third embodiment of the present application.
Fig. 4 is a schematic diagram of an electronic device according to a fourth embodiment of the present application.
Fig. 5 is a schematic diagram of an apparatus for querying data provision according to a sixth embodiment of the present application.
Fig. 6 is a schematic diagram of an electronic device according to a seventh embodiment of the present application.
Fig. 7 is a flowchart of a data processing method according to a ninth embodiment of the present application.
Fig. 8 is a flowchart of a data processing method according to a tenth embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of embodiments in many different forms than those described herein and is therefore not limited to the specific embodiments disclosed below since those skilled in the art will be able to apply this application without departing from the spirit and scope of the present invention.
A first embodiment of the present application provides a watermark embedding method, which is described below with reference to fig. 1.
As shown in fig. 1, in step S101, query data is obtained according to a data query request.
The data query request can be a query of a user (including an access user or an administrator of the database) for data in the database, and can also be a query of the user for other types of data.
The query data refers to data obtained by querying according to the data query request. For example, if the query request is to query the first 1000 records in the database, then the query data is the first 1000 records in the database.
As shown in fig. 1, in step S102, it is determined whether the query data satisfies a condition for triggering watermark embedding; if yes, go to step S103.
Because not all query data are suitable for embedding watermarks, some queries are not suitable for watermark embedding, and unpredictable results can be caused after the watermarks are embedded, whether the watermarks can be embedded or not can be judged according to the query data after the query data are obtained, if the query data meet the condition of triggering watermark embedding, subsequent steps are executed, and watermark embedding operation is carried out; and if the condition for triggering watermark embedding is not met, directly returning query data.
The judging whether the query data meets the condition of triggering watermark embedding includes at least one of the following items:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
For example: setting condition 1 for triggering watermark embedding: and setting the threshold value of the number of data records as 100, and meeting the condition of watermark embedding when the number of the query data is more than 100. A user requests to query all contents (if 1000 records exist) in Table1 in database a, the number of queried data is 1000, the queried data exceeds a set threshold of the number of data records and meets the condition of watermark embedding, and then the subsequent steps are executed to perform watermark embedding operation; otherwise, if the inquiry without triggering the watermark embedding condition does not carry out the digital watermark embedding. Setting condition 2 for triggering watermark embedding: embedding operation is carried out aiming at the Group1 of the user Group. If the user belongs to Group1, the condition of triggering watermark embedding is met, and the subsequent steps can be executed to perform watermark embedding operation; otherwise, no embedding is performed. It should be noted that the conditions for triggering watermark embedding may be used in various combinations, and are set according to actual situations, so as to improve the security of data.
As shown in fig. 1, in step S103, the query data is copied to obtain copied query data.
After the query data is obtained in step S101 and step S102 and it is determined that the query data meets the condition for triggering watermark embedding, the query data is copied in this step to obtain copied query data, an embedded carrier object is provided for the watermark, and the watermark is embedded into the copied query data, so that source data can be prevented from being polluted.
As shown in fig. 1, in step S104, a watermark is embedded in the copied query data, so as to obtain the query data with the embedded watermark.
The watermark refers to an identifier to be embedded in the carrier object. Vector objects here refer to replicated query data. The watermark can be hidden and embedded into the carrier object, the use value of the complex carrier object cannot be influenced, and the watermark cannot be easily detected and modified again. But the watermark can be identified and recognized by the producer. The watermark hidden in the carrier object can achieve the purposes of confirming content creators and purchasers, transmitting secret information, judging whether the carrier object is tampered or not and the like.
The embedding of the watermark into the replicated query data comprises:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
When the watermark is embedded, the watermark can be embedded by adopting a mode of modifying copied inquiry data, or a mode of adding row data and/or column data for implicitly representing the watermark in the copied inquiry data can be adopted to embed the watermark, which mode is specifically selected can be determined according to the characteristics of the copied inquiry data or artificially determined according to set parameters.
In specific implementation, the embedding mode can be distinguished by setting parameters, for example, the modified data embedding mode can be set when the parameter is set to be 1, the pseudo row/pseudo column is newly added when the parameter is set to be 0 (namely, the row data and/or column data embedding for implicitly representing the watermark is newly added), and if the parameter is set to be 1, only the modified data embedding method is used in the subsequent watermark embedding; if the setting parameter is 0, only the new dummy row/dummy column embedding method is used in the subsequent watermark embedding.
When the copied query data is query data in a table form, the way of embedding the watermark into the copied query data can be determined according to the number of columns of the copied query data. Such as a data table in a database.
Specifically, when the column number of the copied query data is greater than or equal to a preset column number threshold, embedding the watermark into the copied query data in a manner of adding row data and/or column data for implicitly representing the watermark into the copied query data; and when the column number of the copied query data is smaller than a preset column number threshold value, modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
In specific implementation, a program may be set, the preset column number threshold is set to be m columns, when the number of columns of the data table is greater than m columns, the watermark is embedded by adding row data and/or column data for implicitly representing the watermark in the copied query data, and when the number of columns of the data table is less than m columns, the data embedding manner is modified to embed the watermark.
When embedding a watermark in the replicated query data, the watermark may be embedded in a plurality of types, the types of watermark including at least one of: a numeric watermark; a character string type watermark; hash value field watermark, image watermark. The numerical watermark includes an integer numerical watermark and a floating-point numerical watermark.
When embedding a watermark in the copied query data, determining the type of the watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
The determining a type of watermark embedded in the copied query data according to the type of the copied query data includes:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
For example, when the preset ratio threshold is 70%, and when the ratio of the number of value type data in the copied query data to the number of copied query data is greater than 70%, it is determined that the type of the watermark embedded in the copied query data is a numerical watermark.
And when the preset ratio threshold is 70%, and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is more than 70%, determining that the type of the watermark embedded in the copied query data is the character type watermark and/or the hash value field watermark.
When the watermark type is a numerical watermark, the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set;
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set;
and according to the new numerical value sub-sequence values and the sequence of the sub-sequences, obtaining the numerical value corresponding to each new numerical value sub-sequence, and taking the numerical value set as the numerical value type watermark.
When the numerical watermark is an integer numerical watermark, the numerical watermark may be obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set { SSN1, SSN2, …, SSNn };
generating different random numbers r for each subsequence, calculating new subsequence numerical values SSN and the sequence i thereof by a function f (SSNi, r, i) ═ (SSNi + a) (r + b) × 1000+ r × 100+ i, and obtaining values { Y1, Y2, …, Yn } which are numerical watermarks; where Yi ═ f (SSNi, r, i);
wherein a, b, n, r and i are positive integers.
When the watermark needs to be extracted, the original watermark is restored through the following function:
i=Yi mod 100,r=(Yi mod 1000)–i,SSN i=int(Yi/1000)/(r+b)-a。
the integer numerical watermark can be embedded into the copied query data in a mode of modifying the copied query data or in a mode of adding row data and/or column data for implicitly representing the watermark in the copied query data.
When the numeric watermark is a floating-point numeric watermark, the floating-point numeric watermark may be obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to generate a new value subsequence set of { SSN1, SSN2, …, SSNn };
calculating the new numerical subsequence and the sequence i thereof through a function f (SSNi, i) ═ SSNi +0.01 × i, and obtaining a value { Y1, Y2, …, Yn } which is a floating point numerical watermark; wherein i is a positive integer.
When the watermark needs to be extracted, the original watermark can be restored by the following equation:
i=(Yi*100)mod 100,x=int(Yi)。
the floating-point numerical watermark can be embedded into the copied query data in a mode of modifying the copied query data or in a mode of adding row data and/or column data for implicitly representing the watermark in the copied query data.
When the type of the watermark is a character string type watermark, the character string type watermark may be obtained by:
connecting the watermark information with a random character to generate watermark information with the length being a preset length;
and performing AES encryption on the watermark information with the length being the preset length to obtain encrypted information, and taking the encrypted information as the character string type watermark. The preset length may be set as required, for example, 16 bytes.
When the watermark needs to be extracted, the watermark information is decrypted, and then the extraction of the watermark data can be completed.
When the type of the watermark is a hash value field watermark, the hash value field watermark is obtained by the following method:
presetting a field for verifying the integrity;
taking out the field content of the integrity verification in the data record bar to be embedded with the watermark information, and arranging and connecting the field content according to a specific mode to obtain first information;
and connecting the first information with the watermark information to obtain second information, and performing hash mapping on the second information to obtain a hash value as the hash value field watermark.
The data entry may refer to a row of data in a table. The field for presetting the integrity verification is at least one field, and part of or all of the fields in the data record can be selected as the field for presetting the integrity verification.
For example, assume that the contents of the fields in the first row that verify integrity are: 1,2,3 and ABC, the contents of the fields can be taken out and connected in sequence to obtain the first information of 123ABC, the watermark information is assumed to be ID4523, the first information is connected with the watermark information to obtain the second information of 123ABC and ID4523, the second information is subjected to Hash mapping to obtain a Hash value as the Hash value field watermark.
Taking the hash value as the hash value field watermark has the functions of verifying integrity and verifying watermark information. For example, if the watermark information is the employee ID and an employee with ID 1234 is suspected to have leaked the information, the above steps may be used to calculate the hash value H1 by themselves, and if the embedded hash value is H, if H1 is H, it may be determined that the information is leaked from the employee with ID 1234; if H1 ≠ H, it can be assumed that the data was tampered or that information was not leaked by the employee ID 1234.
When the type of the watermark is an image watermark, the image watermark may be obtained by: and converting the watermark information into image data, encoding the image data, and embedding the encoded data serving as the image watermark into a database. The image watermark is embedded into the copied query data, the encoding mode is very flexible, and the image data can be converted into numbers, character strings and the like.
When the watermark is embedded by adopting the watermark type, the watermark can be embedded into different positions in copied query data for many times so as to avoid the condition of failure in watermark extraction when the data is damaged.
Now, a detailed description is given of an implementation of the watermark embedding method provided in the first embodiment of the present application. The first embodiment of the application obtains the query data embedded with the watermark by embedding the watermark into the copied query data, thereby solving the problem of source data pollution when the watermark is embedded into the query data; and only when the condition of triggering watermark embedding is met, watermark embedding is carried out, so that the safety of data is improved.
A second embodiment of the present application provides a method for providing query data, which is described below with reference to fig. 2.
As shown in fig. 2, in step S201, a database query request is received.
As shown in fig. 2, in step S202, query data is obtained according to the database query request.
As shown in fig. 2, in step S203, it is determined whether the query data satisfies the condition for triggering watermark embedding, and if so, step S204 is executed.
Because not all query data are suitable for embedding watermarks, some queries are not suitable for watermark embedding, and unpredictable results can be caused after the watermarks are embedded, whether the watermarks can be embedded or not can be judged according to the query data after the query data are obtained, if the query data meet the condition of triggering watermark embedding, subsequent steps are executed, and watermark embedding operation is carried out; and if the condition for triggering watermark embedding is not met, directly returning query data.
The judging whether the query data meets the condition of triggering watermark embedding includes at least one of the following items:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
For example: setting condition 1 for triggering watermark embedding: and setting the threshold value of the number of data records as 100, and meeting the condition of watermark embedding when the number of the query data is more than 100. A user requests to query all contents (if 1000 records exist) in Table1 in database a, the number of queried data is 1000, the queried data exceeds a set threshold of the number of data records and meets the condition of watermark embedding, and then the subsequent steps are executed to perform watermark embedding operation; otherwise, if the inquiry without triggering the watermark embedding condition does not carry out the digital watermark embedding. Setting condition 2 for triggering watermark embedding: embedding operation is carried out aiming at the Group1 of the user Group. If the user belongs to Group1, the condition of triggering watermark embedding is met, and the subsequent steps can be executed to perform watermark embedding operation; otherwise, no embedding is performed. It should be noted that the conditions for triggering watermark embedding may be used in various combinations, and are set according to actual situations, so as to improve the security of data.
As shown in fig. 2, in step S204, the query data is copied to obtain copied query data.
As shown in fig. 2, in step S205, a watermark is embedded in the copied query data, so as to obtain the watermarked query data.
The embedding of the watermark into the replicated query data comprises:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
When the watermark is embedded, the watermark can be embedded by adopting a mode of modifying copied inquiry data, or a mode of adding row data and/or column data for implicitly representing the watermark in the copied inquiry data can be adopted to embed the watermark, which mode is specifically selected can be determined according to the characteristics of the copied inquiry data or artificially determined according to set parameters.
In specific implementation, the embedding mode can be distinguished by setting parameters, for example, the modified data embedding mode can be set when the parameter is set to be 1, the pseudo row/pseudo column is newly added when the parameter is set to be 0 (namely, the row data and/or column data embedding for implicitly representing the watermark is newly added), and if the parameter is set to be 1, only the modified data embedding method is used in the subsequent watermark embedding; if the setting parameter is 0, only the new dummy row/dummy column embedding method is used in the subsequent watermark embedding.
When the copied query data is query data in a table form, the way of embedding the watermark into the copied query data can be determined according to the number of columns of the copied query data. Such as a data table in a database.
Specifically, when the column number of the copied query data is greater than or equal to a preset column number threshold, embedding the watermark into the copied query data in a manner of adding row data and/or column data for implicitly representing the watermark into the copied query data; and when the column number of the copied query data is smaller than a preset column number threshold value, modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
In specific implementation, a program may be set, the preset column number threshold is set to be m columns, when the number of columns of the data table is greater than m columns, the watermark is embedded by adding row data and/or column data for implicitly representing the watermark in the copied query data, and when the number of columns of the data table is less than m columns, the data embedding manner is modified to embed the watermark.
When embedding a watermark in the replicated query data, the watermark may be embedded in a plurality of types, the types of watermark including at least one of: a numeric watermark; a character string type watermark; hash value field watermark, image watermark. The numerical watermark includes an integer numerical watermark and a floating-point numerical watermark.
When embedding a watermark in the copied query data, determining the type of the watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
The determining a type of watermark embedded in the copied query data according to the type of the copied query data includes:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
For example, when the preset ratio threshold is 70%, and when the ratio of the number of value type data in the copied query data to the number of copied query data is greater than 70%, it is determined that the type of the watermark embedded in the copied query data is a numerical watermark.
And when the preset ratio threshold is 70%, and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is more than 70%, determining that the type of the watermark embedded in the copied query data is the character type watermark and/or the hash value field watermark.
A numeric watermark; a character string type watermark; hash value field watermarking; please refer to the related contents of the first embodiment of the present application for the manner of obtaining the image watermark.
As shown in fig. 2, in step S206, the watermark-embedded query data is returned.
And returning the inquiry data embedded with the watermark, namely outputting the inquiry data embedded with the watermark according to a standard output format of a database.
Corresponding to the above-mentioned watermark embedding method, a third embodiment of the present application further provides a watermark embedding apparatus.
As shown in fig. 3, the watermark embedding apparatus includes: query data obtaining unit 301, trigger condition judging unit 302, query data copying unit 303, and watermark embedding unit 304.
A query data obtaining unit 301, configured to obtain query data according to the data query request;
a trigger condition determining unit 302, configured to determine whether the query data meets a condition for triggering watermark embedding;
the query data copying unit 303 is configured to copy the query data to obtain copied query data when the output of the trigger condition determining unit is yes;
a watermark embedding unit 304, configured to embed the watermark into the copied query data, so as to obtain the query data embedded with the watermark.
The judging whether the query data meets the condition of triggering watermark embedding includes at least one of the following items:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
Optionally, the copied query data is query data in a table form;
the device further comprises: an embedding manner determining unit that determines a manner of embedding,
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the apparatus further comprises:
a newly added data mode embedding unit, configured to embed the watermark into the copied query data in a mode of newly adding row data and/or column data, which are used to implicitly represent the watermark, to the copied query data when the number of columns of the copied query data is greater than or equal to a preset column number threshold;
and the modified data mode embedding unit is used for modifying the copied query data to obtain modified query data when the column number of the copied query data is smaller than a preset column number threshold value, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character string type watermark; hash value field watermark.
Optionally, the apparatus further comprises: a watermark type unit is determined according to the data type,
the watermark embedding method comprises the steps of determining the type of a watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
Optionally, the determining a watermark type unit according to a data type is specifically configured to:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
Optionally, the watermark type is a numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set;
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set;
and according to the new numerical value sub-sequence values and the sequence of the sub-sequences, obtaining the numerical value corresponding to each new numerical value sub-sequence, and taking the numerical value set as the numerical value type watermark.
Optionally, the numerical watermark is an integer numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set { SSN1, SSN2, …, SSNn };
generating different random numbers r for each subsequence, calculating new subsequence numerical values SSN and the sequence i thereof by a function f (SSNi, r, i) ═ (SSNi + a) (r + b) × 1000+ r × 100+ i, and obtaining values { Y1, Y2, …, Yn } which are numerical watermarks; where Yi ═ f (SSNi, r, i);
wherein a, b, n, r and i are positive integers.
Optionally, the numeric watermark is a floating-point numeric watermark, and the floating-point numeric watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to generate a new value subsequence set of { SSN1, SSN2, …, SSNn };
calculating the new numerical subsequence and the sequence i thereof through a function f (SSNi, i) ═ SSNi +0.01 × i, and obtaining a value { Y1, Y2, …, Yn } which is a floating point numerical watermark; wherein i is a positive integer.
Optionally, the string-type watermark is obtained by:
connecting the watermark information with a random character to generate watermark information with the length being a preset length;
and performing AES encryption on the watermark information with the length being the preset length to obtain encrypted information, and taking the encrypted information as the character string type watermark.
Optionally, the hash value field watermark is obtained by:
presetting a field for verifying the integrity;
taking out the field content of the integrity verification in the data record bar to be embedded with the watermark information, and arranging and connecting the field content according to a specific mode to obtain first information;
and connecting the first information with the watermark information to obtain second information, and performing hash mapping on the second information to obtain a hash value as the hash value field watermark.
It should be noted that, for the detailed description of the watermark embedding apparatus provided in the third embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not described here again.
Corresponding to the watermark embedding method provided above, a fourth embodiment of the present application further provides an electronic device.
As shown in fig. 4, the electronic apparatus includes:
a processor 401; and
a memory 402 for storing a program of a watermark embedding method, the apparatus performing the following steps after being powered on and running the program of the watermark embedding method by the processor:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
Optionally, the determining whether the query data meets the condition for triggering watermark embedding includes at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
Optionally, the copied query data is query data in a table form;
the electronic device further performs the steps of:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the electronic device further performs the following steps:
when the column number of the copied query data is larger than or equal to a preset column number threshold value, embedding the watermark into the copied query data in a mode of adding row data and/or column data for implicitly representing the watermark into the copied query data;
and when the column number of the copied query data is smaller than a preset column number threshold value, modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character string type watermark; hash value field watermark.
Optionally, the electronic device further performs the following steps:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
Optionally, the determining, according to the type of the copied query data, the type of the watermark embedded in the copied query data includes:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
Optionally, the watermark type is a numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set;
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set;
and according to the new numerical value sub-sequence values and the sequence of the sub-sequences, obtaining the numerical value corresponding to each new numerical value sub-sequence, and taking the numerical value set as the numerical value type watermark.
Optionally, the numerical watermark is an integer numerical watermark, and the numerical watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set { SSN1, SSN2, …, SSNn };
generating different random numbers r for each subsequence, calculating new subsequence numerical values SSN and the sequence i thereof by a function f (SSNi, r, i) ═ (SSNi + a) (r + b) × 1000+ r × 100+ i, and obtaining values { Y1, Y2, …, Yn } which are numerical watermarks; where Yi ═ f (SSNi, r, i);
wherein a, b, n, r and i are positive integers.
Optionally, the numeric watermark is a floating-point numeric watermark, and the floating-point numeric watermark is obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to generate a new value subsequence set of { SSN1, SSN2, …, SSNn };
calculating the new numerical subsequence and the sequence i thereof through a function f (SSNi, i) ═ SSNi +0.01 × i, and obtaining a value { Y1, Y2, …, Yn } which is a floating point numerical watermark; wherein i is a positive integer.
Optionally, the string-type watermark is obtained by:
connecting the watermark information with a random character to generate watermark information with the length being a preset length;
and performing AES encryption on the watermark information with the length being the preset length to obtain encrypted information, and taking the encrypted information as the character string type watermark.
Optionally, the hash value field watermark is obtained by:
presetting a field for verifying the integrity;
taking out the field content of the integrity verification in the data record bar to be embedded with the watermark information, and arranging and connecting the field content according to a specific mode to obtain first information;
and connecting the first information with the watermark information to obtain second information, and performing hash mapping on the second information to obtain a hash value as the hash value field watermark.
It should be noted that, for the detailed description of the electronic device provided in the fourth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
In correspondence with one of the watermark embedding methods provided above, a fifth embodiment of the present application also provides a storage device,
a program storing a watermark embedding method, the program being executed by a processor to perform the steps of:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
It should be noted that, for the detailed description of the storage device provided in the fifth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not described here again.
Corresponding to the method for providing query data provided above, a sixth embodiment of the present application further provides a device for providing query data.
As shown in fig. 5, the apparatus for providing query data includes:
a query request receiving unit 501, configured to receive a database query request;
a query data obtaining unit 502, configured to obtain query data according to the database query request;
a trigger condition determining unit 503, configured to determine whether the query data meets a condition for triggering watermark embedding;
the query data copying unit 504 is configured to copy the query data to obtain copied query data when the output of the trigger condition determining unit is yes;
a watermark embedding unit 505, configured to embed a watermark into the copied query data to obtain query data embedded with the watermark;
a query data returning unit 506, configured to return the watermark embedded query data.
Optionally, the determining whether the query data meets the condition for triggering watermark embedding includes at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
The copied query data is query data in a table form;
the device further comprises: an embedding manner determining unit that determines a manner of embedding,
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character-type watermark; hash value field watermark.
Optionally, the apparatus further comprises: a watermark type unit is determined according to the data type,
the watermark embedding method comprises the steps of determining the type of a watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
It should be noted that, for the detailed description of the apparatus for providing query data provided in the sixth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
Corresponding to the method for providing query data provided above, a seventh embodiment of the present application further provides an electronic device, as shown in fig. 6, where the electronic device includes:
a processor 601; and
a memory 602 for storing a program of a method for providing query data, the apparatus being powered on and executing the program of the method for providing query data by the processor, and performing the following steps:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
Optionally, the determining whether the query data meets the condition for triggering watermark embedding includes at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
Optionally, the embedding the watermark into the copied query data includes:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
Optionally, the copied query data is query data in a table form;
the electronic device further performs the steps of:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
Optionally, the type of the watermark includes at least one of the following types: a numeric watermark; a character-type watermark; hash value field watermark.
Optionally, the electronic device further performs the following steps:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
It should be noted that, for the detailed description of the electronic device provided in the seventh embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
In correspondence with the method for providing query data provided above, an eighth embodiment of the present application further provides a storage device storing a program of the method for providing query data, where the program is executed by a processor to perform the following steps:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
It should be noted that, for the detailed description of the storage device provided in the eighth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
A ninth embodiment of the present application provides a data processing method, which is described below with reference to fig. 7.
As shown in fig. 7, in step S701, a data query request from a requester is received.
The requester refers to a party who sends a data query request. The requestor may refer to a client.
As shown in fig. 7, in step S702, first query data is queried from a database according to the data query request.
The query of the first query data from the database refers to finding the first query data from the database. The first query data includes at least one data record in a database.
As shown in fig. 7, in step S703, it is determined that the query request satisfies a preset condition.
Because not all query data are suitable for embedding watermarks, some query data are not suitable for watermark embedding, and unpredictable results can be caused after the watermarks are embedded, whether the watermarks can be embedded or not can be judged according to the query data after the query data are obtained, and if the query request meets preset conditions, subsequent steps are executed to perform watermark embedding operation.
When the number of data records of the query data is greater than the threshold value of the number of data records, or when a user group in which a user sending a data query request is located meets a condition for triggering watermark embedding, it can be determined that the query request meets a preset condition.
For example: setting a preset condition 1: and setting the threshold value of the number of data records as 100, and meeting the preset condition when the number of the query data is more than 100. A user requests to query all contents (if 1000 records exist) in Table1 in database a, the number of queried data is 1000, the queried data exceeds a set threshold of the number of data records and meets a preset condition, and then the subsequent steps are executed to perform watermark embedding operation; otherwise, if the inquiry does not reach the preset condition, the digital watermark is not embedded. Setting a preset condition 2: embedding operation is carried out aiming at the Group1 of the user Group. If the user belongs to Group1, the preset condition is met, the subsequent steps can be executed, and watermark embedding operation is carried out; otherwise, no embedding is performed. The preset conditions may be used in combination of a plurality of types, and are set according to actual conditions to improve the security of data.
As shown in fig. 7, in step S704, the first query data is copied to obtain second query data.
The second query data is the replicated first query data.
After the first query data is obtained in step S702 and step S703 and it is determined that the query request satisfies the preset condition, the first query data is copied in this step to obtain second query data, an embedded carrier object is provided for the watermark, and the watermark is embedded in the second query data, so that source data can be prevented from being polluted.
As shown in fig. 7, in step S705, a watermark is embedded in the second query data, resulting in a third query data with embedded watermark.
As shown in fig. 7, in step S706, the third query data is fed back to the requester.
A tenth embodiment of the present application provides a data processing method, which is described below with reference to fig. 8.
As shown in fig. 8, in step S801, a data query request is transmitted to the server.
The data query request refers to a query request for data in a database sent by a client. The server may refer to a database management system.
As shown in fig. 8, in step S802, receiving query data with embedded watermark returned by the server;
the watermark-embedded query data is obtained by the following method:
inquiring first inquiry data from a database according to the data inquiry request;
determining that the query request meets a preset condition;
copying the first query data to obtain second query data;
and embedding the watermark into the second query data to obtain the query data embedded with the watermark.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that the scope of the present invention is not limited to the embodiments described above, and that various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the present invention.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (27)

1. A watermark embedding method, comprising:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
2. The method of claim 1, wherein the determining whether the query data satisfies a condition for triggering watermark embedding comprises at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
3. The method of claim 1, wherein embedding a watermark in the replicated query data comprises:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
4. The method of claim 3, wherein the replicated query data is query data in tabular form;
the method further comprises the following steps:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
5. The method of claim 4, further comprising:
when the column number of the copied query data is larger than or equal to a preset column number threshold value, embedding the watermark into the copied query data in a mode of adding row data and/or column data for implicitly representing the watermark into the copied query data;
and when the column number of the copied query data is smaller than a preset column number threshold value, modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark.
6. The method of claim 1, wherein the type of the watermark comprises at least one of: a numeric watermark; a character string type watermark; hash value field watermark.
7. The method of claim 6, further comprising:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
8. The method of claim 7, wherein determining the type of watermark embedded in the copied query data based on the type of copied query data comprises:
when the ratio of the number of numerical type data in the copied query data to the number of the copied query data is greater than a preset ratio threshold, determining that the type of the watermark embedded in the copied query data is a numerical type watermark;
and when the ratio of the number of the character type data in the copied query data to the number of the copied query data is larger than a preset ratio threshold, determining that the type of the watermark embedded into the copied query data is a character type watermark and/or a hash value field watermark.
9. The method according to claim 6, wherein the watermark type is a numeric watermark, the numeric watermark being obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set;
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set;
and according to the new numerical value sub-sequence values and the sequence of the sub-sequences, obtaining the numerical value corresponding to each new numerical value sub-sequence, and taking the numerical value set as the numerical value type watermark.
10. The method according to claim 9, wherein the numeric watermark is an integer numeric watermark, the numeric watermark being obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to obtain a new numerical value subsequence set { SSN1, SSN2, …, SSNn };
generating different random numbers r for each subsequence, calculating new subsequence numerical values SSN and the sequence i thereof by a function f (SSNi, r, i) ═ (SSNi + a) (r + b) × 1000+ r × 100+ i, and obtaining values { Y1, Y2, …, Yn } which are numerical watermarks; where Yi ═ f (SSNi, r, i);
wherein a, b, n, r and i are positive integers.
11. The method according to claim 9, wherein the numeric watermark is a floating-point numeric watermark obtained by:
converting the character string watermark information into an ASCII code numerical value subsequence set { SS1, SS2, …, SSn };
performing cyclic shift operation on each subsequence according to a preset shift bit number to generate a new value subsequence set of { SSN1, SSN2, …, SSNn };
calculating the new numerical subsequence and the sequence i thereof through a function f (SSNi, i) ═ SSNi +0.01 × i, and obtaining a value { Y1, Y2, …, Yn } which is a floating point numerical watermark; wherein i is a positive integer.
12. The method of claim 6, wherein the string-type watermark is obtained by:
connecting the watermark information with a random character to generate watermark information with the length being a preset length;
and performing AES encryption on the watermark information with the length being the preset length to obtain encrypted information, and taking the encrypted information as the character string type watermark.
13. The method of claim 6, wherein the hash value field watermark is obtained by:
presetting a field for verifying the integrity;
taking out the field content of the integrity verification in the data record bar to be embedded with the watermark information, and arranging and connecting the field content according to a specific mode to obtain first information;
and connecting the first information with the watermark information to obtain second information, and performing hash mapping on the second information to obtain a hash value as the hash value field watermark.
14. A method for querying a data feed, comprising:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
15. The method of claim 14, wherein the determining whether the query data satisfies a condition for triggering watermark embedding comprises at least one of:
judging whether the number of data records of the query data is greater than a data record number threshold value or not;
and judging whether the user group where the user sending the data query request is located meets the condition of triggering watermark embedding.
16. The method of claim 14, wherein embedding a watermark in the replicated query data comprises:
modifying the copied query data to obtain modified query data, wherein the modified query data implicitly comprises the copied query data and data representing the watermark; alternatively, the first and second electrodes may be,
and adding row data and/or column data for implicitly representing the watermark in the copied query data.
17. The method of claim 16, wherein the replicated query data is query data in tabular form;
the method further comprises the following steps:
and determining a mode of embedding the watermark into the copied query data according to the column number of the copied query data.
18. The method of claim 14, wherein the type of the watermark comprises at least one of: a numeric watermark; a character-type watermark; hash value field watermark.
19. The method of claim 18, further comprising:
determining a type of watermark embedded in the copied query data according to the type of the copied query data, wherein the type of the copied query data comprises numerical values and/or characters.
20. A watermark embedding apparatus, comprising:
the query data obtaining unit is used for obtaining query data according to the data query request;
a trigger condition judging unit, configured to judge whether the query data satisfies a condition for triggering watermark embedding;
the query data copying unit is used for copying the query data to obtain copied query data when the output of the trigger condition judging unit is yes;
and the watermark embedding unit is used for embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
21. An electronic device, comprising:
a processor; and
a memory for storing a program of a watermark embedding method, the apparatus performing the following steps after being powered on and running the program of the watermark embedding method by the processor:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
22. A storage device, characterized in that,
a program storing a watermark embedding method, the program being executed by a processor to perform the steps of:
obtaining query data according to the data query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
and embedding the watermark into the copied query data to obtain the query data embedded with the watermark.
23. An apparatus for querying a data feed, comprising:
the query request receiving unit is used for receiving a database query request;
the query data obtaining unit is used for obtaining query data according to the database query request;
a trigger condition judging unit, configured to judge whether the query data satisfies a condition for triggering watermark embedding;
the query data copying unit is used for copying the query data to obtain copied query data when the output of the trigger condition judging unit is yes;
a watermark embedding unit, configured to embed a watermark into the copied query data to obtain the query data embedded with the watermark;
and the query data returning unit is used for returning the query data embedded with the watermark.
24. An electronic device, comprising:
a processor; and
a memory for storing a program of a method for providing query data, the apparatus performing the following steps after being powered on and running the program of the method for providing query data through the processor:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
25. A storage device, characterized in that,
a program storing a method for querying data provision, the program being executed by a processor to perform the steps of:
receiving a database query request;
obtaining query data according to the database query request;
judging whether the query data meets the condition of triggering watermark embedding;
if so, copying the query data to obtain copied query data;
embedding the watermark into the copied query data to obtain the query data embedded with the watermark;
and returning the inquiry data embedded with the watermark.
26. A data processing method, comprising:
receiving a data query request from a requester;
inquiring first inquiry data from a database according to the data inquiry request;
determining that the query request meets a preset condition;
copying the first query data to obtain second query data;
embedding the watermark into the second query data to obtain third query data embedded with the watermark;
feeding back the third query data to the requestor.
27. A data processing method, comprising:
sending a data query request to a server;
receiving inquiry data which is returned by a server and is embedded with the watermark; the watermark-embedded query data is obtained by the following method:
inquiring first inquiry data from a database according to the data inquiry request;
determining that the query request meets a preset condition;
copying the first query data to obtain second query data;
and embedding the watermark into the second query data to obtain the query data embedded with the watermark.
CN201810980650.5A 2018-08-27 2018-08-27 Watermark embedding method, watermark embedding device, query data providing device, and data processing method Active CN110866858B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810980650.5A CN110866858B (en) 2018-08-27 2018-08-27 Watermark embedding method, watermark embedding device, query data providing device, and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810980650.5A CN110866858B (en) 2018-08-27 2018-08-27 Watermark embedding method, watermark embedding device, query data providing device, and data processing method

Publications (2)

Publication Number Publication Date
CN110866858A true CN110866858A (en) 2020-03-06
CN110866858B CN110866858B (en) 2022-05-10

Family

ID=69651082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810980650.5A Active CN110866858B (en) 2018-08-27 2018-08-27 Watermark embedding method, watermark embedding device, query data providing device, and data processing method

Country Status (1)

Country Link
CN (1) CN110866858B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800440A (en) * 2020-12-31 2021-05-14 北京安华金和科技有限公司 Dynamic watermark adding processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030294A (en) * 2007-02-13 2007-09-05 江苏国盾科技实业有限责任公司 Production of electronic-physical seal and its synthetic seal
CN101236587A (en) * 2008-02-15 2008-08-06 南通大学 Outsourced database enquiry and verification method based on fragile watermark
CN103701756A (en) * 2012-09-27 2014-04-02 中国电信股份有限公司 Method and device for protecting web form data and web server
CN106778562A (en) * 2016-12-02 2017-05-31 深圳凯达通光电科技有限公司 Video structural Vehicle License Plate Recognition System based on big data
CN107992726A (en) * 2017-11-29 2018-05-04 北京安华金和科技有限公司 A kind of watermark processing and data source tracing method based on the pseudo- row of dummy lines
US20180260617A1 (en) * 2017-03-08 2018-09-13 Morphotrust Usa, Llc System and method for manufacturing and inspecting identification documents

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030294A (en) * 2007-02-13 2007-09-05 江苏国盾科技实业有限责任公司 Production of electronic-physical seal and its synthetic seal
CN101236587A (en) * 2008-02-15 2008-08-06 南通大学 Outsourced database enquiry and verification method based on fragile watermark
CN103701756A (en) * 2012-09-27 2014-04-02 中国电信股份有限公司 Method and device for protecting web form data and web server
CN106778562A (en) * 2016-12-02 2017-05-31 深圳凯达通光电科技有限公司 Video structural Vehicle License Plate Recognition System based on big data
US20180260617A1 (en) * 2017-03-08 2018-09-13 Morphotrust Usa, Llc System and method for manufacturing and inspecting identification documents
CN107992726A (en) * 2017-11-29 2018-05-04 北京安华金和科技有限公司 A kind of watermark processing and data source tracing method based on the pseudo- row of dummy lines

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周明 等: "有选择嵌入水印的关系数据库管理系统实现", 《计算机应用研究》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800440A (en) * 2020-12-31 2021-05-14 北京安华金和科技有限公司 Dynamic watermark adding processing method and device

Also Published As

Publication number Publication date
CN110866858B (en) 2022-05-10

Similar Documents

Publication Publication Date Title
Meng et al. Design scheme of copyright management system based on digital watermarking and blockchain
US20170300713A1 (en) Method and System for Verifiable Searchable Symmetric Encryption
Sion et al. On watermarking numeric sets
CN109740316B (en) Dynamic watermark embedding and verifying method and system and dynamic watermark processing system
Melkundi et al. A robust technique for relational database watermarking and verification
CN110770725B (en) Data processing method and device
US11321431B2 (en) Data processing, watermark embedding and watermark extraction
Martínez et al. On watermarking for collaborative model-driven engineering
CN110866858B (en) Watermark embedding method, watermark embedding device, query data providing device, and data processing method
Liu et al. A block oriented fingerprinting scheme in relational database
Khanduja et al. Identification and Proof of Ownership by WatermarkingRelational Databases
Lohegaon A robust, distortion minimization fingerprinting technique for relational database
Shah et al. Query preserving relational database watermarking
Saikia et al. Coded fingerprinting based watermarking to resist collusion attacks and trace colluders
US10892890B2 (en) Hash offset based key version embedding
US11699209B2 (en) Method and apparatus for embedding and extracting digital watermarking for numerical data
Mohanpurkar et al. A fingerprinting technique for numeric relational databases with distortion minimization
Mohanpurkar et al. Applying watermarking for copyright protection, traitor identification and joint ownership: A review
Dwivedi et al. Watermarking techniques for ownership protection of relational databases
TWI553630B (en) Apparatus and method for adding watermark data to audio signals
El_Haggar et al. Blind watermarking technique for relational database
US11983789B1 (en) Generation method, detection method, generation device, and detection device of zero watermarking for trajectory data, and storage medium
Zhang et al. Fine-grained cloud db damage examination based on bloom filters
CN117909943A (en) Watermark tracing processing method and system based on multiple nodes
Pervez et al. Semblance based disseminated software watermarking algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant