CN117668786A - Database watermark embedding method, device, computer equipment and medium - Google Patents

Database watermark embedding method, device, computer equipment and medium Download PDF

Info

Publication number
CN117668786A
CN117668786A CN202311613087.5A CN202311613087A CN117668786A CN 117668786 A CN117668786 A CN 117668786A CN 202311613087 A CN202311613087 A CN 202311613087A CN 117668786 A CN117668786 A CN 117668786A
Authority
CN
China
Prior art keywords
pseudo
watermark
value
row
field
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.)
Pending
Application number
CN202311613087.5A
Other languages
Chinese (zh)
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.)
State Grid Smart Grid Research Institute Co ltd
State Grid Corp of China SGCC
Original Assignee
State Grid Smart Grid Research Institute Co ltd
State Grid Corp of China SGCC
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 State Grid Smart Grid Research Institute Co ltd, State Grid Corp of China SGCC filed Critical State Grid Smart Grid Research Institute Co ltd
Priority to CN202311613087.5A priority Critical patent/CN117668786A/en
Publication of CN117668786A publication Critical patent/CN117668786A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of database security, and discloses a database watermark embedding method, a device, computer equipment and a medium.

Description

Database watermark embedding method, device, computer equipment and medium
Technical Field
The present invention relates to the field of database security technologies, and in particular, to a method, an apparatus, a computer device, and a medium for embedding a database watermark.
Background
Databases are an important component of modern information systems, are widely applied to various industries, and have the problem of being illegally copied. The copyright description, the user identity and other information are embedded into the database through the digital watermarking technology, so that illegal copying and embezzlement are identified when necessary, and the data copyright is protected.
In the related art, watermark information sequences are inserted into databases by inserting watermark information sequences into databases containing specific information (such as flights, names of persons, etc.) that can generate counterfeit values, which are randomly generated, for example, in a database storing civil aviation information, a counterfeit line is added, which contains a flight number that does not exist at all, and the departure place and destination of the counterfeit. This approach requires background knowledge at the time of detection, such as which of valid flights and places are available. The information embedded by the pseudo-row watermark is randomly generated and forged, is easily identified by an attacker, and is further removed.
Disclosure of Invention
In view of the above, the present invention provides a method, apparatus, computer device and medium for embedding a database watermark, so as to solve the problem that a pseudo-row watermark is easily identified and then removed when a pseudo-row watermark is inserted into a database based on counterfeit information.
In a first aspect, the present invention provides a method for embedding a database watermark, the method comprising: obtaining a watermark information sequence and a plurality of values respectively corresponding to different fields in a database to be processed; determining the bit width of each field and the watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed; determining the value of a pseudo-column key corresponding to each field in a pseudo-row to be inserted according to a preset watermark generation algorithm and a watermark information sequence, wherein the pseudo-row to be inserted comprises a plurality of different fields, and the different fields in the pseudo-row to be inserted correspond to the different fields in the database one by one; determining the numerical value of a target character string of a corresponding field in the watermark information sequence according to the value of a pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field; determining the value of the corresponding field to be inserted into the pseudo row based on the numerical value of the target character string of each field and the watermark number of each value; and determining the information of the pseudo rows to be inserted based on the value of each field in the pseudo rows to be inserted, and embedding the information of the pseudo rows to be inserted into a database to be processed.
When a pseudo-line watermark is inserted into a database, watermark numbering is carried out on a plurality of values corresponding to different fields in the database to be processed by utilizing a watermark information sequence, the bit width of each field is determined, the value of a pseudo-column key corresponding to each field in the pseudo-line to be inserted is determined by utilizing a preset watermark generation algorithm and the watermark information sequence, the value of a target character string of the corresponding field is determined in the watermark information sequence according to the pseudo-column key of each field and the bit width of the corresponding field, then the value of the corresponding field in the pseudo-line to be inserted is determined based on the value of the target character string and the watermark number of each value, the pseudo-line information to be inserted is determined based on the value of the corresponding field in the pseudo-line to be inserted, and the pseudo-line information to be inserted is embedded into the database to be processed. The method provided by the invention has the advantages that the true value of each field for watermark insertion is allocated with a corresponding code, when the pseudo-line watermark is inserted, the watermark is split into different character strings, each character string is allocated into one field in the pseudo-line, the value of the field is used for representing the corresponding watermark character string, the value of each field in the pseudo-line to be inserted is derived from the true value in the database to be processed, and is not easy to be identified by other attackers, so that the attack resistance of the watermark is increased, and the problems that the pseudo-line watermark is easily identified and then removed when the pseudo-line watermark is inserted into the database based on fake information in the related technology are solved.
In an alternative embodiment, the step of obtaining the watermark information sequence comprises: acquiring original watermark information; and processing the original watermark information by using a preset watermark generation algorithm to obtain a watermark information sequence.
In an alternative embodiment, the step of determining the value of the pseudo column key corresponding to each field to be inserted in the pseudo row according to a preset watermark generation algorithm and a watermark information sequence includes: determining a pseudo-row key according to a preset watermark generation algorithm and a watermark information sequence; and determining the value of the pseudo column key corresponding to each field to be inserted into the pseudo row according to the pseudo row key and a preset watermark generation algorithm.
According to the method provided by the alternative embodiment, the pseudo row key is determined by presetting a watermark generation algorithm and a watermark information sequence, and the pseudo column key is determined based on the pseudo row key, so that the accuracy of the pseudo column key is ensured.
In an alternative embodiment, the step of determining the value of the target string of the corresponding field in the watermark information sequence according to the value of the corresponding pseudo-column key of each field in the pseudo-row to be inserted and the bit width of the corresponding field includes: the length of the watermark information sequence is modulo the value of the pseudo-column key corresponding to each field to be inserted in the pseudo-row, and a target value is obtained; determining a starting position of the corresponding field in the watermark information sequence based on the target value; and determining the numerical value of the target character string of the corresponding field in the watermark information sequence according to the bit width and the starting position of each field in the pseudo row to be inserted.
The method provided by the alternative embodiment can accurately determine the corresponding target character string of each field in the pseudo-line in the watermark information sequence, and is convenient for subsequent determination of the pseudo-line information to be inserted.
In an alternative embodiment, the step of determining the value of the corresponding field in the pseudo-row to be inserted based on the value of the target string of each field and the watermark number of each value includes: comparing the numerical value of the target character string of each field with the watermark number of each value of the database to be processed to obtain a comparison result; determining the value corresponding to the numerical value of the target character string of each field based on the comparison result; and taking the value corresponding to the numerical value of the target character string of each field as the value of the corresponding field.
In an alternative embodiment, the method further comprises: and storing the information to be inserted into the pseudo rows into a storage module.
In an alternative embodiment, the method further comprises: when receiving a pseudo-row watermark extraction request, respectively carrying out similarity calculation on each row of information in a database to be detected and pseudo-row information to be inserted to obtain the similarity between each row of information and the pseudo-row information to be inserted, wherein the database to be detected is a database in which the pseudo-row information to be inserted is embedded in advance; taking the row information with the similarity larger than a preset threshold value in the database to be detected as a pseudo-row watermark; and extracting the pseudo-row watermark in the database to be detected.
The method provided by the alternative embodiment can accurately extract the pseudo-row watermark in the database to be detected.
In a second aspect, the present invention provides a database watermark embedding apparatus, the apparatus comprising: the acquisition module is used for acquiring a plurality of values respectively corresponding to different fields in the watermark information sequence and the database to be processed; the first determining module is used for determining the bit width of each field and the watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed; the second determining module is used for determining the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted according to a preset watermark generation algorithm and a watermark information sequence, wherein the pseudo-row to be inserted comprises a plurality of different fields, and the different fields in the pseudo-row to be inserted correspond to the different fields in the database one by one; a third determining module, configured to determine, in the watermark information sequence, a value of a target string of the corresponding field according to a value of a pseudo-column key corresponding to each field in the pseudo-row to be inserted and a bit width of the corresponding field; a fourth determining module, configured to determine a value of a corresponding field to be inserted into the pseudo row based on a value of the target string of each field and a watermark number of each value; and a fifth determining module, configured to determine the dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embed the dummy row information to be inserted into the database to be processed.
In a third aspect, the present invention provides a computer device comprising: the database watermark embedding system comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions so as to execute the database watermark embedding method of the first aspect or any corresponding implementation mode.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to perform the database watermark embedding method of the first aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow diagram of a database watermark embedding method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another database watermark embedding method according to an embodiment of the invention;
FIG. 3 is a flow chart of yet another database watermark embedding method according to an embodiment of the invention;
fig. 4 is a block diagram of a database watermark embedding device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related art, watermark information sequences are inserted into a database by specific information (such as flights, names of persons, etc.) which can generate counterfeit values, and the information embedded by the pseudo-row watermark is randomly generated and is counterfeit information, so that the information is easily identified by an attacker and is further removed.
In view of this, the present invention provides a database watermark embedding method, which can be applied to a server to implement watermark embedding of a database. The method provided by the invention has the advantages that the true value of each field for watermark insertion is allocated with a corresponding code, when the pseudo-line watermark is inserted, the watermark is split into different character strings, each character string is allocated into one field in the pseudo-line, the value of the field is used for representing the corresponding watermark character string, the value of each field in the pseudo-line to be inserted is derived from the true value in the database to be processed, and is not easy to be identified by other attackers, so that the attack resistance of the watermark is increased, and the problems that the pseudo-line watermark is easily identified and then removed when the pseudo-line watermark is inserted into the database based on fake information in the related technology are solved.
In accordance with an embodiment of the present invention, a database watermark embedding method embodiment is provided, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
In this embodiment, a database watermark embedding method is provided, which may be used in the server described above, and fig. 1 is a flowchart of a server method according to an embodiment of the present invention, as shown in fig. 1, where the flowchart includes the following steps:
step S101, obtaining a watermark information sequence and a plurality of values respectively corresponding to different fields in a database to be processed.
Illustratively, the watermark information sequence is used for characterizing traceable information, which in the embodiment of the application may include, but is not limited to, readable files, copyright information, and the like; the watermark information sequence may be character string information obtained by processing the traceable information based on a watermark generation algorithm.
Step S102, determining the bit width of each field and the watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed.
The database to be processed may be a database to be watermark embedded, where the database to be processed includes a plurality of fields, and each field includes a plurality of values, in this embodiment of the present application, the bit width of each field is used to characterize how many bits of watermark information can be mapped in the field, denoted as BitWidth, and a watermark number BitCode is set for each value of the field, where the range is 0 to (2 b theta width-1).
Step S103, determining the value of the pseudo column key corresponding to each field in the pseudo row to be inserted according to a preset watermark generation algorithm and a watermark information sequence, wherein the pseudo row to be inserted contains a plurality of different fields, and the different fields in the pseudo row to be inserted correspond to the different fields in the database one by one.
Illustratively, in the embodiment of the present application, the preset watermark generation Algorithm may include, but is not limited to, a Hash Algorithm (Hash) and an advanced encryption standard Algorithm (Advanced Encryption Standard, AES), and for each field to be inserted in the pseudo row, the value of the pseudo column key of each field is calculated using the preset watermark generation Algorithm.
Step S104, according to the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field, the numerical value of the target character string of the corresponding field is determined in the watermark information sequence.
Illustratively, in the embodiment of the present application, based on the value of the corresponding pseudo column key of each field in the pseudo row to be inserted and the bit width of the corresponding field, the corresponding target character string is intercepted in the watermark information sequence, where the bit width of the target character string is the same as the bit width of the corresponding field.
Step S105, determining the value of the corresponding field in the pseudo-row to be inserted based on the value of the target string of each field and the watermark number of each value.
In the embodiment of the present application, the watermark number that is the same as the value of the corresponding target character string is determined from the watermark numbers that correspond to the multiple values in the database to be processed based on the value of the target character string of each field, and the value corresponding to the watermark number is used as the value to be stored and inserted into the corresponding field in the pseudo row.
Step S106, determining the dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embedding the dummy row information to be inserted into the database to be processed.
In the embodiment of the application, the information of the dummy row to be inserted is determined according to the value of each field in the dummy row to be inserted, and then the dummy row to be inserted is embedded into the target position of the database to be processed, and the target position can be determined based on requirements.
According to the database watermark embedding method, the true value of each field for watermark insertion is assigned with a corresponding code, when the pseudo-line watermark is inserted, the watermark is split into different character strings, each character string is assigned into one field in the pseudo-line, the corresponding watermark character string is represented by the value of the field, the value of each field in the pseudo-line to be inserted is derived from the true value in the database to be processed, and then the true value of each field in the pseudo-line to be inserted is not easily identified by other attackers, so that the watermark attack resistance is improved, the problem that the pseudo-line watermark is easily identified and then removed when the pseudo-line watermark is inserted into the database based on fake information in the related art is solved.
In this embodiment, a database watermark embedding method is provided, which may be used in the server described above, and fig. 2 is a flowchart of the database watermark embedding method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S201, obtaining a watermark information sequence and a plurality of values respectively corresponding to different fields in a database to be processed. Please refer to step S101 in the embodiment shown in fig. 1 in detail, which is not described herein.
Specifically, the step S201 includes:
and step S2011, obtaining original watermark information.
Illustratively, in the embodiment of the present application, the original watermark information may be traceable information, such as readable text, copyright information, and the like.
Step S2012, the original watermark information is processed by using a preset watermark generation algorithm to obtain a watermark information sequence.
In an embodiment of the present application, the preset watermark generation algorithm may be a hash algorithm, and the original watermark information is processed by using the hash algorithm and the total key to obtain the watermark information. The process of the original watermark information can be characterized by the following equation (1):
w=f (K, original watermark information) (1)
Wherein W represents a watermark information sequence, F represents a preset watermark generation algorithm, and K represents a total key.
Step S202, determining the bit width of each field and the watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed. Please refer to step S102 in the embodiment shown in fig. 1 in detail, which is not described herein.
Step S203, determining the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted according to a preset watermark generation algorithm and a watermark information sequence, wherein the pseudo-row to be inserted comprises a plurality of different fields, and the different fields in the pseudo-row to be inserted correspond to the different fields in the database one by one.
Specifically, the step S203 includes:
step S2031, determining a pseudo-row key according to a preset watermark generation algorithm and a watermark information sequence.
Illustratively, in embodiments of the present application, the pseudo-row key may be determined by the following equation (2):
RowKey=F(W, Rand) (2)
wherein RowKey represents a pseudo-row key; f represents a preset watermark generation algorithm; w represents a watermark information sequence; rand is a random number, and the size of Rand is related to the robustness of the watermark, and can be determined according to requirements.
Step S2032, determining a value of the pseudo column key corresponding to each field in the pseudo row to be inserted according to the pseudo row key and the preset watermark generation algorithm.
Illustratively, in the embodiment of the present application, the value of the pseudo column key corresponding to each field in the pseudo row to be inserted may be determined by the following formula (3):
ColKey=F(RowKey, ColName) (3)
wherein ColKey represents a pseudo-column key of a corresponding field, F represents a preset watermark generation algorithm, rowKey represents a pseudo-row key, and ColName is a name of the corresponding field.
Step S204, according to the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field, the numerical value of the target character string of the corresponding field is determined in the watermark information sequence. Please refer to step S104 in the embodiment shown in fig. 1 in detail, which is not described herein.
Specifically, the step S204 includes:
step S2041, the value of each field corresponding to the pseudo-column key in the pseudo-row to be inserted is modulo the length of the watermark information sequence, and the target value is obtained.
For each field to be inserted into the dummy row, the length of the watermark information sequence is modulo by using the ColKey value of each field to obtain a target value, for example, the bit width of the field is 4, the watermark length is 64 bits, and the value of the ColKey is 129, and then the target value obtained after the modulo is 1.
Step S2042 determines the starting position of the corresponding field in the watermark information sequence based on the target value.
In the embodiment of the present application, when the bit width of the field is 4 and the target value obtained after taking the modulus is 1, the 1 st bit in the watermark information sequence is taken as the starting position. Character string composed of 4 bits with length of 4 is taken as value X
Step S2043, the numerical value of the target character string of the corresponding field is determined in the watermark information sequence according to the bit width and the starting position of each field in the pseudo row to be inserted.
Illustratively, in the embodiment of the present application, when the bit width of the field is 4 and the 1 st bit in the watermark information sequence is taken as the start position, a string formed by 4 bits with a length of 4 from the start position is taken as the target string.
In step S205, the value of the corresponding field in the pseudo-row to be inserted is determined based on the value of the target string of each field and the watermark number of each value.
Step S206, determining the dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embedding the dummy row information to be inserted into the database to be processed. Please refer to step S106 in the embodiment shown in fig. 1 in detail, which is not described herein.
In this embodiment, a database watermark embedding method is provided, which may be used in the server described above, and fig. 3 is a flowchart of the database watermark embedding method according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
step S301, obtaining a watermark information sequence and a plurality of values respectively corresponding to different fields in a database to be processed. Please refer to step S201 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S302, determining the bit width of each field and the watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed. Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
Step S303, determining the value of the pseudo column key corresponding to each field in the pseudo row to be inserted according to a preset watermark generation algorithm and a watermark information sequence, wherein the pseudo row to be inserted contains a plurality of different fields, and the different fields in the pseudo row to be inserted correspond to the different fields in the database one by one. Please refer to step S203 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S304, according to the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field, the numerical value of the target character string of the corresponding field is determined in the watermark information sequence. Please refer to step S204 in the embodiment shown in fig. 2 in detail, which is not described herein.
In step S305, the value of the corresponding field in the pseudo-row to be inserted is determined based on the value of the target string of each field and the watermark number of each value.
Specifically, the step S305 includes:
and step S3051, comparing the numerical value of the target character string of each field with the watermark number of each value of the database to be processed to obtain a comparison result.
Illustratively, in the embodiment of the present application, the value of the target string of each field is compared with the watermark number of each value of the database to be processed, and the watermark number matched with the value of the target string is determined.
Step S3052, based on the comparison result, determines the value corresponding to the numerical value of the target character string of each field.
Illustratively, in the embodiment of the present application, according to the watermark number that matches the numerical value of the target character string, the value corresponding to the watermark number is determined.
In step S3053, the value corresponding to the numeric value of the target string in each field is used as the value of the corresponding field.
Illustratively, in the embodiment of the present application, the value of the watermark number with the value of the target string being matched is taken as the value of the corresponding field of the target string.
Step S306, determining dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embedding the dummy row information to be inserted into the database to be processed. Please refer to step S206 in the embodiment shown in fig. 2, which is not described herein.
In some alternative embodiments, the method further comprises: and storing the information to be inserted into the pseudo rows into a storage module. In this embodiment of the present application, the storage module may be any preset module having a storage function, and specific content of the storage module is not limited in this embodiment of the present application, and may be determined by a person skilled in the art according to requirements.
In some alternative embodiments, the method further comprises:
and a1, when receiving a pseudo-line watermark extraction request, respectively carrying out similarity calculation on each line of information in a database to be detected and the pseudo-line information to be inserted to obtain the similarity between each line of information and the pseudo-line information to be inserted, wherein the database to be detected is a database in which the pseudo-line information to be inserted is embedded in advance. The watermark extraction request may be sent by any request end, and the specific content of the request end is not limited in the embodiment of the present application, and may be determined by those skilled in the art according to requirements. In this embodiment of the present application, when an extraction request of a pseudo-row watermark is received, a similarity between each row of information in a database to be detected and pre-stored pseudo-row information to be inserted is calculated, where a specific calculation process is shown in the following formula (4):
sim=single field match or not BitWidth of single field BitWidth/sigma fields (4)
Wherein Sim represents the similarity of pseudo rows, and the meaning of the rest variables is described above, and will not be repeated here.
Specifically, when the bitWidth of the first field of a certain row in the database to be detected is 4, and the field is matched with the first field to be inserted in the dummy row, the bitWidth of the second field is 2, and is not matched with the first field to be inserted in the dummy row, the similarity between the row information and the dummy row information is as shown in the following formula (5):
Sim=(1*4+0*2)/(4+2)=0.6666 (5)
and a2, taking the row information with the similarity larger than a preset threshold value in the database to be detected as the pseudo-row watermark. For example, the preset threshold may be determined empirically, and specifically, the preset threshold may include, but is not limited to, 0.60, and if the similarity corresponding to any line of the database is greater than the preset threshold, the line is determined to be a pseudo-line watermark.
And a3, extracting the pseudo-row watermark in the database to be detected. By way of example, in the embodiment of the application, all watermark information can be stored through a single pseudo row, robustness is achieved, the pseudo row can be removed after the watermark is extracted, and authenticity of a database is guaranteed.
The database watermark embedding method provided by the invention is specifically described below through a specific embodiment.
Examples:
the watermark information sequence determined based on the watermark generation algorithm is: 0110110010101110.
the database watermark embedding method provided by the invention is used for embedding the watermark into the database to be processed, and the embedding result is shown in the following table 1:
TABLE 1
Location of site Age of Habit of Special length Learning calendar Industry (e.g.)
Original recording A 61 Early onset of action Football ball University IT
Original recording B 32 Early sleep Volleyball Large special purpose Electric power
Original recording C 9 Late onset Basketball ball Master Building construction
Original recording D 45 Night sleep Tennis ball Doctor Textile fabric
…… …… …… …… …… …… ……
Embedded recording C 32 Early sleep Basketball ball Large special purpose Textile fabric
Wherein "C" represents that the 0 th to 2 nd bit of the watermark is 011, "32" represents that the 3 rd to 4 th bit of the watermark is 01, "early sleep" represents that the 5 th to 7 th bit of the watermark is 100, "basketball" represents that the 8 th to 10 th bit of the watermark is 101, "big spot" represents that the 11 th to 13 th bit of the watermark is 011, and "weaving" represents that the 14 th to 15 th bit of the watermark is 10.
The embodiment also provides a database watermark embedding device, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a database watermark embedding apparatus, as shown in fig. 4, including:
the obtaining module 401 is configured to obtain a watermark information sequence and a plurality of values corresponding to different fields in a database to be processed respectively;
a first determining module 402, configured to determine a bit width of each field and a watermark number of each value according to a plurality of values and watermark information sequences corresponding to different fields in the database to be processed;
a second determining module 403, configured to determine, according to a preset watermark generation algorithm and a watermark information sequence, a value of a pseudo-column key corresponding to each field in the pseudo-row to be inserted;
a third determining module 404, configured to determine, in the watermark information sequence, a value of a target string of the corresponding field according to a value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and a bit width of the corresponding field, where the pseudo-row to be inserted includes a plurality of different fields, and the different fields in the pseudo-row to be inserted correspond to different fields in the database one by one;
a fourth determining module 405, configured to determine a value of a corresponding field in the pseudo row to be inserted based on the value of the target string of each field and the watermark number of each value;
a fifth determining module 406, configured to determine the dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embed the dummy row information to be inserted into the database to be processed.
In some alternative embodiments, the acquisition module 402 includes:
the acquisition sub-module is used for acquiring the original watermark information;
and the processing sub-module is used for processing the original watermark information by utilizing a preset watermark generation algorithm to obtain a watermark information sequence.
In some alternative embodiments, the second determining module includes:
the first determining submodule is used for determining a pseudo-row key according to a preset watermark generation algorithm and a watermark information sequence;
and the second determining submodule is used for determining the value of the pseudo column key corresponding to each field to be inserted into the pseudo row according to the root pseudo row key and a preset watermark generation algorithm.
In some alternative embodiments, the third determination module 404 includes:
a third determining submodule, configured to modulo a length of the watermark information sequence by a value of a pseudo column key corresponding to each field to be inserted into the pseudo row, to obtain a target value;
a fourth determining submodule, configured to determine a starting position of the corresponding field in the watermark information sequence based on the target value;
and a fifth determining submodule, configured to determine a value of the target string of the corresponding field in the watermark information sequence according to the bit width and the start position of each field in the pseudo row to be inserted.
In some alternative embodiments, the fourth determination module 405 includes:
the comparison sub-module is used for comparing the numerical value of the target character string of each field with the watermark number of each value of the database to be processed to obtain a comparison result;
a sixth determining submodule, configured to determine a value corresponding to the numerical value of the target character string of each field based on the comparison result;
and a seventh determining submodule, configured to take a value corresponding to the numerical value of the target character string of each field as the value of the corresponding field.
In some alternative embodiments, the apparatus further comprises: and the storage module is used for storing the information to be inserted into the pseudo rows into the storage module.
In some alternative embodiments, the apparatus further comprises:
the computing module is used for respectively carrying out similarity computation on each row of information in the database to be detected and the dummy row information to be inserted when receiving the dummy row watermark extraction request to obtain the similarity between each row of information and the dummy row information to be inserted, wherein the database to be detected is a database in which the dummy row information to be inserted is embedded in advance;
a sixth determining module, configured to use row information in the database to be detected, where the similarity is greater than a preset threshold, as a pseudo-row watermark;
and the extraction module is used for extracting the pseudo-row watermark in the database to be detected.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The database watermark embedding apparatus in this embodiment is presented in the form of functional units, here referred to as ASIC (Application Specific Integrated Circuit ) circuits, processors and memories executing one or more software or fixed programs, and/or other devices that can provide the above described functionality.
The embodiment of the invention also provides computer equipment, which is provided with the database watermark embedding device shown in the figure 4.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 5, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 5.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (10)

1. A method of database watermark embedding, the method comprising:
obtaining a watermark information sequence and a plurality of values respectively corresponding to different fields in a database to be processed;
determining the bit width of each field and the watermark number of each value according to a plurality of values respectively corresponding to different fields in the database to be processed and the watermark information sequence;
determining the value of a pseudo column key corresponding to each field in a pseudo row to be inserted according to a preset watermark generation algorithm and the watermark information sequence, wherein the pseudo row to be inserted comprises a plurality of different fields, and the different fields in the pseudo row to be inserted correspond to the different fields in the database one by one;
determining the numerical value of the target character string of the corresponding field in the watermark information sequence according to the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field;
determining the value of a corresponding field to be inserted into the pseudo row based on the numerical value of the target character string of each field and the watermark number of each value;
and determining the information of the pseudo rows to be inserted based on the value of each field in the pseudo rows to be inserted, and embedding the information of the pseudo rows to be inserted into the database to be processed.
2. The method of claim 1, wherein the step of obtaining the watermark information sequence comprises:
acquiring original watermark information;
and processing the original watermark information by using a preset watermark generation algorithm to obtain a watermark information sequence.
3. The method according to claim 1, wherein the step of determining the value of the corresponding pseudo-column key of each field to be inserted in the pseudo-row from the pre-watermark generation algorithm and the watermark information sequence comprises:
determining a pseudo-row key according to the preset watermark generation algorithm and the watermark information sequence;
and determining the value of the pseudo column key corresponding to each field in the pseudo row to be inserted according to the pseudo row key and a preset watermark generation algorithm.
4. The method according to claim 1, wherein the step of determining the value of the target string of the corresponding field in the watermark information sequence based on the value of the corresponding pseudo-column key of each field in the pseudo-row to be inserted and the bit width of the corresponding field comprises:
modulo the length of the watermark information sequence by the value of the pseudo-column key corresponding to each field to be inserted in the pseudo-row to obtain a target value;
determining a starting position of a corresponding field in the watermark information sequence based on the target value;
and determining the numerical value of the target character string of the corresponding field in the watermark information sequence according to the bit width of each field in the pseudo row to be inserted and the starting position.
5. The method of claim 4, wherein the step of determining the value of the corresponding field in the pseudo-row to be inserted based on the value of the target string of each field and the watermark number of each value comprises:
comparing the numerical value of the target character string of each field with the watermark number of each value of the database to be processed to obtain a comparison result;
determining a value corresponding to the numerical value of the target character string of each field based on the comparison result;
and taking the value corresponding to the numerical value of the target character string of each field as the value of the corresponding field.
6. The method according to claim 1, wherein the method further comprises:
and storing the information of the pseudo rows to be inserted into a storage module.
7. The method of claim 6, wherein the method further comprises:
when receiving a pseudo-row watermark extraction request, respectively carrying out similarity calculation on each row of information in a database to be detected and the pseudo-row information to be inserted to obtain the similarity between each row of information and the pseudo-row information to be inserted, wherein the database to be detected is a database in which the pseudo-row information to be inserted is embedded in advance;
taking the row information with the similarity larger than a preset threshold value in the database to be detected as a pseudo-row watermark;
and extracting the pseudo-row watermark in the database to be detected.
8. A database watermark embedding apparatus, the apparatus comprising:
the acquisition module is used for acquiring a plurality of values respectively corresponding to different fields in the watermark information sequence and the database to be processed;
the first determining module is used for determining the bit width of each field and the watermark number of each value according to a plurality of values corresponding to different fields in the database to be processed and the watermark information sequence;
the second determining module is used for determining the value of the pseudo column key corresponding to each field in the pseudo row to be inserted according to a preset watermark generation algorithm and the watermark information sequence, wherein the pseudo row to be inserted contains a plurality of different fields, and the different fields in the pseudo row to be inserted are in one-to-one correspondence with the different fields in the database;
a third determining module, configured to determine, in the watermark information sequence, a value of a target string of the corresponding field according to the value of the pseudo-column key corresponding to each field in the pseudo-row to be inserted and the bit width of the corresponding field;
a fourth determining module, configured to determine a value of a corresponding field in the pseudo row to be inserted based on a value of the target character string of each field and the watermark number of each value;
and a fifth determining module, configured to determine dummy row information to be inserted based on the value of each field in the dummy row to be inserted, and embed the dummy row information to be inserted into the database to be processed.
9. A computer device, comprising:
a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions that, upon execution, perform the database watermark embedding method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the database watermark embedding method of any one of claims 1 to 7.
CN202311613087.5A 2023-11-29 2023-11-29 Database watermark embedding method, device, computer equipment and medium Pending CN117668786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311613087.5A CN117668786A (en) 2023-11-29 2023-11-29 Database watermark embedding method, device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311613087.5A CN117668786A (en) 2023-11-29 2023-11-29 Database watermark embedding method, device, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN117668786A true CN117668786A (en) 2024-03-08

Family

ID=90063317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311613087.5A Pending CN117668786A (en) 2023-11-29 2023-11-29 Database watermark embedding method, device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN117668786A (en)

Similar Documents

Publication Publication Date Title
US20120317421A1 (en) Fingerprinting Executable Code
CN107111695B (en) Model anti-collusion watermarking
CN110688675B (en) Data leakage tracing device and method based on privacy protection and readable storage medium
CN112559985B (en) Watermark embedding and extracting method
CN113381962B (en) Data processing method, device and storage medium
CN110770725B (en) Data processing method and device
US8661559B2 (en) Software control flow watermarking
CN112948895A (en) Data watermark embedding method, watermark tracing method and device
CN114356919A (en) Watermark embedding method, tracing method and device for structured database
Sonnleitner A robust watermarking approach for large databases
CN117668786A (en) Database watermark embedding method, device, computer equipment and medium
Sun et al. Multiple watermarking relational databases using image
US11699209B2 (en) Method and apparatus for embedding and extracting digital watermarking for numerical data
JP3651777B2 (en) Digital watermark system, digital watermark analysis apparatus, digital watermark analysis method, and recording medium
Mohanpurkar et al. A fingerprinting technique for numeric relational databases with distortion minimization
US10514979B2 (en) Method and device for processing data
Dwivedi et al. Watermarking techniques for ownership protection of relational databases
CN103824006B (en) A kind of mobile phone application software automatically generates the method and system of watermark
CN111415288A (en) Digital watermark embedding and detecting method and device
CN116235169A (en) Digital watermarking of text data
CN108537009B (en) Method and system for downloading picture and verifying original edition
DE102009060807B4 (en) storage system
CN110688645A (en) Big data analysis system based on computer verification code technology
CN105208462A (en) Video digital watermarking processing method and video digital watermarking system executing same
CN114021085B (en) Big data security digital watermarking system based on artificial intelligence

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