WO2020140636A1 - Watermark embedding and extracting methods and apparatuses, and terminal device and medium - Google Patents

Watermark embedding and extracting methods and apparatuses, and terminal device and medium Download PDF

Info

Publication number
WO2020140636A1
WO2020140636A1 PCT/CN2019/118688 CN2019118688W WO2020140636A1 WO 2020140636 A1 WO2020140636 A1 WO 2020140636A1 CN 2019118688 W CN2019118688 W CN 2019118688W WO 2020140636 A1 WO2020140636 A1 WO 2020140636A1
Authority
WO
WIPO (PCT)
Prior art keywords
elements
watermark
preset number
embedding
target file
Prior art date
Application number
PCT/CN2019/118688
Other languages
French (fr)
Chinese (zh)
Inventor
朱照华
王健宗
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020140636A1 publication Critical patent/WO2020140636A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method, device, terminal device, and medium for embedding and extracting watermarks.
  • Digital watermarking technology is a powerful copyright protection method.
  • existing watermarking technologies can be divided into two categories.
  • the first category is visible watermarking technology.
  • visible watermarking can be seen by third parties, although it can To a certain extent, the file is protected, but its own existence is prone to malicious third-party attacks, and sometimes the visible watermark will destroy the original characteristics of the data, such as pictures, audio, and visible watermarks in the document will more or less affect Its visual or auditory effect; the other is the invisible watermarking technology.
  • This watermarking technology is difficult to find its existence except for the embedder, so it can provide better data protection than visible watermarking, and Does not affect the original characteristics of the data.
  • the files embedded with invisible watermark information are currently less resistant to attacks, and it is difficult to recover the watermark when subjected to attack operations such as secondary encoding and audio interception.
  • the embodiments of the present application provide a method, device, terminal device and medium for embedding and extracting watermarks, to solve the problem that the file embedded with invisible watermark information has a poor ability to resist attacks.
  • a first aspect of an embodiment of the present application provides a watermark embedding method, including:
  • Each element in the set of real numbers is embedded in the target file; each element and the function value corresponding to each element are used to extract the watermark information.
  • a second aspect of the embodiments of the present application provides a watermark extraction method, including:
  • the watermark information embedded in the target file is determined according to the function value of the polynomial function when the argument is zero.
  • a third aspect of the embodiments of the present application provides a watermark embedding device, including:
  • a first construction module used to determine the number of polynomial functions to be constructed according to the preset number of divided watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; the polynomial The function value of the function when the argument is zero is the decimal representation of the watermark information;
  • the second building module is used to select multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions;
  • a storage module used to substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element;
  • the embedding module is used to embed each element in the real number set into the target file; each element and the function value corresponding to each element are used to extract the watermark information.
  • a fourth aspect of the embodiments of the present application provides a watermark extraction device, including:
  • An extraction module configured to extract at least a preset number of elements embedded in the target file from the target file
  • An obtaining module configured to obtain a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process
  • a first processing module configured to determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
  • the second processing module is used to determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
  • a fifth aspect of the embodiments of the present application provides a terminal device including a memory and a processor, and the memory stores computer-readable instructions that can run on the processor, and the processor executes the computer When reading the instruction, the watermark embedding method in the first aspect or the watermark extraction method in the second aspect is implemented.
  • a sixth aspect of the embodiments of the present application provides a computer-readable storage medium that stores computer-readable instructions, characterized in that the computer-readable instructions are implemented when executed by at least one processor The watermark embedding method in the first aspect, or implementing the watermark extraction method in the second aspect.
  • the embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element
  • the value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
  • FIG. 1 is an implementation flowchart of a watermark embedding method provided by an embodiment of the present application
  • FIG. 2 is an implementation flowchart of embedding each element in a real number set into a target file in the watermark embedding method provided by an embodiment of the present application;
  • FIG. 3 is a flowchart of an implementation of a musical note instruction in which a binary value corresponding to each element in a real number set is embedded in a MIDI file in the watermark embedding method provided by an embodiment of the present application;
  • FIG. 4 is an implementation flowchart of a watermark extraction method provided by an embodiment of the present application.
  • FIG. 5 is an implementation flowchart of extracting at least a preset number of elements embedded in the target file from the target file in the watermark extraction method provided by an embodiment of the present application;
  • FIG. 6 is a schematic diagram of a watermark embedding device provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a watermark extraction device provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a terminal device provided by an embodiment of the present application.
  • the execution subject of the watermark embedding method and the execution subject of the watermark extraction method may be the same terminal device or different terminal devices, which is not limited herein.
  • a watermark embedding method may be executed on the first terminal device to embed the target file
  • a watermark extraction method may be executed on the first terminal device to perform the watermark extraction on the target file
  • the watermark embedding method may be executed on the first terminal device Embed the watermark of the target file, and execute the watermark extraction method on the second terminal device to extract the watermark of the target file.
  • MIDI commands are organized in the form of MIDI commands in MIDI format files.
  • the corresponding MIDI commands contain the following information: channel number (MIDI), pitch (pitch), velocity (velocity) ), event type (event) and duration (delta).
  • MIDI channel number
  • pitch pitch
  • velocity velocity
  • event type event
  • duration delta
  • the content of the channel number and event type fields are strictly related to MIDI encoding. If it is modified, it may cause encoding errors; the pitch field reflects the sound we can hear in the music.
  • FIG. 1 is an implementation flowchart of a watermark embedding method provided by an embodiment of the present application, and the details are as follows:
  • S101 Determine the number of polynomial functions to be constructed according to the preset number of divisions of the watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; the polynomial function is taken from the independent variable The function value at zero is the decimal representation of the watermark information.
  • the preset number of divided watermark information can be obtained first.
  • the preset division number of the watermark information refers to the number of copies into which the watermark information is divided.
  • the preset division number can be set randomly or according to other rules, which is not limited herein.
  • the number of times the polynomial function to be constructed can be determined according to the relationship and the preset number of divided watermark information. It is possible to select multiple values as coefficients of each item in the polynomial function according to a preset selection rule or randomly.
  • the preset selection rule can be determined according to actual needs and is not limited herein.
  • the polynomial function is used as a watermark information splitter to decompose the watermark information.
  • multiple real values can be randomly selected as elements within a preset value range to form a set of real numbers.
  • the number of elements in the real number set is equal to the preset number of divided watermark information. For example, if the preset number of divided watermark information is 12, then 12 real values can be randomly selected to form a real number set, that is, the real number set contains 12 elements, and each element is a real value.
  • the elements in the real number set are used for embedding in the target file to achieve watermark embedding.
  • the watermark information represents the value in decimal, which can be calculated by the following formula:
  • i 1, 2,... LW ⁇ is the watermark information to be embedded, and LW is the length of the watermark information.
  • each element in the set of real numbers can be used as the value of the unknown quantity of the polynomial function, which is substituted into the polynomial function to calculate the function value of the corresponding polynomial function and save these function values.
  • p is an embedding parameter, which is determined by the actual parameter selected in the embedding process, and is expressed as the number of bits of the element embedded in each note instruction information of the target file, and its value may be 2 by default.
  • each element is different from each other.
  • the reason for setting such a value range is to ensure that all the values of xi have the same length after being converted into binary, so as to facilitate the extraction operation of the watermark. Values outside this range can also be selected in principle, but if selected, additional information is required to record the location information of each watermark, and the extraction process is more cumbersome. For this reason, the value of xi is restricted within this range.
  • the value range of the elements in the real set is determined by the embedded parameters and the length of the watermark information, which can make the elements in the real set have the same length after being converted into binary, which is convenient for determining the length of the elements in the extraction process and facilitating the extraction operation of the elements.
  • For each element xi in the set X embed it in the MIDI file, and for each element yi in the set Y, it can be recorded in the local storage or server for extracting the watermark information.
  • each element can be extracted from the target file, and then the polynomial function in the embedding process is determined according to the function value corresponding to each element and each element recorded, and then the watermark information is determined according to the polynomial function to realize the watermark information. extract.
  • the embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element
  • the value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
  • the target file is a MIDI file.
  • S104 may include:
  • S202 Embed the binary values corresponding to the elements in the real number set into the note instructions in the MIDI file in sequence according to the time order of the note instructions in the MIDI file.
  • the elements in the real number set X can be embedded in order according to the time order of the note instructions in the MIDI file.
  • each element in the real number set X is converted from real values to binary data and then embedded.
  • the note instruction includes a velocity parameter and/or a time identification parameter; as shown in FIG. 3, S202 may include:
  • S301 Determine the bit value corresponding to the velocity parameter and/or the time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein, the bit number value is a binary value corresponding to each element in the real number set One digit of
  • the embedding process of the watermark information in it can be divided into two parts:
  • o j represents the value of the watermark bit to be embedded at this position.
  • o j represents the value of the watermark bit to be embedded at this position
  • dj represents the binary value of the last bit of the time identification parameter.
  • a MIDI note command has a velocity parameter value of 94 and a time stamp parameter value of 1024, and the corresponding binary data are '01011110' and '10000000000', respectively. If '10' is embedded in this note instruction, the embedded parameters become 95 (01011111) and 1024 (10000000000).
  • This embodiment replaces the last bit value of the velocity parameter and/or time identification parameter in each note command with the corresponding bit value.
  • This embedding method modifies the carrier less, which is convenient for embedding, and embeds the watermarked file Basically, it will not be noticed by human ears, and it will not affect the auditory effect of the listener on the MIDI file because of the embedded watermark.
  • FIG. 4 is an implementation flowchart of a watermark extraction method provided by an embodiment of the present application, and the details are as follows:
  • S401 Extract at least a preset number of elements embedded in the target file from the target file.
  • the watermark extraction method requires only a part of embedded elements to perform extraction, where the preset number is the minimum number of elements required for successful extraction of the watermark, and below the preset number, the watermark extraction fails.
  • the preset number can be determined according to the total number of embedded elements.
  • the target file is a MIDI file
  • the note instructions of the MIDI file include velocity parameters and/or time identification parameters; as shown in FIG. 5, S401 may include:
  • S502 Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file.
  • the data length information in the process of embedding the watermark information may include the total number u of elements embedded in the target file, the data length lw of the watermark information, and the embedding parameter p.
  • the data length of each element may be determined according to the data length information in the watermark information embedding process, and then the first sequence and/or the second sequence may be divided.
  • each element in the real number set X is obtained.
  • the relevant information p and u used to calculate the element length are determined in the embedding process and are recorded in the local memory or server for auxiliary extraction.
  • Each element can be obtained by dividing data according to the divided element length in m1 and m2.
  • S503 Select a preset number of elements from each element embedded in the target file.
  • a preset number of elements may be randomly selected from each element embedded in the target file, or a preset number of elements may be selected according to a certain rule, which is not limited herein.
  • the function value corresponding to each element calculated during the watermark information embedding process can be stored in the local memory or the server's database, and at least a preset number can be obtained from the local memory or server during the watermark extraction process The function value corresponding to the element of.
  • S403 Determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements.
  • the polynomial function used as the resolver during the embedding of the watermark information may be determined according to at least a preset number of elements and a function value corresponding to at least the preset number of elements.
  • the polynomial function in the process of embedding the watermark information may be determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
  • S404 Determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
  • the embedding in the watermark information is determined according to at least the preset number of elements and the function value corresponding to at least the preset number of elements.
  • the polynomial function in the process and then determine the watermark information embedded in the target file according to the polynomial function, to achieve the extraction of watermark information.
  • the watermark information can be extracted based on at least a predetermined number of elements, without requiring all elements, and the ability of the watermark to resist attacks can be enhanced, so that the target file can still be intact after being subjected to large changes Extracts the content of the watermark.
  • the embodiment of the present application adopts a MIDI file adaptive watermark embedding method based on the Shamir algorithm, which mainly uses the masking effect of human hearing to watermark the partially redundant code fields and the partially controlled sound information code fields in the MIDI file format coding Embedding, while using the Shamir algorithm to share the watermark in the encoding field of different notes in the MIDI file to enhance the ability of the watermark to resist attacks, so that it can still extract the watermark content from the carrier file after undergoing major changes.
  • the advantages are:
  • the watermark of this method is an invisible watermark, so this method has good invisibility, and malicious third parties cannot judge the existence of the watermark by hearing, so it can provide better copyright protection to some extent.
  • This method disperses and embeds the watermark information into each part of the MIDI music file, and only part of the information can complete the extraction of the watermark information, so even if the file embedded with the watermark information is intercepted or lost due to secondary encoding Part of the information, we can still restore the watermark.
  • the watermark has strong robustness and can resist common attacks, such as secondary encoding, audio interception and other attack operations, so it has good practicality.
  • FIG. 6 shows a schematic diagram of the watermark embedding apparatus provided by the embodiment of the present application. For ease of explanation, only parts related to this embodiment are shown.
  • the device includes a first building module 61, a second building module 62, a storage module 63 and an embedding module 64.
  • the first construction module 61 is used to determine the number of polynomial functions to be constructed according to the preset number of divided watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function;
  • the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information.
  • the second building module 62 is configured to select multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions.
  • the storage module 63 is configured to substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element.
  • the embedding module 64 is configured to embed each element in the real number set into the target file; the each element and the function value corresponding to each element are used to extract the watermark information.
  • the target file is a MIDI file
  • the embedding module 64 is used to:
  • the binary values corresponding to the elements in the real number set are sequentially embedded into the note instructions in the MIDI file according to the chronological order of the note instructions in the MIDI file.
  • the note instructions include velocity parameters and/or time identification parameters; the embedding module 64 is used to:
  • the embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element
  • the value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
  • FIG. 7 shows a schematic diagram of a watermark extraction device provided by an embodiment of the present application. For ease of explanation, only parts related to this embodiment are shown.
  • the device includes an extraction module 71, an acquisition module 72, a first processing module 73 and a second processing module 74.
  • the extraction module 71 is configured to extract at least a preset number of elements embedded in the target file from the target file.
  • the obtaining module 72 is configured to obtain the function value corresponding to the at least a preset number of elements saved during the watermark information embedding process.
  • the first processing module 73 is configured to determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements.
  • the second processing module 74 is configured to determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
  • the target file is a MIDI file
  • the note instructions of the MIDI file include velocity parameters and/or time identification parameters
  • the extraction module 71 is used to:
  • the first processing module 73 is used to:
  • the polynomial function in the process of embedding the watermark information is determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
  • the embedding in the watermark information is determined according to at least the preset number of elements and the function value corresponding to at least the preset number of elements.
  • the polynomial function in the process and then determine the watermark information embedded in the target file according to the polynomial function, to achieve the extraction of watermark information.
  • the watermark information can be extracted based on at least a predetermined number of elements, without requiring all elements, and the ability of the watermark to resist attacks can be enhanced, so that the target file can still be intact after being subjected to large changes Extracts the content of the watermark.
  • the terminal device 8 of this embodiment includes: a processor 80, a memory 81, and computer-readable instructions 82 stored in the memory 81 and executable on the processor 80, such as programs.
  • the processor 80 executes the computer-readable instruction 82, the steps in the above watermark embedding method embodiment are implemented, for example, steps 101 to 104 shown in FIG. 1, and/or the steps in the above watermark extraction method embodiment are implemented, For example, steps 401 to 404 shown in FIG. 4.
  • the functions of the modules/units in the foregoing device embodiments are realized, for example, the functions of the modules 61 to 64 shown in FIG. 6, and/or the modules shown in FIG. 71 to 74 functions.
  • the computer-readable instructions 82 may be divided into one or more modules/units, the one or more modules/units are stored in the memory 81, and executed by the processor 80, To complete this application.
  • the one or more modules/units may be a series of computer-readable instruction instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 82 in the terminal device 8.
  • the terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
  • the terminal device may include, but is not limited to, a processor 80 and a memory 81.
  • FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8, and may include more or fewer components than those illustrated, or a combination of certain components, or different components.
  • the terminal device may further include an input and output device, a network access device, a bus, a display, and so on.
  • the so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8.
  • the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk equipped on the terminal device 8, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device.
  • the memory 81 is used to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 81 can also be used to temporarily store data that has been or will be output.
  • the disclosed device/terminal device and method may be implemented in other ways.
  • the device/terminal device embodiments described above are only schematic.
  • the division of the module or unit is only a logical function division, and in actual implementation, there may be another division manner, such as multiple units Or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain (Synchlink) DRAM
  • RDRAM direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

Watermark embedding and extracting methods and apparatuses, and a terminal device and a medium. The watermark embedding method comprises: determining degree of a polynomial function to be constructed according to a preset number of copies of division of watermark information, selecting multiple numerical values as coefficients of items in the polynomial function, and constructing the polynomial function, wherein a function value of the polynomial function when the independent variable is zero is a decimal representation value of the watermark information (S101); selecting multiple real values as elements to form a real number set, wherein the number of the elements in the real number set is equal to the preset number of copies of division (S102); respectively substituting the elements in the real number set into the polynomial function, and calculating and saving function values corresponding to the elements (S103); embedding the elements in the real number set into a target file, wherein the elements and the function values corresponding to the elements are used for extracting the watermark information (S104). According to the method, the attack resistance of a watermark can be enhanced, so that the content of the watermark can be completely extracted from the target file after the target file undergoes major changes.

Description

一种水印嵌入和提取方法、装置、终端设备及介质Watermark embedding and extracting method, device, terminal equipment and medium
本申请要求于2019年01月04日提交中国专利局、申请号为201910008098.8、发明名称为“一种水印嵌入和提取方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application filed on January 04, 2019, with the application number 201910008098.8 and the invention titled "A watermark embedding and extraction method and terminal device", the entire content of which is incorporated by reference in In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种水印嵌入和提取方法、装置、终端设备及介质。The present application relates to the field of computer technology, and in particular, to a method, device, terminal device, and medium for embedding and extracting watermarks.
背景技术Background technique
版权保护一直都是数字化时代以来被人们所重点关注的问题之一,在如今强调数据与资源共享的时代里,任何上传到互联网中的数据都有被第三者窃取以及篡改的风险,即使这些数据和资源的发行者在发布数据时对于这些数据的使用权进行了说明,但是这些数据遭到第三方非授权的使用后也无法被证明其真正的所有者,因此探寻好的方法进行版权保护是目前数据安全领域的一项重要的研究方向,特别在如今越来越受关注的音乐版权保护领域。Copyright protection has always been one of the issues that people have focused on since the digital age. In today’s era of emphasis on data and resource sharing, any data uploaded to the Internet has the risk of being stolen and tampered by a third party, even if these The issuer of the data and resources explained the right to use the data when publishing the data, but the unauthorized use of third-party data cannot prove its true owner, so explore good methods for copyright protection It is an important research direction in the field of data security, especially in the field of music copyright protection, which is now more and more concerned.
数字水印技术是一种强有力的版权保护方法,目前而言,现有的水印技术可以分为两类,第一类为可见水印技术,顾名思义,可见水印可以被第三方见到,虽然它可以在一定程度上对文件进行保护,但是其本身的存在容易招致恶意第三方的攻击,并且有时候可见水印会破坏数据原本的特征,例如图片、音频以及文档中的可见水印或多或少都会影响其视觉或者听觉效果;另一类为不可见水印技术,这种水印技术除了嵌入者之外其他人很难发现其存在,因此相比可见水印而言其可以对数据提供更好的保护,并且不会影响数据原本的特征。但是目前嵌入不可见水印信息后的文件抵御攻击的能力较差,在受到如二次编码,音频截取等攻击操作时,水印难以恢复。Digital watermarking technology is a powerful copyright protection method. At present, existing watermarking technologies can be divided into two categories. The first category is visible watermarking technology. As the name implies, visible watermarking can be seen by third parties, although it can To a certain extent, the file is protected, but its own existence is prone to malicious third-party attacks, and sometimes the visible watermark will destroy the original characteristics of the data, such as pictures, audio, and visible watermarks in the document will more or less affect Its visual or auditory effect; the other is the invisible watermarking technology. This watermarking technology is difficult to find its existence except for the embedder, so it can provide better data protection than visible watermarking, and Does not affect the original characteristics of the data. However, the files embedded with invisible watermark information are currently less resistant to attacks, and it is difficult to recover the watermark when subjected to attack operations such as secondary encoding and audio interception.
技术问题technical problem
有鉴于此,本申请实施例提供了一种水印嵌入和提取方法、装置、终端设备及介质,以解决目前嵌入不可见水印信息后的文件抵御攻击的能力较差的问题。In view of this, the embodiments of the present application provide a method, device, terminal device and medium for embedding and extracting watermarks, to solve the problem that the file embedded with invisible watermark information has a poor ability to resist attacks.
技术解决方案Technical solution
本申请实施例的第一方面提供了一种水印嵌入方法,包括:A first aspect of an embodiment of the present application provides a watermark embedding method, including:
根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所 述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为水印信息的十进制表示值;Determine the number of polynomial functions to be constructed according to the preset number of divisions of the watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; when the independent variable takes zero The function value is the decimal representation of the watermark information;
选取多个实数值作为元素,组成构建实数集合;所述实数集合中元素的个数等于所述预设划分份数;Selecting multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions;
将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值;Substitute each element in the real number set into the polynomial function, calculate and save the function value corresponding to each element;
将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。Each element in the set of real numbers is embedded in the target file; each element and the function value corresponding to each element are used to extract the watermark information.
本申请实施例的第二方面提供了一种水印提取方法,包括:A second aspect of the embodiments of the present application provides a watermark extraction method, including:
从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素;Extracting at least a preset number of elements embedded in the target file from the target file;
获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值;Obtaining a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process;
根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数;Determining a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。The watermark information embedded in the target file is determined according to the function value of the polynomial function when the argument is zero.
本申请实施例的第三方面提供了水印嵌入装置,包括:A third aspect of the embodiments of the present application provides a watermark embedding device, including:
第一构建模块,用于根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为水印信息的十进制表示值;A first construction module, used to determine the number of polynomial functions to be constructed according to the preset number of divided watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; the polynomial The function value of the function when the argument is zero is the decimal representation of the watermark information;
第二构建模块,用于选取多个实数值作为元素,组成实数集合;所述实数集合中元素的个数等于所述预设划分份数;The second building module is used to select multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions;
存储模块,用于将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值;A storage module, used to substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element;
嵌入模块,用于将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。The embedding module is used to embed each element in the real number set into the target file; each element and the function value corresponding to each element are used to extract the watermark information.
本申请实施例的第四方面提供了水印提取装置,包括:A fourth aspect of the embodiments of the present application provides a watermark extraction device, including:
提取模块,用于从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素;An extraction module, configured to extract at least a preset number of elements embedded in the target file from the target file;
获取模块,用于获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值;An obtaining module, configured to obtain a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process;
第一处理模块,用于根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数;A first processing module, configured to determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
第二处理模块,用于根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文 件的水印信息。The second processing module is used to determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
本申请实施例的第五方面提供了一种终端设备,包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现第一方面中的水印嵌入方法,或者实现第二方面中的水印提取方法。A fifth aspect of the embodiments of the present application provides a terminal device including a memory and a processor, and the memory stores computer-readable instructions that can run on the processor, and the processor executes the computer When reading the instruction, the watermark embedding method in the first aspect or the watermark extraction method in the second aspect is implemented.
本申请实施例的第六方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现第一方面中的水印嵌入方法,或者实现第二方面中的水印提取方法。A sixth aspect of the embodiments of the present application provides a computer-readable storage medium that stores computer-readable instructions, characterized in that the computer-readable instructions are implemented when executed by at least one processor The watermark embedding method in the first aspect, or implementing the watermark extraction method in the second aspect.
有益效果Beneficial effect
本申请实施例通过构建多项式函数以及实数集合,其中多项式函数在自变量取零时的函数值为水印信息的十进制表示值;将实数集合中各个元素嵌入到目标文件中,计算并保存各个元素对应的函数值以便对水印信息进行提取,实现水印信息的嵌入,能够增强水印抵抗攻击的能力,使得在目标文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容。The embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element The value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings used in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only for the application In some embodiments, for those of ordinary skill in the art, without paying creative labor, other drawings may be obtained based on these drawings.
图1是本申请实施例提供的水印嵌入方法的实现流程图;FIG. 1 is an implementation flowchart of a watermark embedding method provided by an embodiment of the present application;
图2是本申请实施例提供的水印嵌入方法中将实数集合中各个元素嵌入到目标文件中的实现流程图;2 is an implementation flowchart of embedding each element in a real number set into a target file in the watermark embedding method provided by an embodiment of the present application;
图3是本申请实施例提供的水印嵌入方法中将实数集合中各个元素对应的二进制数值嵌入到MIDI文件中的音符指令的实现流程图;3 is a flowchart of an implementation of a musical note instruction in which a binary value corresponding to each element in a real number set is embedded in a MIDI file in the watermark embedding method provided by an embodiment of the present application;
图4是本申请实施例提供的水印提取方法的实现流程图;FIG. 4 is an implementation flowchart of a watermark extraction method provided by an embodiment of the present application;
图5是本申请实施例提供的水印提取方法中从目标文件中提取出嵌入到目标文件中的至少预设个数的元素的实现流程图;FIG. 5 is an implementation flowchart of extracting at least a preset number of elements embedded in the target file from the target file in the watermark extraction method provided by an embodiment of the present application;
图6是本申请实施例提供的水印嵌入装置的示意图;6 is a schematic diagram of a watermark embedding device provided by an embodiment of the present application;
图7是本申请实施例提供的水印提取装置的示意图;7 is a schematic diagram of a watermark extraction device provided by an embodiment of the present application;
图8是本申请实施例提供的终端设备的示意图。8 is a schematic diagram of a terminal device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details hindering the description of the present application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to explain the technical solutions described in the present application, the following will be described with specific embodiments.
在本实施例中,水印嵌入方法的执行主体和水印提取方法的执行主体可以为同一终端设备,也可以为不同的终端设备,在此不作限定。例如,可以在第一终端设备上执行水印嵌入方法对目标文件进行水印嵌入,并且在第一终端设备上执行水印提取方法对目标文件进行水印提取;或者可以在第一终端设备上执行水印嵌入方法对目标文件进行水印嵌入,在第二终端设备上执行水印提取方法对目标文件进行水印提取。In this embodiment, the execution subject of the watermark embedding method and the execution subject of the watermark extraction method may be the same terminal device or different terminal devices, which is not limited herein. For example, a watermark embedding method may be executed on the first terminal device to embed the target file, and a watermark extraction method may be executed on the first terminal device to perform the watermark extraction on the target file; or the watermark embedding method may be executed on the first terminal device Embed the watermark of the target file, and execute the watermark extraction method on the second terminal device to extract the watermark of the target file.
为便于说明,以对MIDI文件进行水印嵌入和水印提取为例进行说明。首先对需要说明的参数做一个定义:定义A={a1,a2,…,aLA}为MIDI文件中存储的音符指令信息,包括音符开(Note-on)、音符关(Note-off)两类指令,LA为MIDI文件中音符指令的数量。在一个音符指令当中,通常有两部分的信息可以用作水印的嵌入,分别是力度字段v以及时间标识字段d,其中力度字段的长度为8bit,时间标识字段的长度不确定;需要嵌入的水印信息W={wi=0 or 1|i=1,2,…LW},LW为水印信息的长度。For ease of explanation, take MIDI files for watermark embedding and watermark extraction as an example. First, make a definition of the parameters that need to be explained: define A = {a1, a2, ..., aLA} as the note instruction information stored in the MIDI file, including note-on and note-off Command, LA is the number of note commands in the MIDI file. In a note instruction, there are usually two parts of information that can be used for watermark embedding, namely the velocity field v and the time identification field d, where the length of the velocity field is 8 bits, the length of the time identification field is uncertain; the watermark needs to be embedded Information W={wi=0 or 1|i=1, 2,... LW}, LW is the length of the watermark information.
音乐内容在MIDI格式的文件当中是以MIDI指令的形式组织的,对于一个音符而言,其相应的MIDI指令中包含有如下信息:信道号(MIDI channel)、音高(pitch)、力度(velocity)、事件类型(event type)以及持续时间(delta tine)。在这些信息当中信道号、事件类型字段当中的内容与MIDI编码严格相关,若修改则可能会造成编码错误;音高字段在音乐中反映的是我们可以听到的声音,在MIDI中这个字段的基本单位是半音,因此对这个字段的修改会对最终的音乐效果造成比较大的影响;力度和持续时间这两个字段的基本单位很小,对这两个字段进行小幅度修改一般而言在人耳上是觉察不出来的,所以这两个字段比较适合进行水印嵌入。Music content is organized in the form of MIDI commands in MIDI format files. For a note, the corresponding MIDI commands contain the following information: channel number (MIDI), pitch (pitch), velocity (velocity) ), event type (event) and duration (delta). In these messages, the content of the channel number and event type fields are strictly related to MIDI encoding. If it is modified, it may cause encoding errors; the pitch field reflects the sound we can hear in the music. This field in MIDI The basic unit is a semitone, so the modification of this field will have a greater impact on the final music effect; the basic units of the two fields of velocity and duration are very small, and minor modifications to these two fields are generally in the It is not perceivable on human ears, so these two fields are more suitable for watermark embedding.
图1为本申请实施例提供的水印嵌入方法的实现流程图,详述如下:FIG. 1 is an implementation flowchart of a watermark embedding method provided by an embodiment of the present application, and the details are as follows:
S101,根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为水印信息的十进制表示值。S101: Determine the number of polynomial functions to be constructed according to the preset number of divisions of the watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; the polynomial function is taken from the independent variable The function value at zero is the decimal representation of the watermark information.
在本实施例中,可以首先获取水印信息的预设划分份数。水印信息的预设划分份数是指将水印信息所划分成的份数,该预设划分份数可以随机设置或者按照其他规则设置,在此不 作限定。水印信息的预设划分份数与待构建的多项式函数的次数之间存在关系式,可以根据关系式和水印信息的预设划分份数确定待构建的多项式函数的次数。可以按照预设选取规则或者随机选取多个数值作为多项式函数中各项的系数,其中预设选取规则可根据实际需求确定,在此不作限定。多项式函数用于作为水印信息的分解器对水印信息做分解。In this embodiment, the preset number of divided watermark information can be obtained first. The preset division number of the watermark information refers to the number of copies into which the watermark information is divided. The preset division number can be set randomly or according to other rules, which is not limited herein. There is a relationship between the preset number of divided watermark information and the number of polynomial functions to be constructed. The number of times the polynomial function to be constructed can be determined according to the relationship and the preset number of divided watermark information. It is possible to select multiple values as coefficients of each item in the polynomial function according to a preset selection rule or randomly. The preset selection rule can be determined according to actual needs and is not limited herein. The polynomial function is used as a watermark information splitter to decompose the watermark information.
S102,选取多个实数值作为元素,组成构建实数集合。所述实数集合中元素的个数等于所述预设划分份数。S102. Select multiple real values as elements to form a set of real numbers. The number of elements in the real number set is equal to the preset divided number.
在本实施例中,可以在预设取值范围内随机选取多个实数值作为元素,组成构建实数集合。实数集合中元素的个数等于将水印信息的预设划分份数。例如若水印信息的预设划分份数为12份,则可以随机选取12个实数值组成实数集合,即该实数集合包含12个元素,每个元素为一个实数值。实数集合中的元素用于嵌入到目标文件中,以实现水印嵌入。In this embodiment, multiple real values can be randomly selected as elements within a preset value range to form a set of real numbers. The number of elements in the real number set is equal to the preset number of divided watermark information. For example, if the preset number of divided watermark information is 12, then 12 real values can be randomly selected to form a real number set, that is, the real number set contains 12 elements, and each element is a real value. The elements in the real number set are used for embedding in the target file to achieve watermark embedding.
可选地,所述多项式函数的次数为k-1次,所述实数集合中元素的总个数为u,其中u=2k–1;k为大于1的整数。Optionally, the degree of the polynomial function is k-1, and the total number of elements in the set of real numbers is u, where u=2k-1; k is an integer greater than 1.
在本实施例中,可以首先随机决定将该水印信息划分的份数u,其中u>1,然后随机构建一个k–1次多项式函数f(x),使得f(0)=b,b为水印信息十进制表示值,可以通过下式计算得出:In this embodiment, the number u of the watermark information divided first may be randomly determined, where u>1, and then a k-1 degree polynomial function f(x) is randomly constructed, so that f(0)=b, b is The watermark information represents the value in decimal, which can be calculated by the following formula:
Figure PCTCN2019118688-appb-000001
Figure PCTCN2019118688-appb-000001
其中,W={wi=0 or 1|i=1,2,…LW}为需要嵌入的水印信息,LW为水印信息的长度。Among them, W={wi=0 or 1|i=1, 2,... LW} is the watermark information to be embedded, and LW is the length of the watermark information.
S103,将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值。S103: Substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element.
在本实施例中,可以分别将实数集合中的各个元素作为多项式函数的未知量的值,代入到多项式函数中,计算得到对应的多项式函数的函数值,并保存这些函数值。In this embodiment, each element in the set of real numbers can be used as the value of the unknown quantity of the polynomial function, which is substituted into the polynomial function to calculate the function value of the corresponding polynomial function and save these function values.
可选地,所述实数集合为X={x 1,x 2,…,x u},
Figure PCTCN2019118688-appb-000002
其中,u为所述实数集合中元素的总个数;lw为所述水印信息的数据长度;p为嵌入参数。
Optionally, the set of real numbers is X={x 1 , x 2 ,..., x u },
Figure PCTCN2019118688-appb-000002
Where u is the total number of elements in the real number set; lw is the data length of the watermark information; p is the embedding parameter.
在本实施例中,p为嵌入参数,由嵌入过程中所选取的实际参数决定,表示为目标文件的每一个音符指令信息中间嵌入的元素的位数,其值可以默认为2。另外,在实数集合X中,每一个元素都互不相同。In this embodiment, p is an embedding parameter, which is determined by the actual parameter selected in the embedding process, and is expressed as the number of bits of the element embedded in each note instruction information of the target file, and its value may be 2 by default. In addition, in the real number set X, each element is different from each other.
其中,之所以设定这样的取值范围是为了保证所有xi的值在转化为二进制之后都具有相同的长度,以方便水印的提取操作。对于此范围以外的值原则上也可以选取,不过如果选 取的话需要额外的信息记录每个水印位置信息,提取过程更为繁琐,出于这方面考虑所以将xi取值在该范围内约束。Among them, the reason for setting such a value range is to ensure that all the values of xi have the same length after being converted into binary, so as to facilitate the extraction operation of the watermark. Values outside this range can also be selected in principle, but if selected, additional information is required to record the location information of each watermark, and the extraction process is more cumbersome. For this reason, the value of xi is restricted within this range.
通过嵌入参数和水印信息的长度确定实数集合内元素的取值范围,能够使实数集合内元素转化为二进制后具有相同的长度,便于在提取过程中确定元素的长度,方便对元素的提取操作。The value range of the elements in the real set is determined by the embedded parameters and the length of the watermark information, which can make the elements in the real set have the same length after being converted into binary, which is convenient for determining the length of the elements in the extraction process and facilitating the extraction operation of the elements.
S104,将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。S104: Embed each element in the real number set into the target file; each element and the function value corresponding to each element are used to extract the watermark information.
例如,对于集合X中的每一个元素xi,计算其在f(x)中所对应的值,记做Y={y1,y2,…,yu}。对于集合X中的每一个元素xi,将其嵌入到MIDI文件当中,对于集合Y中的每一个元素yi,可以在本地存储器或服务器中将其记录,用于对水印信息的提取。For example, for each element xi in the set X, calculate its corresponding value in f(x) and write Y={y1, y2, ..., yu}. For each element xi in the set X, embed it in the MIDI file, and for each element yi in the set Y, it can be recorded in the local storage or server for extracting the watermark information.
在水印信息提取过程中,可以从目标文件中提取出各个元素,然后根据各个元素以及记录的各个元素对应的函数值确定嵌入过程中的多项式函数,再根据多项式函数确定水印信息,实现水印信息的提取。In the process of extracting watermark information, each element can be extracted from the target file, and then the polynomial function in the embedding process is determined according to the function value corresponding to each element and each element recorded, and then the watermark information is determined according to the polynomial function to realize the watermark information. extract.
本申请实施例通过构建多项式函数以及实数集合,其中多项式函数在自变量取零时的函数值为水印信息的十进制表示值;将实数集合中各个元素嵌入到目标文件中,计算并保存各个元素对应的函数值以便对水印信息进行提取,实现水印信息的嵌入,能够增强水印抵抗攻击的能力,使得在目标文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容。The embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element The value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
作为本申请的一个实施例,所述目标文件为MIDI文件,如图2所示,S104可以包括:As an embodiment of the present application, the target file is a MIDI file. As shown in FIG. 2, S104 may include:
S201,将所述实数集合中各个元素转换为对应的二进制数值。S201. Convert each element in the real number set to a corresponding binary value.
S202,按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令。S202: Embed the binary values corresponding to the elements in the real number set into the note instructions in the MIDI file in sequence according to the time order of the note instructions in the MIDI file.
在本实施例中,可以按照MIDI文件中音符指令出现的时间顺序依次将实数集合X中的元素嵌入,此处是把实数集合X中各个元素由实数值转换为二进制数据然后嵌入。In this embodiment, the elements in the real number set X can be embedded in order according to the time order of the note instructions in the MIDI file. Here, each element in the real number set X is converted from real values to binary data and then embedded.
作为本申请的一个实施例,所述音符指令包括力度参数和/或时间标识参数;如图3所示,S202可以包括:As an embodiment of the present application, the note instruction includes a velocity parameter and/or a time identification parameter; as shown in FIG. 3, S202 may include:
S301,按照MIDI文件中音符指令的时间顺序确定每个音符指令中力度参数和/或时间标识参数对应的比特位数值;其中,所述比特位数值为所述实数集合中各个元素对应的二进制数值的一位数值;S301: Determine the bit value corresponding to the velocity parameter and/or the time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein, the bit number value is a binary value corresponding to each element in the real number set One digit of
S302,将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值。S302. Replace the last bit value of the velocity parameter and/or time identification parameter in each note instruction with the corresponding bit value.
在本实施例中,对于MIDI文件中的每一个音符指令ai,水印信息在其中的嵌入过程可 以分为两个部分:In this embodiment, for each note instruction ai in the MIDI file, the embedding process of the watermark information in it can be divided into two parts:
对于力度参数v而言,修改其二进制表示的最后一位参数v8,具体的修改过程为For the velocity parameter v, modify the last bit parameter v8 in its binary representation, the specific modification process is
Figure PCTCN2019118688-appb-000003
Figure PCTCN2019118688-appb-000003
其中o j表示该位置所需要嵌入的水印比特位数值。 Where o j represents the value of the watermark bit to be embedded at this position.
对于时间标识参数d而言,采用与力度参数一样的方式进行修改,具体的修改过程为For the time marker parameter d, it is modified in the same way as the force parameter. The specific modification process is
Figure PCTCN2019118688-appb-000004
Figure PCTCN2019118688-appb-000004
其中o j表示该位置所需要嵌入的水印比特位数值,dj表示时间标识参数的最后一位的二进制值。 Where o j represents the value of the watermark bit to be embedded at this position, and dj represents the binary value of the last bit of the time identification parameter.
举例对此嵌入过程进行说明,假设一个MIDI音符指令力度参数值为94,时间标识参数值为1024,其对应的二进制数据分别为’01011110’和’10000000000’。如果在这个音符指令中嵌入’10’,那么嵌入后的参数变为95(01011111)和1024(10000000000)。As an example to illustrate the embedding process, suppose a MIDI note command has a velocity parameter value of 94 and a time stamp parameter value of 1024, and the corresponding binary data are '01011110' and '10000000000', respectively. If '10' is embedded in this note instruction, the embedded parameters become 95 (01011111) and 1024 (10000000000).
本实施例将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值,这种嵌入方式对于载体的修改较小,方便嵌入,并且嵌入水印后的文件基本不会被人耳察觉,不会因为嵌入水印影响听者对MIDI文件的听觉效果。This embodiment replaces the last bit value of the velocity parameter and/or time identification parameter in each note command with the corresponding bit value. This embedding method modifies the carrier less, which is convenient for embedding, and embeds the watermarked file Basically, it will not be noticed by human ears, and it will not affect the auditory effect of the listener on the MIDI file because of the embedded watermark.
图4为本申请实施例提供的水印提取方法的实现流程图,详述如下:FIG. 4 is an implementation flowchart of a watermark extraction method provided by an embodiment of the present application, and the details are as follows:
S401,从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素。S401: Extract at least a preset number of elements embedded in the target file from the target file.
在本实施例中,水印提取过程中,可以首先从目标文件中提取出至少预设个数的元素。其中,本实施例提供的水印提取方法只需要嵌入的部分元素就能实现提取,其中预设个数即为水印成功提取所需的最少元素个数,低于预设个数则水印提取失败。预设个数可以根据嵌入的元素总个数确定。In this embodiment, during the watermark extraction process, at least a preset number of elements may be extracted from the target file. Among them, the watermark extraction method provided in this embodiment requires only a part of embedded elements to perform extraction, where the preset number is the minimum number of elements required for successful extraction of the watermark, and below the preset number, the watermark extraction fails. The preset number can be determined according to the total number of embedded elements.
可选地,所述嵌入到所述目标文件中的元素的总个数为u,所述预设个数为k,其中u=2k–1;k为大于1的整数。Optionally, the total number of elements embedded in the target file is u, and the preset number is k, where u=2k-1; k is an integer greater than 1.
在本实施例中,根据关系式u=2k–1可以由嵌入到目标文件中的元素的总个数确定出预设个数k的值。In this embodiment, the value of the preset number k can be determined from the total number of elements embedded in the target file according to the relationship u=2k-1.
作为本申请的一个实施例,所述目标文件为MIDI文件,所述MIDI文件的音符指令包括力度参数和/或时间标识参数;如图5所示,S401可以包括:As an embodiment of the present application, the target file is a MIDI file, and the note instructions of the MIDI file include velocity parameters and/or time identification parameters; as shown in FIG. 5, S401 may include:
S501,提取MIDI文件中每个音符指令的力度参数的最后一位数值,组成第一序列;和/或,提取MIDI文件中每个音符指令的持续时间参数的最后一位数值,组成第二序列。S501, extract the last digit of the velocity parameter of each note instruction in the MIDI file to form a first sequence; and/or, extract the last digit of the duration parameter of each note instruction in the MIDI file to form a second sequence .
例如,可以提取MIDI文件当中的每一个音符指令的力度参数的最后一位数值,将其进行组合成为一串二进制码m1;提取MIDI文件当中每一个音符指令持续时间参数的最后一位数值,组合出一串二进制序列m2。For example, you can extract the last digit of the velocity parameter of each note command in the MIDI file and combine it into a string of binary codes m1; extract the last digit of the duration parameter of each note command in the MIDI file, combine A series of binary sequences m2 are generated.
S502,根据在水印信息嵌入过程中的数据长度信息对所述第一序列和/或所述第二序列进行划分,得到嵌入到所述目标文件中的各个元素。S502: Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file.
在本实施例中,在水印信息嵌入过程中的数据长度信息可以包括嵌入到目标文件的元素的总个数u、水印信息的数据长度lw以及嵌入参数p。可以根据在水印信息嵌入过程中的数据长度信息确定各元素的数据长度,然后对第一序列和/或第二序列进行划分。In this embodiment, the data length information in the process of embedding the watermark information may include the total number u of elements embedded in the target file, the data length lw of the watermark information, and the embedding parameter p. The data length of each element may be determined according to the data length information in the watermark information embedding process, and then the first sequence and/or the second sequence may be divided.
例如,以MIDI文件为例,可以依次提取嵌入到音符指令信息当中的元素,然后根据元素长度公式
Figure PCTCN2019118688-appb-000005
得到实数集合X中每一个元素,其中,用于计算元素长度的相关信息p和u在嵌入过程中决定后都在本地存储器或服务器记录用作辅佐提取。在m1和m2中根据划分的元素长度进行数据划分即可得到各个元素。
For example, taking a MIDI file as an example, you can sequentially extract the elements embedded in the note instruction information, and then according to the element length formula
Figure PCTCN2019118688-appb-000005
Each element in the real number set X is obtained. Among them, the relevant information p and u used to calculate the element length are determined in the embedding process and are recorded in the local memory or server for auxiliary extraction. Each element can be obtained by dividing data according to the divided element length in m1 and m2.
S503,从嵌入到所述目标文件中的各个元素中选取预设个数的元素。S503: Select a preset number of elements from each element embedded in the target file.
在本实施例中,可以从嵌入到目标文件中的各个元素中随机选取预设个数的元素,或者按照一定规则选取预设个数的元素,在此不作限定。In this embodiment, a preset number of elements may be randomly selected from each element embedded in the target file, or a preset number of elements may be selected according to a certain rule, which is not limited herein.
S402,获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值。S402. Acquire a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process.
在本实施例中,在水印信息嵌入过程中计算出的各元素对应的函数值可以保存在本地存储器中或服务器的数据库中,在水印提取过程中可以从本地存储器或服务器获取至少预设个数的元素对应的函数值。In this embodiment, the function value corresponding to each element calculated during the watermark information embedding process can be stored in the local memory or the server's database, and at least a preset number can be obtained from the local memory or server during the watermark extraction process The function value corresponding to the element of.
例如,在划分的元素中选取k个元素{x1,x2,…,xk}并在本地或服务器查找到其对应的函数值{y1,y2,…,yk}。For example, select k elements {x1, x2, ..., xk} among the divided elements and find their corresponding function values {y1, y2, ..., yk} locally or on the server.
S403,根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数。S403: Determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements.
在本实施例中,可以根据至少预设个数的元素和至少预设个数的元素对应的函数值确定在水印信息嵌入过程中作为分解器的多项式函数。In this embodiment, the polynomial function used as the resolver during the embedding of the watermark information may be determined according to at least a preset number of elements and a function value corresponding to at least the preset number of elements.
可选地,可以根据所述至少预设个数的元素、所述至少预设个数的元素对应的函数值和拉格朗日差值公式确定在水印信息嵌入过程中的多项式函数。Optionally, the polynomial function in the process of embedding the watermark information may be determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
S404,根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。S404: Determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
例如,可以通过公式
Figure PCTCN2019118688-appb-000006
计算多项式函数的公式,其中
Figure PCTCN2019118688-appb-000007
Figure PCTCN2019118688-appb-000008
最后恢复成多项式函数公式的常数项的二进制形式就是水印信息的二进制 值。
For example, you can use the formula
Figure PCTCN2019118688-appb-000006
Formula for calculating polynomial function, where
Figure PCTCN2019118688-appb-000007
Figure PCTCN2019118688-appb-000008
Finally, the binary form of the constant term restored to the polynomial function formula is the binary value of the watermark information.
本申请实施例通过从目标文件中提取出嵌入到目标文件中的至少预设个数的元素,根据至少预设个数的元素和至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数,再根据多项式函数确定嵌入目标文件的水印信息,实现水印信息的提取。本申请实施例根据至少预设个数的元素就能实现对水印信息的提取,而不需要全部元素,能够增强水印抵抗攻击的能力,使得在目标文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容。In this embodiment of the present application, at least a preset number of elements embedded in the target file are extracted from the target file, and the embedding in the watermark information is determined according to at least the preset number of elements and the function value corresponding to at least the preset number of elements. The polynomial function in the process, and then determine the watermark information embedded in the target file according to the polynomial function, to achieve the extraction of watermark information. According to the embodiment of the present application, the watermark information can be extracted based on at least a predetermined number of elements, without requiring all elements, and the ability of the watermark to resist attacks can be enhanced, so that the target file can still be intact after being subjected to large changes Extracts the content of the watermark.
本申请实施例采用一种基于Shamir算法的MIDI文件自适应水印嵌入方法,主要利用人类听觉的掩蔽效应对MIDI文件格式编码中的部分冗余的编码字段以及部分控制声音信息的编码字段进行水印的嵌入,同时利用Shamir算法将水印共享到MIDI文件内不同音符的编码字段当中以增强水印抵抗攻击的能力,使之在载体文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容,优点在于:The embodiment of the present application adopts a MIDI file adaptive watermark embedding method based on the Shamir algorithm, which mainly uses the masking effect of human hearing to watermark the partially redundant code fields and the partially controlled sound information code fields in the MIDI file format coding Embedding, while using the Shamir algorithm to share the watermark in the encoding field of different notes in the MIDI file to enhance the ability of the watermark to resist attacks, so that it can still extract the watermark content from the carrier file after undergoing major changes. The advantages are:
1)该方法水印属于不可见水印,因此该方法有着良好的不可见性,恶意的第三方无法通过听觉判断水印的存在,因此在某种程度上可以提供更加好的版权保护。1) The watermark of this method is an invisible watermark, so this method has good invisibility, and malicious third parties cannot judge the existence of the watermark by hearing, so it can provide better copyright protection to some extent.
2)该方法将水印信息分散嵌入到了MIDI音乐文件的各个部分当中,并只需其中的部分信息便可完成水印信息的提取,因此即使嵌入水印信息后的文件被截取或者因为二次编码损失了部分信息,我们仍可以将水印恢复。该水印有着较强的鲁棒性,可以抵御常见的攻击,例如二次编码,音频截取等攻击操作,因此具有很好的实用性。2) This method disperses and embeds the watermark information into each part of the MIDI music file, and only part of the information can complete the extraction of the watermark information, so even if the file embedded with the watermark information is intercepted or lost due to secondary encoding Part of the information, we can still restore the watermark. The watermark has strong robustness and can resist common attacks, such as secondary encoding, audio interception and other attack operations, so it has good practicality.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
对应于上文实施例所述的水印嵌入方法,图6示出了本申请实施例提供的水印嵌入装置的示意图。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the watermark embedding method described in the above embodiment, FIG. 6 shows a schematic diagram of the watermark embedding apparatus provided by the embodiment of the present application. For ease of explanation, only parts related to this embodiment are shown.
参照图6,该装置包括第一构建模块61、第二构建模块62、存储模块63和嵌入模块64。Referring to FIG. 6, the device includes a first building module 61, a second building module 62, a storage module 63 and an embedding module 64.
第一构建模块61,用于根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为水印信息的十进制表示值。The first construction module 61 is used to determine the number of polynomial functions to be constructed according to the preset number of divided watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; The function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information.
第二构建模块62,用于选取多个实数值作为元素,组成实数集合;所述实数集合中元素的个数等于所述预设划分份数。The second building module 62 is configured to select multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions.
存储模块63,用于将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值。The storage module 63 is configured to substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element.
嵌入模块64,用于将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。The embedding module 64 is configured to embed each element in the real number set into the target file; the each element and the function value corresponding to each element are used to extract the watermark information.
可选地,所述目标文件为MIDI文件,所述嵌入模块64用于:Optionally, the target file is a MIDI file, and the embedding module 64 is used to:
将所述实数集合中各个元素转换为对应的二进制数值;Convert each element in the real number set to a corresponding binary value;
按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令。The binary values corresponding to the elements in the real number set are sequentially embedded into the note instructions in the MIDI file according to the chronological order of the note instructions in the MIDI file.
可选地,所述音符指令包括力度参数和/或时间标识参数;所述嵌入模块64用于:Optionally, the note instructions include velocity parameters and/or time identification parameters; the embedding module 64 is used to:
按照MIDI文件中音符指令的时间顺序确定每个音符指令中力度参数和/或时间标识参数对应的比特位数值;其中,所述比特位数值为所述实数集合中各个元素对应的二进制数值的一位数值;Determine the bit value corresponding to the velocity parameter and/or time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein the bit number value is one of the binary values corresponding to each element in the real number set Digit value
将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值。Replace the last digit of the velocity parameter and/or time identification parameter in each note command with the corresponding digit value.
本申请实施例通过构建多项式函数以及实数集合,其中多项式函数在自变量取零时的函数值为水印信息的十进制表示值;将实数集合中各个元素嵌入到目标文件中,计算并保存各个元素对应的函数值以便对水印信息进行提取,实现水印信息的嵌入,能够增强水印抵抗攻击的能力,使得在目标文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容。The embodiment of the present application constructs a polynomial function and a real number set, where the function value of the polynomial function when the argument is zero is the decimal representation value of the watermark information; embed each element in the real number set into the target file, calculate and save the correspondence of each element The value of the function is used to extract the watermark information and realize the embedding of the watermark information, which can enhance the ability of the watermark to resist attacks, so that the watermark content can be completely extracted from the target file after undergoing large changes.
对应于上文实施例所述的水印提取方法,图7示出了本申请实施例提供的水印提取装置的示意图。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the watermark extraction method described in the above embodiment, FIG. 7 shows a schematic diagram of a watermark extraction device provided by an embodiment of the present application. For ease of explanation, only parts related to this embodiment are shown.
参照图7,该装置包括提取模块71、获取模块72、第一处理模块73和第二处理模块74。Referring to FIG. 7, the device includes an extraction module 71, an acquisition module 72, a first processing module 73 and a second processing module 74.
提取模块71,用于从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素。The extraction module 71 is configured to extract at least a preset number of elements embedded in the target file from the target file.
获取模块72,用于获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值。The obtaining module 72 is configured to obtain the function value corresponding to the at least a preset number of elements saved during the watermark information embedding process.
第一处理模块73,用于根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数。The first processing module 73 is configured to determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements.
第二处理模块74,用于根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。The second processing module 74 is configured to determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
可选地,所述目标文件为MIDI文件,所述MIDI文件的音符指令包括力度参数和/或时间标识参数;所述提取模块71用于:Optionally, the target file is a MIDI file, and the note instructions of the MIDI file include velocity parameters and/or time identification parameters; the extraction module 71 is used to:
提取MIDI文件中每个音符指令的力度参数的最后一位数值,组成第一序列;和/或,提取MIDI文件中每个音符指令的持续时间参数的最后一位数值,组成第二序列;Extract the last digit of the velocity parameter of each note command in the MIDI file to form the first sequence; and/or extract the last digit of the duration parameter of each note command in the MIDI file to form the second sequence;
根据在水印信息嵌入过程中的数据长度信息对所述第一序列和/或所述第二序列进行划分,得到嵌入到所述目标文件中的各个元素;Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file;
从嵌入到所述目标文件中的各个元素中选取预设个数的元素。Select a preset number of elements from each element embedded in the target file.
可选地,所述第一处理模块73用于:Optionally, the first processing module 73 is used to:
根据所述至少预设个数的元素、所述至少预设个数的元素对应的函数值和拉格朗日差值公式确定在水印信息嵌入过程中的多项式函数。The polynomial function in the process of embedding the watermark information is determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
本申请实施例通过从目标文件中提取出嵌入到目标文件中的至少预设个数的元素,根据至少预设个数的元素和至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数,再根据多项式函数确定嵌入目标文件的水印信息,实现水印信息的提取。本申请实施例根据至少预设个数的元素就能实现对水印信息的提取,而不需要全部元素,能够增强水印抵抗攻击的能力,使得在目标文件遭受了较大的改动之后仍可以从中完整的提取出水印的内容。In this embodiment of the present application, at least a preset number of elements embedded in the target file are extracted from the target file, and the embedding in the watermark information is determined according to at least the preset number of elements and the function value corresponding to at least the preset number of elements. The polynomial function in the process, and then determine the watermark information embedded in the target file according to the polynomial function, to achieve the extraction of watermark information. According to the embodiment of the present application, the watermark information can be extracted based on at least a predetermined number of elements, without requiring all elements, and the ability of the watermark to resist attacks can be enhanced, so that the target file can still be intact after being subjected to large changes Extracts the content of the watermark.
图8是本申请一实施例提供的终端设备的示意图。如图8所示,该实施例的终端设备8包括:处理器80、存储器81以及存储在所述存储器81中并可在所述处理器80上运行的计算机可读指令82,例如程序。所述处理器80执行所述计算机可读指令82时实现上述水印嵌入方法实施例中的步骤,例如图1所示的步骤101至104,和/或实现上述水印提取方法实施例中的步骤,例如图4所示的步骤401至404。或者,所述处理器80执行所述计算机可读指令82时实现上述各装置实施例中各模块/单元的功能,例如图6所示模块61至64的功能,和/或图7所示模块71至74的功能。8 is a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 8, the terminal device 8 of this embodiment includes: a processor 80, a memory 81, and computer-readable instructions 82 stored in the memory 81 and executable on the processor 80, such as programs. When the processor 80 executes the computer-readable instruction 82, the steps in the above watermark embedding method embodiment are implemented, for example, steps 101 to 104 shown in FIG. 1, and/or the steps in the above watermark extraction method embodiment are implemented, For example, steps 401 to 404 shown in FIG. 4. Alternatively, when the processor 80 executes the computer-readable instructions 82, the functions of the modules/units in the foregoing device embodiments are realized, for example, the functions of the modules 61 to 64 shown in FIG. 6, and/or the modules shown in FIG. 71 to 74 functions.
示例性的,所述计算机可读指令82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令指令段,该指令段用于描述所述计算机可读指令82在所述终端设备8中的执行过程。Exemplarily, the computer-readable instructions 82 may be divided into one or more modules/units, the one or more modules/units are stored in the memory 81, and executed by the processor 80, To complete this application. The one or more modules/units may be a series of computer-readable instruction instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 82 in the terminal device 8.
所述终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的示例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线、显示器等。The terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server. The terminal device may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art may understand that FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8, and may include more or fewer components than those illustrated, or a combination of certain components, or different components. For example, the terminal device may further include an input and output device, a network access device, a bus, a display, and so on.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific  Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
所述存储器81可以是所述终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk equipped on the terminal device 8, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store the computer-readable instructions and other programs and data required by the terminal device. The memory 81 can also be used to temporarily store data that has been or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In practical applications, the above-mentioned functions may be allocated by different functional units, Module completion means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above integrated unit may use hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the purpose of distinguishing each other, and are not intended to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For a part that is not detailed or recorded in an embodiment, you can refer to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art may realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application of the technical solution and design constraints. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单 元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/terminal device and method may be implemented in other ways. For example, the device/terminal device embodiments described above are only schematic. For example, the division of the module or unit is only a logical function division, and in actual implementation, there may be another division manner, such as multiple units Or components can be combined or integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software function unit.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art may understand that all or part of the process in the method of the foregoing embodiments may be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions may be stored in a non-volatile computer In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the foregoing method embodiments. Wherein, any reference to the memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the foregoing The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. Within the scope of protection of this application.

Claims (20)

  1. 一种水印嵌入方法,其特征在于,包括:A watermark embedding method, characterized in that it includes:
    根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为所述水印信息的十进制表示值;Determine the number of polynomial functions to be constructed according to the preset number of divisions of the watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; when the independent variable takes zero The function value of is the decimal representation value of the watermark information;
    选取多个实数值作为元素,组成实数集合;所述实数集合中元素的个数等于所述预设划分份数;Selecting multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions;
    将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值;Substitute each element in the real number set into the polynomial function, calculate and save the function value corresponding to each element;
    将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。Each element in the set of real numbers is embedded in the target file; each element and the function value corresponding to each element are used to extract the watermark information.
  2. 如权利要求1项所述的水印嵌入方法,其特征在于,所述目标文件为MIDI文件,所述将所述实数集合中各个元素嵌入到目标文件中包括:The watermark embedding method according to claim 1, wherein the target file is a MIDI file, and embedding each element in the real number set into the target file includes:
    将所述实数集合中各个元素转换为对应的二进制数值;Convert each element in the real number set to a corresponding binary value;
    按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令。The binary values corresponding to the elements in the real number set are sequentially embedded into the note instructions in the MIDI file according to the chronological order of the note instructions in the MIDI file.
  3. 如权利要求2所述的水印嵌入方法,其特征在于,所述音符指令包括力度参数和/或时间标识参数;所述按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令包括:The watermark embedding method according to claim 2, wherein the note instruction includes a velocity parameter and/or a time identification parameter; and the elements in the real number set are sequentially corresponding to the chronological order of the note instruction in the MIDI file The note instructions embedded in the binary value of the MIDI file include:
    按照MIDI文件中音符指令的时间顺序确定每个音符指令中力度参数和/或时间标识参数对应的比特位数值;其中,所述比特位数值为所述实数集合中各个元素对应的二进制数值的一位数值;Determine the bit value corresponding to the velocity parameter and/or time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein the bit number value is one of the binary values corresponding to each element in the real number set Digit value
    将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值。Replace the last digit of the velocity parameter and/or time identification parameter in each note command with the corresponding digit value.
  4. 一种水印提取方法,其特征在于,包括:A watermark extraction method, which includes:
    从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素;Extracting at least a preset number of elements embedded in the target file from the target file;
    获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值;Obtaining a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process;
    根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数;Determining a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
    根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。The watermark information embedded in the target file is determined according to the function value of the polynomial function when the argument is zero.
  5. 如权利要求4所述的水印提取方法,其特征在于,所述目标文件为MIDI文件,所述MIDI文件的音符指令包括力度参数和/或时间标识参数;所述从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素包括:The watermark extraction method according to claim 4, wherein the target file is a MIDI file, and the note instructions of the MIDI file include velocity parameters and/or time identification parameters; the extracted from the target file is embedded into The at least preset number of elements in the target file includes:
    提取MIDI文件中每个音符指令的力度参数的最后一位数值,组成第一序列;和/或,提取MIDI文件中每个音符指令的持续时间参数的最后一位数值,组成第二序列;Extract the last digit of the velocity parameter of each note command in the MIDI file to form the first sequence; and/or extract the last digit of the duration parameter of each note command in the MIDI file to form the second sequence;
    根据在水印信息嵌入过程中的数据长度信息对所述第一序列和/或所述第二序列进行划分,得到嵌入到所述目标文件中的各个元素;Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file;
    从嵌入到所述目标文件中的各个元素中选取预设个数的元素。Select a preset number of elements from each element embedded in the target file.
  6. 如权利要求4或5所述的水印提取方法,其特征在于,所述根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数包括:The watermark extraction method according to claim 4 or 5, characterized in that the determination according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements during the watermark information embedding process The polynomial functions of include:
    根据所述至少预设个数的元素、所述至少预设个数的元素对应的函数值和拉格朗日差值公式确定在水印信息嵌入过程中的多项式函数。The polynomial function in the process of embedding the watermark information is determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
  7. 一种水印嵌入装置,其特征在于,包括:A watermark embedding device is characterized by comprising:
    第一构建模块,用于根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为水印信息的十进制表示值;A first construction module, used to determine the number of polynomial functions to be constructed according to the preset number of divided watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; the polynomial The function value of the function when the argument is zero is the decimal representation of the watermark information;
    第二构建模块,用于选取多个实数值作为元素,组成实数集合;所述实数集合中元素的个数等于所述预设划分份数;The second building module is used to select multiple real values as elements to form a real number set; the number of elements in the real number set is equal to the preset number of divisions;
    存储模块,用于将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值;A storage module, used to substitute each element in the real number set into the polynomial function, and calculate and save the function value corresponding to each element;
    嵌入模块,用于将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。The embedding module is used to embed each element in the real number set into the target file; each element and the function value corresponding to each element are used to extract the watermark information.
  8. 如权利要求7所述的水印嵌入装置,其特征在于,所述目标文件为MIDI文件,所述嵌入模块具体用于:The watermark embedding device according to claim 7, wherein the target file is a MIDI file, and the embedding module is specifically used for:
    将所述实数集合中各个元素转换为对应的二进制数值;Convert each element in the real number set to a corresponding binary value;
    按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令。The binary values corresponding to the elements in the real number set are sequentially embedded into the note instructions in the MIDI file according to the chronological order of the note instructions in the MIDI file.
  9. 如权利要求8所述的水印嵌入装置,其特征在于,所述音符指令包括力度参数和/或时间标识参数;所述嵌入模块具体用于:The watermark embedding device according to claim 8, wherein the note instruction includes a velocity parameter and/or a time identification parameter; the embedding module is specifically used to:
    按照MIDI文件中音符指令的时间顺序确定每个音符指令中力度参数和/或时间标识参 数对应的比特位数值;其中,所述比特位数值为所述实数集合中各个元素对应的二进制数值的一位数值;Determine the bit value corresponding to the velocity parameter and/or time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein the bit number value is one of the binary values corresponding to each element in the real number set Digit value
    将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值。Replace the last digit of the velocity parameter and/or time identification parameter in each note command with the corresponding digit value.
  10. 一种水印提取装置,其特征在于,包括:A watermark extraction device is characterized by comprising:
    提取模块,用于从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素;An extraction module, configured to extract at least a preset number of elements embedded in the target file from the target file;
    获取模块,用于获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值;An obtaining module, configured to obtain a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process;
    第一处理模块,用于根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数;A first processing module, configured to determine a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
    第二处理模块,用于根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。The second processing module is configured to determine the watermark information embedded in the target file according to the function value of the polynomial function when the argument is zero.
  11. 如权利要求10所述的水印提取装置,其特征在于,所述目标文件为MIDI文件,所述MIDI文件的音符指令包括力度参数和/或时间标识参数;The watermark extraction device according to claim 10, wherein the target file is a MIDI file, and the note instructions of the MIDI file include velocity parameters and/or time identification parameters;
    所述提取模块71具体用于:The extraction module 71 is specifically used to:
    提取MIDI文件中每个音符指令的力度参数的最后一位数值,组成第一序列;和/或,提取MIDI文件中每个音符指令的持续时间参数的最后一位数值,组成第二序列;Extract the last digit of the velocity parameter of each note command in the MIDI file to form the first sequence; and/or extract the last digit of the duration parameter of each note command in the MIDI file to form the second sequence;
    根据在水印信息嵌入过程中的数据长度信息对所述第一序列和/或所述第二序列进行划分,得到嵌入到所述目标文件中的各个元素;Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file;
    从嵌入到所述目标文件中的各个元素中选取预设个数的元素。Select a preset number of elements from each element embedded in the target file.
  12. 如权利要求10或11所述的水印提取装置,其特征在于,所述第一处理模块具体用于:The watermark extraction device according to claim 10 or 11, wherein the first processing module is specifically used to:
    根据所述至少预设个数的元素、所述至少预设个数的元素对应的函数值和拉格朗日差值公式确定在水印信息嵌入过程中的多项式函数。The polynomial function in the process of embedding the watermark information is determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
  13. 一种终端设备,其特征在于,所述终端设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device, characterized in that the terminal device includes a memory and a processor, and the memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions The following steps are implemented:
    根据水印信息的预设划分份数确定待构建的多项式函数的次数,并选取多个数值作为所述多项式函数中各项的系数,构建所述多项式函数;所述多项式函数在自变量取零时的函数值为所述水印信息的十进制表示值;Determine the number of polynomial functions to be constructed according to the preset number of divisions of the watermark information, and select multiple values as coefficients of each item in the polynomial function to construct the polynomial function; when the independent variable takes zero The function value of is the decimal representation value of the watermark information;
    选取多个实数值作为元素,组成实数集合;所述实数集合中元素的个数等于所述预设 划分份数;Selecting multiple real values as elements to form a set of real numbers; the number of elements in the set of real numbers is equal to the preset number of divisions;
    将所述实数集合中各个元素分别代入所述多项式函数,计算并保存各个元素对应的函数值;Substitute each element in the real number set into the polynomial function, calculate and save the function value corresponding to each element;
    将所述实数集合中各个元素嵌入到目标文件中;所述各个元素和所述各个元素对应的函数值用于对所述水印信息进行提取。Each element in the set of real numbers is embedded in the target file; each element and the function value corresponding to each element are used to extract the watermark information.
  14. 如权利要求13所述的终端设备,其特征在于,所述目标文件为MIDI文件,所述将所述实数集合中各个元素嵌入到目标文件中包括:The terminal device according to claim 13, wherein the target file is a MIDI file, and embedding each element in the set of real numbers into the target file includes:
    将所述实数集合中各个元素转换为对应的二进制数值;Convert each element in the real number set to a corresponding binary value;
    按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令。The binary values corresponding to the elements in the real number set are sequentially embedded into the note instructions in the MIDI file according to the chronological order of the note instructions in the MIDI file.
  15. 如权利要求14所述的终端设备,其特征在于,所述音符指令包括力度参数和/或时间标识参数;所述按照MIDI文件中音符指令的时间顺序依次将所述实数集合中各个元素对应的二进制数值嵌入到所述MIDI文件中的音符指令包括:The terminal device according to claim 14, wherein the note instruction includes a velocity parameter and/or a time identification parameter; and the elements corresponding to each element in the real number set are sequentially assigned in accordance with the time order of the note instruction in the MIDI file The note instructions embedded with binary values in the MIDI file include:
    按照MIDI文件中音符指令的时间顺序确定每个音符指令中力度参数和/或时间标识参数对应的比特位数值;其中,所述比特位数值为所述实数集合中各个元素对应的二进制数值的一位数值;Determine the bit value corresponding to the velocity parameter and/or time identification parameter in each note instruction according to the chronological order of the note instructions in the MIDI file; wherein the bit number value is one of the binary values corresponding to each element in the real number set Digit value
    将每个音符指令中力度参数和/或时间标识参数的最后一位数值替换为对应的比特位数值。Replace the last digit of the velocity parameter and/or time identification parameter in each note command with the corresponding digit value.
  16. 一种终端设备,其特征在于,所述终端设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device, characterized in that the terminal device includes a memory and a processor, and the memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions The following steps are implemented:
    从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素;Extracting at least a preset number of elements embedded in the target file from the target file;
    获取在水印信息嵌入过程中保存的所述至少预设个数的元素对应的函数值;Obtaining a function value corresponding to the at least a preset number of elements saved during the watermark information embedding process;
    根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数;Determining a polynomial function in the process of embedding watermark information according to the at least a preset number of elements and a function value corresponding to the at least a preset number of elements;
    根据所述多项式函数在自变量取零时的函数值确定嵌入所述目标文件的水印信息。The watermark information embedded in the target file is determined according to the function value of the polynomial function when the argument is zero.
  17. 如权利要求16所述的终端设备,其特征在于,所述目标文件为MIDI文件,所述MIDI文件的音符指令包括力度参数和/或时间标识参数;所述从目标文件中提取出嵌入到所述目标文件中的至少预设个数的元素包括:The terminal device according to claim 16, wherein the target file is a MIDI file, and the note instructions of the MIDI file include a velocity parameter and/or a time identification parameter; the extracted from the target file is embedded into the The at least preset number of elements in the target file includes:
    提取MIDI文件中每个音符指令的力度参数的最后一位数值,组成第一序列;和/或,提取MIDI文件中每个音符指令的持续时间参数的最后一位数值,组成第二序列;Extract the last digit of the velocity parameter of each note command in the MIDI file to form the first sequence; and/or extract the last digit of the duration parameter of each note command in the MIDI file to form the second sequence;
    根据在水印信息嵌入过程中的数据长度信息对所述第一序列和/或所述第二序列进行划分,得到嵌入到所述目标文件中的各个元素;Divide the first sequence and/or the second sequence according to the data length information in the process of embedding the watermark information to obtain each element embedded in the target file;
    从嵌入到所述目标文件中的各个元素中选取预设个数的元素。Select a preset number of elements from each element embedded in the target file.
  18. 如权利要求16或17所述的终端设备,其特征在于,所述根据所述至少预设个数的元素和所述至少预设个数的元素对应的函数值确定在水印信息嵌入过程中的多项式函数包括:The terminal device according to claim 16 or 17, wherein the determining of the watermark information embedding process based on the at least a preset number of elements and a function value corresponding to the at least a preset number of elements Polynomial functions include:
    根据所述至少预设个数的元素、所述至少预设个数的元素对应的函数值和拉格朗日差值公式确定在水印信息嵌入过程中的多项式函数。The polynomial function in the process of embedding the watermark information is determined according to the at least a preset number of elements, a function value corresponding to the at least a preset number of elements, and a Lagrange difference formula.
  19. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要求1至3任一项所述方法的步骤。A computer-readable storage medium storing computer-readable instructions, characterized in that, when the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 3 is implemented A step of.
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要求4至6任一项所述方法的步骤。A computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions are executed by a processor to implement the method according to any one of claims 4 to 6. A step of.
PCT/CN2019/118688 2019-01-04 2019-11-15 Watermark embedding and extracting methods and apparatuses, and terminal device and medium WO2020140636A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910008098.8A CN109784006A (en) 2019-01-04 2019-01-04 Watermark insertion and extracting method and terminal device
CN201910008098.8 2019-01-04

Publications (1)

Publication Number Publication Date
WO2020140636A1 true WO2020140636A1 (en) 2020-07-09

Family

ID=66499263

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118688 WO2020140636A1 (en) 2019-01-04 2019-11-15 Watermark embedding and extracting methods and apparatuses, and terminal device and medium

Country Status (2)

Country Link
CN (1) CN109784006A (en)
WO (1) WO2020140636A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109784006A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 Watermark insertion and extracting method and terminal device
CN110517699B (en) * 2019-08-23 2023-05-26 平安科技(深圳)有限公司 Information steganography method, device, equipment and storage medium
CN110619883B (en) * 2019-08-23 2023-05-23 平安科技(深圳)有限公司 Information embedding method, information extracting method, information embedding device, information extracting device, terminal and storage medium
CN112613045B (en) * 2020-11-30 2023-06-06 国网智能电网研究院有限公司 Method and system for embedding data watermark of target data
CN113688601B (en) * 2021-10-26 2022-02-22 北京凯睿数加科技有限公司 Watermark generation method and device based on form, electronic equipment and computer medium
CN116150716B (en) * 2023-04-24 2023-06-30 中国科学技术大学 Database watermark embedding method, extraction method, storage medium and electronic device
CN116975246B (en) * 2023-08-03 2024-04-26 深圳市博锐高科科技有限公司 Data acquisition method, device, chip and terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193280A (en) * 2006-01-23 2007-08-02 Tokyo Univ Of Science Information embedding device, control method of information embedding device, and program
CN101105832A (en) * 2007-08-13 2008-01-16 浙江工业大学 Relational database water mark embed and extraction method based on (t,n) threshold
CN102855425A (en) * 2012-08-13 2013-01-02 贵州大学 Electronic evidence preservation method based on threshold digital signature
CN109784006A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 Watermark insertion and extracting method and terminal device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11327547A (en) * 1998-05-20 1999-11-26 Victor Co Of Japan Ltd Watermark information processor and its method
CN101231742B (en) * 2008-01-08 2011-01-05 北京大学 Apparatus and method for abstracting and imbedding digital watermarking in two value text image
CN101236645A (en) * 2008-02-28 2008-08-06 上海交通大学 Damage-free digital watermarking based image tampering detection and positioning method
CN101847411B (en) * 2010-05-28 2012-05-23 中国科学技术大学 MIDI (Musical Instrument Digital Interface) audio hidden information analysis method and device
CN108665403B (en) * 2017-03-29 2022-06-24 腾讯科技(深圳)有限公司 Digital watermark embedding method, digital watermark extracting method, digital watermark embedding device, digital watermark extracting device and digital watermark system
CN107330306B (en) * 2017-06-28 2020-07-28 百度在线网络技术(北京)有限公司 Text watermark embedding and extracting method and device, electronic equipment and storage medium
CN107798249B (en) * 2017-07-24 2020-02-21 平安科技(深圳)有限公司 Method for releasing behavior pattern data and terminal equipment
CN107885565B (en) * 2017-10-31 2019-02-19 平安科技(深圳)有限公司 Watermark embedding method, device, equipment and the storage medium at the financial interface APP
CN108806657A (en) * 2018-06-05 2018-11-13 平安科技(深圳)有限公司 Music model training, musical composition method, apparatus, terminal and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193280A (en) * 2006-01-23 2007-08-02 Tokyo Univ Of Science Information embedding device, control method of information embedding device, and program
CN101105832A (en) * 2007-08-13 2008-01-16 浙江工业大学 Relational database water mark embed and extraction method based on (t,n) threshold
CN102855425A (en) * 2012-08-13 2013-01-02 贵州大学 Electronic evidence preservation method based on threshold digital signature
CN109784006A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 Watermark insertion and extracting method and terminal device

Also Published As

Publication number Publication date
CN109784006A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
WO2020140636A1 (en) Watermark embedding and extracting methods and apparatuses, and terminal device and medium
Dhawan et al. Analysis of various data security techniques of steganography: A survey
Kumar et al. A recent survey on multimedia and database watermarking
Memon et al. Hybrid watermarking of medical images for ROI authentication and recovery
Bhalerao et al. A secure image watermarking for tamper detection and localization
Al-Nofaie et al. Enhancing Arabic text steganography for personal usage utilizing pseudo-spaces
US7873183B2 (en) Embedding and detecting watermarks based on embedded positions in document layout
Girdhar et al. Comprehensive survey of 3D image steganography techniques
CN110245469B (en) Webpage watermark generation method, watermark analysis method, device and storage medium
Huo et al. A semi-fragile image watermarking algorithm with two-stage detection
CN108961141A (en) Dual Zero watermarking method, system, storage medium and the server of map vector
CN114356919A (en) Watermark embedding method, tracing method and device for structured database
JP4877193B2 (en) Version management system and version management method
CN112434319A (en) Data encryption method and device for electronic file
CN110929230A (en) Work management method, device, equipment and storage medium
Liu et al. Adaptive feature calculation and diagonal mapping for successive recovery of tampered regions
Li et al. Copyright authentication of digital vector maps based on spatial autocorrelation indices
Wang et al. RST invariant fragile watermarking for 2D vector map authentication
WO2024066271A1 (en) Database watermark embedding method and apparatus, database watermark tracing method and apparatus, and electronic device
WO2021120781A1 (en) Picture copyright authentication method and device, and storage medium
CN112989405A (en) Trusted storage method, device, equipment and storage medium for data storage certificate
CN101355428B (en) Method for protecting data integrity using increment checkout
Lin et al. A copyright protection scheme based on PDF
CN116127419A (en) Data processing method, data identification method, font file generation method and device
Chang et al. A blind robust reversible watermark scheme for textual relational databases with virtual primary key

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19906685

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/11/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19906685

Country of ref document: EP

Kind code of ref document: A1