Audio watermark embedding method and apparatus, electronic device, and storage medium
By classifying audio watermark data by attributes and content, and combining encoding rate and spectrum embedding techniques, the problem of audio watermarks being susceptible to interference is solved, achieving higher concealment and integrity.
Patent Information
- Application Number
- CN202411187782.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Existing audio watermark embedding methods are easily affected by audio processing operations, resulting in poor concealment or loss of watermark information and poor embedding effect.
By dividing the watermark attribute data into attributes and content, attribute encoding sequence blocks and watermark content blocks are generated. The target watermark data blocks are embedded into the audio spectrum using a preset encoding rate, and embedding is performed by frequency band division and channel selection. Finally, inverse discrete cosine transform is performed.
It improves the concealment and anti-interference ability of audio watermarks, ensuring that watermark information can still be completely extracted even when some watermarks are damaged or lost, thus enhancing the effect of audio watermark embedding.
Smart Images

Figure CN119152861B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of voice processing, and in particular to an audio watermark embedding method and device, an electronic device, and a storage medium. BACKGROUND
[0002] At present, the audio watermark embedding method usually directly modifies the sampling point data of the audio signal, and embeds the audio watermark information into the least significant bit of each sampling point. For example, in the insurance claim process, the insurance company may receive multiple audio evidences from different channels. In order to confirm the source and authenticity of the audio evidences, a watermark containing timestamp, device number, and key information (such as transaction amount, part of the account number) of the transaction is embedded in the recording process. However, this method is susceptible to audio processing operations (such as compression, filtering, etc.), which makes the watermark concealment worse, and even loses the watermark information, resulting in poor effect of audio watermark embedding. Therefore, how to improve the effect of audio watermark embedding has become a problem to be solved. SUMMARY
[0003] The main purpose of the embodiments of the present application is to provide an audio watermark embedding method and device, an electronic device, and a storage medium, which aims to improve the effect of audio watermark embedding.
[0004] To achieve the above purpose, the first aspect of the embodiments of the present application provides an audio watermark embedding method, which comprises:
[0005] Obtaining original watermark data; wherein the original watermark data comprises watermark attribute data and watermark content data;
[0006] Dividing the watermark attribute data by attribute to obtain a watermark attribute block, and dividing the watermark content data by content to obtain a watermark content block;
[0007] Encoding the watermark attribute block to obtain an attribute encoding sequence block;
[0008] Merging the attribute encoding sequence block and the watermark content block to obtain a target watermark data block;
[0009] Obtaining an original audio and obtaining a target spectrum by obtaining the spectrum of the original audio;
[0010] Embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain a target audio.
[0011] In some embodiments, the step of embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain a target audio comprises:
[0012] selecting a target spectrum segment from the target spectrum; the target spectrum segment is used to represent a spectrum segment to be embedded by the target watermark data block;
[0013] dividing the target spectrum segment into target spectrum bands;
[0014] embedding the target watermark data block into the target spectrum bands according to the encoding rate, to obtain an embedded watermark spectrum;
[0015] performing inverse discrete cosine transform on the embedded watermark spectrum, to obtain the target audio.
[0016] In some embodiments, the embedding the target watermark data block into the target spectrum bands according to the encoding rate, to obtain an embedded watermark spectrum, comprises:
[0017] obtaining a first channel and a second channel; the first channel is used to represent that an encoding result of the target watermark data block is zero, and embedding of the target watermark data block is implemented through even channels; the second channel is used to represent that the encoding result of the target watermark data block is not zero, and embedding of the target watermark data block is implemented through odd channels;
[0018] embedding the target watermark data block into the target spectrum bands according to the encoding rate and the first channel, to obtain an embedded watermark spectrum; or embedding the target watermark data block into the target spectrum bands according to the encoding rate and the second channel, to obtain an embedded watermark spectrum.
[0019] In some embodiments, the encoding processing of the watermark attribute block, to obtain an attribute encoding sequence block, comprises:
[0020] performing a flip operation on the watermark attribute block, to obtain a flipped sequence block;
[0021] splicing the flipped sequence block and the corresponding watermark attribute block, to obtain a palindrome sequence block;
[0022] encoding the palindrome sequence block, to obtain the attribute encoding sequence block.
[0023] In some embodiments, the attribute division of the watermark attribute data, to obtain a watermark attribute block, and the content division of the watermark content data, to obtain a watermark content block, comprises:
[0024] compressing the watermark attribute data, to obtain compressed watermark attribute data; and compressing the watermark content data, to obtain compressed watermark content data;
[0025] The compressed watermark attribute data is binary converted to obtain a binary watermark attribute sequence; and the compressed watermark content data is binary converted to obtain a binary watermark content sequence.
[0026] The binary watermark attribute sequence is divided into data length blocks according to a preset data length to obtain the watermark attribute blocks; and the binary watermark content sequence is divided into data length blocks according to a preset data length to obtain the watermark content blocks.
[0027] In some embodiments, after the target audio is obtained by embedding the target watermark data block into the target frequency spectrum according to the preset encoding rate, the method further comprises:
[0028] performing a discrete cosine transform on the target audio to obtain the target frequency spectrum;
[0029] performing a decoding operation on the target frequency spectrum to obtain a decoded watermark attribute block;
[0030] searching for a corresponding watermark content block according to the decoded watermark attribute block;
[0031] splicing the watermark content blocks to obtain a binary audio watermark block;
[0032] performing a decompression operation on the binary audio watermark block to obtain the original watermark data.
[0033] In some embodiments, the decoding operation on the target frequency spectrum to obtain the decoded watermark attribute block comprises:
[0034] performing an attribute watermark detection on the target frequency spectrum to obtain a detected watermark attribute block;
[0035] performing a palindrome recognition on the detected watermark attribute block to obtain a palindrome watermark attribute block;
[0036] performing a position detection on the palindrome watermark attribute block to obtain a palindrome watermark attribute block position;
[0037] obtaining an encoding order of the palindrome watermark attribute block according to the palindrome watermark attribute block position;
[0038] decoding the detected watermark attribute block according to the encoding order to obtain the decoded watermark attribute block.
[0039] To achieve the above object, a second aspect of the embodiment of the present application provides an audio watermark embedding device, which comprises:
[0040] a watermark data acquisition module configured to acquire original watermark data; wherein the original watermark data comprises watermark attribute data and watermark content data;
[0041] an attribute and content division module, configured to divide the watermark attribute data to obtain watermark attribute blocks, and divide the watermark content data to obtain watermark content blocks;
[0042] a watermark encoding module, configured to encode the watermark attribute blocks to obtain attribute encoding sequence blocks;
[0043] a watermark merging module, configured to merge the attribute encoding sequence blocks and the watermark content blocks to obtain target watermark data blocks;
[0044] an audio spectrum acquisition module, configured to acquire an original audio, and acquire a spectrum of the original audio to obtain a target spectrum;
[0045] a watermark embedding module, configured to embed the target watermark data blocks into the target spectrum according to a preset encoding rate to obtain a target audio.
[0046] To achieve the above object, a third aspect of embodiments of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the method of the first aspect when executing the computer program.
[0047] To achieve the above object, a fourth aspect of embodiments of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, and the computer program implementing the method of the first aspect when executed by a processor.
[0048] The audio watermarking embedding method, apparatus, electronic device, and storage medium proposed in this application involve: acquiring original watermark data, wherein the original watermark data includes watermark attribute data and watermark content data; dividing the watermark attribute data into attribute blocks to obtain watermark attribute blocks, and dividing the watermark content data into content blocks to obtain watermark content blocks; encoding the watermark attribute blocks to obtain attribute encoding sequence blocks; merging the attribute encoding sequence blocks and the watermark content blocks to obtain a target watermark data block; acquiring original audio and obtaining the spectrum of the original audio to obtain a target spectrum; and embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain the target audio. This application firstly standardizes the subsequent audio watermark embedding process by dividing the watermark attribute data into attributes and the watermark content data into content, thus simplifying the embedding process. Secondly, by encoding the watermark attribute blocks, the audio watermark can be identified even when its position in the audio signal shifts, improving the concealment of the audio watermark embedding. The attribute encoding sequence block is then merged with the watermark content block to generate the audio watermark to be embedded. Finally, the target watermark data block is embedded into the target spectrum according to the encoding rate to obtain the target audio. This allows for repeated embedding of the audio watermark into the audio, and even when part of the audio watermark is damaged or lost, the complete watermark information can still be extracted from the remaining audio, further improving the effectiveness of the audio watermark embedding. Attached Figure Description
[0049] Figure 1 This is a flowchart of the audio watermark embedding method provided in the embodiments of this application;
[0050] Figure 2 yes Figure 1 The flowchart of step S102 in the document;
[0051] Figure 3 yes Figure 1 The flowchart of step S103 in the process;
[0052] Figure 4 yes Figure 1 The flowchart of step S106 in the process;
[0053] Figure 5 yes Figure 4 The flowchart of step S403 in the process;
[0054] Figure 6 This is another flowchart of the audio watermark embedding method provided in the embodiments of this application;
[0055] Figure 7 yes Figure 6 The flowchart of step S602 in the document;
[0056] Figure 8is a structural schematic diagram of an audio watermark embedding device provided by an embodiment of the present application.
[0057] Figure 9 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0059] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0061] Based on this, the embodiments of the present application provide an audio watermark embedding method and device, an electronic device and a storage medium, aiming to improve the audio watermark embedding effect.
[0062] The audio watermark embedding method and device, the electronic device and the storage medium provided by the embodiments of the present application are specifically described by the following embodiments. First, the audio watermark embedding method in the embodiments of the present application is described.
[0063] The audio watermark embedding method provided by the embodiments of the present application relates to the technical field of speech processing. The audio watermark embedding method provided by the embodiments of the present application can be applied in a terminal, can be applied in a server end, and can also be software running in a terminal or a server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as an independent physical server, can be configured as a server cluster or a distributed system composed of multiple physical servers, can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform; and the software can be an application for implementing the audio watermark embedding method, etc., but is not limited to the above forms.
[0064] The application is operable in a variety of general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments, and / or configurations that can be suitable for use with the application include personal computers, server computers, handheld or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0065] Figure 1 is an optional flowchart of an audio watermark embedding method provided by an embodiment of the application, Figure 1 The method in the above embodiment can include, but is not limited to, steps S101 to S106.
[0066] Step S101, obtaining original watermark data; wherein the original watermark data includes watermark attribute data and watermark content data.
[0067] Step S102, performing attribute division on the watermark attribute data to obtain a watermark attribute block, and performing content division on the watermark content data to obtain a watermark content block.
[0068] Step S103, performing encoding processing on the watermark attribute block to obtain an attribute encoding sequence block.
[0069] Step S104, merging the attribute encoding sequence block and the watermark content block to obtain a target watermark data block.
[0070] Step S105, obtaining an original audio and obtaining a spectrum of the original audio to obtain a target spectrum.
[0071] Step S106, embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain a target audio.
[0072] The steps S101 to S106 shown in the embodiments of the present application are as follows: obtaining original watermark data; wherein the original watermark data comprises watermark attribute data and watermark content data; performing attribute division on the watermark attribute data to obtain a watermark attribute block, and performing content division on the watermark content data to obtain a watermark content block; performing encoding processing on the watermark attribute block to obtain an attribute encoding sequence block; merging the attribute encoding sequence block and the watermark content block to obtain a target watermark data block; obtaining an original audio and obtaining a target spectrum by obtaining a spectrum of the original audio; and embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain a target audio. The present application first performs attribute division on the watermark attribute data and content division on the watermark content data, which helps to standardize the subsequent audio watermark embedding process and simplifies the embedding of the audio watermark. Second, the watermark attribute block is encoded, so that the audio watermark can be identified even if the position of the audio watermark in the audio signal is shifted, thereby improving the concealment of the audio watermark embedding. The attribute encoding sequence block and the watermark content block are merged to generate the audio watermark to be embedded. Finally, the target watermark data block is embedded into the target spectrum according to the encoding rate to obtain the target audio, which can repeatedly embed the audio watermark into the audio. In the case of partial audio watermark damage or loss, complete watermark information can still be extracted from the remaining audio, thereby further improving the effect of audio watermark embedding.
[0073] In step S101 of some embodiments, specifically, the original watermark data refers to watermark data to be embedded in the original audio, including watermark attribute data and watermark content data; wherein the watermark attribute data refers to indication data to be embedded with the watermark; and the watermark content data refers to actual watermark data to be embedded in the audio.
[0074] For example, in insurance claims, the watermark content data can be user identity information, a timestamp, a transaction amount, and part of a transaction account number, etc. of the insurance claims recording; and the watermark attribute data can be embedding length and embedding strength, etc. indicating the content of the claims.
[0075] Further, the user identity information can ensure the source of the claims request, the timestamp can accurately record the occurrence time of the insurance claims recording, which helps to determine the time sequence of the event and prevent claims fraud, the watermark of the transaction amount can ensure the accuracy of the claims amount and prevent the amount from being tampered with during transmission, and the transaction account number can partially hide the account information while providing sufficient data for identity verification and transaction tracking.
[0076] Specifically, the original watermark data can be obtained from a database, and the database can be a background database of an enterprise.
[0077] Please refer to Figure 2In some embodiments, step S102 can include, but is not limited to, steps S201 to S203:
[0078] Step S201, compressing the watermark attribute data to obtain compressed watermark attribute data; and compressing the watermark content data to obtain compressed watermark content data.
[0079] Step S202, performing binary conversion on the compressed watermark attribute data to obtain a binary watermark attribute sequence; and performing binary conversion on the compressed watermark content data to obtain a binary watermark content sequence.
[0080] Step S203, dividing the binary watermark attribute sequence into data length blocks according to a preset data length to obtain watermark attribute blocks; and dividing the binary watermark content sequence into data length blocks according to a preset data length to obtain watermark content blocks.
[0081] In step S201 of some embodiments, specifically, a compressor is defined, and the watermark attribute data is transmitted to the compressor to perform a compression operation to obtain the compressed watermark attribute data.
[0082] Specifically, the compressor can be initialized, and the compression level, compression method, window size, and compression strategy of the initialized compressor are defined, and the compressor is generated according to the defined parameters. The compression level has a value range of 0 to 9, indicating that the compression degree is from no compression to maximum compression; the compression method indicates that the DEFLATE compression algorithm is used for compression; the window size usually has a value of -15 to -8, wherein -15 indicates that the default window size (i.e., maximum compression) is used, and other values can be used to specify a custom window size; the compression strategy includes a default strategy and a filter strategy.
[0083] Further, the watermark attribute data is pointed to by using the compressor pointer, the data to be compressed is passed to the compressor, and the compression size of the watermark attribute data is determined; based on the compression size, the compression level, the compression method, the window size, the compression strategy, and the compressor, a compression operation is performed to obtain the compressed watermark attribute data.
[0084] The compressor initialization can be implemented by a deflate_init2 function, the compressor pointer can be a zs.next_in function, the starting data of the watermark attribute data to be compressed can be determined by the zs.next_in function, and the size of the watermark attribute data to be compressed can be determined by the zs.avail_in function; further, the zs.next_out function is used to point to the starting position of the buffer for storing the compressed data, i.e., the compressed data is written into the buffer, the compressed data stored in the buffer is written into an output file or an output stream, and finally the compressed watermark attribute data is output.
[0085] Specifically, the method for compressing the watermark content data to obtain compressed watermark content data is consistent with the method for compressing the watermark attribute data to obtain compressed watermark attribute data, which will not be described herein again.
[0086] In this embodiment, by compressing the watermark attribute data and the watermark content data, the data volume of the watermark attribute data and the watermark content data can be reduced, the transmission efficiency of the data can be improved, the compression level, the compression method, the window size, and the compression strategy can be configured in the compression process, the compression effect of the data compression can be improved, and thus the efficiency and the effect of subsequent audio embedding can be improved.
[0087] In step S202 of some embodiments, the binary watermark attribute sequence refers to a sequence of watermark attributes described by binary; and the binary watermark content sequence refers to a sequence of watermark content described by binary.
[0088] Specifically, each byte sequence can be converted into a binary representation form by traversing the byte sequence of the compressed watermark attribute data and performing binary encoding on each byte sequence by using a preset tool.
[0089] Specifically, the preset tool can be a binary encoding conversion tool such as utf-8, utf-32, Punycode, or Base64.
[0090] For example, each byte can be converted into an octal representation binary string or a hexadecimal representation binary string.
[0091] Specifically, the method for converting the compressed watermark content data into binary to obtain the binary watermark content sequence is consistent with the method for converting the compressed watermark attribute data into binary to obtain the binary watermark attribute sequence, which will not be described herein again.
[0092] In this embodiment, by converting the compressed watermark attribute data into binary and converting the compressed watermark content data into binary, the data can be standardized, which helps to improve the efficiency of subsequent encoding, and also reduces the data transmission errors in the data transmission process.
[0093] In step S203 of some embodiments, the watermark attribute block refers to a data block obtained by encapsulating the watermark attribute data divided according to the attribute data length; the watermark content block refers to a data block obtained by encapsulating the watermark content data divided according to the content data length; and each watermark attribute block has a corresponding watermark content block.
[0094] Specifically, the preset data length is used to represent the length of each data block when the data is divided into multiple data blocks, and the data length of each data block is equal.
[0095] Specifically, the binary watermark attribute sequence is divided into data length blocks according to the data length, and a plurality of watermark attribute blocks are obtained.
[0096] For example, if the watermark attribute sequence contains 19 byte sequences and the data length is 2 byte sequence lengths, the watermark attribute sequence is divided into 10 watermark attribute blocks. Since the 10th watermark attribute block has only 1 byte sequence, it is less than 2 byte sequence lengths, and zero can be filled at the end until it reaches 2 byte sequence lengths (the 19th byte sequence is 01101100, and one byte sequence is filled as 00000000).
[0097] Specifically, the binary watermark content sequence is divided into data length blocks according to the preset data length, and the method of obtaining the watermark content block is consistent with the method of dividing the binary watermark attribute sequence into data length blocks according to the preset data length. Here, it is not repeated.
[0098] In this embodiment, the binary watermark attribute sequence is divided into data length blocks according to the preset data length, and the binary watermark content sequence is divided into data length blocks according to the preset data length. The data is divided into equal length data blocks, and when the length of the data block is insufficient, zero filling processing is performed to ensure the alignment and completeness of the data block during transmission, improve the data transmission rate, and divide the data into multiple data blocks. The data block can be batch processed, which helps to improve the efficiency of subsequent audio encoding.
[0099] Please refer to Figure 3 In some embodiments, step S103 can include but is not limited to steps S301 to S303:
[0100] Step S301, performing a flip operation on the watermark attribute block to obtain a flip sequence block.
[0101] Step S302, splicing the flip sequence block and its corresponding watermark attribute block to obtain a palindrome sequence block;
[0102] Step S303, encoding the palindrome sequence block to obtain an attribute encoding sequence block.
[0103] In step S301 of some embodiments, specifically, the flip sequence block refers to the sequence block after the watermark attribute block is flipped.
[0104] For example, if the watermark attribute block is 01010011, the flip sequence block after flipping is 11001010.
[0105] In step S302 of some embodiments, the palindrome sequence block refers to the sequence block obtained by splicing the watermark attribute block and the flip sequence block.
[0106] For example, the watermark attribute block is 01010011, the flip sequence block is 11001010, and the palindrome sequence block is 0101001111001010.
[0107] In step S303 of some embodiments, specifically, the watermark attribute block is encoded in a binary palindrome manner, that is, the palindrome sequence is encoded, wherein the encoding length of the watermark attribute block is L1, and the total length of the palindrome sequence encoding is 2*L1; and L1 can be determined based on the length of the binary string, and can generally be 8, 16, 32, or 64, etc.
[0108] For example: the binary representation of the first palindrome sequence block is H1, the binary of the second palindrome sequence block is H2, and the binary representation of the third palindrome sequence block is H3, and the attribute encoding sequence block can be:
[0109] H1=10...0000|0000...01; H2=01...0000|0000...10; H3=11...0000|0000...11, wherein 10...0000 is a watermark encoding block with a length of L1; 0000...01 is a flip sequence block with a length of L1; H1=10...0000|0000...01 is a palindrome sequence block with a length of 2*L1.
[0110] In this embodiment, by encoding the palindrome sequence block, the encoding of the palindrome sequence block is realized, so that in subsequent audio watermark embedding, if the position of the watermark in the audio signal is shifted, it can also be accurately identified, and the concealment of the audio watermark embedding is improved.
[0111] In step S104 of some embodiments, the target watermark data block is used to represent the data block obtained by merging the attribute encoding sequence block and the watermark content block.
[0112] For example, in insurance claim settlement, the watermark content block contains user identity information, timestamp, transaction amount, and part of the digits of the transaction account number of the insurance claim settlement recording; the watermark attribute data contains data indicating the embedding length and embedding method (such as periodic embedding) of the claim content; and the target watermark data block contains the user identity information, timestamp, transaction amount, and part of the digits of the transaction account number of the insurance claim settlement recording embedded by the periodic embedding method and 6-character sequence embedding length.
[0113] For example, since the watermark data block and the attribute encoding sequence block are both through binary representation, the target watermark data block can be Ha=H1|h1=10...0000|0000...01|10...1100; wherein h1 represents the watermark content block corresponding to H1; Hb=H2|h2=01...0000|0000...10|10...0011; wherein h2 represents the watermark content block corresponding to H2; Hc=H3|h3=11...0000|0000...11|10...1001; wherein h3 represents the watermark content block corresponding to H3, and the length of these watermark content blocks is L1.
[0114] In step S105 of some embodiments, the original audio refers to audio data that needs to be embedded with a watermark, which can be determined based on actual business and is not limited here.
[0115] For example, in the financial field, the original audio can be insurance claim recording audio from different channels or transaction audio of users consulting and purchasing financial products, etc.
[0116] Specifically, the original audio can also be obtained from a database, and the database can be a background database of an enterprise.
[0117] Specifically, the target spectrum is a frequency spectrum representing the original audio.
[0118] Specifically, since the audio signal of the original audio is continuous, before obtaining the spectrum of the original audio, it is usually necessary to divide it into multiple shorter frames for processing, and each frame contains a certain number of sampling points, and there can be overlap between frames. Therefore, by pre-emphasizing the original audio, the audio signal of the original audio is divided into frames according to the set time length, the audio frame signal of each frame of the original audio is obtained, and the audio frame signal is windowed to increase the connectivity between the left end and the right end of the frame in the audio frame signal, making the connection between the audio frame signals more continuous, and a more accurate spectrum can be obtained.
[0119] For example, the original audio data can be cut according to a frame window length of 0.025s from the starting position of the original audio, and after each cutting, the audio frame is moved forward by a distance of 0.01s frame shift until the end position of the original audio is reached, and the processing of the original audio is determined to be completed.
[0120] Further, the windowed audio frame signal is subjected to discrete cosine transform processing to generate a target spectrum corresponding to the original audio.
[0121] Specifically, the original audio can be subjected to discrete cosine transform operation through the following formula:
[0122]
[0123] wherein X(u) represents the target spectrum of the u-th frame; u represents the frame number of the target spectrum; n represents the frame number of the original audio; N represents the frame size in the original audio; and x(n) represents the original audio of the n-th frame.
[0124] In this embodiment, the target spectrum is obtained by obtaining the spectrum of the original audio, lossless compression of the audio can be realized, the transformation of the audio is accurately represented to maintain the quality of the original audio, and the effect of audio watermark embedding can still be ensured in subsequent audio watermark embedding.
[0125] Referring to Figure 4 In some embodiments, step S106 can include but is not limited to steps S401 to S404.
[0126] Step S401: selecting a target spectrum segment from the target spectrum; the target spectrum segment is used to represent a spectrum segment in which the target watermark data block is to be embedded.
[0127] Step S402: performing frequency band division on the target spectrum segment to obtain a target spectrum band.
[0128] Step S403: embedding the target watermark data block into the target spectrum band according to the encoding rate to obtain an embedded watermark spectrum.
[0129] Step S404: performing inverse discrete cosine transformation on the embedded watermark spectrum to obtain a target audio.
[0130] In step S401 of some embodiments, the target spectrum segment is used to represent a spectrum segment in which the target watermark data block is to be embedded.
[0131] Specifically, the spectrum segment can be determined according to an actual scenario.
[0132] For example, in order not to affect the quality of the original audio, a spectrum segment in a 2000Hz to 3000Hz region can be selected as the target spectrum segment, which covers the intersection of vowels and consonants, because the human ear is least sensitive to the spectrum segment in this region and has the least impact on the quality of the original audio.
[0133] In this embodiment, by selecting the target spectrum segment from the target spectrum, the spectrum segment covering the intersection of vowels and consonants can be determined, which helps to retain the basic characteristics of the original audio, so that the original audio remains identifiable during the audio watermark embedding process. In addition, since the spectrum segment is not the most sensitive region of the human ear, speech watermark embedding in this spectrum segment can achieve a higher compression rate without significantly affecting the auditory perception, which helps to retain the naturalness and intelligibility of the original audio, and further improves the effect of audio watermark embedding.
[0134] In step S402 of some embodiments, the target spectrum band refers to a spectrum band obtained by dividing the target spectrum segment.
[0135] Specifically, the target spectrum band can be determined based on the frequency resolution requirement.
[0136] For example, the target spectrum segment is 2000Hz to 3000Hz, and the required frequency resolution is 50Hz. Then, the target spectrum segment 3000Hz-2000Hz is divided by the frequency resolution 50Hz, obtaining 20, which indicates that the target spectrum segment is divided into 20 spectrum bands with equal width, and each spectrum band has a width of 50Hz.
[0137] Specifically, the larger the spectrum band width, the finer the target spectrum segment is divided, the better the listening experience, but the difficulty of recognition increases. The smaller the spectrum band width, the coarser the division, the worse the listening experience, but the difficulty of recognition decreases. In order to avoid the above situation, 50Hz can be selected as the spectrum band width.
[0138] In step S403 of some embodiments, the encoding rate is used to represent the period of embedding the watermark into the target spectrum. The embedded watermark spectrum refers to the spectrum containing the watermark data.
[0139] For example, the encoding rate of the target watermark data block embedded in the target spectrum band is 0.15s, which means that the watermark encoding embedding operation is performed once every 0.15s. The frame shift in the watermark embedding process is 0.01s. The encoding rate 0.15s is divided by the frame shift 0.01s, obtaining 15 frames of watermark that need to be embedded, which means that the target watermark data block performs encoding embedding operation once every 15 frames.
[0140] Please refer to Figure 5 In some embodiments, step S403 can further include but is not limited to steps S501 to S502:
[0141] Step S501, obtaining a first channel and a second channel; the first channel is used to represent that the encoding result of the target watermark data block is zero, and the embedding of the target watermark data block is realized through an even channel; the second channel is used to represent that the encoding result of the target watermark data block is not zero, and the embedding of the target watermark data block is realized through an odd channel.
[0142] Step S502, embedding the target watermark data block into the target spectrum band according to the encoding rate and the first channel to obtain the embedded watermark spectrum; or embedding the target watermark data block into the target spectrum band according to the encoding rate and the second channel to obtain the embedded watermark spectrum.
[0143] In step S501 of some embodiments, the first channel is used to represent that the encoding result of the target watermark data block is zero, and the embedding of the target watermark data block is realized through even channels; the second channel is used to represent that the encoding result of the target watermark data block is not zero, and the embedding of the target watermark data block is realized through odd channels, and the first channel and the second channel both include odd channels and even channels.
[0144] For example, in the encoding embedding process of the watermark, the method of combining the first channel and the second channel can be used for encoding embedding; for the first channel, when the encoding result of the target watermark data block is zero, the spectral features of all odd channels of the first channel are set to zero, and the even channels in the first channel are kept unchanged; for the second channel, when the encoding result of the target watermark data block is not zero, generally the encoding result is 1, the spectral features of all even channels of the second channel are set to zero, and the odd channels in the second channel are kept unchanged.
[0145] In this embodiment, by combining the first channel and the second channel to embed the target watermark data block, the encoding of the target watermark data block can be dispersed into different channels (odd channels or even channels), which helps to significantly reduce the perceptual impact of the embedded watermark on the original audio signal, improve the concealment of audio watermark embedding, and also increase the redundancy of the watermark, so that even if part of the watermark information is lost or damaged in the transmission or processing process, the remaining watermark information can still be correctly decoded. The embedding mode of negative text combined with positive text also increases the complexity of the watermark, making it more difficult for unauthorized attempts to remove or tamper with the watermark, thereby improving the effect of audio watermark embedding.
[0146] In step S502 of some embodiments, specifically, the watermark embedding can be realized by the following formula:
[0147] b(i) = 2000 + i * (1000 / M)
[0148] Wherein, b(i) represents the encoding frequency of the i th channel; i represents the first channel or the second channel; M represents the number of target spectral bands.
[0149] Specifically, the encoding frequency represented by b(i) can also be used to represent the ordinate value of the spectrum, and each target spectral band M corresponds to a channel i.
[0150] For example, when the encoding rate is 0.15s and the number of target spectrum bands is 20, the width of each target spectrum band is 50Hz; when the encoding result of the target watermark data block is 0, at 0.15s, 15 frames of target spectrum in the odd channels of the first channel are set to 0, and the even channels of the first channel remain unchanged; when the encoding result of the target watermark data block is 1, at 0.3s, 15 frames of target spectrum in the even channels of the second channel are set to 0, and the odd channels of the second channel remain unchanged.
[0151] In the embodiment, the target watermark data block is embedded into the target spectrum band according to the encoding rate and the first channel or the second channel, the target watermark data block can be periodically embedded repeatedly in combination with the encoding rate, the number of encoding is reduced, and the efficiency of audio watermark embedding is improved; and the appropriate watermark encoding embedding position is selected in combination with the first channel or the second channel, so that the effect of audio watermark embedding is improved.
[0152] In step S404 of some embodiments, the target audio refers to converting the frequency domain audio in which the watermark is embedded into time domain audio.
[0153] For example, in insurance claim settlement, the user identity information, timestamp, transaction amount and transaction account number of the car insurance claim recording are embedded into the car insurance claim recording, and a recording containing watermark data is obtained. Decoding the recording, the target audio obtained is also a recording containing watermark data of user identity information, timestamp, transaction amount and transaction account number.
[0154] Specifically, the inverse discrete cosine transform can be performed by the following formula:
[0155]
[0156] Wherein, X'(u) represents the u-th frame of the embedded watermark spectrum; u represents the number of frames of the embedded watermark spectrum; n represents the number of time domain signal frames of the target audio; N represents the size of the time domain signal frame in the target audio; x'(n) represents the n-th frame of the target audio of the time domain signal.
[0157] In the embodiment, the inverse discrete cosine transform of the embedded watermark spectrum can ensure that the information of the original audio signal is as complete as possible during the conversion of the audio signal from the frequency domain to the time domain, and the consistency of the audio signal during the conversion is ensured.
[0158] Please refer to Figure 6 In some embodiments, after step S106, the audio watermark embedding method further comprises steps S601 to S605:
[0159] Step S601: performing discrete cosine transform on the target audio to obtain a target spectrum.
[0160] Step S602, decoding operation is performed on the target spectrum to obtain a decoded watermark attribute block.
[0161] Step S603, the corresponding watermark content block is found according to the decoded watermark attribute block.
[0162] Step S604, the watermark content blocks are spliced to obtain a binary audio watermark.
[0163] Step S605, decompression operation is performed on the binary audio watermark to obtain original watermark data.
[0164] In step S601 of some embodiments, the target spectrum is a frequency spectrum representing the original audio.
[0165] Specifically, the target audio is subjected to discrete cosine transform to obtain the target spectrum, and the method is consistent with the method of performing discrete cosine transform operation on the original audio by the following formula in S105, which will not be repeated here.
[0166] In step S602 of some embodiments, the decoded watermark attribute block refers to the watermark data block obtained after decoding the encoded watermark block, and also contains watermark attribute data. Since the watermark attribute block contains the identification information of the watermark content block, the decoded watermark attribute block obtained by decoding can find the watermark content block corresponding to each watermark attribute block.
[0167] Please refer to Figure 7 In some embodiments, step S602 can include but is not limited to steps S701 to S705:
[0168] Step S701, attribute watermark detection is performed on the target spectrum to obtain a detected watermark attribute block.
[0169] Step S702, palindrome recognition is performed on the detected watermark attribute block to obtain a palindrome watermark attribute block.
[0170] Step S703, position detection is performed on the palindrome watermark attribute block to obtain a palindrome watermark attribute block position.
[0171] Step S704, the encoding order of the palindrome watermark attribute block is obtained according to the palindrome watermark attribute block position.
[0172] Step S705, decoding is performed on the detected watermark attribute block according to the encoding order to obtain a decoded watermark attribute block.
[0173] In step S701 of some embodiments, the detected watermark attribute block refers to the watermark attribute block detected in the target spectrum.
[0174] Specifically, the frequency band features extracted can be decoded, i.e., the spectrum features of the 2000-3000 Hz frequency band are extracted to obtain the watermark attribute features, and the watermark attribute features are extracted to obtain the detection watermark attribute block.
[0175] In step S702 of some embodiments, the palindrome watermark attribute block refers to the palindrome sequence block detected from the detection watermark attribute block, which should be consistent with the palindrome sequence block when the watermark attribute block is encoded.
[0176] Specifically, the target spectrum is detected from the first frame, and the detected palindrome sequence contained in the first detection watermark attribute block is compared with the palindrome sequence block. If the detected palindrome sequence is consistent with the palindrome sequence block, the palindrome information in the detection watermark attribute block is extracted as the palindrome watermark attribute block. If the detected palindrome sequence is not consistent with the palindrome sequence block, a new detection watermark attribute block is searched in the next frame of the target spectrum until the detected palindrome sequence is consistent with the palindrome sequence block.
[0177] In this embodiment, by performing palindrome recognition on the detection watermark attribute block, it can be ensured that the parameters used for watermark embedding are not tampered with, and the security of audio watermark embedding is improved.
[0178] In step S703 of some embodiments, the palindrome watermark attribute block position contains the start position and end position of each palindrome watermark attribute block, and the length of the palindrome watermark attribute block can be determined according to the start position and end position.
[0179] Specifically, since the watermark attribute blocks are divided according to the same length, the length of each palindrome sequence watermark attribute block should also be equal. By comparing the length of the palindrome watermark attribute block with the length of the previously detected palindrome watermark attribute block, if the length of the palindrome watermark attribute block is consistent with the length of the previously detected palindrome watermark attribute block, the start position and end position are determined according to the length of the palindrome watermark attribute block. If the length of the palindrome watermark attribute block is not consistent with the length of the previously detected palindrome watermark attribute block, a new detection watermark attribute block is searched in the next frame of the target spectrum until the length of the detected palindrome watermark attribute block is consistent with the length of the previously detected palindrome watermark attribute block.
[0180] In this embodiment, by detecting the position of the palindrome watermark attribute block, abnormalities in the palindrome watermark attribute block can be detected in time, and the abnormal palindrome watermark attribute block cannot be extracted, which can further ensure the security of watermark embedding. Since the watermark is periodically embedded according to the encoding rate during audio watermark embedding, even if an abnormal palindrome watermark attribute block is found, the watermark content corresponding to the attribute block will not be lost, and the integrity of the watermark can still be ensured.
[0181] In step S704 of some embodiments, the encoding order refers to the order of the watermark attribute blocks when encoding.
[0182] Specifically, by comparing the order relationship between the decoded watermark attribute blocks with the order relationship of the watermark attribute blocks, if the order relationship between the decoded watermark attribute blocks is consistent with the order relationship of the watermark attribute blocks, it indicates that the encoding position of the palindrome watermark attribute block is correct; if the order relationship between the decoded watermark attribute blocks is not consistent with the order relationship of the watermark attribute blocks, the next frame of target spectrum is searched for a new detection watermark attribute block until the order relationship between the decoded watermark attribute blocks is consistent with the order relationship of the watermark attribute blocks.
[0183] For example, the encoding order of the watermark attribute blocks is Y1, Y2, Y3, and the encoding order of the palindrome watermark attribute block should also be Y1, Y2, Y3.
[0184] In step S705 of some embodiments, specifically, the detection watermark attribute block is decoded according to the encoding order Y1, Y2, Y3, and the Y1 decoded watermark attribute block, the Y2 decoded watermark attribute block, and the Y3 decoded watermark attribute block can be obtained.
[0185] In step S603 of some embodiments, specifically, since the decoded watermark attribute block contains the identification of the corresponding watermark content block, the corresponding watermark content block can be found by decoding the watermark attribute block identification.
[0186] For example, the decoded watermark attribute block identification is consistent with the encoding order, if the decoded watermark attribute block identification is G1, the watermark content block is g1, and by detecting each frame of spectrum in the target spectrum, all watermark content blocks corresponding to the decoded watermark attribute block can be found.
[0187] In this embodiment, by finding the corresponding watermark content block according to the decoded watermark attribute block, the watermark embedding process can be closely matched to ensure consistency with the parameters and encoding rules used in watermark embedding, and the consistency of watermark encoding and decoding is maintained.
[0188] In step S604 of some embodiments, the binary audio watermark block should contain a binary watermark attribute sequence and a binary watermark content sequence.
[0189] Specifically, since the decoded watermark attribute block is obtained based on the encoding order, each decoded watermark attribute block and its corresponding watermark content block are spliced by the encoding order of the watermark attribute block to obtain the binary audio watermark.
[0190] For example, according to the encoding order Y1, Y2, Y3, the binary watermark attribute sequence T1, T2, T3 is obtained, and the binary watermark content sequence corresponding to the binary watermark attribute sequence is in the order t1, t2, t3, and the binary audio watermark block is T1t1T2t2T3t3.
[0191] In step S605 of some embodiments, the original watermark data refers to the decompressed watermark data, and also includes the watermark attribute data and the watermark content data.
[0192] Specifically, the decoded binary audio watermark is still compressed data. In order to obtain the original audio information, the compressed data needs to be decompressed. The zlib can be used to decompress the compressed data to obtain the original watermark data.
[0193] The embodiment of the present application obtains the original watermark data, wherein the original watermark data includes watermark attribute data and watermark content data; the watermark attribute data is divided by attribute to obtain a watermark attribute block, and the watermark content data is divided by content to obtain a watermark content block; the watermark attribute block is encoded to obtain an attribute encoding sequence block; the attribute encoding sequence block and the watermark content block are merged to obtain a target watermark data block; the original audio is obtained, and the spectrum of the original audio is obtained to obtain a target spectrum; and the target watermark data block is embedded into the target spectrum according to a preset encoding rate to obtain a target audio. The attribute division of the watermark attribute data and the content division of the watermark content data are helpful to the standardization of the subsequent audio watermark embedding process, and simplify the embedding of the audio watermark. The encoding of the watermark attribute block can enable the audio watermark to be identified when the position of the audio watermark in the audio signal is shifted, and improve the concealment of the audio watermark embedding. The attribute encoding sequence block and the watermark content block are merged to generate the audio watermark to be embedded. Finally, the target watermark data block is embedded into the target spectrum according to the encoding rate to obtain the target audio, which can repeatedly embed the audio watermark into the audio. When part of the audio watermark is damaged or lost, the complete watermark information can still be extracted from the remaining audio, and the effect of the audio watermark embedding is further improved.
[0194] Please refer to Figure 8 The embodiment of the present application also provides an audio watermark embedding device, which can implement the audio watermark embedding method described above. The device comprises:
[0195] A watermark data obtaining module is configured to obtain original watermark data, wherein the original watermark data includes watermark attribute data and watermark content data.
[0196] An attribute and content division module is configured to divide the watermark attribute data by attribute to obtain a watermark attribute block, and divide the watermark content data by content to obtain a watermark content block.
[0197] a watermark encoding module, configured to encode the watermark attribute block to obtain an attribute encoding sequence block;
[0198] a watermark merging module, configured to merge the attribute encoding sequence block and the watermarked content block to obtain a target watermark data block;
[0199] an audio spectrum acquisition module, configured to acquire an original audio and acquire a spectrum of the original audio to obtain a target spectrum;
[0200] a watermark embedding module, configured to embed the target watermark data block into the target spectrum according to a preset encoding rate to obtain a target audio.
[0201] The specific implementation of the audio watermark embedding apparatus is basically the same as the specific implementation of the audio watermark embedding method described above, and will not be repeated here.
[0202] The embodiments of the present application further provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the audio watermark embedding method described above when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0203] Please refer to Figure 9 , Figure 9 a hardware structure of an electronic device of another embodiment is shown, which includes:
[0204] The processor 901 can be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute related programs to implement the technical solutions provided by the embodiments of the present application.
[0205] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 902 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 902 and are called and executed by the processor 901 to implement the audio watermark embedding method of the embodiments of the present application.
[0206] The input / output interface 903 is used to realize information input and output.
[0207] The communication interface 904 is configured to realize the communication interaction between the device and other devices. The communication can be realized in a wired manner (for example, a USB, a network cable, and the like) or in a wireless manner (for example, a mobile network, a WI-FI, a Bluetooth, and the like).
[0208] The bus 905 is configured to transmit information between various components (for example, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.
[0209] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other through the bus 905 to realize the communication connection between the device.
[0210] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to realize the audio watermark embedding method.
[0211] The memory is a non-transitory computer readable storage medium, and can be used to store a non-transitory software program and a non-transitory computer executable program. In addition, the memory can include a high-speed random access memory, and can further include a non-transitory memory, for example, at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and the remote memory can be connected to the processor through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0212] The audio watermark embedding method, the audio watermark embedding device, the electronic device and the storage medium provided by the embodiments of the present application obtain original watermark data, wherein the original watermark data comprises watermark attribute data and watermark content data; the watermark attribute data is divided by attribute to obtain a watermark attribute block, and the watermark content data is divided by content to obtain a watermark content block; the watermark attribute block is processed by encoding to obtain an attribute encoding sequence block; the attribute encoding sequence block and the watermark content block are merged to obtain a target watermark data block; an original audio is obtained, and a target spectrum is obtained by obtaining a spectrum of the original audio; and the target watermark data block is embedded into the target spectrum according to a preset encoding rate to obtain a target audio. The embodiments of the present application first divide the watermark attribute data by attribute and divide the watermark content data by content, which is helpful for standardizing the subsequent audio watermark embedding process and simplifying the embedding of the audio watermark. Secondly, the watermark attribute block is encoded, so that the audio watermark can be identified when the position of the audio watermark in the audio signal is shifted, and the concealment of the audio watermark embedding is improved. The attribute encoding sequence block and the watermark content block are merged to generate the audio watermark to be embedded. Finally, the target watermark data block is embedded into the target spectrum according to the encoding rate to obtain the target audio, so that the audio watermark can be repeatedly embedded into the audio. When part of the audio watermark is damaged or lost, complete watermark information can still be extracted from the remaining audio, and the effect of the audio watermark embedding is further improved.
[0213] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0214] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than the figures shown, or combine certain steps or different steps.
[0215] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0216] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.
[0217] The terms "first", "second", "third", "fourth", and the like in the description of this application and in the claims hereof, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed herein is solely for the convenience of the reader and does not limit the scope of the application. It is also to be understood that the description and examples in this application are intended to cover all possible combinations where any of the several elements can represent one or more elements.
[0218] It should be understood that, in the application, "at least one" means one or more, "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0219] In several embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. The coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0220] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment of the present application.
[0221] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0222] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.
[0223] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not limited to the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.
Claims
1. An audio watermark embedding method characterized by, The method comprises: obtaining original watermark data; wherein the original watermark data comprises watermark attribute data and watermark content data; performing attribute division on the watermark attribute data to obtain a watermark attribute block, and performing content division on the watermark content data to obtain a watermark content block; performing encoding processing on the watermark attribute block to obtain an attribute encoding sequence block; merging the attribute encoding sequence block and the watermark content block to obtain a target watermark data block; obtaining original audio and obtaining a target spectrum of the original audio; embedding the target watermark data block into the target spectrum according to a preset encoding rate to obtain target audio.
2. The method of claim 1, wherein, The embedding of the target watermark data block into the target spectrum according to the preset encoding rate to obtain target audio comprises: selecting a target spectrum segment from the target spectrum; the target spectrum segment is used to represent a spectrum segment into which the target watermark data block is to be embedded; performing frequency band division on the target spectrum segment to obtain a target spectrum band; embedding the target watermark data block into the target spectrum band according to the encoding rate to obtain an embedded watermark spectrum; performing inverse discrete cosine transformation on the embedded watermark spectrum to obtain the target audio.
3. The method of claim 2, wherein, The embedding of the target watermark data block into the target spectrum band according to the encoding rate to obtain an embedded watermark spectrum comprises: obtaining a first channel and a second channel; the first channel is used to represent that an encoding result of the target watermark data block is zero, and embedding of the target watermark data block is implemented through an even channel; the second channel is used to represent that the encoding result of the target watermark data block is not zero, and embedding of the target watermark data block is implemented through an odd channel; embedding the target watermark data block into the target spectrum band according to the encoding rate and the first channel to obtain an embedded watermark spectrum, or embedding the target watermark data block into the target spectrum band according to the encoding rate and the second channel to obtain an embedded watermark spectrum.
4. The method of claim 1, wherein, The encoding processing on the watermark attribute block to obtain an attribute encoding sequence block comprises: performing a flip operation on the watermark attribute block to obtain a flip sequence block; splicing the flip sequence block and the watermark attribute block corresponding to the flip sequence block to obtain a palindrome sequence block; encoding the palindrome sequence block to obtain the attribute encoding sequence block.
5. The method according to any one of claims 1 to 4, characterized in that, The attribute division on the watermark attribute data to obtain a watermark attribute block, and the content division on the watermark content data to obtain a watermark content block, comprise: compressing the watermark attribute data to obtain compressed watermark attribute data, and compressing the watermark content data to obtain compressed watermark content data; performing binary conversion on the compressed watermark attribute data to obtain a binary watermark attribute sequence, and performing binary conversion on the compressed watermark content data to obtain a binary watermark content sequence; performing data length block division on the binary watermark attribute sequence according to a preset data length to obtain the watermark attribute block, and performing data length block division on the binary watermark content sequence according to the preset data length to obtain the watermark content block.
6. The method of claim 5, wherein, After the target audio is obtained by embedding the target watermark data block into the target frequency spectrum according to the preset encoding rate, the method further comprises: performing discrete cosine transform on the target audio to obtain the target frequency spectrum; performing decoding operation on the target frequency spectrum to obtain a decoded watermark attribute block; finding the corresponding watermark content block according to the decoded watermark attribute block; splicing the watermark content block to obtain a binary audio watermark block; performing decompression operation on the binary audio watermark block to obtain the original watermark data.
7. The method of claim 6, wherein, The performing decoding operation on the target frequency spectrum to obtain a decoded watermark attribute block comprises: performing attribute watermark detection on the target frequency spectrum to obtain a detected watermark attribute block; performing palindrome identification on the detected watermark attribute block to obtain a palindrome watermark attribute block; performing position detection on the palindrome watermark attribute block to obtain a palindrome watermark attribute block position; obtaining the encoding order of the palindrome watermark attribute block according to the palindrome watermark attribute block position; performing decoding on the detected watermark attribute block according to the encoding order to obtain the decoded watermark attribute block.
8. An audio watermark embedding apparatus characterized by comprising: The device comprises: a watermark data acquisition module configured to acquire original watermark data, wherein the original watermark data comprises watermark attribute data and watermark content data; an attribute and content division module configured to divide the watermark attribute data by attribute to obtain a watermark attribute block, and divide the watermark content data by content to obtain a watermark content block; a watermark encoding module configured to perform encoding processing on the watermark attribute block to obtain an attribute encoding sequence block; a watermark merging module configured to merge the attribute encoding sequence block and the watermark content block to obtain a target watermark data block; an audio frequency spectrum acquisition module configured to acquire original audio and obtain a frequency spectrum of the original audio to obtain a target frequency spectrum; a watermark embedding module configured to embed the target watermark data block into the target frequency spectrum according to a preset encoding rate to obtain a target audio.
9. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the audio watermark embedding method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the audio watermark embedding method of any one of claims 1 to 7.
Citation Information
Patent Citations
Adding and extracting method of audio watermark and terminal equipment
CN109493875A
Audio watermark embedding method, audio watermark extraction method and audio detection method
CN117275494A