Watermark embedding method and device and nonvolatile storage medium
By embedding the data to be processed, and generating and embedding plaintext watermarks, robust watermarks and vulnerable watermarks, the problem of data leakage risk during the data sharing flow is solved, and the data is high security and reliability are achieved.
Patent Information
- Application Number
- CN202411900023.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-20
AI Technical Summary
During the data sharing flow, there is a risk of data leakage, resulting in reduced data security.
By performing watermark embedding of the to be processed data, multiple types of watermarks are generated and embedded, including plaintext watermarks, robust watermarks, and vulnerable watermarks. Plain text watermarks and robust watermarks are generated based on the watermark information stored in the database, and vulnerable watermarks are generated based on the pending data. Watermarks are embedded in the data's high availability sequence locations to improve data security.
Through the embedding of multiple types of watermarks, the authenticity and integrity of data are checked, the survival rate of data when it is attacked or tampered is improved, the traceability of data is ensured, and the security of data flow is improved.
Smart Images

Figure CN119848809A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of digital watermarking, and in particular to a method and device for embedding watermarks, and a non-volatile storage medium. Background Art
[0002] With the continuous advancement of informatization construction, the public's dependence on informatization has gradually increased. 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 business scenarios, due to business overlap, data needs to be shared, and there is a demand for structured data circulation. In the process of data sharing and circulation, there is a risk of data leakage, which leads to the problem of reduced security during data circulation.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method and device for embedding a watermark, and a non-volatile storage medium, so as to at least solve the technical problem of reduced data security caused by the risk of data leakage during data circulation.
[0005] According to one aspect of an embodiment of the present 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, and the multiple types of watermarks include: 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 sends 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 a target position of the first type of data to obtain a second type of data, wherein the target position is a position of a high-availability column 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 position is determined by the following method: determining the amount of information contained in each sequence in the first category of data; ranking all sequence contained in the first category of data according to the amount of information to obtain an information amount ranking of each sequence; determining sequence corresponding to multiple information amount rankings greater than a preset ranking as high-availability sequence, and determining the position of the high-availability sequence in the first category of data as the target position.
[0008] Optionally, the plaintext watermark is generated by the following method: 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 end data in the data to be processed, and embedding the watermark information and the first value into the next bit of the end data to obtain the first type of data, wherein the end data is the data located at the last bit 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 data, and each column of the data to be embedded with the fragile watermark corresponds to a column data, and the fragile watermark is generated by the following method: determining multiple row data and multiple column data contained in the data to be embedded with the fragile watermark; for each row data, determining the attribute column data contained in the row data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row data and belongs to a column data at the same time; for each column data, generating an attribute watermark for embedding into the column data based on the column data.
[0010] Optionally, a tuple watermark is generated based on the attribute column data, including: determining a second value of each attribute column data, wherein the type of the second value includes: an attribute value of the attribute column data, wherein the attribute value is determined based on 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 a tuple watermark, and concatenating the first processing result and the first preset key to generate a first data sequence; generating a first subsequence having 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 a preset tuple watermark length.
[0011] Optionally, an attribute watermark for embedding in the column data is generated based on the column data, including: determining multiple tuples contained in the column data, wherein the tuples are generated by segmenting the row data, and a tuple belongs to both a row data and a column data; for each tuple, determining a 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 with a second preset length based on the second data sequence, wherein the second subsequence is an 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 category of data includes: randomly determining the third category of data to be embedded with the fragile watermark in the second category of data, and determining the position of the third category of data in the second category of data as the initial embedding position; determining a target embedding position corresponding to the initial embedding position according to a preset position deviation, an attribute value of the third category of data located at the initial embedding position, and a primary key of the third category of data located at the initial embedding position, wherein the target embedding position is a corrected initial embedding position, and the attribute value of the third category of data is determined based on actual information recorded in the third category of data; determining a zero-width character corresponding to the fragile watermark, and embedding the zero-width character into the target position.
[0013] According to another aspect of an embodiment of the present application, a device for embedding watermarks is also provided, including: an acquisition module, used to acquire target request information, wherein the target request information is used to request transfer processing of the data to be processed, wherein the transfer processing includes: downloading and exporting; a processing module, 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, and the multiple types of watermarks include: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on the watermark information stored in a database, and the fragile watermarks are generated based on the data to be processed; an output module, used to output the target data to a target user who sends the target request information.
[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a computer program is stored, wherein the above-mentioned method of embedding watermark is executed by running the computer program on a device where the non-volatile storage medium is located.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned watermark embedding method through the computer program.
[0016] According to another aspect of the embodiment of the present application, a computer program product is further provided, including computer instructions, which implement the steps of the above-mentioned method for embedding watermarks when the computer instructions are executed by a processor.
[0017] In an embodiment of the present application, a method of obtaining target request information is adopted, wherein the target request information is used to request transfer processing of the data to be processed, wherein the transfer processing includes: downloading, exporting; watermark embedding processing is performed 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, and the multiple types of watermarks include: plain text watermark, robust watermark, fragile watermark, plain text watermark and robust watermark are generated according to the watermark information stored in the database, and the fragile watermark is generated according to the data to be processed; the method of outputting the target data to the target user who sends the target request information is adopted, and the purpose of verifying the authenticity and integrity of the data is achieved by embedding multiple types of watermarks in the data to be embedded with the watermark, wherein the robust watermark improves the watermark survival rate when the data is attacked or tampered with, the fragile watermark can detect whether the data has been illegally modified, and the plain text watermark can ensure the traceability of the data, thereby achieving the technical effect of improving the security of the data during the data circulation process, and further solving the technical problem of reduced data security caused by the risk of data leakage during data circulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a method for embedding watermarks according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of steps of a method for embedding a watermark according to an embodiment of the present application;
[0021] Figure 3 is a flow chart of embedding a watermark in data to be processed according to an embodiment of the present application;
[0022] Figure 4 It is a structural diagram of a watermark embedding device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0026] Structured data: data that is logically expressed and implemented by a two-dimensional table structure, which consists of rows and columns, and each cell stores specific data.
[0027] Primary Key: An identifier that uniquely identifies each element (each row).
[0028] Zero-width character: A non-printable Unicode character.
[0029] In the related art, only a single type of watermark is embedded in the data, so there are problems such as the watermark is easily destroyed, it is impossible to verify whether the data has been tampered with, and it is impossible to trace the data. In order to solve this problem, the embodiments of the present application provide relevant solutions, which are described in detail below.
[0030] According to an embodiment of the present application, an embodiment of a method for embedding a watermark is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed 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 can be executed in an order different from that shown here.
[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for embedding watermarks. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), 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 the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal 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 method of embedding watermarks in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned method of embedding watermarks is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0036] The embodiment of the present application provides a method for embedding watermarks that can be run in the above-mentioned operating environment. Figure 2 is a flow chart of steps of a method for embedding watermarks provided in an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0037] Step S202, obtaining target request information, wherein the target request information is used to request transfer processing of the data to be processed, wherein the transfer processing includes: downloading and exporting.
[0038] The method provided in the embodiment of the present application can be used to embed a watermark 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 the data to be processed, requesting to export the data to be processed, etc., which requires the data to be processed to be transferred from the original storage location, the data to be processed is embedded with a watermark before the data to be processed is transferred. The client that initiates the target request information can be a user terminal or a terminal that executes the method provided in the embodiment of the present application.
[0039] Step S204, 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, and the multiple types of watermarks include: plain text watermark, robust watermark, fragile watermark, the plain text watermark and the robust watermark are generated based on the watermark information stored in the database, and the fragile watermark is 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 at the same time. For example, a robust watermark, a plaintext watermark and a fragile watermark are embedded into the data to be processed at the same time. After completing the watermark embedding process, the data to be processed (i.e., the target data) embedded with multiple different types of watermarks can be obtained. The robust watermark in the above scheme is a highly stable watermark generated based on information (i.e., watermark information) pre-stored in a database as watermark content, wherein the robust watermark can resist attacks and modifications and is not easily deleted, tampered with or destroyed; the above plaintext watermark is a visual watermark generated based on information (i.e., watermark information) pre-stored in a database as watermark content, and the plaintext watermark can be observed by the naked eye after being embedded in the data to be processed. 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. If any change occurs to the data embedded with the fragile watermark, the fragile watermark will change (become unrecognizable or invalid). Therefore, the fragile watermark can be used to verify whether the data has been tampered with or destroyed.
[0041] The embodiment of the present application may also use a neural network model to perform the watermark embedding process. In step S204, the neural network model may be loaded into the memory. For example, the raw data of the neural network model may be loaded from the non-volatile memory into the volatile memory so that the processor runs the neural network model. The raw data of the neural network model refers to unprocessed data, which usually includes parameters and structural data of the neural network model. The structural data may be a calculation relationship based on the parameters, such as the forward propagation calculation relationship between the intermediate layers and between the neurons. Specifically, the structural data may include the structure-related code of the neural network model, such as the code for performing related calculations between the intermediate layers and between the neurons.
[0042] In one embodiment, an area for loading a neural network model can be divided in the memory, which may include a structure data storage area and a parameter storage area. The structure data storage area is used to store structure-related codes, and the parameters referenced by it can point to the address of a specific parameter in the parameter storage area through a pointer. During the training process of the neural network model, it may be necessary to frequently update the parameters, and the parameter values in the parameter storage area can be updated.
[0043] According to some optional embodiments of the present 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 category of data; generating a robust watermark and embedding the robust watermark into a target position of the first category of data to obtain a second category of data, wherein the target position is a position of a high-availability column in the first category of data; generating a fragile watermark and embedding the fragile watermark into the second category of data to obtain the target data.
[0044] Figure 3 It is a flowchart for embedding watermarks in the data to be processed, such as Figure 3 As shown, when embedding watermarks in the data to be processed, the sequence of embedding plaintext watermarks, robust watermarks and fragile watermarks is followed; specifically, firstly, a plaintext watermark visible to the naked eye when displayed is embedded in the data to be processed, and the data to be processed after the plaintext watermark is embedded (i.e., the first type of data) is obtained; further, a robust watermark with high stability is embedded in the data to be processed after the plaintext watermark is embedded (i.e., the first type of data), and the data to be processed embedded with the robust watermark and the plaintext watermark (i.e., the second type of data) is obtained; finally, a fragile watermark is embedded in the data to be processed embedded with the robust watermark and the plaintext watermark (i.e., the second type of data), and the data to be processed embedded with multiple different types of watermarks (i.e., the target data) can be obtained. In this embodiment, it is specified that the robust watermark is embedded in the position (i.e., the target position) where multiple series with a large amount of recorded information (i.e., the high availability series) are located. In this embodiment, embedding different types of watermarks in sequence can achieve multi-level data protection and verification, utilizing the complementary advantages of different watermark types. Through the public marking of plaintext watermarks, the persistent protection of robust watermarks, and the instant detection of fragile watermarks, multi-level security protection of the processed data is performed, effectively improving the security and reliability of the data.
[0045] Optionally, the target position is determined by the following method: determining the amount of information contained in each sequence in the first category of data; ranking all sequence contained in the first category of data according to the amount of information to obtain an information amount ranking of each sequence; determining sequence corresponding to multiple information amount rankings greater than a preset ranking as high-availability sequence, and determining the position of the high-availability sequence in the first category of data as the target position.
[0046] As mentioned in the previous embodiment, in the method provided by the embodiment of the present application, the robust watermark is embedded in the position of the high-availability sequence, wherein the high-availability sequence is determined according to the amount of information contained in each sequence. The amount of information contained in each sequence is directly proportional to the availability of the sequence. Since the robust watermark is embedded in the data to be processed (i.e., the first type of data) in which the plain text watermark has been embedded, in order to determine the high-availability sequence, the amount of information recorded in each sequence of the first type of data is first determined, and all the sequences contained in the first type of data are ranked in order from the most to the least information. After obtaining the ranking result (i.e., the information ranking) of each sequence, multiple sequences whose ranking results (i.e., the information ranking) are greater than the preset ranking are selected as the high-availability sequences for embedding the robust watermark. The specific positions of these high-availability sequences in the first type of data are the embedding positions (i.e., the target positions) of the robust watermark. Among them, the above-mentioned preset ranking represents a rank; since the method provided in the embodiment of the present application is used to embed watermarks in structured data, whether it is the data to be processed, the data to be processed embedded with a plaintext watermark (i.e., the first category of data), or other data (including: the second category of data, the third category of data) are all structured data, and the structured data is stored in the form of a two-dimensional table (containing multiple rows and columns). Therefore, the multiple series contained in the first category of data can be identified.
[0047] According to some other optional embodiments of the present application, a plaintext watermark is generated by the following method: 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 end data in the data to be processed, and embedding the watermark information and the first value into the next bit of the end data to obtain the first type of data, wherein the end data is the data located at the last bit 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 a database as watermark content. Specifically, a plaintext watermark can be generated by the method described in the embodiments of this application. In this embodiment, a plaintext watermark is generated based on watermark information and signed watermark information (i.e., digital signature), wherein 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 obtain the watermark information, or other value algorithms (e.g., value function, dictionary, or film and television) can be used to obtain the watermark information; 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 the plaintext watermark is generated in the above manner, the plaintext watermark can be embedded into the data to be processed. In this embodiment, after the plaintext watermark is added to the end of the data to be processed as a pseudo-row, the plaintext watermark is specifically embedded in the next bit of the end position of the data to be processed. Therefore, when embedding the plaintext watermark, it is necessary to determine the data located at the last bit of the data to be processed (i.e., the end data), and add the plaintext watermark in the form of a row to the back of a certain bit of data; since the data to be processed is stored in the form of a two-dimensional table, the two-dimensional table form can also be regarded as a table generated by arranging multiple cells, then the end 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 next bit of the last cell of the data to be processed. For example, when using the hash algorithm, the process of generating a digital signature can be expressed as the formula: W m2 =SM2(SM3(W m1 ),K), where SM3 is a hash function, W m1 represents the watermark information used to generate the plaintext watermark. SM2 is an asymmetric encryption algorithm. K is the key used when applying SM2. SM2 and key K are used to implement the signature to obtain the digital signature of the watermark information. W m2 Represents a digital signature called a watermark. When extracting the plaintext watermark, it can be based on W m1 Recalculate the value of W m2 The value of is used to verify whether the plaintext watermark is damaged. If the two match, it means that the plaintext watermark is complete and has not been damaged.
[0049] According to some optional embodiments of the present 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 data, and each column of the data to be embedded with the fragile watermark corresponds to a column data, and the fragile watermark is generated by the following method: determining multiple row data and multiple column data contained in the data to be embedded with the fragile watermark; for each row data, determining the attribute column data contained in the row data, and generating a tuple watermark based on the attribute column data, wherein the attribute column data is data contained in the row data and belongs to a column data at the same time; for each column data, generating an attribute watermark for embedding into the column data based on the column data.
[0050] The fragile watermark used in the embodiment of the present application includes a fragile watermark for embedding row data (i.e., tuple watermark) and a fragile watermark for embedding column data (i.e., attribute watermark), wherein the row data refers to each row of the data to be embedded with the fragile watermark (in the embodiment of the present application, it is the data to be processed in which the plaintext watermark and the robust watermark are embedded, 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 embodiment, 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 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 row data currently being processed and one of the multiple series (i.e., column data) contained in the data to be processed. The data to be processed is structured data, which is stored in a two-dimensional table form. The two-dimensional table form itself is a combination of multiple cells. Each cell corresponds to different attributes according to the data stored in it. Therefore, in this embodiment, it can also be called an attribute column, and the data stored in each cell is also called attribute column data. The attribute watermark in the fragile watermark is generated using the column data itself.
[0051] Optionally, a tuple watermark is generated based on the attribute column data, including: determining a second value of each attribute column data, wherein the type of the second value includes: an attribute value of the attribute column data, wherein the attribute value is determined based on 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 a tuple watermark, and concatenating the first processing result and the first preset key to generate a first data sequence; generating a first subsequence having 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 a preset tuple watermark length.
[0052] In this embodiment, a tuple watermark is generated based on a value-taking result (i.e., a second value) of the attribute column data, wherein the value-taking result (i.e., the second value) of the attribute column data may be an attribute value of the attribute column data. When the attribute value (i.e., the second value) is used to process the attribute column data, a hash function (such as SM3) may be used. When the hash function (SM3) is used to process the attribute column data, the process of generating the tuple watermark may be expressed as the following formula:
[0053]
[0054] Where N represents the number of attribute column data, i represents the i-th row data, Represents the tuple watermark of the Nth attribute column tuple in the i-th row data, extractBits is a function to extract subsequences, indicating the (first) data sequence (SM3(K||r1·A1||r2·A2||…r γ ·A γ ) extracts the length of 2 s-1 *γ (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, which are used to introduce randomness in hash calculation to adjust the complexity of the tuple watermark; A1, A2……A γ represents different attribute values, and the attribute value is determined according to the information actually recorded in each attribute column data (for example, if the information actually recorded in the attribute column is the certificate information, then the binary format of the certificate 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; r1·A1, r2·A2, …r γ ·A γ That is the first processing result.
[0055] According to some optional embodiments of the present application, an attribute watermark for embedding in the column data is generated based on the column data, including: determining multiple tuples contained in the column data, wherein the tuple is generated by segmenting the row data, and a tuple belongs to both a row data and a column data; for each tuple, determining a 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 with a second preset length based on the second data sequence, wherein the second subsequence is an 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, generating an attribute watermark can be expressed as 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 data, i is the number of tuples, in this embodiment, a tuple is a cell constituting a two-dimensional table when the data to be processed contained in the column data is stored in the form of a two-dimensional table, and 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 a tuple watermark is generated, the data stored in the cell is identified as attribute column data, and when an attribute watermark is generated, the data stored in the cell is identified as a tuple; K represents a second preset key, and the key used when generating an attribute watermark (i.e., the second preset key) and the key used when generating a 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, which are used to introduce randomness in hash calculation to adjust the complexity of the tuple watermark. SM3 is a hash function, and H0 is a hash function for data: (r1·P1||r2·P2||…r i ·P i ) is processed to generate a hash value (i.e., the second processing result), || is a concatenation symbol, extractBits is a function for extracting a subsequence, indicating that in the (second) data sequence (K||r1·P1||r2·P2||…r i ·P i ) extracts the length of 2 s -1 *i (second) subsequence, 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 represents the attribute value of the j-th tuple, Represents the attribute watermark of 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 category of data includes: randomly determining the third category of data to be embedded with the fragile watermark in the second category of data, and determining the position of the third category of data in the second category of data as the initial embedding position; determining a target embedding position corresponding to the initial embedding position according to a preset position deviation, an attribute value of the third category of data located at the initial embedding position, and a primary key of the third category of data located at the initial embedding position, wherein the target embedding position is a corrected initial embedding position, and the attribute value of the third category of data is determined based on actual information recorded in the third category of data; determining a 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 an 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 the initial embedding position. Format conversion refers to converting the fragile watermark into a corresponding zero-width character. In the solution provided in the embodiment of the present application, embedding a fragile watermark refers to embedding a 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 as 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 Represents the jth attribute value of tuple i, which is the randomly determined data to be embedded with the fragile watermark (i.e., the third type of data) A i,j is the value of the data stored in the cell at the i-th row and j-th column in the multiple cells included in the second type of data; the second type of data is represented by a table (i.e., a two-dimensional table) composed of multiple cells and including multiple rows and columns; the second type of data is the data to be processed embedded with a plaintext watermark and a robust watermark, therefore, the data stored in the cell at the i-th row and j-th column in the data to be processed (excluding the watermark data) is the same as the data stored in the cell at the i-th row and j-th column in the second type of data (excluding the watermark data), therefore, A i,jIt can also be the value of the data stored in the cell at the i-th row and j-th column in the data to be processed. SM3 represents a hash function, L represents a preset position deviation, Mod(L) represents the modulus of the preset position deviation, r1, ..., r i Represents the preset weight corresponding to each tuple, P1, ..., P i Represents the primary key of each tuple, location i,j represents the modified vulnerable watermark embedding position (i.e., the target embedding position), A 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 fragile watermark is embedded in C , the cell at this position embeds a zero-width character W C The attribute value after is A i,j ′ When converting a fragile watermark into a zero-width character, different conversion rules can be defined for different types of fragile watermarks. For example, after converting a tuple watermark and an attribute watermark into binary form, for a fragile watermark of type tuple watermark, bit 0 in the tuple watermark is converted into a zero-width character u200C, and bit 1 in the tuple watermark is converted into a zero-width character u200D; for a fragile watermark of type attribute watermark, bit 0 in the attribute watermark is converted into a zero-width character u200B, and bit 1 in the attribute watermark is converted into a zero-width character u200E.
[0065] Step S206: output the target data to the target user who sent the target request information.
[0066] In step S204, after the watermark is embedded in the data to be processed, the data embedded with the watermark (i.e., target data) can be output to the user (i.e., target user) corresponding to the client that initiates the request information (i.e., target request information) requesting the transfer of the data to be processed, thereby realizing the transfer of the data to be processed.
[0067] Through the above steps, it is possible to embed plaintext watermarks, robust watermarks and fragile watermarks in the data. The fragile watermark can be used to detect whether the data has been tampered with, the robust watermark can be used to prevent the watermark in the data from being tampered with, and the plaintext watermark can be used to trace the data transmission trajectory, thereby improving the security of the data sharing process.
[0068] Figure 4 is a structural diagram of a watermark embedding device provided according to an embodiment of the present application, such as Figure 4As shown, the device for embedding watermarks includes: an acquisition module 40, used to obtain target request information, wherein the target request information is used to request transfer processing of the 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, and the multiple types of watermarks include: plain text watermarks, robust watermarks, and fragile watermarks, the plain text watermarks and robust watermarks are generated based on the watermark information stored in the database, and the fragile watermarks are generated based on the data to be processed; 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 The preferred implementation of the illustrated embodiment can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.
[0070] The embodiment of the present application further provides a non-volatile storage medium, in which a computer program is stored, wherein the above method of embedding watermark is executed by running the computer program on a device where the non-volatile storage medium is located.
[0071] The above-mentioned 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 transfer processing of the 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, and the multiple types of watermarks include: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on the 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 sends the target request information.
[0072] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above watermark embedding method through the computer program.
[0073] The processor in the above-mentioned electronic device is used to run a program that performs the following functions: obtaining target request information, wherein the target request information is used to request transfer processing of the 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, and the multiple types of watermarks include: plaintext watermarks, robust watermarks, and fragile watermarks, wherein the plaintext watermarks and robust watermarks are generated based on the 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 sends the target request information.
[0074] The embodiment of the present application further provides a computer program product, including computer instructions, which implement the steps of the above watermark embedding method when executed by a processor.
[0075] It should be noted that the various modules in the above-mentioned watermark embedding device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0076] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0077] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description 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. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0079] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0080] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0081] If the integrated unit is implemented in the form of 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 the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0082] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for embedding a watermark, characterized in that: include: Acquiring target request information, wherein the target request information is used to request transfer processing of the 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, the multiple types of watermarks include: plain text watermark, robust watermark, fragile watermark, the plain text watermark and the robust watermark are generated according to the watermark information stored in the database, and the fragile watermark is generated according to the data to be processed; The target data is output to a target user who sends the target request information.
2. The method according to claim 1, characterized in that Performing watermark embedding processing on the data to be processed to obtain target data includes: Generate the plaintext watermark, and embed the plaintext watermark into the data to be processed to obtain the first type of data; Generate the robust watermark, and embed the robust watermark into a target position of the first type of data to obtain second type of data, wherein the target position is a position of a high availability column in the first type of data; The fragile watermark is generated, and the fragile watermark is embedded into the second type of data to obtain the target data.
3. The method according to claim 2, characterized in that The target position is determined by: Determine the amount of information contained in each sequence in the first type of data; Ranking all number sequences included in the first category of data according to the information amount to obtain an information amount ranking of each number sequence; The number series corresponding to a plurality of the information quantity rankings greater than a preset ranking are determined as the high availability number series, and the position of the high availability number series in the first category of data is determined as the target position.
4. The method according to claim 1, characterized in that The plaintext watermark is generated by the following method: Determine a first value of the watermark information, and determine a digital signature of the first value, wherein the type of the first value includes: a hash value of the watermark information; determine the watermark information and the digital signature as the plaintext watermark; The plaintext watermark is embedded into the data to be processed to obtain the first type of data, including: Determine the tail data in the data to be processed, and embed the watermark information and the first value into the next bit of the tail data to obtain the first type of data, wherein the tail data is the data located at the last bit in the data to be processed.
5. The method according to claim 1, characterized in that: The fragile watermark includes: a tuple watermark for embedding row data, and an attribute watermark for embedding column data, wherein each row of data to be embedded with the fragile watermark corresponds to one row data, and each column of data to be embedded with the fragile watermark corresponds to one column data, and the fragile watermark is generated by the following method: Determine a plurality of row data and a plurality of column data included 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 one of the tuple watermarks according to the attribute column data, wherein the attribute column data is data contained in the row of data and simultaneously belongs to one of the column data; For each of the column data, the attribute watermark for embedding into the column data is generated according to the column data.
6. The method according to claim 5, characterized in that Generating a tuple watermark according to the attribute column data includes: Determine a second value of each of the attribute column data, wherein the type of the second value includes: an attribute value of the attribute column data, and the attribute value is determined according to 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; A first subsequence having a first preset length is generated according to the first data sequence, wherein the first subsequence is a tuple watermark, and the first preset length is determined according to the number of the attribute column data and a preset tuple watermark length.
7. The method according to claim 5, characterized in that Generating the attribute watermark for embedding into the column data according to the column data comprises: Determine a plurality of tuples included in the column data, wherein the tuples are generated by segmenting the row data, and one tuple belongs to both one row data and one column data; For each of the tuples, determining a 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 a plurality of the second processing results and the second preset key to generate a second data sequence; A second subsequence having a second preset length is generated according to the second data sequence, wherein the second subsequence is the attribute watermark, and the second preset length is determined according to the number of the tuples and a preset attribute watermark length.
8. The method according to claim 2, characterized in that: Embedding the fragile watermark into the second type of data comprises: 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 an initial embedding position; Determining a target embedding position corresponding to the initial embedding position according to a preset position deviation, an attribute value of the third type of data located at the initial embedding position, and a 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 according to actual information recorded in the third type of data; A zero-width character corresponding to the fragile watermark is determined, and the zero-width character is embedded into the target position.
9. A device for embedding a watermark, characterized in that: include: An acquisition module is used to acquire target request information, wherein the target request information is used to request transfer processing of the data to be processed, wherein the transfer processing includes: downloading and exporting; a processing module, configured 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, the multiple types of watermarks including: plain text watermark, robust watermark, fragile watermark, the plain text watermark and the robust watermark are generated according to the watermark information stored in the database, and the fragile watermark is generated according to the data to be processed; An output module is used to output the target data to a target user who sends the target request information.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, wherein the method for embedding watermarks according to any one of claims 1 to 8 is executed by running the computer program on the device where the non-volatile storage medium is located.
11. 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 watermark embedding method according to any one of claims 1 to 8 through the computer program.
12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method for embedding watermarks described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Robust watermark technique of digital image selected from space domain of images
CN101004830A
Outsourced database enquiry and verification method based on fragile watermark
CN101236587A
Structured data watermark embedding method and extraction method
CN117807571A
Watermark embedding and detecting method and device for large model generation text
CN118608367A
Apparatus and method for issuing and authenticating securities, etc. using digital water marking
CN1455912A