Watermark embedding method, watermark extraction method, electronic device, storage medium
By encoding and grouping watermark information and combining it with a randomization module, the problem of insufficient concealment of digital watermarks in databases is solved, and the extraction of watermark information with high concealment and robustness is achieved.
Patent Information
- Application Number
- CN202210755956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-06-30
AI Technical Summary
Existing digital watermarking technology lacks sufficient confidentiality in databases, and watermark information is easily tampered with or lost, increasing the difficulty of extraction.
The original watermark information is encoded using a preset encoding rule, watermark bits are embedded in groups, and the watermark bits are repeatedly embedded in multiple object groups through a randomization processing module to ensure the confidentiality and robustness of the watermark information.
It improves the confidentiality of watermark information and ensures robust watermark extraction even after some watermark bits are lost, thus enhancing the integrity and reliability of watermark information.
Smart Images

Figure CN117370944B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to, but is not limited to, the field of database technology, and particularly to a watermark embedding method, a watermark extraction method, an electronic device, and a storage medium. Background Technology
[0002] Data breaches are a major threat to database security. To trace the source of data breaches, data watermarks are often added to data objects such as databases, videos, or images. Digital watermarking is a technique that hides watermark information in structured data according to certain rules and algorithms, without affecting the usability of the data object. Common watermark information is usually plaintext or a simple encoding of plaintext. Once the embedded password is leaked, the watermark information is easily tampered with, and its confidentiality is not guaranteed. Furthermore, watermark information is usually embedded after modulo the watermark length. After the data object is modified or deleted, some watermark information can easily be lost, increasing the difficulty of extracting the watermark information. Summary of the Invention
[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0004] This invention provides a watermark embedding method, a watermark extraction method, an electronic device, and a storage medium, which can improve the concealment of digital watermark embedding and the robustness of watermark extraction.
[0005] In a first aspect, embodiments of the present invention provide a watermark embedding method, including:
[0006] The original watermark information is obtained, and the original watermark information is encoded according to a preset encoding rule to obtain embedded watermark information, which includes multiple watermark bits.
[0007] The embedded object is split into multiple object groups according to the preset grouping rules;
[0008] According to the preset embedding rules, each watermark bit is embedded in at least one of the object groups;
[0009] The object groups are recombined to obtain the embedded object carrying the embedded watermark information.
[0010] Secondly, embodiments of the present invention provide a watermark extraction method, including:
[0011] The embedded object is split into multiple object groups according to a preset grouping rule, wherein the embedded object carries embedded watermark information embedded according to the watermark embedding method described in the first aspect.
[0012] According to preset embedding rules, multiple watermark bits are extracted from at least one of the object groups;
[0013] Multiple watermark bits are aggregated into embedded watermark information, and the original watermark information corresponding to the embedded watermark information is determined.
[0014] Thirdly, embodiments of the present invention provide an electronic device, including:
[0015] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the watermark embedding method as described in the first aspect, or implements the watermark extraction method as described in the second aspect.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which are used to perform the watermark embedding method as described in the first aspect, or to perform the watermark extraction method as described in the second aspect.
[0017] This invention includes the following steps: acquiring original watermark information; encoding the original watermark information according to a preset encoding rule to obtain embedded watermark information, wherein the embedded watermark information includes multiple watermark bits; splitting the embedded object into multiple object groups according to a preset grouping rule; embedding each watermark bit into at least one object group according to a preset embedding rule; and recombining the object groups to obtain the embedded object carrying the embedded watermark information. According to the technical solution of this embodiment, the confidentiality of the watermark information is improved through encoding, and by embedding watermark bits into multiple object groups, different object groups can embed the same watermark bits, ensuring robust watermark extraction even after some watermark bits are lost. Attached Figure Description
[0018] Figure 1 This is a flowchart of a watermark embedding method provided in an embodiment of the present invention;
[0019] Figure 2 This is a flowchart of encoding and watermark extraction provided in another embodiment of the present invention;
[0020] Figure 3 This is a flowchart of splitting object grouping provided in another embodiment of the present invention;
[0021] Figure 4 This is a flowchart of dividing the mapping interval provided in another embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of an embedded watermark provided in another embodiment of the present invention;
[0023] Figure 6 This is a flowchart of watermark embedding based on random numbers provided in another embodiment of the present invention;
[0024] Figure 7 This is a flowchart of a watermark extraction method provided in another embodiment of the present invention;
[0025] Figure 8 This is a flowchart of encoding and watermark extraction provided in another embodiment of the present invention;
[0026] Figure 9 This is a flowchart of aggregating embedded watermark information provided in another embodiment of the present invention;
[0027] Figure 10 This is a flowchart of the process of recovering watermark bits provided in another embodiment of the present invention;
[0028] Figure 11 This is a flowchart for querying original watermark information provided in another embodiment of the present invention;
[0029] Figure 12 This is a device diagram of an electronic device provided in another embodiment of the present invention. Detailed Implementation
[0030] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, or the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0031] This invention provides a watermark embedding method, an electronic device, and a storage medium. The watermark embedding method includes: acquiring original watermark information; encoding the original watermark information according to a preset encoding rule to obtain embedded watermark information, wherein the embedded watermark information includes multiple watermark bits; splitting the embedded object into multiple object groups according to a preset grouping rule; embedding each watermark bit into at least one object group according to a preset embedding rule; and recombining the object groups to obtain the embedded object carrying the embedded watermark information. According to the technical solution of this embodiment, the confidentiality of the watermark information is improved through encoding, and by embedding watermark bits into multiple object groups, different object groups can embed the same watermark bits, ensuring robust watermark extraction even after some watermark bits are lost.
[0032] The technical solutions of various embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0033] like Figure 1 As shown, Figure 1 This is a flowchart of a watermark embedding method provided in an embodiment of the present invention, including but not limited to steps S110 to S140.
[0034] Step S110: Obtain the original watermark information, encode the original watermark information according to the preset encoding rules, and obtain the embedded watermark information, which includes multiple watermark bits.
[0035] Step S120: The embedded object is split into multiple object groups according to the preset grouping rules;
[0036] Step S130: According to the preset embedding rules, each watermark bit is embedded into at least one object group;
[0037] Step S140: Regroup the objects to obtain embedded objects carrying embedded watermark information.
[0038] It should be noted that the original watermark information can be user identity information, time information, version information, etc., and this embodiment does not limit the specific type of the original watermark information. The embedded object can be an object that can be divided into multiple parts, such as a database or video, and can have a digital watermark written on it. For the sake of simplicity, this embodiment uses a database as the embedded object for illustration, which is not intended to limit the technical solution of this embodiment.
[0039] It should be noted that the preset encoding rule can be a one-way hash function, such as the common SHA256, SHA512, or SM3, which can encode the original watermark information to obtain highly confidential encoded data as embedded watermark information. It is understood that the embedded watermark information can be the encoded data obtained from the encoding, or it can be obtained by truncating the encoded data to a certain length. This embodiment does not impose many limitations on this and can be adjusted according to the actual capacity of the database.
[0040] It's important to note that, taking a database as the embedding object as an example, the database can be split into a collection of multiple tables, with each collection serving as a database group, or a single table can be considered a database group. After obtaining multiple database groups, the number of watermark bits to embed can be determined based on the data capacity of each group. If a database group can accommodate all watermark bits, the embedded watermark information can be written to all database groups, or different watermark bits can be written to different database groups. Because the embedded watermark information is written to different database groups, and the written watermark bits can be repeated, the same watermark bit can be written to multiple database groups. Even if CRUD operations are performed on database groups, the embedded watermark information can still be extracted from other database groups, effectively improving the robustness of the watermark.
[0041] It should be noted that after the watermark bits are written into the database group, the reverse operation can be performed according to the grouping rules to recombine the database, so that the data structure of the database remains unchanged, and the embedded watermark information is added to the recorded data, thereby realizing the embedding of digital watermark.
[0042] Additionally, in one embodiment, reference is made to Figure 2 , Figure 1 Step S110 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0043] Step S210: Determine the target encoding algorithm from the optional encoding algorithms;
[0044] Step S220: Encode the original watermark information according to the target encoding algorithm to obtain the encoded watermark information;
[0045] Step S230: Extract the embedded watermark information from the encoded watermark information according to the preset watermark length;
[0046] Step S240: Save the encryption mapping relationship between the original watermark information, the embedded watermark information, and the target encoding algorithm.
[0047] It should be noted that, according to the description of the above embodiments, the optional encoding algorithm can be set according to actual needs, such as a hash encryption algorithm. The original watermark information is encoded by the one-way hash function described in the above embodiments, so that the embedded watermark information and the original watermark information are different in data representation, and the original watermark information cannot be directly obtained from the embedded watermark information, thereby enhancing the confidentiality of the data watermark.
[0048] It should be noted that the encoded watermark information output by the one-way hash function is a fixed-length bit. For example, the encoded watermark information obtained by encoding according to SHA256 is 256 bits. Based on this, the watermark length can be set according to actual needs. A fixed length of bits can be extracted from the encoded watermark information as the embedded watermark information. For example, the first 192 bits contain most of the watermark information, so the first 192 bits can be extracted as the embedded watermark information. The specific length can be selected according to actual needs.
[0049] It is worth noting that after encoding and truncation, since the target encoding algorithm can be a one-way hash function, it is difficult to reverse the embedded watermark information to recover the original watermark information. In order to facilitate watermark extraction, a management database can be established to maintain the encrypted mapping relationship between the original watermark information, the embedded watermark information, and the target encoding algorithm. This allows the original watermark information to be retrieved through the encrypted mapping information after the embedded watermark information is extracted, thereby realizing watermark extraction.
[0050] Additionally, in one embodiment, reference is made to Figure 3 , Figure 1 Step S120 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0051] Step S310: Obtain the preset watermark sparsity density. The watermark sparsity density represents the ratio of the amount of data between the object data of the object group and the embedded watermark bits.
[0052] Step S320: Determine the number of groups based on the watermark length and watermark sparsity density, and split the embedded object into multiple object groups based on the number of groups.
[0053] It should be noted that, in order to determine the number of database groups, it can be determined according to the set watermark sparsity density. For example, if the watermark sparsity density is 10%, then a maximum of 10 watermark information can be inserted for every 100 data records. In this case, if the length of the embedded watermark information is 192 bits as described in the above embodiment, and the entire embedded watermark information needs to be inserted into each database group, then the database group needs to have at least 1920 data records. Based on this, the database is grouped to obtain multiple database groups. The specific grouping granularity can be adjusted according to the requirements, and will not be limited here.
[0054] Additionally, in one embodiment, reference is made to Figure 4 , Figure 1 Step S130 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0055] Step S410: Generate multiple mapping intervals based on the number of bits of embedded watermark information, wherein the values of each mapping interval are non-overlapping and sequentially consecutive.
[0056] Step S420: Associate the watermark bits with the corresponding mapping intervals, wherein each mapping interval is associated with at least one watermark bit;
[0057] Step S430: Based on the embedding rules, determine at least one target object group corresponding to each mapping interval from at least one object group;
[0058] Step S440: The watermark bits associated in each mapping interval are embedded into the corresponding target object group.
[0059] It should be noted that the number of mapping intervals can be determined based on the number of bits embedded in the watermark information and the number of bits associated with each mapping interval. For example, if each mapping interval is associated with one bit, then the number of mapping intervals is the same as the number of bits embedded in the watermark information. Or, if each mapping interval is associated with multiple bits, then the number of mapping intervals can be determined after determining the association relationship according to actual needs. This embodiment does not impose any restrictions on this.
[0060] It should be noted that the embedding rule can be to perform random calculation based on the parameters grouped by the database, determine the corresponding mapping interval according to the obtained random number, and obtain the corresponding watermark bit from the mapping interval for embedding. Therefore, the values of two adjacent mapping intervals can be continuous, which not only ensures that any random number can match the corresponding mapping interval, but also, when extracting the watermark, can aggregate the watermark bits extracted from the database grouping based on the mapping interval corresponding to the database grouping as the order basis.
[0061] For example, referring to Figure 5 , if the length of the embedded watermark information is N bits and each bit corresponds to a mapping interval, then N mapping intervals can be generated. The numerical length of each mapping interval can be the same, or can be adjusted according to the importance of the embedded watermark information. For example, the data of the first M (M < N) bits is more important and the probability of matching the embedded watermark information after extraction is greater. The numerical range of the mapping interval corresponding to the first M bits can be set larger, so that more random numbers can match the mapping interval corresponding to the first M bits, improving the robustness of watermark extraction.
[0062] In addition, in one embodiment, referring to Figure 6 , Figure 4 The step S430 of the embodiment shown further includes but is not limited to the following steps:
[0063] Step S610, obtain a preset random number generation function, and the maximum value that the random number generation function can generate is greater than or equal to the number of bits of the embedded watermark information;
[0064] Step S620, obtain the identification parameter of the object grouping, and the identification parameter is used to uniquely identify the object grouping;
[0065] Step S630, input the identification parameter into the random number generation function to generate the target random number of the object grouping;
[0066] Step S640, determine at least one target object grouping corresponding to each mapping interval, where the target random number corresponding to the target object grouping falls into the corresponding mapping interval.
[0067] It should be noted that in order to improve the secrecy of the embedded watermark information, a random number can be generated through a randomization embedding processing module. The randomization embedding processing module can preset the random number generation function, input the identification parameter to generate a random number, and then determine the watermark bit embedded in the database grouping according to the mapping relationship between the random number and the mapping interval.
[0068] It should be noted that the identifier parameter can be determined according to the specific type of the embedded object. Taking a database as an example, the identifier parameter can be a set of primary key and foreign key information of the database. After inputting the above parameters into the random number generation function, a certain target random number is obtained, thereby matching the watermark bit corresponding to the group.
[0069] To better illustrate the technical solution of this embodiment, the following is combined with... Figure 5 Here is a specific example:
[0070] After obtaining the original watermark information, it is encoded using the one-way hash function SHA256. The first 192 bits are extracted from the resulting 256 bits as the embedded watermark information. The mapping relationship between the original watermark information, the embedded watermark information, the watermark encoding function, the one-way hash function, and the cryptographic information required by the hash function is maintained. The database is divided into multiple database groups according to the embedded watermark length and the watermark sparsity density. Each watermark bit of the embedded watermark information is pre-encoded into 192 mapping intervals. Then, a randomization processing function (random number range 1-256) is selected, and the database primary key and foreign key key information sets are used as parameters to obtain a certain random number (1-256). Based on the numerical mapping relationship between the random number and the mapping interval, it is determined whether the current database group is embedded with a watermark (if it is not within the interval, it is not embedded with a watermark), and the embedded watermark bits. After completion, all database groups with embedded watermark bits are reassembled into a complete database carrying embedded watermark information.
[0071] Additionally, refer to Figure 7 An embodiment of the present invention also provides a watermark extraction method, including but not limited to the following steps:
[0072] Step S710: The embedded object is split into multiple object groups according to the preset grouping rules, wherein the embedded object carries embedded watermark information.
[0073] Step S720: Extract multiple watermark bits from at least one object group according to a preset embedding rule;
[0074] Step S730: Aggregate multiple watermark bits into embedded watermark information, and determine the original watermark information corresponding to the embedded watermark information.
[0075] It should be noted that the methods for obtaining embedded watermark information, grouping rules, and embedding rules can be found in [the following text is missing from the original] Figure 1 The embodiments shown are presented here, and for the sake of simplicity, they will not be repeated here.
[0076] It should be noted that, given that the embedding rules are known, the process of extracting embedded watermark information can be the reverse of the embedding process. Taking a database as an example, after determining multiple database groups according to the grouping rules when embedding watermarks, the corresponding watermark bits are extracted from each database group. The embedded watermark information is then aggregated based on the position of the mapping interval corresponding to the watermark bits. Given that the embedding process is known, those skilled in the art are familiar with how to reverse the process to obtain embedded watermark information, so we will not elaborate further here.
[0077] Additionally, in one embodiment, reference is made to Figure 8 , Figure 7 Step S710 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0078] Step S810: Obtain the preset watermark sparsity density. The watermark sparsity density represents the ratio of the amount of data between the object data of the object group and the embedded watermark bits.
[0079] Step S820: Determine the number of groups based on the watermark length and watermark sparse density, and split the embedded object into multiple object groups based on the number of groups.
[0080] It should be noted that the technical principles of this embodiment are the same as those of the previous one. Figure 2 The principle of the illustrated embodiment is similar, the difference being that the operation after determining the group in this embodiment is to extract the embedded watermark information from the object group, while... Figure 2 The operation after grouping in the illustrated embodiment is to write the embedded watermark information into the object group. Otherwise, the grouping rules are the same, and will not be repeated here for the sake of simplicity.
[0081] Additionally, in one embodiment, reference is made to Figure 9 , Figure 7 Step S730 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0082] Step S910: Obtain a preset random number generation function. The maximum value that the random number generation function can generate is greater than or equal to the number of bits embedded in the watermark information.
[0083] Step S920: Obtain the identifier parameter of the object group. The identifier parameter is used to uniquely identify the object group.
[0084] Step S930: Input the identifier parameter into the random number generation function to generate the target random number for the object grouping;
[0085] Step S940: The mapping interval into which the target random number falls is determined as the target mapping interval for object grouping. The mapping interval is generated based on the number of bits embedded with watermark information. The values of each mapping interval do not overlap and are sequentially continuous. Each mapping interval is associated with at least one watermark bit.
[0086] Step S950: Based on the sorting of the target mapping intervals corresponding to each object group, the watermark bits extracted from the object group are aggregated into embedded watermark information.
[0087] It should be noted that the principles of steps S910 to S930 can be referred to Figure 6 The description of the embodiments shown is omitted here for the sake of simplicity.
[0088] It should be noted that after determining the target mapping interval, since the mapping intervals are numerically continuous, their positional relationship is known. Based on this, the corresponding watermark bits can be sorted and combined to aggregate and obtain the embedded watermark information.
[0089] It should be noted that since each watermark bit can be repeatedly embedded into multiple database groups, after obtaining watermark bits at the same bit position, one can be selected for aggregation to obtain the embedded watermark information.
[0090] Additionally, in one embodiment, reference is made to Figure 10 After execution Figure 7 Following step S730 in the illustrated embodiment, the following steps are included, but are not limited to:
[0091] Step S1010: When at least one object group loses watermark bits, determine the same interval group of the object group that lost watermark bits, wherein the same interval group is the object group that has the same target random number as the object group that lost watermark bits, and the watermark bits of the same interval group are not lost.
[0092] Step S1020: Based on the preset threshold value and the watermark bits of the same interval group, recover the watermark bits lost by the object group that lost the watermark bits.
[0093] It should be noted that after performing CRUD operations on database objects, the watermark bits may be lost due to data changes. In this embodiment, each watermark bit is repeatedly embedded in multiple database groups. By collecting information on the same watermark bit within the same group, the watermark bit information of the current group can be recovered by applying a certain threshold ratio (the probability of the data appearing is greater than the threshold ratio). Then, through the aggregation and merging module, the watermark information with the same bit in all extracted groups is used to determine the final embedded watermark information according to the aggregation and merging algorithm, thereby recovering the embedded watermark information.
[0094] Additionally, in one embodiment, reference is made to Figure 11 , Figure 7 Step S730 of the illustrated embodiment also includes, but is not limited to, the following steps:
[0095] Step S1110: Obtain the encryption mapping relationship. The encryption mapping relationship is the mapping relationship between the original watermark information, the embedded watermark information, and the target encoding algorithm. The target encoding algorithm is used to encode the original watermark information.
[0096] Step S1120: Determine the original watermark information corresponding to the embedded watermark information based on the encryption mapping relationship.
[0097] It should be noted that the encryption mapping relationship can be obtained by referring to... Figure 2 The description of the illustrated embodiments will not be repeated here.
[0098] It is worth noting that since the target encoding algorithm can be a one-way hash function, it is difficult to obtain the original watermark information through decoding and other operations. In order to ensure the robustness of watermark extraction, the original watermark information can be extracted by maintaining an encrypted mapping relationship after obtaining the embedded watermark information and querying the original watermark information from the encrypted mapping relationship.
[0099] Additionally, refer to Figure 12 An embodiment of the present invention also provides an electronic device 1200, which includes a memory 1210, a processor 1220, and a computer program stored on the memory 1210 and executable on the processor 1220.
[0100] The processor 1220 and the memory 1210 can be connected via a bus or other means.
[0101] The non-transient software program and instructions required to implement the watermark embedding method of the above embodiments are stored in the memory 1210. When executed by the processor 1220, the watermark embedding method of the above embodiments is executed, for example, the method described above is executed. Figure 1 Method steps S110 to S140, Figure 2 Method steps S210 to S240, Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S440 Figure 6 Method steps S610 to S640 Figure 7 Method steps S710 to S730, Figure 8 Method steps S810 to S820 Figure 9 Method steps S910 to S950 Figure 10 Method steps S1010 to S1020 Figure 11 The method steps S1110 to S1120.
[0102] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0103] Furthermore, one embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor or controller, for example, by a processor in the above-described electronic device embodiment, causing the processor to perform the watermark embedding method described above, for example, performing the above-described... Figure 1 Method steps S110 to S140, Figure 2 Method steps S210 to S240, Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S440 Figure 6 Method steps S610 to S640 Figure 7 Method steps S710 to S730, Figure 8 Method steps S810 to S820 Figure 9 Method steps S910 to S950 Figure 10 Method steps S1010 to S1020 Figure 11The method steps S1110 to S1120 are described above. Those skilled in the art will understand that all or some of the steps in the methods and systems disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0104] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A watermark embedding method, comprising: The original watermark information is obtained, and the original watermark information is encoded according to a preset encoding rule to obtain embedded watermark information, which includes multiple watermark bits. The embedded object is split into multiple object groups according to the preset grouping rules; According to the preset embedding rules, each watermark bit is embedded in at least one of the object groups; The object groups are recombined to obtain the embedded object carrying the embedded watermark information.
2. The method according to claim 1, characterized in that, The step of encoding the original watermark information according to a preset encoding rule to obtain embedded watermark information includes: Determine the target encoding algorithm from the available encoding algorithms; The original watermark information is encoded according to the target encoding algorithm to obtain encoded watermark information; The embedded watermark information is extracted from the encoded watermark information according to the preset watermark length; The encryption mapping relationship between the original watermark information, the embedded watermark information, and the target encoding algorithm is saved.
3. The method according to claim 2, characterized in that, The step of splitting the embedded object into multiple object groups according to a preset grouping rule includes: Obtain a preset watermark sparsity density, wherein the watermark sparsity density characterizes the ratio of the amount of data between the object data of the object group and the embedded watermark bits; The number of groups is determined based on the watermark length and the watermark sparse density, and the embedded object is split into multiple object groups based on the number of groups.
4. The method according to claim 1, characterized in that, The step of embedding each watermark bit into at least one object group according to a preset embedding rule includes: Multiple mapping intervals are generated based on the number of bits of the embedded watermark information, wherein the values of each mapping interval are non-overlapping and sequentially consecutive. The watermark bit is associated with the corresponding mapping interval, wherein each mapping interval is associated with at least one watermark bit; Based on the embedding rules, at least one target object group corresponding to each of the mapping intervals is determined from at least one of the object groups; The watermark bits associated with each of the mapping intervals are embedded into the corresponding target objects in a group.
5. The method according to claim 4, characterized in that, The step of determining at least one target object group corresponding to each of the mapping intervals from at least one of the object groups according to the embedding rule includes: Obtain a preset random number generation function, wherein the maximum value that the random number generation function can generate is greater than or equal to the number of bits of the embedded watermark information; Obtain the identifier parameter of the object group, the identifier parameter being used to uniquely identify the object group; The identifier parameter is input into the random number generation function to generate the target random number for the object grouping; Determine at least one target object group corresponding to each of the mapping intervals, wherein the target random number corresponding to the target object group falls into the corresponding mapping interval.
6. A watermark extraction method, comprising: The embedded object is split into multiple object groups according to a preset grouping rule, wherein the embedded object carries embedded watermark information embedded by the watermark embedding method according to any one of claims 1 to 5. According to preset embedding rules, multiple watermark bits are extracted from at least one of the object groups; Multiple watermark bits are aggregated into embedded watermark information, and the original watermark information corresponding to the embedded watermark information is determined.
7. The method according to claim 6, characterized in that, The step of splitting the embedded object into multiple object groups according to a preset grouping rule includes: Obtain a preset watermark sparsity density, wherein the watermark sparsity density characterizes the ratio of the amount of data between the object data of the object group and the embedded watermark bits; The number of groups is determined based on the watermark length and the watermark sparse density, and the embedded object is split into multiple object groups based on the number of groups.
8. The method according to claim 6, characterized in that, The step of aggregating multiple watermark bits into embedded watermark information includes: Obtain a preset random number generation function, wherein the maximum value that the random number generation function can generate is greater than or equal to the number of bits of the embedded watermark information; Obtain the identifier parameter of the object group, the identifier parameter being used to uniquely identify the object group; The identifier parameter is input into the random number generation function to generate the target random number for the object grouping; The mapping interval into which the target random number falls is determined as the target mapping interval of the object group, wherein the mapping interval is generated according to the number of bits of the embedded watermark information, the values of each mapping interval are non-overlapping and sequentially continuous, and each mapping interval is associated with at least one watermark bit; Based on the sorting of the target mapping interval corresponding to each object group, the watermark bits extracted from the object group are aggregated into the embedded watermark information.
9. The method according to claim 8, characterized in that, Before aggregating the multiple watermark bits into embedded watermark information, the method further includes: When at least one of the object groups loses the watermark bit, the same interval group of the object group that lost the watermark bit is determined, wherein the same interval group has the same target random number as the object group that lost the watermark bit, and the watermark bit of the same interval group is not lost. Based on a preset threshold value and the watermark bits of the same interval group, the watermark bits lost by the object group that lost the watermark bits are recovered.
10. The method according to claim 6, characterized in that, Determining the original watermark information corresponding to the embedded watermark information includes: Obtain the encryption mapping relationship, which is the mapping relationship between the original watermark information, the embedded watermark information, and the target encoding algorithm, wherein the target encoding algorithm is used to encode the original watermark information; The original watermark information corresponding to the embedded watermark information is determined based on the encryption mapping relationship.
11. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the watermark embedding method as described in any one of claims 1 to 5, or the watermark extraction method as described in claims 6 to 10.
12. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the watermark embedding method as described in any one of claims 1 to 5, or to execute the watermark extraction method as described in any one of claims 6 to 10.
Citation Information
Patent Citations
Vector map watermark method based on object property characteristic
CN101458810A
Electronic chart watermarking method based on space redundancy relation
CN105023235A