Method and apparatus for embedding watermark, and nonvolatile storage medium
By embedding plaintext, robust, and vulnerable watermarks before data transfer, the risk of data leakage during data sharing and circulation is solved, achieving multi-layered security protection and verification of data, and ensuring the authenticity and integrity of the data.
Patent Information
- Application Number
- CN202411900023.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In business scenarios such as taxation, human resources and social security, and finance, there is a risk of data leakage during the data sharing and circulation process, which leads to a decrease in data security.
Multiple types of watermarks are embedded before data transfer, including plaintext watermarks, robust watermarks, and vulnerable watermarks. Plaintext and robust watermarks are generated based on information stored in the database, while vulnerable watermarks are generated based on the data to be processed. Plaintext watermarks ensure data traceability, robust watermarks improve data stability, and vulnerable watermarks detect data tampering.
Multi-layered watermark embedding enhances the security and reliability of data during circulation, ensuring data authenticity and integrity and reducing the risk of data leakage.
Smart Images

Figure CN119848809B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital watermarking technology, and more specifically, to a method and apparatus for embedding watermarks, and a non-volatile storage medium. Background Technology
[0002] With the continuous advancement of information technology construction, the public's reliance on information technology is gradually increasing. For business scenarios that use structured data, such as taxation, human resources and social security, and finance, there are extremely high requirements for business continuity and data security. However, in the above-mentioned business scenarios, due to the overlap of business, there is a need to share data, and there is a demand for the circulation of structured data. In the process of data sharing and circulation, there is a risk of data leakage, which leads to a decrease in the security of data circulation.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a method and apparatus for embedding watermarks, as well as a non-volatile storage medium, to at least address the technical problem of reduced data security caused by the risk of data leakage during data circulation.
[0005] According to one aspect of the embodiments of this application, a method for embedding watermarks is provided, comprising: obtaining target request information, wherein the target request information is used to request transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; performing watermark embedding processing on the data to be processed to obtain target data, wherein the target data is data to be processed embedded with multiple types of watermarks, the multiple types of watermarks including: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on watermark information stored in a database, and the fragile watermarks are generated based on the data to be processed; and outputting the target data to a target user who sent the target request information.
[0006] Optionally, watermark embedding processing is performed on the data to be processed to obtain target data, including: generating a plaintext watermark and embedding the plaintext watermark into the data to be processed to obtain a first type of data; generating a robust watermark and embedding the robust watermark into the target position of the first type of data to obtain a second type of data, wherein the target position is the position of the high availability sequence in the first type of data; generating a fragile watermark and embedding the fragile watermark into the second type of data to obtain the target data.
[0007] Optionally, the target location is determined by the following method: determining the amount of information contained in each column of the first type of data; ranking all columns contained in the first type of data according to the amount of information to obtain the information content ranking of each column; identifying the columns corresponding to multiple information content rankings that are greater than the preset ranking as high availability columns, and determining the position of the high availability columns in the first type of data as the target location.
[0008] Optionally, the plaintext watermark is generated by: determining a first value of the watermark information and determining a digital signature of the first value, wherein the type of the first value includes: a hash value of the watermark information; determining the watermark information and the digital signature as a plaintext watermark; embedding the plaintext watermark into the data to be processed to obtain a first type of data, including: determining the last data in the data to be processed and embedding the watermark information and the first value into the next position of the last data to obtain a first type of data, wherein the last data is the last data in the data to be processed.
[0009] Optionally, the fragile watermark includes: a tuple watermark for embedding row data and an attribute watermark for embedding column data, wherein each row of the data to be embedded with the fragile watermark corresponds to a row of data, and each column of the data to be embedded with the fragile watermark corresponds to a column of data. The fragile watermark is generated by the following method: determining multiple rows and multiple columns of data contained in the data to be embedded with the fragile watermark; for each row of data, determining the attribute column data contained in the row of data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row of data and also belongs to a column of data; for each column of data, generating an attribute watermark to be embedded in the column of data based on the column data.
[0010] Optionally, generating a tuple watermark based on attribute column data includes: determining a second value for each attribute column data, wherein the type of the second value includes: the attribute value of the attribute column data, which is determined based on the information actually recorded in the attribute column data; processing the attribute column data using the second value corresponding to the attribute column data to obtain a first processing result; obtaining a first preset key for generating the tuple watermark, and concatenating the first processing result and the first preset key to generate a first data sequence; generating a first subsequence of a first preset length based on the first data sequence, wherein the first subsequence is a tuple watermark, and the first preset length is determined based on the number of attribute column data and the preset tuple watermark length.
[0011] Optionally, generating an attribute watermark for embedding in the column data includes: determining multiple tuples contained in the column data, wherein the tuples are generated by splitting the row data, and a tuple belongs to both a row data and a column data; for each tuple, determining the primary key of the tuple, and processing the tuple using the primary key corresponding to the tuple to obtain a second processing result, wherein the primary key is used to uniquely identify the corresponding tuple; obtaining a second preset key for generating the attribute watermark, and concatenating multiple second processing results and the second preset key to generate a second data sequence; generating a second subsequence of a second preset length based on the second data sequence, wherein the second subsequence is the attribute watermark, and the second preset length is determined based on the number of tuples and the preset attribute watermark length.
[0012] Optionally, embedding the fragile watermark into the second type of data includes: randomly determining a third type of data to be embedded with the fragile watermark in the second type of data, and determining the position of the third type of data in the second type of data as the initial embedding position; determining the target embedding position corresponding to the initial embedding position based on the preset position deviation, the attribute value of the third type of data located at the initial embedding position, and the primary key of the third type of data located at the initial embedding position, wherein the target embedding position is the corrected initial embedding position, and the attribute value of the third type of data is determined based on the actual information recorded in the third type of data; determining the zero-width character corresponding to the fragile watermark, and embedding the zero-width character into the target position.
[0013] According to another aspect of the embodiments of this application, an apparatus for embedding watermarks is also provided, comprising: an acquisition module for acquiring target request information, wherein the target request information is used to request transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; a processing module for performing watermark embedding processing on the data to be processed to obtain target data, wherein the target data is data to be processed embedded with multiple types of watermarks, the multiple types of watermarks including: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on watermark information stored in a database, and the fragile watermarks are generated based on the data to be processed; and an output module for outputting the target data to a target user who sent the target request information.
[0014] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, in which a computer program is stored, wherein the above-described method of embedding watermarks is executed by running the computer program in the device where the non-volatile storage medium is located.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the above-described method for embedding watermarks through the computer program.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the steps of the above-described method for embedding watermarks.
[0017] In this embodiment, a method is employed to obtain target request information, which requests the transfer of data to be processed. This transfer processing includes downloading and exporting; watermark embedding is performed on the data to be processed to obtain target data, which is data to be processed embedded with multiple types of watermarks, including plaintext watermarks, robust watermarks, and fragile watermarks. Plaintext and robust watermarks are generated based on watermark information stored in a database, while fragile watermarks are generated based on the data to be processed; the target data is then output to the target user who sent the target request information. By embedding multiple types of watermarks into the data to be watermarked, the authenticity and integrity of the data are verified. Robust watermarks improve the watermark survival rate when data is attacked or tampered with, fragile watermarks can detect whether data has been illegally modified, and plaintext watermarks ensure data traceability. This achieves the technical effect of improving data security during data circulation, thereby solving the technical problem of reduced data security caused by the risk of data leakage during data circulation. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a method of embedding watermarks according to an embodiment of this application;
[0020] Figure 2 This is a flowchart illustrating the steps of a method for embedding a watermark according to an embodiment of this application;
[0021] Figure 3 This is a flowchart illustrating how to embed a watermark in data to be processed according to an embodiment of this application;
[0022] Figure 4 This is a structural diagram of an apparatus for embedding watermarks according to an embodiment of this application. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:
[0026] Structured data: Data that is logically expressed and implemented using a two-dimensional table structure. The two-dimensional table structure consists of rows and columns, and each cell stores specific data.
[0027] Primary Key: An identifier used to uniquely identify each element (each row).
[0028] Zero-width character: A type of non-printable Unicode character.
[0029] In related technologies, only a single type of watermark is embedded in the data. Therefore, the watermark is easily destroyed, making it impossible to verify whether the data has been tampered with, and the data cannot be traced. To address this problem, this application provides a related solution, which is detailed below.
[0030] According to an embodiment of this application, a method for embedding watermarks is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a method of embedding watermarks is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0032] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a form of processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the watermark embedding method in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned watermark embedding method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0035] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0036] This application provides a method for embedding watermarks that can run under the above-described operating environment. Figure 2 This is a flowchart illustrating the steps of a method for embedding a watermark according to an embodiment of this application, as shown below. Figure 2 As shown, the method includes the following steps:
[0037] Step S202: Obtain target request information, wherein the target request information is used to request the transfer processing of the data to be processed, wherein the transfer processing includes: downloading and exporting.
[0038] The method provided in this application embodiment can be used to embed watermarks into structured data. In step S202, after obtaining a series of request information (i.e., target request information) initiated by the client for requesting to download or export data to be processed, which requires transferring the data to be processed from its original storage location, the watermark is prepared to be embedded into the data to be processed before the data is transferred. The client that initiates the target request information can be a user terminal or a terminal executing the method provided in this application embodiment.
[0039] Step S204: Watermark embedding processing is performed on the data to be processed to obtain target data. The target data is the data to be processed that has embedded multiple types of watermarks, including plaintext watermarks, robust watermarks, and fragile watermarks. Plaintext watermarks and robust watermarks are generated based on watermark information stored in the database, while fragile watermarks are generated based on the data to be processed.
[0040] In step S204, when embedding watermarks into the data to be processed, multiple different types of watermarks are embedded into the data to be processed simultaneously. For example, robust watermarks, plaintext watermarks, and fragile watermarks are embedded into the data to be processed simultaneously. After the watermark embedding process is completed, the data to be processed (i.e., the target data) with multiple different types of watermarks embedded can be obtained. The robust watermark in the above scheme is a highly stable watermark generated based on information pre-stored in the database as watermark content (i.e., watermark information). Robust watermarks resist attacks and modifications, and are not easily deleted, tampered with, or destroyed. The plaintext watermark is a visual watermark generated based on information pre-stored in the database as watermark content (i.e., watermark information). After being embedded in the data to be processed, the plaintext watermark is visible to the naked eye. The watermarks used to generate the robust watermark and the plaintext watermark can be the same or different. The fragile watermark is a watermark generated based on the information recorded in the data to be processed itself. Any change to the data with the fragile watermark embedded will change the fragile watermark (making it unrecognizable or invalid). Therefore, the fragile watermark can be used to verify whether the data has been tampered with or destroyed.
[0041] This application embodiment can also use a neural network model to perform the watermark embedding process. In step S204, the neural network model can be loaded into memory. For example, the raw data of the neural network model can be loaded from non-volatile memory into volatile memory so that the processor can run the neural network model. The raw data of the neural network model refers to unprocessed data, which usually includes the parameters and structural data of the neural network model. The structural data can be the calculation relationship based on the parameters, such as the forward propagation calculation relationship between intermediate layers and between neurons. Specifically, the structural data can include the structure-related code of the neural network model, such as the code used to perform related calculations between intermediate layers and between neurons.
[0042] In one implementation, a region can be partitioned in memory for loading the neural network model, which may include a structure data storage area and a parameter storage area. The structure data storage area stores structure-related code, and the parameters referenced by it can be accessed via pointers pointing to the addresses of specific parameters in the parameter storage area. During the training of the neural network model, frequent parameter updates may be required; in this case, updating the parameter values in the parameter storage area is sufficient.
[0043] According to some optional embodiments of this application, watermark embedding processing is performed on the data to be processed to obtain target data, including: generating a plaintext watermark and embedding the plaintext watermark into the data to be processed to obtain a first type of data; generating a robust watermark and embedding the robust watermark into a target position of the first type of data to obtain a second type of data, wherein the target position is the position of the high availability sequence in the first type of data; generating a fragile watermark and embedding the fragile watermark into the second type of data to obtain the target data.
[0044] Figure 3 This is a flowchart for embedding watermarks into the data to be processed, such as... Figure 3 As shown, when embedding watermarks into the data to be processed, the process is performed in the following order: plaintext watermark, robust watermark, and fragile watermark. Specifically, firstly, a plaintext watermark that is visible to the naked eye when displayed is embedded into the data to be processed, resulting in data with the plaintext watermark embedded (i.e., the first type of data). Next, a highly stable robust watermark is embedded into the data with the plaintext watermark embedded (i.e., the first type of data), resulting in data with both robust and plaintext watermarks embedded (i.e., the second type of data). Finally, a fragile watermark is embedded into the data with both robust and plaintext watermarks embedded (i.e., the second type of data), resulting in data with multiple different types of watermarks embedded (i.e., the target data). In this embodiment, the robust watermark is specified to be embedded at the location (i.e., the target location) of multiple data sequences with a large amount of recorded information (i.e., high availability sequences). In this embodiment, embedding different types of watermarks sequentially can achieve multi-layered data protection and verification. By utilizing the complementary advantages of different watermark types, the public marking of plaintext watermarks, the persistent protection of robust watermarks, and the real-time detection of vulnerable watermarks, multi-layered security protection is provided for the data to be processed, effectively improving the security and reliability of the data.
[0045] Optionally, the target location is determined by the following method: determining the amount of information contained in each column of the first type of data; ranking all columns contained in the first type of data according to the amount of information to obtain the information content ranking of each column; identifying the columns corresponding to multiple information content rankings that are greater than the preset ranking as high availability columns, and determining the position of the high availability columns in the first type of data as the target location.
[0046] As mentioned in the previous embodiment, in the method provided in this application embodiment, a robust watermark is embedded into the location of a high availability sequence. The high availability sequence is determined based on the amount of information contained in each sequence. The amount of information contained in each sequence is directly proportional to the availability of that sequence. Since the robust watermark is embedded in the data to be processed (i.e., the first type of data) that already has a plaintext watermark embedded, to determine the high availability sequence, firstly, the amount of information recorded in each sequence of the first type of data is determined. All sequences in the first type of data are ranked according to the amount of information, from most to least. After obtaining the ranking result of each sequence (i.e., the information content ranking), multiple sequences whose ranking result (i.e., the information content ranking) is greater than a preset ranking are selected as high availability sequences for embedding the robust watermark. The specific location of these high availability sequences in the first type of data is the embedding location (i.e., the target location) of the robust watermark. The aforementioned preset ranking represents a position. Since the method provided in this application embodiment is used to embed watermarks into structured data, whether it is the data to be processed, the data to be processed with embedded plain text watermarks (i.e., the first type of data), or other data (including the second type of data and the third type of data), it is all structured data. The structured data is stored in the form of a two-dimensional table (containing multiple rows and columns). Therefore, multiple sequences contained in the first type of data can be identified.
[0047] According to some alternative embodiments of this application, a plaintext watermark is generated by the following method: determining a first value of watermark information and determining a digital signature of the first value, wherein the type of the first value includes: a hash value of the watermark information; determining the watermark information and the digital signature as a plaintext watermark; embedding the plaintext watermark into the data to be processed to obtain a first type of data, including: determining the last data in the data to be processed and embedding the watermark information and the first value into the next position of the last data to obtain the first type of data, wherein the last data is the last data in the data to be processed.
[0048] As mentioned in the above embodiments, a plaintext watermark is a visual watermark generated based on information (i.e., watermark information) pre-stored in the database as watermark content. Specifically, a plaintext watermark can be generated using the methods described in the embodiments of this application. In this embodiment, a plaintext watermark is generated based on the watermark information and the signed watermark information (i.e., digital signature). The signed watermark information can be obtained by the following method: obtaining the value result of the watermark information (i.e., the first value), and then using a key to sign the value result of the watermark information (i.e., the first value) to obtain the signed watermark information (i.e., digital signature). In this embodiment, the value result of the watermark information (i.e., the first value) can be obtained by using a hash algorithm to extract the value of the watermark information, or by using other value extraction algorithms (e.g., value extraction functions, dictionaries, or video). When a hash algorithm is used, the value result of the watermark information (i.e., the first value) is the hash value of the watermark information. After generating the plaintext watermark using the above method, the plaintext watermark can be embedded into the data to be processed. In this embodiment, the plaintext watermark is added as a pseudo-row to the end of the data to be processed. Specifically, the plaintext watermark is embedded in the position after the end of the data to be processed. Therefore, when embedding the plaintext watermark, it is necessary to determine the last data (i.e., the last data) in the data to be processed and add the plaintext watermark as a row after the data. Since the data to be processed is stored in the form of a two-dimensional table, which can also be regarded as a table generated by arranging multiple cells, the last data of the data to be processed is the data stored in the last cell. When embedding the plaintext watermark, the cell (one or more) storing the plaintext watermark is added as the position after the last cell of the data to be processed. For example, when using a hash algorithm, the process of generating a digital signature can be represented by the formula: W m2 =SM2(SM3(W m1 ),K), where SM3 is a hash function, W m1 This represents the watermark information used to generate the plaintext watermark. SM2 is an asymmetric encryption algorithm, K is the key used when applying SM2, and SM2 and key K are used to implement the signature, thus obtaining the digital signature of the watermark information. W m2 A digital signature represented by a watermark. When extracting a plaintext watermark, it can be done based on W. m1 The value of W is recalculated. m2 The value is used to verify whether the plaintext watermark has been destroyed. If the two match, it means that the plaintext watermark is intact and has not been destroyed.
[0049] According to some optional embodiments of this application, the fragile watermark includes: a tuple watermark for embedding row data and an attribute watermark for embedding column data, wherein each row of the data to be embedded with the fragile watermark corresponds to a row of data, and each column of the data to be embedded with the fragile watermark corresponds to a column of data. The fragile watermark is generated by the following method: determining multiple rows of data and multiple columns of data contained in the data to be embedded with the fragile watermark; for each row of data, determining the attribute column data contained in the row of data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row of data and also belongs to a column of data; for each column of data, generating an attribute watermark for embedding into the column of data based on the column data.
[0050] The fragile watermarks used in this application embodiment include fragile watermarks (i.e., tuple watermarks) for embedding row data and fragile watermarks (i.e., attribute watermarks) for embedding column data. The row data refers to each row of the data to be embedded with the fragile watermark (in this application embodiment, it is the data to be processed that has embedded plaintext watermarks and robust watermarks, i.e., the second type of data), and the column data refers to each column of the data to be embedded with the fragile watermark. As mentioned in the above embodiments, the fragile watermark is generated based on the information actually recorded in the data to be processed. In this embodiment, when generating the tuple watermark in the fragile watermark, multiple cells recorded in each row of data are determined, and the tuple watermark is generated based on the data recorded in these cells (i.e., attribute column data). Each cell belongs to both the currently processed row of data and one of the multiple columns (i.e., column data) contained in the data to be processed. The data to be processed is structured data, stored in a two-dimensional table format. A two-dimensional table format itself represents a combination of multiple cells, each cell corresponding to different attributes based on its stored data. Therefore, in this embodiment, it can also be called an attribute column, and the data stored in each cell is called attribute column data. The attribute watermark in the fragile watermark is generated using the column data itself.
[0051] Optionally, generating a tuple watermark based on attribute column data includes: determining a second value for each attribute column data, wherein the type of the second value includes: the attribute value of the attribute column data, which is determined based on the information actually recorded in the attribute column data; processing the attribute column data using the second value corresponding to the attribute column data to obtain a first processing result; obtaining a first preset key for generating the tuple watermark, and concatenating the first processing result and the first preset key to generate a first data sequence; generating a first subsequence of a first preset length based on the first data sequence, wherein the first subsequence is a tuple watermark, and the first preset length is determined based on the number of attribute column data and the preset tuple watermark length.
[0052] In this embodiment, a tuple watermark is generated based on the value result (i.e., the second value) of the attribute column data. The value result (i.e., the second value) can be the attribute value of the attribute column data. When processing the attribute column data using the attribute value (i.e., the second value), a hash function (such as SM3) can be used. When processing the attribute column data using a hash function (SM3), the process of generating the tuple watermark can be expressed as the following formula:
[0053]
[0054] Where N represents the number of attribute column data, and i represents the data in the i-th row. The tuple watermark represents the Nth attribute column tuple in the i-th row of data. `extractBits` is a function that extracts subsequences, indicating the subsequence in the (first) data sequence (SM3(K||r1·A1||r2·A2||…r…). γ ·A γ Extracting length 2 from ) s-1 *γ's (first) subsequence, K is the first preset key, || is the concatenation symbol, r i (i = 1, 2, ..., γ) are multiple weight values associated with the i-th tuple, used to introduce randomness during hash calculation to adjust the complexity of the tuple watermark; A1, A2, ..., A γ Representing different attribute values, the attribute values are determined based on the actual information recorded in each attribute column (for example, if the actual information recorded in an attribute column is document information, then the binary format of the document number is the attribute value of the attribute column data), γ represents the number of attribute types corresponding to all attribute column data contained in the i-th non-tuple, and s represents the preset tuple watermark length; in the above formula, r1·A1, r2·A2, ... r γ ·A γ That is, the first processing result.
[0055] According to some optional embodiments of this application, generating an attribute watermark for embedding in column data includes: determining multiple tuples contained in the column data, wherein a tuple is generated by splitting row data, and a tuple belongs to both a row and a column; for each tuple, determining the primary key of the tuple, and processing the tuple using the primary key corresponding to the tuple to obtain a second processing result, wherein the primary key is used to uniquely identify the corresponding tuple; obtaining a second preset key for generating the attribute watermark, and concatenating multiple second processing results and the second preset key to generate a second data sequence; generating a second subsequence of a second preset length based on the second data sequence, wherein the second subsequence is the attribute watermark, and the second preset length is determined based on the number of tuples and the preset attribute watermark length.
[0056] In this embodiment, the generation of attribute watermarks can be expressed by the following formula:
[0057] H0=SM3(K||r1·P1||r2·P2||…r i ·P i )
[0058]
[0059] Among them, P1, P2, ..., P i is the primary key of each tuple contained in a column of data, and i is the number of tuples. In this embodiment, a tuple is a cell in a two-dimensional table that contains the data to be processed contained in the column of data. Each cell belongs to both a row and a column. Therefore, the data stored in a cell is both attribute column data and a tuple. When generating a tuple watermark, the data stored in the cell is identified as attribute column data, and when generating an attribute watermark, the data stored in the cell is identified as a tuple. K represents the second preset key. The key used when generating the attribute watermark (i.e., the second preset key) and the key used when generating the tuple watermark (i.e., the first preset key) can be the same or different. i (i = 1, 2, ..., i) are multiple weight values associated with the i-th tuple, used to introduce randomness during hash calculation to adjust the complexity of the tuple watermark. SM3 is a hash function, and H0 is the hash function used to process the data: (r1·P1||r2·P2||…r i ·P i The generated hash value (i.e., the second processing result) is processed, || is the concatenation symbol, and extractBits is the function to extract subsequences, indicating the subsequences in the (second) data sequence (K||r1·P1||r2·P2||…r). i ·P i Extracting length 2 from ) s -1 *i is the (second) subsequence, where s represents the preset attribute watermark length. The preset tuple watermark length and the preset attribute watermark length can be the same or different. A1, A2, ..., A j The attribute value representing the j-th tuple, The attribute watermark represents the g-th tuple of the j-th column data, where g represents the total number of tuples.
[0060] Optionally, embedding the fragile watermark into the second type of data includes: randomly determining a third type of data to be embedded with the fragile watermark in the second type of data, and determining the position of the third type of data in the second type of data as the initial embedding position; determining the target embedding position corresponding to the initial embedding position based on the preset position deviation, the attribute value of the third type of data located at the initial embedding position, and the primary key of the third type of data located at the initial embedding position, wherein the target embedding position is the corrected initial embedding position, and the attribute value of the third type of data is determined based on the actual information recorded in the third type of data; determining the zero-width character corresponding to the fragile watermark, and embedding the zero-width character into the target position.
[0061] In this embodiment, embedding a fragile watermark includes two steps: determining the embedding position and format conversion. The final embedding position (i.e., the target embedding position) of the fragile watermark is determined by randomly determining an initial embedding position and then correcting it. Format conversion refers to converting the fragile watermark into a corresponding zero-width character. In the solution provided in this application embodiment, embedding a fragile watermark means embedding the zero-width character corresponding to the fragile watermark, that is, embedding the zero-width character corresponding to the fragile watermark into the determined fragile watermark embedding position (i.e., the target embedding position). The method for determining the final embedding position (i.e., the target embedding position) of the fragile watermark can be expressed by the following formula:
[0062] location i,j =SM3(A i,j Mod(L)||r1·P1||…r i ·P i )
[0063] A i,j ′ =insert(A i,j ,location i,j W C )
[0064] Among them, A i,j The j-th attribute value of tuple i is a randomly determined data (i.e., third-type data) to be embedded with a fragile watermark. i,j The second type of data refers to the value stored in the cell at position i in row j, which is one of multiple cells in the second type of data. The second type of data is represented as a table (i.e., a two-dimensional table) consisting of multiple cells and multiple rows and columns. The second type of data is the data to be processed that embeds plaintext watermarks and robust watermarks. Therefore, the data stored in the cell at position i in row j (excluding watermark data) in the data to be processed is the same as the data stored in the cell at position i in row j (excluding watermark data) in the second type of data. Therefore, A... i,jIt can also be the value of the data stored in the cell at row i and column j in the data to be processed. SM3 represents the hash function, L represents the preset position deviation, Mod(L) represents the modulus of the preset position deviation, r1, ..., r i Represents the preset weights corresponding to each tuple, P1, ..., P2. i The location represents the primary key of each tuple. i,j A represents the corrected vulnerable watermark embedding location (i.e., the target embedding location). i,j ′ =insert(A i,j ,location i,j W C ) represents in A i,j The corresponding target embedding location i,j The zero-width character W corresponding to the embedded fragile watermark. C The cell at this location has a zero-width character W embedded. C The attribute value after that is A i,j ′ When converting fragile watermarks to zero-width characters, different conversion rules can be defined for different types of fragile watermarks. For example, after converting tuple watermarks and attribute watermarks to binary form, for fragile watermarks of type tuple watermark, bit 0 in the tuple watermark is converted to the zero-width character u200C, and bit 1 in the tuple watermark is converted to the zero-width character u200D; for fragile watermarks of type attribute watermark, bit 0 in the attribute watermark is converted to the zero-width character u200B, and bit 1 in the attribute watermark is converted to the zero-width character u200E.
[0065] Step S206: Output target data to the target user who sent the target request information.
[0066] In step S204, after embedding a watermark into the data to be processed, the watermarked data (i.e., the target data) can be output to the user (i.e., the target user) corresponding to the client that initiated the request information (i.e., the target request information) to transfer the data to be processed, thus realizing the transfer of the data to be processed.
[0067] Through the above steps, plaintext watermarks, robust watermarks, and fragile watermarks can be embedded in data. Fragile watermarks can detect whether data has been tampered with, robust watermarks can prevent watermarks in data from being tampered with, and plaintext watermarks can trace the data transmission trajectory, thus improving the security of data sharing.
[0068] Figure 4 This is a structural diagram of a device for embedding watermarks according to an embodiment of this application, as shown below. Figure 4As shown, the watermark embedding device includes: an acquisition module 40, used to acquire target request information, wherein the target request information is used to request the transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; a processing module 42, used to perform watermark embedding processing on the data to be processed to obtain target data, wherein the target data is the data to be processed embedded with multiple types of watermarks, including: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on watermark information stored in the database, and the fragile watermarks are generated based on the data to be processed; and an output module 44, used to output the target data to the target user who sent the target request information.
[0069] It should be noted that, Figure 4 Preferred embodiments of the shown examples can be found in [reference needed]. Figure 2 The relevant descriptions of the embodiments shown will not be repeated here.
[0070] This application also provides a non-volatile storage medium storing a computer program, wherein the above-described watermark embedding method is executed by running the computer program on the device where the non-volatile storage medium is located.
[0071] The aforementioned non-volatile storage medium is used to store programs that perform the following functions: obtaining target request information, wherein the target request information is used to request the transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; performing watermark embedding processing on the data to be processed to obtain target data, wherein the target data is the data to be processed embedded with multiple types of watermarks, including: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on watermark information stored in the database, and the fragile watermarks are generated based on the data to be processed; and outputting the target data to the target user who sent the target request information.
[0072] This application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to execute the above-described method for embedding watermarks through the computer program.
[0073] The processor in the aforementioned electronic device is used to run a program that performs the following functions: acquiring target request information, wherein the target request information is used to request the transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; performing watermark embedding processing on the data to be processed to obtain target data, wherein the target data is the data to be processed embedded with multiple types of watermarks, including: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on watermark information stored in the database, and the fragile watermarks are generated based on the data to be processed; and outputting the target data to the target user who sent the target request information.
[0074] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the above-described method for embedding watermarks.
[0075] It should be noted that each module in the above-mentioned watermark embedding device can be a program module (e.g., a set of program instructions that implement a certain function) or a hardware module. For the latter, it can be manifested in the following forms, but is not limited to them: each of the above modules is manifested as a processor, or the functions of each of the above modules are implemented by a processor.
[0076] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0077] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0078] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0079] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0080] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0082] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for embedding a watermark, characterized in that, include: Obtain target request information, wherein the target request information is used to request the transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; The process of embedding watermarks into the data to be processed to obtain target data includes: generating a plaintext watermark and embedding the plaintext watermark into the data to be processed to obtain a first type of data; generating a robust watermark and embedding the robust watermark into a target position in the first type of data to obtain a second type of data, wherein the target position is the position of the high availability sequence in the first type of data; and generating a fragile watermark and embedding the fragile watermark into the second type of data to obtain the target data. The target data is the data to be processed embedded with multiple types of watermarks, including: the plaintext watermark, the robust watermark, and the fragile watermark. The plaintext watermark and the robust watermark are generated based on watermark information stored in a database, and the fragile watermark is generated based on... The fragile watermark generated from the data to be processed includes: a tuple watermark for embedding row data and an attribute watermark for embedding column data. Each row of the data to be embedded with the fragile watermark corresponds to one row of data, and each column of the data to be embedded with the fragile watermark corresponds to one column of data. The fragile watermark is generated by the following method: determining multiple rows and multiple columns of data contained in the data to be embedded with the fragile watermark; for each row of data, determining the attribute column data contained in the row of data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row of data and simultaneously belongs to one column of data; for each column of data, generating the attribute watermark to be embedded in the column of data. The target data is output to the target user who sent the target request information.
2. The method according to claim 1, characterized in that, The target location was determined using the following method: Determine the amount of information contained in each sequence of data in the first type of data; Rank all the data columns contained in the first type of data according to the information content, and obtain the information content ranking of each data column; The data sequences corresponding to multiple information volume rankings that are greater than the preset ranking are determined as the high availability data sequences, and the position of the high availability data sequences in the first type of data is determined as the target position.
3. The method according to claim 1, characterized in that, The plaintext watermark is generated using the following method: A first value of the watermark information is determined, and a digital signature of the first value is determined, wherein the type of the first value includes: the hash value of the watermark information; the watermark information and the digital signature are determined as the plaintext watermark; The plaintext watermark is embedded into the data to be processed to obtain the first type of data, including: The last data in the data to be processed is determined, and the watermark information and the first value are embedded into the next position of the last data to obtain the first type of data, wherein the last data is the last data in the data to be processed.
4. The method according to claim 1, characterized in that, Generate a tuple watermark based on the attribute column data, including: Determine a second value for each of the attribute column data, wherein the type of the second value includes: the attribute value of the attribute column data, the attribute value being determined based on the information actually recorded in the attribute column data; The attribute column data is processed using the second value corresponding to the attribute column data to obtain a first processing result; Obtain a first preset key for generating the tuple watermark, and concatenate the first processing result and the first preset key to generate a first data sequence. A first subsequence of a first preset length is generated based on the first data sequence, wherein the first subsequence is a tuple watermark, and the first preset length is determined based on the number of attribute column data and the preset tuple watermark length.
5. The method according to claim 1, characterized in that, Generate the attribute watermark for embedding into the column data based on the column data, including: Determine multiple tuples contained in the column data, wherein the tuples are generated by splitting the row data, and one tuple belongs to both a row data and a column data simultaneously; For each tuple, a primary key is determined, and the tuple is processed using the primary key corresponding to the tuple to obtain a second processing result, wherein the primary key is used to uniquely identify the corresponding tuple; Obtain a second preset key for generating the attribute watermark, and concatenate multiple second processing results and the second preset key to generate a second data sequence; A second subsequence of a second preset length is generated based on the second data sequence, wherein the second subsequence is the attribute watermark, and the second preset length is determined based on the number of tuples and the preset attribute watermark length.
6. The method according to claim 1, characterized in that, Embedding the fragile watermark into the second type of data includes: Randomly select a third type of data from the second type of data to embed the fragile watermark, and determine the position of the third type of data in the second type of data as the initial embedding position; The target embedding position corresponding to the initial embedding position is determined based on the preset position deviation, the attribute value of the third type of data located at the initial embedding position, and the primary key of the third type of data located at the initial embedding position. The target embedding position is the corrected initial embedding position, and the attribute value of the third type of data is determined based on the actual information recorded in the third type of data. Identify the zero-width character corresponding to the fragile watermark and embed the zero-width character into the target position.
7. A device for embedding a watermark, characterized in that, include: The acquisition module is used to acquire target request information, wherein the target request information is used to request the transfer processing of data to be processed, wherein the transfer processing includes: downloading and exporting; The processing module is used to perform watermark embedding processing on the data to be processed to obtain target data, including: generating a plaintext watermark and embedding the plaintext watermark into the data to be processed to obtain a first type of data; generating a robust watermark and embedding the robust watermark into a target position in the first type of data to obtain a second type of data, wherein the target position is the position of the high availability sequence in the first type of data; generating a fragile watermark and embedding the fragile watermark into the second type of data to obtain the target data, wherein the target data is the data to be processed embedded with multiple types of watermarks, the multiple types of watermarks including: the plaintext watermark, the robust watermark, and the fragile watermark, wherein the plaintext watermark and the robust watermark are generated based on watermark information stored in a database, and the fragile watermark... The watermark is generated based on the data to be processed. The fragile watermark includes: a tuple watermark for embedding row data and an attribute watermark for embedding column data. Each row of the data to be embedded with the fragile watermark corresponds to one row of data, and each column of the data to be embedded with the fragile watermark corresponds to one column of data. The fragile watermark is generated by the following method: determining multiple rows and multiple columns of data contained in the data to be embedded with the fragile watermark; for each row of data, determining the attribute column data contained in the row of data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row of data and simultaneously belongs to one column of data; for each column of data, generating the attribute watermark to be embedded in the column of data. The output module is used to output the target data to the target user who sent the target request information.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein the device containing the non-volatile storage medium executes the watermark embedding method according to any one of claims 1 to 6 by running the computer program.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of embedding watermarks as described in any one of claims 1 to 6 through the computer program.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method for embedding watermarks as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Structured data watermark embedding method and extraction method
CN117807571A
Integrity protection for electronic document with combination of visible, invisible-robust and invisible non-robust watermarks for on-line verification
DE19930908A1