Audio watermark adding method, audio watermark extracting method and related products
By segmenting audio watermarks and adding reference numbers, the problem of audio copyright protection is solved, the effective addition and extraction of audio watermarks is achieved, and the reliability and accuracy of copyright protection are improved.
Patent Information
- Application Number
- CN202411115594.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-25
AI Technical Summary
It is difficult to effectively protect the copyright of audio with existing technology, especially in the era of illegal proliferation, copying and tampering in the Internet era, and there is a lack of effective methods for adding and extracting audio watermarks.
By dividing the audio watermark to be added into multiple segments and adding a reference serial number to each segment of the audio watermark, after generating the second audio watermark, add it to the audio to be processed to achieve the addition of the audio watermark; during extraction, from the target audio Intercept frame segments, extract audio watermarks, sort and verify them based on the sequence number and verification information to ensure the accuracy of the audio watermarks.
It realizes the effective addition and extraction of audio watermarks, improves the reliability and accuracy of audio copyright protection, and prevents illegal use.
Smart Images

Figure CN118841019A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method for adding an audio watermark, a method for extracting an audio watermark, and related products. Background Art
[0002] In the Internet age, audio can be quickly spread and obtained, but it also breeds copyright infringements such as illegal dissemination, illegal copying, and illegal tampering of audio. Therefore, in order to protect the copyright of audio, audio watermarking technology came into being. Audio watermarking technology protects the copyright of audio by adding audio watermarks to audio. Therefore, how to add audio watermarks to audio is of great significance. Summary of the invention
[0003] The present application provides a method for adding an audio watermark, a method for extracting an audio watermark, and related products, so as to add the audio watermark to be added to the audio to be processed, wherein the related products include: an apparatus for adding an audio watermark, an apparatus for extracting an audio watermark, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, a method for adding an audio watermark is provided, the method comprising:
[0005] Get the audio to be processed and the audio watermark to be added;
[0006] Dividing the audio watermark to be added into n segments of first audio watermarks, where n is an integer greater than 1;
[0007] Adding a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks, wherein the reference serial number indicates the order of the first audio watermark corresponding to the reference serial number in the n first audio watermarks;
[0008] The n segments of the second audio watermark are added to the audio to be processed to obtain the target audio with the audio watermark to be added.
[0009] In combination with any implementation manner of the present application, obtaining the audio watermark to be added includes:
[0010] Get the audio watermark to be processed;
[0011] Generate target verification information by encrypting the audio watermark to be processed;
[0012] The audio watermark to be processed and the target verification information are concatenated to obtain the audio watermark to be added.
[0013] In combination with any implementation manner of the present application, the n-segment second audio watermark includes a verification audio watermark, the verification audio watermark includes the target verification information, and the position of the target verification information in the verification audio watermark is the verification position.
[0014] In combination with any embodiment of the present application, the adding a reference number to each of the n first audio watermarks to obtain the n second audio watermarks includes:
[0015] The reference number and the preset identifier are added to each of the n first audio watermarks to obtain the n second audio watermarks, and the position of the preset identifier in the second audio watermark is the identifier position.
[0016] In combination with any implementation manner of the present application, the position of the reference serial number in the second audio watermark is a serial number position.
[0017] In a second aspect, a method for extracting an audio watermark is provided, the method comprising:
[0018] Obtaining target audio, wherein the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, when n segments of second audio watermarks are obtained by respectively adding reference numbers to each of the n segments of the first audio watermarks, wherein the reference numbers indicate the order of the first audio watermarks corresponding to the reference numbers in the n segments of first audio watermarks, and the n segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments;
[0019] Intercepting m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n;
[0020] Extracting audio watermarks from the m frames of audio frames to be extracted to obtain i first extracted watermarks, where i is less than or equal to m, the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark, and the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions;
[0021] According to the to-be-confirmed sequence numbers in the i first extracted watermarks, the candidate audio watermarks in the i first extracted watermarks are sorted to obtain a target audio watermark of the target audio.
[0022] In combination with any embodiment of the present application, the verification audio watermark in the n-segment second audio watermark includes target verification information, the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position;
[0023] Before sorting the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the target audio watermark of the target audio, the method further includes:
[0024] Determine, from the i first extracted watermarks, the first extracted watermark whose sequence number to be confirmed is the target sequence number as the second extracted watermark;
[0025] determining first verification information according to the information located at the verification position in the second extracted watermark;
[0026] The step of sorting the first audio watermarks in the i first extracted watermarks according to the sequence numbers to be confirmed in the i first extracted watermarks to obtain the target audio watermark of the target audio includes:
[0027] Sort the first audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the to-be-confirmed audio watermarks;
[0028] In a case where it is determined based on the first verification information that the audio watermark to be confirmed is correct, the audio watermark to be confirmed is used as the target audio watermark.
[0029] In combination with any implementation manner of the present application, the target verification information is obtained by encrypting the audio watermark to be added;
[0030] The method of using the audio watermark to be confirmed as the target audio watermark when it is determined based on the first verification information that the audio watermark to be confirmed is correct includes:
[0031] Generate second verification information by performing the encryption process on the audio watermark to be confirmed;
[0032] When the first verification information is identical to the second verification information, it is determined that the audio watermark to be confirmed is correct.
[0033] In combination with any implementation manner of the present application, the step of extracting the audio watermarks from the m frames of audio frames to be extracted to obtain i first extracted watermarks includes:
[0034] For each of the m audio frames to be extracted, extract the audio watermark to obtain m third extracted watermarks, wherein the third extracted watermarks correspond to the audio frames to be extracted one by one;
[0035] Determine m to-be-confirmed sequence numbers according to the information located at the sequence number position in the m third extracted watermarks, wherein the to-be-confirmed sequence numbers correspond one-to-one to the third extracted watermarks;
[0036] According to the m to-be-confirmed serial numbers, the i first extracted watermarks are determined from the m third extracted watermarks, and the to-be-confirmed serial number corresponding to the first extracted watermark is the reference serial number.
[0037] In combination with any embodiment of the present application, before determining the i first extracted watermarks from the m third extracted watermarks according to the m sequence numbers to be confirmed, the method further includes:
[0038] Determine m to-be-confirmed identifiers according to the information at the identifier position in the m third extracted watermarks, wherein the to-be-confirmed identifiers correspond one-to-one to the third extracted watermarks;
[0039] The step of determining the i first extracted watermarks from the m third extracted watermarks according to the m sequence numbers to be confirmed comprises:
[0040] The i first extracted watermarks are determined from the m third extracted watermarks according to the m to-be-confirmed serial numbers and the m to-be-confirmed identifiers, and the to-be-confirmed identifier corresponding to the first extracted watermark is a preset identifier.
[0041] In a third aspect, a device for adding an audio watermark is provided, the device for adding an audio watermark comprising:
[0042] An acquisition unit, used to acquire the audio to be processed and the audio watermark to be added;
[0043] a dividing unit, configured to divide the audio watermark to be added into n segments of first audio watermarks, where n is an integer greater than 1;
[0044] an adding unit, configured to add a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n first audio watermarks;
[0045] The adding unit is used to add the n second audio watermarks to the audio to be processed to obtain the target audio with the audio watermark to be added.
[0046] In conjunction with any implementation manner of the present application, the acquisition unit is specifically configured to:
[0047] Get the audio watermark to be processed;
[0048] Generate target verification information by encrypting the audio watermark to be processed;
[0049] The audio watermark to be processed and the target verification information are concatenated to obtain the audio watermark to be added.
[0050] In combination with any implementation manner of the present application, the n-segment second audio watermark includes a verification audio watermark, the verification audio watermark includes the target verification information, and the position of the target verification information in the verification audio watermark is the verification position.
[0051] In combination with any embodiment of the present application, the adding unit is specifically used for:
[0052] The reference number and the preset identifier are added to each of the n first audio watermarks to obtain the n second audio watermarks, and the position of the preset identifier in the second audio watermark is the identifier position.
[0053] In combination with any implementation manner of the present application, the position of the reference serial number in the second audio watermark is a serial number position.
[0054] In a fourth aspect, a device for extracting an audio watermark is provided, the device for extracting an audio watermark comprising:
[0055] an acquiring unit, configured to acquire a target audio, wherein the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, in the case where n segments of second audio watermarks are obtained by respectively adding a reference serial number to each segment of the first audio watermark in n segments of first audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n segments of first audio watermarks, and the n segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments;
[0056] An interception unit, used for intercepting m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n;
[0057] an extracting unit, configured to extract the audio watermarks from the m frames of audio frames to be extracted, and obtain i first extracted watermarks, where i is less than or equal to m, and the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark, and the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions;
[0058] A processing unit is used to sort the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain a target audio watermark of the target audio.
[0059] In combination with any embodiment of the present application, the verification audio watermark in the n-segment second audio watermark includes target verification information, the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position;
[0060] The processing unit is further used for:
[0061] Determine, from the i first extracted watermarks, the first extracted watermark whose sequence number to be confirmed is the target sequence number as the second extracted watermark;
[0062] determining first verification information according to the information located at the verification position in the second extracted watermark;
[0063] The processing unit is specifically used for:
[0064] Sort the first audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the to-be-confirmed audio watermarks;
[0065] In a case where it is determined based on the first verification information that the audio watermark to be confirmed is correct, the audio watermark to be confirmed is used as the target audio watermark.
[0066] In combination with any implementation manner of the present application, the target verification information is obtained by encrypting the audio watermark to be added;
[0067] The processing unit is specifically used for:
[0068] Generate second verification information by performing the encryption process on the audio watermark to be confirmed;
[0069] When the first verification information is identical to the second verification information, it is determined that the audio watermark to be confirmed is correct.
[0070] In combination with any embodiment of the present application, the extraction unit is specifically used for:
[0071] For each of the m audio frames to be extracted, extract the audio watermark to obtain m third extracted watermarks, wherein the third extracted watermarks correspond to the audio frames to be extracted one by one;
[0072] Determine m to-be-confirmed sequence numbers according to the information located at the sequence number position in the m third extracted watermarks, wherein the to-be-confirmed sequence numbers correspond one-to-one to the third extracted watermarks;
[0073] According to the m to-be-confirmed serial numbers, the i first extracted watermarks are determined from the m third extracted watermarks, and the to-be-confirmed serial number corresponding to the first extracted watermark is the reference serial number.
[0074] In combination with any embodiment of the present application, the processing unit is further used for:
[0075] Determine m to-be-confirmed identifiers according to the information at the identifier position in the m third extracted watermarks, wherein the to-be-confirmed identifiers correspond one-to-one to the third extracted watermarks;
[0076] The extraction unit is specifically used for:
[0077] The i first extracted watermarks are determined from the m third extracted watermarks according to the m to-be-confirmed serial numbers and the m to-be-confirmed identifiers, and the to-be-confirmed identifier corresponding to the first extracted watermark is a preset identifier.
[0078] In a fifth aspect, an electronic device is provided, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof, or the electronic device executes the method as described in the second aspect above and any possible implementation thereof.
[0079] In a sixth aspect, another electronic device is provided, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the first aspect and any embodiment thereof, or the electronic device executes the second aspect and any embodiment thereof.
[0080] In the seventh aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the first aspect and any embodiment thereof, or the processor is caused to execute the second aspect and any embodiment thereof.
[0081] In an eighth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to execute the above-mentioned first aspect and any embodiment thereof, or the computer is caused to execute the above-mentioned second aspect and any embodiment thereof.
[0082] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0084] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0085] Figure 1 A flowchart of a method for adding an audio watermark provided in an embodiment of the present application;
[0086] Figure 2 A schematic diagram of an n-segment second audio watermark provided in an embodiment of the present application;
[0087] Figure 3 A flowchart of a method for adding an audio watermark provided in an embodiment of the present application;
[0088] Figure 4 A flowchart of an audio processing method provided in an embodiment of the present application;
[0089] Figure 5 A timing diagram of an audio processing method provided in an embodiment of the present application;
[0090] Figure 6 A schematic diagram of the structure of a device for adding an audio watermark provided in an embodiment of the present application;
[0091] Figure 7 A schematic diagram of the structure of a device for extracting an audio watermark provided in an embodiment of the present application;
[0092] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0094] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0095] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0096] The embodiment of the present application provides a method for adding an audio watermark and a method for extracting an audio watermark, wherein the method for adding an audio watermark is used to add an audio watermark to audio, and the method for extracting an audio watermark is used to extract an audio watermark from audio. The execution subject of the method for adding an audio watermark is an audio watermark adding device (hereinafter referred to as adding device), wherein the adding device can be any electronic device that can execute the technical solution disclosed in the embodiment of the method of the present application. Optionally, the adding device can be one of the following: a computer, a server.
[0097] It should be understood that the method embodiment of the present application can also be implemented by a processor executing a computer program code. The following describes the embodiment of the present application in conjunction with the drawings in the embodiment of the present application. Figure 1 , Figure 1 A flowchart of a method for adding an audio watermark is provided in an embodiment of the present application.
[0098] 101. Obtain the audio to be processed and the audio watermark to be added.
[0099] In the embodiment of the present application, the audio to be processed may be any audio segment. For example, the audio to be processed is a voice segment, another example, the audio to be processed is an audio segment in a video, and another example, the audio to be processed is a song.
[0100] In an implementation of obtaining the audio to be processed, the adding device receives the audio to be processed input by the user through an input component. The input component includes at least one of the following: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.
[0101] In another implementation of obtaining the audio to be processed, the adding device receives the audio to be processed sent by the terminal. The terminal may be any of the following: a mobile phone, a computer, a tablet computer, and a server.
[0102] In the embodiment of the present application, the audio watermark to be added is a digital watermark. The audio watermark to be added may include any information. In one possible implementation, the audio watermark to be added is a character sequence, for example, the audio watermark to be added is a string of numbers, and for another example, the audio watermark to be added is a combination of letters and numbers.
[0103] In one implementation of obtaining the audio watermark to be added, the adding device receives the audio watermark to be added input by the user through the input component. In another implementation of obtaining the audio watermark to be added, the adding device receives the audio watermark to be added sent by the terminal.
[0104] It should be understood that in the embodiment of the present application, the step of the adding device obtaining the audio to be processed and the step of obtaining the audio watermark to be added can be performed separately or simultaneously, and the present application does not limit this.
[0105] 102. Divide the audio watermark to be added into n segments of first audio watermarks.
[0106] In the embodiment of the present application, n is an integer greater than 1. A watermark can be added to the audio through the target audio watermark adding method, but the performance of the target audio watermark adding method has limitations, and the length of the audio watermark that can be added at one time has an upper limit. For example, when adding an audio watermark to the audio through the target audio watermark adding method, a watermark with a length of up to 20 characters can be added at one time, so the upper limit of the target audio watermark adding method is 20 characters.
[0107] The target audio watermarking method can be any audio watermarking method. In a possible implementation, the target audio watermarking method is based on the audio watermark, the amplitude of the frequency spectrum information of the audio is adjusted, and the adjusted frequency spectrum information is transformed in the time domain to obtain the audio with the audio watermark, wherein the frequency spectrum information of the audio can be obtained by performing a frequency domain transformation on the audio, and the frequency domain transformation is used to convert the time domain information into frequency domain information. For example, the frequency domain transformation is a Fourier transform. For another example, the frequency domain transformation is a short-time Fourier transform (STFT). Specifically, the audio watermark is encoded to obtain a watermark encoding result, wherein the watermark encoding result is a binary sequence with x bits. The audio is transformed in the frequency domain to obtain the frequency spectrum information, and x groups of amplitudes are determined from the amplitude of the frequency spectrum information. According to the x-bit value in the binary sequence, x amplitude adjustment amounts are determined, and the amplitude adjustment amounts correspond to the values in the binary sequence one by one. The amplitude adjustment amounts corresponding to the same values are the same, and the amplitude adjustment amounts corresponding to different values are different. Using x amplitude adjustment amounts, x groups of amplitudes in the spectrum information are adjusted to obtain watermark spectrum information. The watermark spectrum information is transformed in the time domain to obtain audio with an audio watermark, wherein the time domain transformation is used to transform the frequency domain information into the time domain information, for example, the time domain transformation is an inverse Fourier transform.
[0108] For example, the audio watermark is a binary sequence, and the number of bits in the binary sequence is x, where x is an integer greater than 1. The amplitude of the spectrum information of the audio is divided into x groups to obtain x groups of amplitudes, where the difference between the average values of the amplitudes in any two groups of amplitudes is less than or equal to the amplitude threshold. In the binary sequence, the value of the bit is 0 or 1, and a first amplitude adjustment amount corresponding to the bit with a value of 0 is determined, and a second amplitude adjustment amount corresponding to the bit with a value of 1 is determined, where the first amplitude adjustment amount is different from the second amplitude adjustment amount. When the value of the bit in the binary sequence is 0, the amplitude in a group of amplitudes is adjusted based on the first amplitude adjustment amount, and when the value of the bit in the binary sequence is 1, the amplitude in a group of amplitudes is adjusted based on the second amplitude adjustment amount, and the bits in the binary sequence correspond to a group of amplitudes one by one. In this way, the information of the binary sequence can be added to the spectrum information of the audio by adjusting the spectrum information of the audio, thereby realizing the addition of the audio watermark to the spectrum information of the audio.
[0109] In another possible implementation, the target audio watermark adding method is to add the audio watermark to the least significant bit by adjusting the least significant bit in the audio.
[0110] In yet another possible implementation, the target audio watermarking method adds an audio watermark to the audio based on a watermarking model, wherein the watermarking model is a deep learning model having the ability to add an audio watermark to the audio.
[0111] Optionally, the upper limit value may be duration, and there is a conversion relationship between duration and characters, wherein duration refers to the duration of the audio watermark in the audio after the audio watermark is added to the audio. For example, the duration of 10 characters is 0.2 seconds, so after a 10-character audio watermark is added to the audio, the duration of the audio watermark in the audio is 0.2 seconds.
[0112] Since the length of the audio watermark that can be added at one time has an upper limit, when the length of the audio watermark to be added exceeds the upper limit, the audio watermark to be added needs to be divided into n segments of the first audio watermark, and then the n segments of the first audio watermark are added to the audio through n additions. Therefore, the length of any segment of the first audio watermark is less than or equal to the upper limit of the target audio watermark adding method. In addition, the lengths of any two segments of the first audio watermark can be the same or different.
[0113] In a possible implementation, the audio watermark to be added is a character sequence, and the adding device divides the audio watermark to be added into n segments of first audio watermarks by dividing the character sequence into n segments. For example, the audio watermark to be added is XHS12320, n=3. The n segments of the first audio watermark can be: XHS, 123, 20.
[0114] 103. Add a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks.
[0115] In the embodiment of the present application, the reference number represents the order of the first audio watermark corresponding to the reference number in the n-segment first audio watermark, and the reference number corresponds to the first audio watermark one-to-one. According to the order of the n-segment first audio watermark, the n-segment first audio watermark is merged to obtain the audio watermark to be added. For example, the audio watermark to be added is XHS12320, and the n-segment first audio watermark includes: the first audio watermark a, the first audio watermark b, and the first audio watermark c, wherein the first audio watermark a is XHS, the first audio watermark b is 123, and the first audio watermark c is 20. The order of the first audio watermark a in the n-segment first audio watermark is 1, the order of the first audio watermark b in the n-segment first audio watermark is 2, and the order of the first audio watermark c in the n-segment first audio watermark is 3. If n segments of the first audio watermark are spliced according to the n segments of the first audio watermark, then in the spliced audio watermark, the watermark contents are first audio watermark a, first audio watermark b, and first audio watermark c in sequence. At this time, the spliced audio watermark is XHS12320, which is the audio watermark to be added.
[0116] It should be understood that the reference number can represent the order of the first audio watermark corresponding to the reference number in the n-segment first audio watermark, but the reference number may not be the order, that is, the order represented by each reference number is determined, but the reference number may be different from the represented order. For example, the audio watermark to be added is XHS12320, and the n-segment first audio watermark includes: first audio watermark a, first audio watermark b, first audio watermark c, wherein the order of the first audio watermark a in the n-segment first audio watermark is 1, the order of the first audio watermark b in the n-segment first audio watermark is 2, and the order of the first audio watermark c in the n-segment first audio watermark is 3. The reference number corresponding to the first audio watermark a is R, the reference number corresponding to the first audio watermark b is S, and the reference number corresponding to the first audio watermark c is Q. At this time, the order represented by R is 1, the order represented by S is 2, and the order represented by Q is 3.
[0117] The adding device can obtain the second audio watermark by adding a reference number to the first audio watermark. The n second audio watermarks can be obtained by adding corresponding reference numbers to each of the n first audio watermarks. For example, the n first audio watermarks include: a first audio watermark a, a first audio watermark b, the order of the first audio watermark a in the n first audio watermarks is 1, and the order of the first audio watermark b in the n first audio watermarks is 2. The reference number corresponding to the first audio watermark a is 1, and the reference number corresponding to the first audio watermark b is 2. The adding device obtains the second audio watermark c by adding the reference number 1 to the first audio watermark a, and the adding device obtains the second audio watermark d by adding the reference number 2 to the first audio watermark b. At this time, the n second audio watermarks include the second audio watermark c and the second audio watermark d.
[0118] Optionally, the position of the reference number in the second audio watermark is the serial number position. Specifically, the second audio watermark is a character sequence, and the serial number position indicates the position of the reference number in the character sequence. For example, if the serial number position is the 1st bit, then the 1st bit in the second audio watermark is the reference number. For another example, if the serial number position is the 13th to 16th bits, then the 13th to 16th bits in the second audio watermark represent the reference number. In the case where the position of the reference number in the second audio watermark is the serial number position, after extracting the audio watermark from the target audio, the reference number can be determined from the audio watermark based on the serial number position, which is conducive to obtaining the audio watermark to be added based on the extracted audio watermark.
[0119] 104. Add the n second audio watermarks to the audio to be processed to obtain target audio with the audio watermark to be added.
[0120] The adding device can add the audio watermark to be added to the audio to be processed by adding n segments of the second audio watermark to the audio to be processed, thereby obtaining the target audio with the audio watermark to be added. Optionally, the adding device adds n segments of the second audio watermark to the audio to be processed by a target audio watermark adding method, thereby obtaining the target audio with the audio watermark to be added. In a possible implementation, the adding device adds one segment of the second audio watermark at a time, and adds the n segments of the second audio watermark to the audio to be processed by adding n times, thereby obtaining the target audio with the audio watermark to be added. Optionally, the adding device divides the audio to be processed into n frames of audio frames to be processed, and then adds the n segments of the second audio watermark to the n frames of audio frames to be processed by adding n times to obtain n frames of watermarked audio frames, wherein the second audio watermark corresponds to the audio frames to be processed one by one, and then splices the n frames of watermarked audio frames to obtain the target audio.
[0121] The order of the n second audio watermarks in the target audio may be different from the reference numbers in the n second audio watermarks. For example, the n second audio watermarks include: second audio watermark a, second audio watermark b, second audio watermark c, wherein the reference number in the second audio watermark a is 1, the reference number in the second audio watermark b is 2, and the reference number in the second audio watermark c is 3. The adding device obtains the target audio after adding the second audio watermark a, the second audio watermark b, and the second audio watermark c to the audio to be processed, wherein the timestamp of the second audio watermark a in the target audio is from the 4th second to the 4.2th second, the timestamp of the second audio watermark b in the target audio is from the 2nd second to the 2.2th second, and the timestamp of the second audio watermark c in the target audio is from the 6th second to the 6.2th second. At this time, the order of appearance of the second audio watermark a, second audio watermark b and second audio watermark c in the target audio is: second audio watermark b, second audio watermark a, second audio watermark c. This order of appearance is different from the reference serial number in the n segments of second audio watermarks.
[0122] In the embodiment of the present application, after obtaining the audio to be processed and the audio watermark to be added, the adding device divides the audio watermark to be added into n segments of the first audio watermark, thereby the audio watermark to be added with a longer length can be divided into n segments of the first audio watermark with a shorter length. Then, a reference number is added to each of the n segments of the first audio watermark to obtain n segments of the second audio watermark, wherein the reference number indicates the order of the first audio watermark corresponding to the reference number in the n segments of the first audio watermark. By adding the n segments of the second audio watermark to the audio to be processed, it is possible to obtain the target audio with the audio watermark to be added by adding the n segments of the second audio watermark with a shorter length to the audio to be processed and the audio watermark with a longer length to be added to the audio to be processed. Moreover, since each segment of the second audio watermark includes a reference number, after adding the n segments of the second audio watermark to the audio to be processed to obtain the target audio, the order of the n second audio watermarks in the target audio can be determined based on the reference number, which is conducive to extracting the audio watermark to be added from the target audio.
[0123] As an optional implementation manner, the adding device obtains the audio watermark to be added by performing the following steps:
[0124] 2001. Obtain the audio watermark to be processed.
[0125] In the embodiment of the present application, the audio watermark to be processed may be any audio watermark.
[0126] 2002. Generate target verification information by encrypting the audio watermark to be processed.
[0127] In an embodiment of the present application, the target verification information is used to verify the audio watermark extracted from the target audio. Specifically, the target verification information is used to verify whether the audio watermark extracted from the target audio is the audio watermark to be processed. In one possible implementation method, the adding device generates target verification information by encrypting the audio watermark to be added. This allows the target verification information to change with the change of the audio watermark to be processed, thereby increasing the difficulty of cracking the target verification information, which is beneficial to the verification based on the target verification information. For example, a symmetric encryption algorithm is used to encrypt the audio watermark to be added to generate target verification information. For another example, an asymmetric encryption algorithm is used to encrypt the audio watermark to be added to generate target verification information.
[0128] 2003. Concatenate the audio watermark to be processed and the target verification information to obtain the audio watermark to be added.
[0129] The adding device obtains the audio watermark to be added by executing step 2003, and the audio watermark to be added may include the audio watermark to be processed and the target verification information. In the case where the audio watermark to be added includes the target verification information, the target verification information is also present in the n-segment first audio watermark obtained by dividing the audio watermark to be added into n segments, and the target verification information is also present in the n-segment second audio watermark obtained by adding the reference serial number to the n-segment first audio watermark.
[0130] Optionally, the n-segment second audio watermark includes a verification audio watermark, wherein the verification audio watermark includes target verification information, and the position of the target verification information in the verification audio watermark is the verification position. Specifically, the verification audio watermark is a character sequence, and the verification position indicates the position of the verification information in the character sequence. For example, if the verification position is the last digit, then the last digit in the verification audio watermark is the target verification information. For another example, if the verification position is the 8th to 10th digits, then the 8th to 10th digits in the verification audio watermark represent the target verification information. In the case where the position of the target verification information in the verification audio watermark is the verification position, after extracting the verification audio watermark from the target audio, the target verification information can be determined from the verification audio watermark based on the verification position, and then the extracted verification audio watermark can be verified based on the target verification information, thereby improving the accuracy of the audio watermark to be added based on the extracted verification audio watermark.
[0131] In this embodiment, after obtaining the audio watermark to be processed, the extraction device encrypts the audio watermark to be processed to obtain the target verification information, thereby generating corresponding verification information for the audio watermark to be processed. Then, the audio watermark to be processed and the target verification information are spliced to obtain the audio watermark to be added, so that the audio watermark to be added can include the target verification information. In this way, after obtaining the target audio by adding n segments of the second audio watermark to the audio to be processed, the target verification information can be used to verify whether the audio watermark extracted from the target audio is the audio watermark to be processed.
[0132] As an optional implementation, the extraction device performs the following steps during the execution of step 103: adding a reference number and a preset identifier to each of the n first audio watermarks to obtain n second audio watermarks, wherein the position of the preset identifier in the second audio watermark is the identifier position.
[0133] The preset identifier added to each segment of the first audio watermark is the same, but the reference number added to each segment of the first audio watermark is different. Specifically, the second audio watermark is a character sequence, and the identifier position indicates the position of the preset identifier in the character sequence. For example, if the identifier position is the 1st bit, then the 1st bit in the second audio watermark is the preset identifier. For another example, if the identifier position is the 1st to 12th bits, then the 1st to 12th bits in the second audio watermark represent the preset identifier.
[0134] When the position of the preset identifier in the second audio watermark is the identifier position, after extracting the audio watermark from the target audio, the preset identifier can be determined from the audio watermark based on the identifier position, and then whether the extracted audio watermark is correct can be determined based on the preset identifier.
[0135] The above-mentioned preset identifier can be any character. In a possible implementation method, the audio to be processed is the audio released by the target object through the target platform. For example, the target platform is an audio on-demand platform, and the audio to be processed is the audio released by the target object on the audio on-demand platform. For another example, the target platform is a video on-demand platform, and the audio to be processed is the audio released by the target object on the video on-demand platform. The preset identifier is the identifier of the target object on the target platform. Optionally, the target identifier is the name of the target object on the target platform, and the target identifier may be the identity document (ID) of the target object on the target platform. In the case where the audio to be processed is the audio uploaded by the target object to the target platform, by using the ID of the target object on the target platform as the preset identifier, and then by adding the preset identifier and the reference serial number to the first audio watermark to obtain the second audio watermark, it is possible to generate a watermark matching the ID of the object for the audio uploaded by the object, and the watermark matching the ID of the object can be added to the audio uploaded by the object.
[0136] See also Figure 2 , Figure 2 A schematic diagram of an n-segment second audio watermark provided in an embodiment of the present application. Figure 2 As shown, the n second audio watermarks include the first second audio watermark, the second second audio watermark, the third second audio watermark, the fourth second audio watermark, and the fifth second audio watermark, that is, there are 5 second audio watermarks in total, n=5. Figure 2As shown, each second audio watermark includes 8 bytes of information. The 8 bytes of information include 2 bytes of group header information, wherein the 2 bytes of group header information include a 12-bit preset identifier and a 4-bit reference number. The first second audio watermark, the second second audio watermark, the third second audio watermark, and the fourth second audio watermark all include a 6-byte payload, that is, a 48-bit payload. The fifth second audio watermark includes a 2-byte payload and 4-byte target check information, that is, a 16-bit payload and 32-bit target check information. Among them, the payload is the first audio watermark, that is, the payload is the information in the audio watermark to be processed. Figure 2 In the example, the total capacity of the payload in the five second audio watermarks is 26 bytes, that is, the capacity of the audio watermark to be processed is 26 bytes. Except for the fifth second audio watermark, the second audio watermarks do not include target verification information.
[0137] Figure 2 The 2 seconds on the right side of the figure indicate that the watermark is obtained based on the audio to be processed. Figure 2 After the 5 second audio watermarks are shown, the 5 second audio watermarks can be added to the audio to be processed to obtain the target audio, wherein in the target audio, the time interval between any two second audio watermarks is 2 seconds. Figure 2 The 0.1 second on the right side of the figure indicates that after obtaining the target audio, one audio frame to be extracted can be intercepted from the target audio every 0.1 seconds to obtain m audio frames to be extracted. By extracting the audio watermark from the m audio frames to be extracted, the audio watermark in the target audio can be obtained.
[0138] exist Figure 2 In the embodiment, by dividing the audio watermark to be processed into 5 second audio watermarks and then adding the 5 second audio watermarks to the audio to be processed, 5 shorter second audio watermarks can be added to the audio to be processed by adding them 5 times, thereby realizing adding the longer audio watermark to be processed to the audio to be processed.
[0139] The embodiment of the present application also provides a method for extracting an audio watermark, wherein the execution subject of the method for extracting an audio watermark is a device for extracting an audio watermark (hereinafter referred to as an extraction device), wherein the extraction device can be any electronic device that can execute the technical solution disclosed in the embodiment of the method of the present application. Optionally, the extraction device can be one of the following: a computer, a server.
[0140] See also Figure 3 , Figure 3 A flowchart of a method for adding an audio watermark is provided in an embodiment of the present application.
[0141] 301. Obtain target audio.
[0142] In an embodiment of the present application, the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, while n segments of second audio watermarks are obtained by adding reference numbers to each segment of the first audio watermark in the n segments of the first audio watermark. Specifically, the n segments of second audio are obtained by adding reference numbers to each segment of the first audio watermark in the n segments of the first audio watermark, and the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed. Among them, the reference number represents the order of the first audio watermark corresponding to the reference number in the n segments of the first audio watermark, and the n segments of the first audio watermark are obtained by dividing the audio watermark to be added into n segments. The meaning of the reference number can be found in the explanation of the reference number in step 103, and the specific implementation process of obtaining the target audio can be found in the description of obtaining the target audio in steps 101 to 103, which will not be repeated here.
[0143] In an implementation method of acquiring target audio, an extraction device receives the target audio input by a user through an input component.
[0144] In another implementation of acquiring the target audio, the extraction device receives the target audio sent by the terminal.
[0145] 302. Extract m audio frames to be extracted from the target audio.
[0146] In the embodiment of the present application, m is an integer greater than or equal to n. Since the audio watermark to be added is divided into n segments and added to the audio to be processed to obtain the target audio, if the complete audio watermark to be added is to be extracted from the target audio, at least n audio watermarks need to be extracted. Therefore, when m is an integer greater than or equal to n, the extraction device may subsequently extract n audio watermarks from m frames of audio frames to be extracted, and then it may be possible to extract the complete audio watermark to be added from the target audio. In one possible implementation method, the extraction device obtains the length of the target audio. The target audio is divided into m segments according to the length of the target audio, and m frames of audio frames to be extracted are obtained. Optionally, any two frames of audio frames to be extracted in the m frames of audio frames to be extracted have no overlap.
[0147] In another possible implementation, the length of the audio frame to be extracted is greater than the length of the second audio watermark, where the length of the second audio watermark is the duration of the second audio watermark in the audio. For example, if the duration of the second audio watermark in the audio is 2 seconds and the length of the second audio watermark is 2 seconds, then the length of the audio frame to be extracted is greater than 2 seconds. By making the length of the audio frame to be extracted greater than the length of the second audio watermark, the probability that a frame of audio to be extracted includes a complete second audio watermark can be increased, thereby improving the efficiency of subsequently extracting the audio watermark from the audio frame to be extracted.
[0148] In another possible implementation, the extraction device divides the target audio according to a preset step length to obtain m frames of audio frames to be extracted, wherein the preset step length is greater than 0 and less than the length of the second audio watermark. In this implementation, the extraction device divides the target audio once every preset step length to obtain a frame of audio frames to be extracted. For example, the length of the audio frame to be extracted is 3 seconds, and the preset step length is 1 second. The extraction device can divide the 0th to 3rd seconds of the target audio into a frame of audio frames to be extracted, and divide the 4th to 7th seconds into a frame of audio frames to be extracted. When the preset step length is greater than 0, the extraction device divides the target audio according to the preset step length to obtain m frames of audio frames to be extracted, which can improve the efficiency of division, and further improve the efficiency of obtaining m frames of audio frames to be extracted. The preset step length is less than the length of the second audio watermark, which can avoid skipping a complete second audio watermark when dividing two adjacent frames of audio frames to be extracted, and further make the m frames of audio frames to be extracted contain more watermark information in the target audio.
[0149] 303. Extract the audio watermarks from the m audio frames to be extracted to obtain i first extracted watermarks.
[0150] In the embodiment of the present application, i is less than or equal to m, that is, the number of first extracted watermarks is less than or equal to m. The first extracted watermark includes a sequence number to be confirmed and a candidate audio watermark, wherein the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions, and the candidate audio watermark is the watermark information in the first extracted watermark. Since the target audio is obtained by adding n segments of the second audio watermark to the audio to be processed, the audio watermark in the target audio is the second audio watermark, so the audio watermark extracted from the target audio watermark also contains information that has the same function as the reference sequence number, that is, the first extracted watermark contains information that has the same function as the reference sequence number, and the position of the information in the first extracted watermark is the same as the position of the reference sequence number in the second audio watermark, both of which are sequence number positions. Specifically, the reference sequence number can be used to sort the second audio watermark, and the information in the first extracted watermark located at the sequence number position can be used to sort the first extracted watermark. In a possible implementation, the second audio watermark is obtained by adding the reference sequence number to the first audio watermark, then the information in the extracted watermark other than the reference sequence number is the candidate audio watermark. Optionally, the extraction device may determine the sequence number to be confirmed in the first extracted watermark according to the information located at the sequence number position in the first extracted watermark.
[0151] In one possible implementation, the second audio watermark is added to the audio to be processed by the following method: the second audio watermark is encoded to obtain a watermark encoding result to be added, wherein the watermark encoding result to be added is a binary sequence with x bits. The audio to be processed is subjected to frequency domain transformation to obtain the spectrum information to be processed, and x groups of amplitudes are determined from the amplitudes of the spectrum information to be processed, and the difference between the average values of the amplitudes in any two groups of amplitudes is less than or equal to the amplitude threshold. According to the x-bit values in the binary sequence, x amplitude adjustment amounts are determined, and the amplitude adjustment amounts correspond to the values in the binary sequence one by one, the amplitude adjustment amounts corresponding to the same values are the same, and the amplitude adjustment amounts corresponding to different values are different. Using the x amplitude adjustment amounts, the x groups of amplitudes in the spectrum information to be processed are adjusted to obtain the target spectrum information. The target spectrum information is subjected to time domain transformation to obtain the audio with the second audio watermark.
[0152] At this time, the extraction device can extract the audio watermark in the audio frame to be extracted in the following manner: perform frequency domain transformation on the audio frame to be extracted to obtain the spectrum information to be extracted. Determine x groups of amplitudes from the spectrum information to be extracted, wherein the method of determining the x groups of amplitudes when extracting the watermark is the same as the method of determining the x groups of amplitudes when adding the watermark. For each group of amplitudes in the x groups of amplitudes, determine the bit corresponding to the group of amplitudes according to the average value of the amplitudes in the group of amplitudes. Specifically, before adjusting the amplitudes in the group of amplitudes, the difference in the average values of the amplitudes in any two groups of amplitudes is less than or equal to the amplitude threshold, indicating that the difference in the average values of the amplitudes in any two groups of amplitudes is not large. Because the amplitude adjustment amounts corresponding to bits of different sizes are different, the amplitude average values of different groups of amplitudes corresponding to bits of different sizes are relatively different after the amplitudes are adjusted. Therefore, the value of the bit corresponding to the group of amplitudes can be determined according to the average value of the amplitudes in a group of amplitudes, and then the first extracted watermark can be obtained. For example, if the first amplitude adjustment amount is 0 and the second amplitude adjustment amount is 0.3, then the average value of the amplitudes in a group of amplitudes adjusted based on the first amplitude adjustment amount is smaller than the average value of the amplitudes in a group of amplitudes adjusted based on the second amplitude adjustment amount. Therefore, the value corresponding to a group of amplitudes with a smaller average value in the x groups of amplitudes is determined to be 0, and the value corresponding to a group of amplitudes with a larger average value in the x groups of amplitudes is determined to be 1. After determining the values corresponding to each group of amplitudes, the binary sequence can be determined based on the correspondence between each group of amplitudes and the values of the bits of the binary sequence. For example, x is 2, that is, the binary sequence has 2 bits in total. A group of amplitudes corresponding to the value of the first bit in the binary sequence is the first group of amplitudes in the x groups of amplitudes, and a group of amplitudes corresponding to the value of the second bit in the binary sequence is the second group of amplitudes in the x groups of amplitudes. If the value corresponding to the first group of amplitudes is 0 and the value corresponding to the second group of amplitudes is 1, then the binary sequence is 01, that is, the first extracted watermark is 01.
[0153] In another possible implementation, the second audio watermark is added to the audio to be processed by adjusting the least significant bit in the audio to be processed. In this case, the extraction device obtains the first extracted watermark by extracting the audio watermark from the least significant bit of the audio frame to be extracted.
[0154] In another possible implementation, the extraction device may utilize a watermark extraction model to extract an audio watermark from an audio frame to be extracted to obtain a first extracted watermark, wherein the watermark extraction model is a deep learning model capable of extracting audio watermarks from audio.
[0155] 304. Sort the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain a target audio watermark of the target audio.
[0156] Since the order of the n second audio watermarks in the target audio may be different from the reference numbers in the n second audio watermarks, and the target audio is obtained by adding n second audio watermarks to the audio to be processed, after the extraction device extracts i first extracted watermarks from m frames of audio frames to be extracted of the target audio, it is necessary to sort the i first extracted watermarks to obtain the audio watermark in the target audio.
[0157] Because the reference serial number indicates the order of the first audio watermark corresponding to the reference serial number in the n-segments of first audio watermarks, wherein the n-segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments, after the reference serial numbers of the n-segments of first audio watermarks are respectively added to the corresponding first audio watermarks to obtain n-segments of second audio watermarks, the watermark information in the n-segments of second audio watermarks is sorted according to the reference serial numbers of the n-segments of second audio watermarks, and the audio watermark to be added can be obtained. Therefore, after the n-segments of second audio watermarks are added to the audio to be processed to obtain the target audio, and the i first extracted watermarks are extracted from the target audio, the i first extracted watermarks can be sorted according to the serial numbers to be confirmed in the i first extracted watermarks, and the audio watermark in the target audio can be obtained.
[0158] For example, the i first extracted watermarks include the first extracted watermark a, the first extracted watermark b, and the first extracted watermark c, wherein the reference number of the first extracted watermark a is 2, and the candidate audio watermark of the first extracted watermark is 445, the reference number of the first extracted watermark b is 1, and the candidate audio watermark of the first extracted watermark is XHS, the reference number of the first extracted watermark c is 3, and the candidate audio watermark of the first extracted watermark is 32. Then the extraction device sorts the candidate audio watermarks in the first extracted watermark a, the candidate audio watermarks in the first extracted watermark b, and the candidate audio watermarks in the first extracted watermark c according to the reference number in the first extracted watermark a, the reference number in the first extracted watermark b, and the reference number in the first extracted watermark c, and the obtained audio watermark is: XHS44532.
[0159] In the embodiment of the present application, the target audio is obtained by adding n second audio watermarks to the audio to be processed, where n second audio watermarks are obtained by adding reference numbers to each first audio watermark in n first audio watermarks, wherein the reference number indicates the order of the first audio watermark corresponding to the reference number in the n first audio watermarks, and the n first audio watermarks are obtained by dividing the audio watermark to be added into n segments. That is, the target audio is obtained by adding n second audio watermarks of shorter length obtained based on the audio watermarks of longer length to the audio to be processed. After acquiring the target audio, the extraction device intercepts m audio frames to be extracted from the target audio, wherein m is an integer greater than or equal to n. Then, the audio watermarks in the m audio frames to be extracted are extracted to obtain i first extracted watermarks, wherein the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark. Finally, according to the sequence number to be confirmed in the i first extracted watermarks, the candidate audio watermarks in the i first extracted watermarks are sorted to obtain the target audio watermark of the target audio. In this way, after i first extracted watermarks with shorter lengths are extracted from the target audio, the target audio watermark with longer length in the target audio can be restored by sorting the i first extracted watermarks.
[0160] As an optional implementation, the verification audio watermark in the n-segment second audio watermark includes target verification information, wherein the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position. The meaning of the target verification information in this step is the same as that of the target verification information in step 2001, and will not be repeated here. For example, the n-segment second audio watermark includes a second audio watermark a and a second audio watermark b, wherein the reference serial number in the second audio watermark a is 1, and the reference serial number in the second audio watermark b is 2. If the second audio watermark a includes the target verification information, then the second audio watermark a is a verification audio watermark, and the target serial number is 1. If the second audio watermark b includes the target verification information, then the second audio watermark b is a verification audio watermark, and the target serial number is 2. It should be understood that the verification audio watermark includes not only the target verification information and the reference serial number, but also the candidate audio watermarks.
[0161] In this embodiment, before executing step 304, the extraction device further executes the following steps:
[0162] 4001. Determine the first extracted watermark whose to-be-confirmed sequence number is the target sequence number from the i first extracted watermarks as the second extracted watermark.
[0163] Since the target sequence number is a reference sequence number for verifying the audio watermark, and the verifying audio watermark includes the target verification information, the first extracted watermark whose sequence number to be confirmed is the target sequence number among the i first extracted watermarks also includes the verification information. Therefore, the extraction device determines the first extracted watermark whose sequence number to be confirmed is the target sequence number from the i first extracted watermarks as the second extracted watermark, that is, the second extracted watermark is the watermark including the verification information among the i first extracted watermarks.
[0164] 4002. Determine first verification information based on the information located at the verification position in the second extracted watermark.
[0165] Since the second extracted watermark includes verification information, the extraction device can determine the first verification information from the second extracted watermark. Specifically, the position of the target verification information in the verification audio watermark is the verification position. The extraction device determines the first verification information based on the information located at the verification position in the second extracted watermark. For example, the verification position is the last 1 digit, and the second extracted watermark is XHS234138. Then the last digit 8 of the second extracted watermark is the first verification information. For another example, the verification position is the last 3 digits, and the second extracted watermark is XHS234138. Then the last three digits 138 of the second extracted watermark are the first verification information.
[0166] After obtaining the first verification information, the extraction device performs the following steps during the execution of step 304:
[0167] 4003. Sort the first audio watermarks in the i first extracted watermarks according to the to-be-confirmed serial numbers in the i first extracted watermarks to obtain the to-be-confirmed audio watermarks.
[0168] The implementation process of this step can refer to the implementation process of step 304, but the result obtained in step 304 is called the target audio watermark, while the result obtained in this step is called the audio watermark to be confirmed.
[0169] 4004. When it is determined that the audio watermark to be confirmed is correct based on the first verification information, use the audio watermark to be confirmed as the target audio watermark.
[0170] Since the target audio is obtained by adding n segments of the second audio watermark to the audio to be processed, wherein the verification audio watermark in the n segments of the second audio watermark includes the target verification information, the target audio also contains the verification information, and the verification information in the target audio has the same function as the target verification information. Furthermore, since the verification information extracted from the target audio is the first verification information, the function of the first verification information is the same as that of the target verification information, and both are used to verify whether the audio watermark extracted from the target audio is correct. Therefore, the extraction device can determine whether the audio watermark to be confirmed is correct based on the first verification information, and can use the audio watermark to be confirmed as the target audio watermark when it is determined that the audio watermark to be confirmed is correct based on the first verification information.
[0171] In one possible implementation, the target verification information is obtained by encrypting the audio watermark to be processed. If the audio to be confirmed extracted from the target audio is correct, the verification information obtained by encrypting the audio watermark to be confirmed should be the same as the first verification information extracted from the audio to be confirmed. It should be understood that since the audio to be confirmed includes the second extracted watermark, extracting the first verification information from the second extracted watermark is the same as extracting the first verification information from the audio to be confirmed.
[0172] Therefore, after obtaining the audio watermark to be confirmed, the extraction device determines that the first verification information is correct before using the audio watermark to be confirmed as the target audio watermark by performing the following steps to determine that the first verification information is correct: encrypting the audio watermark to be confirmed to generate the second verification information. If the first verification information is the same as the second verification information, it is determined that the audio watermark to be confirmed is correct.
[0173] In this implementation, the encryption process performed by the extraction device on the audio watermark to be confirmed is the same as the encryption process performed on the audio watermark to be processed. For example, the target verification information is obtained by encrypting the audio watermark to be processed using a symmetric encryption algorithm, and the extraction device obtains the second verification information by encrypting the audio watermark to be confirmed using a symmetric encryption algorithm. After the second verification information is generated by encrypting the audio watermark to be confirmed, it can be determined whether the audio to be confirmed is correct by comparing the first verification information with the second verification information. Specifically, the first verification information is the same as the second verification information, indicating that the audio to be confirmed is correct. The first verification information is different from the second verification information, indicating that the audio to be confirmed is incorrect. Therefore, when the first verification information and the second verification information are the same, the extraction device determines that the first verification information is correct.
[0174] In another possible implementation, the extraction device determines that the audio watermark to be confirmed is correct when the first verification information is the same as the target verification information. In yet another possible implementation, the extraction device generates the second verification information by encrypting the audio watermark to be confirmed. When the second verification information is the same as the target verification information, it is determined that the audio watermark to be confirmed is correct.
[0175] In this embodiment, the verification audio watermark in the n-segment second audio watermark includes target verification information, the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position. The extraction device determines the first extraction watermark whose sequence number to be confirmed is the target sequence number from the i first extraction watermarks as the second extraction watermark. The first verification information is determined based on the information located at the verification position in the second extraction watermark. Then, according to the sequence number to be confirmed in the i first extraction watermarks, the first audio watermarks in the i first extraction watermarks are sorted to obtain the audio watermark to be confirmed. Finally, when it is determined that the audio watermark to be confirmed is correct based on the first verification information, the audio watermark to be confirmed is used as the target audio watermark, thereby improving the accuracy of the target audio watermark.
[0176] As an optional implementation manner, the extraction device performs the following steps during the process of executing step 303:
[0177] 5001. For each of the m audio frames to be extracted, extract the audio watermark respectively to obtain m third extracted watermarks.
[0178] In the embodiment of the present application, the third extracted watermark corresponds to the audio frame to be extracted one by one. The extraction device can obtain one third extracted watermark by extracting the audio watermark of one audio frame to be extracted. By extracting the audio watermark of m audio frames to be extracted, m third extracted watermarks can be obtained.
[0179] 5002. Determine m serial numbers to be confirmed based on the information located at the serial number positions in the m third extracted watermarks.
[0180] In this step, the sequence number to be confirmed corresponds to the third extracted watermark one by one. Specifically, the extraction device can determine one sequence number to be confirmed according to the information at the sequence number position in one third extracted watermark, and can determine m sequence numbers to be confirmed according to the information at the sequence number position in m third extracted watermarks. For example, if the third extracted watermark is a binary sequence and the sequence number position is from the 13th to the 16th bit, then the extraction device can determine the sequence number to be confirmed of the third extracted watermark according to the information from the 13th to the 16th bit.
[0181] 5003. According to the m sequence numbers to be confirmed, i first extracted watermarks are determined from the m third extracted watermarks.
[0182] In this step, the pending confirmation serial number corresponding to the first extracted watermark is the reference serial number. The pending confirmation serial number is the reference serial number, indicating that the probability of the third extracted watermark being correct is high. Therefore, the extraction device can select i first extracted watermarks from m third extracted watermarks based on the reference serial number and the pending confirmation serial number.
[0183] In a possible implementation, the extraction device determines the reference sequence number from the m sequence numbers to be confirmed to obtain i candidate sequence numbers, and determines i third extracted watermarks corresponding to the i candidate sequence numbers as i first extracted watermarks.
[0184] Since the reference serial number is known, the extraction device can determine the reference serial number from the m serial numbers to be confirmed, and finally obtain i candidate serial numbers. For example, n=3, there are 3 reference serial numbers in total, and the 3 reference serial numbers are R, S, and Q, where R represents the order of 1, S represents the order of 2, and Q represents the order of 3. If the m serial numbers to be confirmed include R, 2, S, and Q, then 2 is not a reference serial number. For another example, n=3, there are 3 reference serial numbers in total, and the 4 reference serial numbers are *, E, and 8, where * represents the order of 1, E represents the order of 2, and 8 represents the order of 3. If the m serial numbers to be confirmed include *, 3, 8, E, and 9, then 2 and 3 are not reference serial numbers.
[0185] In this embodiment, the extraction device extracts the audio watermark for each of the m audio frames to be extracted, and obtains m third extracted watermarks. According to the information located at the sequence number position in the m third extracted watermarks, m sequence numbers to be confirmed are determined. Finally, according to the m sequence numbers to be confirmed, i first extracted watermarks are determined from the m third extracted watermarks, wherein the sequence number to be confirmed corresponding to the first extracted watermark is the reference sequence number. In this way, the correctness of the third extracted watermark is verified based on the sequence number to be confirmed and the reference sequence number, so that i first extracted watermarks are determined from the m third extracted watermarks based on the verification result, and the accuracy of the i first extracted watermarks can be improved.
[0186] As an optional implementation manner, before executing step 5003, the extraction device further executes the following steps:
[0187] 6001. Determine m identifications to be confirmed based on the information located at the identification position in the m third extracted watermarks.
[0188] The meaning of the identification position in this step is the same as that of the identification position in step 2002, and will not be repeated here. The identification to be confirmed corresponds to the third extracted watermark one by one. Specifically, the extraction device can determine one identification to be confirmed based on the information at the identification position in one third extracted watermark, and can determine m identification to be confirmed based on the information at the identification position in m third extracted watermarks. For example, if the third extracted watermark is a binary sequence, and the identification position is from the 1st to the 12th bit, then the extraction device can determine the identification to be confirmed of the third extracted watermark based on the information at the 1st to the 12th bit.
[0189] After determining m identifications to be confirmed, the extraction device performs the following steps during the execution of step 5003:
[0190] 6002. Determine the i first extracted watermarks from the m third extracted watermarks according to the m to-be-confirmed serial numbers and the m to-be-confirmed identifiers.
[0191] In this step, the to-be-confirmed serial number corresponding to the third extracted watermark is the reference serial number, and the to-be-confirmed identifier corresponding to the third extracted watermark is the preset identifier. Since both the reference serial number and the preset identifier are known, the extraction device can use the reference serial number and the preset identifier as a basis to select i first extracted watermarks from m third extracted watermarks. That is, if the to-be-confirmed serial number and the to-be-confirmed identifier in the extracted third extracted watermark are both correct, it can be determined that the third extracted watermark is correct, and the correct third extracted watermark is used as the first extracted watermark.
[0192] In this embodiment, after determining m identifications to be confirmed and m serial numbers to be confirmed, the extraction device determines i first extracted watermarks from the m third extracted watermarks according to the m serial numbers to be confirmed and the m identifications to be confirmed, wherein the serial number to be confirmed corresponding to the first extracted watermark is a reference serial number, and the identification to be confirmed corresponding to the first extracted watermark is a preset identifier. Thus, the correctness of the third extracted watermark is verified based on the serial number to be confirmed, the reference serial number, the identification to be confirmed and the preset identifier, thereby determining i first extracted watermarks from the m third extracted watermarks based on the verification result, and the accuracy of the i first extracted watermarks can be improved.
[0193] See also Figure 4 , Figure 4 The following is a flow chart of an audio processing method provided in an embodiment of the present application. The audio processing method includes the flow chart of the method for adding an audio watermark and the flow chart of the method for extracting an audio watermark as described above. Figure 4 As shown, firstly, the audio watermark to be processed and the target verification information are spliced to obtain the audio watermark to be added, and then the audio watermark to be added is divided into n segments of the first audio watermark. Then, a reference number and a preset identifier are added. Specifically, a reference number and a preset identifier are added to each of the n segments of the first audio watermark to obtain n segments of the second audio watermark. The audio to be processed is divided into n frames of audio frames to be processed. Then, frame by frame addition is performed. Specifically, n segments of the second audio watermark are added to n frames of audio frames to be processed through n additions to obtain n frames of watermarked audio frames, wherein the second audio watermark corresponds to the audio frames to be processed one by one, and then the n frames of watermarked audio frames are spliced to obtain the target audio.
[0194] After obtaining the target audio, the target audio is divided. Specifically, the target audio is divided into m segments to obtain m frames of audio frames to be extracted. Then the audio watermark is extracted. Specifically, the audio watermarks in the m frames of audio frames to be extracted are extracted to obtain m third extracted watermarks. Then it is determined whether the sequence number to be confirmed and the identifier to be confirmed are correct. Specifically, for each of the m third extracted watermarks, it is determined whether the sequence number to be confirmed is a reference sequence number, and whether the identifier to be confirmed is a preset identifier. If the preset conditions are met, the third extracted watermark is determined to be the first extracted watermark. If the preset conditions are not met, the third extracted watermark is deleted, wherein the preset conditions are that the sequence number to be confirmed in the third extracted watermark is a reference sequence number, and the identifier to be confirmed in the third extracted watermark is a preset identifier. In this way, i first extracted watermarks can be screened out from the m third extracted watermarks. After screening out i first extracted watermarks, the first extracted watermark whose to-be-confirmed sequence number is the target sequence number can be determined from the i first extracted watermarks as the second extracted watermark, and then the first verification information can be determined according to the information located at the verification position in the second extracted watermark. In addition, after screening out i first extracted watermarks, the candidate audio watermarks in the i first extracted watermarks can be sorted according to the to-be-confirmed sequence number in the i first extracted watermarks to obtain the to-be-confirmed audio watermark of the target audio. The second verification information can be obtained by encrypting the to-be-confirmed audio watermark. After obtaining the first verification information and the second verification information, it is determined whether the first verification information and the second verification information are the same. If they are the same, the to-be-confirmed audio watermark is used as the target audio watermark.
[0195] See also Figure 5 , Figure 5 This is a timing diagram of an audio processing method provided in an embodiment of the present application. Figure 5As shown, the client first uploads the audio to be processed to the target platform, and then uploads the audio to be processed to the adding device running the target platform, wherein the target platform is one of the following: an audio on demand platform, a video on demand platform. The adding device then performs the following steps: splicing the audio watermark to be processed and the target verification information to obtain the audio watermark to be added, dividing the audio watermark to be added into n segments of the first audio watermark, adding a reference number and a preset identifier to each of the n segments of the first audio watermark, respectively, to obtain n segments of the second audio watermark, adding the n segments of the second audio watermark to the audio to be processed, and obtaining the target audio with the audio watermark to be added. After obtaining the target audio, the adding device can publish the target audio to the target platform. After the target audio is published to the target platform, the extraction device can obtain the target video from the target platform. After obtaining the target video, the following steps can be performed in sequence: intercept m frames of audio frames to be extracted from the target audio, extract the audio watermarks in the m frames of audio frames to be extracted, obtain m third extracted watermarks, select i first extracted watermarks from the m third extracted watermarks, obtain the audio watermark to be confirmed and the first verification information based on the i first extracted watermarks, encrypt the audio watermark to be confirmed to obtain the second verification information, and determine that the audio watermark to be confirmed is the target audio watermark of the target audio when the first verification information and the second verification information are the same. In this way, the target audio watermark can be extracted from the target audio.
[0196] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0197] The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.
[0198] See also Figure 6 , Figure 6 The present invention provides a schematic diagram of a device for adding an audio watermark according to an embodiment of the present invention. The device 1 for adding an audio watermark includes: an acquisition unit 11, a division unit 12, and an adding unit 13. Specifically:
[0199] An acquisition unit 11 is used to acquire the audio to be processed and the audio watermark to be added;
[0200] A dividing unit 12, configured to divide the audio watermark to be added into n segments of first audio watermarks, where n is an integer greater than 1;
[0201] an adding unit 13, configured to add a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n first audio watermarks;
[0202] The adding unit 13 is used to add the n second audio watermarks to the audio to be processed to obtain the target audio with the audio watermark to be added.
[0203] In combination with any implementation manner of the present application, the acquisition unit 11 is specifically used for:
[0204] Get the audio watermark to be processed;
[0205] Generate target verification information by encrypting the audio watermark to be processed;
[0206] The audio watermark to be processed and the target verification information are concatenated to obtain the audio watermark to be added.
[0207] In combination with any implementation manner of the present application, the n-segment second audio watermark includes a verification audio watermark, the verification audio watermark includes the target verification information, and the position of the target verification information in the verification audio watermark is the verification position.
[0208] In combination with any embodiment of the present application, the adding unit 13 is specifically used for:
[0209] The reference number and the preset identifier are added to each of the n first audio watermarks to obtain the n second audio watermarks, and the position of the preset identifier in the second audio watermark is the identifier position.
[0210] In combination with any implementation manner of the present application, the position of the reference serial number in the second audio watermark is a serial number position.
[0211] In the embodiment of the present application, after obtaining the audio to be processed and the audio watermark to be added, the device for adding the audio watermark divides the audio watermark to be added into n segments of the first audio watermark, thereby the audio watermark to be added with a longer length can be divided into n segments of the first audio watermark with a shorter length. Then, a reference number is added to each of the n segments of the first audio watermark to obtain n segments of the second audio watermark, wherein the reference number indicates the order of the first audio watermark corresponding to the reference number in the n segments of the first audio watermark. By adding the n segments of the second audio watermark to the audio to be processed, it is possible to obtain the target audio with the audio watermark to be added by adding the n segments of the second audio watermark with a shorter length to the audio to be processed and the audio watermark with a longer length to be added to the audio to be processed. Moreover, since each segment of the second audio watermark includes a reference number, after adding the n segments of the second audio watermark to the audio to be processed to obtain the target audio, the order of the n second audio watermarks in the target audio can be determined based on the reference number, thereby facilitating the extraction of the audio watermark to be added from the target audio.
[0212] See also Figure 7 , Figure 7 The present invention provides a schematic diagram of a device for extracting an audio watermark according to an embodiment of the present invention. The device 2 for extracting an audio watermark includes: an acquisition unit 21, a capture unit 22, an extraction unit 23, and a processing unit 24. Specifically:
[0213] an acquiring unit 21, configured to acquire a target audio, wherein the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, in the case where n segments of second audio watermarks are obtained by respectively adding a reference serial number to each segment of the first audio watermark in n segments of first audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n segments of first audio watermarks, and the n segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments;
[0214] An interception unit 22, configured to intercept m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n;
[0215] The extracting unit 23 is used to extract the audio watermarks from the m frames of audio frames to be extracted, and obtain i first extracted watermarks, where i is less than or equal to m, and the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark, and the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions;
[0216] The processing unit 24 is used to sort the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain a target audio watermark of the target audio.
[0217] In combination with any embodiment of the present application, the verification audio watermark in the n-segment second audio watermark includes target verification information, the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position;
[0218] The processing unit 24 is further configured to:
[0219] Determine, from the i first extracted watermarks, the first extracted watermark whose sequence number to be confirmed is the target sequence number as the second extracted watermark;
[0220] determining first verification information according to the information located at the verification position in the second extracted watermark;
[0221] The processing unit 24 is specifically used for:
[0222] Sort the first audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the to-be-confirmed audio watermarks;
[0223] In a case where it is determined based on the first verification information that the audio watermark to be confirmed is correct, the audio watermark to be confirmed is used as the target audio watermark.
[0224] In combination with any implementation manner of the present application, the target verification information is obtained by encrypting the audio watermark to be added;
[0225] The processing unit 24 is specifically used for:
[0226] Generate second verification information by performing the encryption process on the audio watermark to be confirmed;
[0227] When the first verification information is identical to the second verification information, it is determined that the audio watermark to be confirmed is correct.
[0228] In combination with any embodiment of the present application, the extraction unit 23 is specifically used for:
[0229] For each of the m audio frames to be extracted, extract the audio watermark to obtain m third extracted watermarks, wherein the third extracted watermarks correspond to the audio frames to be extracted one by one;
[0230] Determine m to-be-confirmed sequence numbers according to the information located at the sequence number position in the m third extracted watermarks, wherein the to-be-confirmed sequence numbers correspond one-to-one to the third extracted watermarks;
[0231] According to the m to-be-confirmed serial numbers, the i first extracted watermarks are determined from the m third extracted watermarks, and the to-be-confirmed serial number corresponding to the first extracted watermark is the reference serial number.
[0232] In combination with any embodiment of the present application, the processing unit 24 is further configured to:
[0233] Determine m to-be-confirmed identifiers according to the information at the identifier position in the m third extracted watermarks, wherein the to-be-confirmed identifiers correspond one-to-one to the third extracted watermarks;
[0234] The extraction unit 23 is specifically used for:
[0235] The i first extracted watermarks are determined from the m third extracted watermarks according to the m to-be-confirmed serial numbers and the m to-be-confirmed identifiers, and the to-be-confirmed identifier corresponding to the first extracted watermark is a preset identifier.
[0236] In the embodiment of the present application, the target audio is obtained by adding n second audio watermarks to the audio to be processed, where n second audio watermarks are obtained by adding reference numbers to each of the n first audio watermarks, wherein the reference number indicates the order of the first audio watermark corresponding to the reference number in the n first audio watermarks, and the n first audio watermarks are obtained by dividing the audio watermark to be added into n segments. That is, the target audio is obtained by adding n second audio watermarks of shorter length obtained based on the longer audio watermark to be added to the audio to be processed. After acquiring the target audio, the device for extracting audio watermarks intercepts m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n. Then, the audio watermarks in the m audio frames to be extracted are extracted to obtain i first extracted watermarks, wherein the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermarks. Finally, the candidate audio watermarks in the i first extracted watermarks are sorted according to the sequence number to be confirmed in the i first extracted watermarks, and the target audio watermark of the target audio can be obtained. In this way, after i first extracted watermarks with shorter lengths are extracted from the target audio, the target audio watermark with longer length in the target audio can be restored by sorting the i first extracted watermarks.
[0237] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0238] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device 3 includes a processor 31 and a memory 32. Optionally, the electronic device 3 also includes an input device 33 and an output device 34. The processor 31, the memory 32, the input device 33 and the output device 34 are coupled via a connector, and the connector includes various interfaces, transmission lines or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.
[0239] The processor 31 may include one or more processors, for example, one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Optionally, the processor 31 may be a processor group consisting of multiple CPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present application.
[0240] The memory 32 can be used to store computer program instructions and various computer program codes including the program code for executing the program code of the present application. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.
[0241] The input device 33 is used to input data and / or signals, and the output device 34 is used to output data and / or signals. The input device 33 and the output device 34 can be independent devices or an integrated device.
[0242] It can be understood that in the embodiment of the present application, the memory 32 can be used not only to store relevant instructions, but also to store relevant data. The embodiment of the present application does not limit the specific data stored in the memory.
[0243] Understandably, Figure 8 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of the present application are within the protection scope of the present application.
[0244] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0245] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
[0246] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0247] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.
[0248] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0249] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0250] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Claims
1. A method for adding an audio watermark, characterized in that: The method comprises: Get the audio to be processed and the audio watermark to be added; Dividing the audio watermark to be added into n segments of first audio watermarks, where n is an integer greater than 1; Adding a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks, wherein the reference serial number indicates the order of the first audio watermark corresponding to the reference serial number in the n first audio watermarks; The n segments of the second audio watermark are added to the audio to be processed to obtain the target audio with the audio watermark to be added.
2. The method according to claim 1, characterized in that: Get the audio watermark to be added, including: Get the audio watermark to be processed; Generate target verification information by encrypting the audio watermark to be processed; The audio watermark to be processed and the target verification information are concatenated to obtain the audio watermark to be added.
3. The method according to claim 2, characterized in that The n segments of the second audio watermarks include a verification audio watermark, the verification audio watermark includes the target verification information, and the position of the target verification information in the verification audio watermark is the verification position.
4. The method according to claim 2, characterized in that: The step of adding a reference number to each of the n first audio watermarks to obtain n second audio watermarks comprises: The reference number and the preset identifier are added to each of the n first audio watermarks to obtain the n second audio watermarks, and the position of the preset identifier in the second audio watermark is the identifier position.
5. The method according to claim 1 or 2, characterized in that: The position of the reference serial number in the second audio watermark is the serial number position.
6. A method for extracting an audio watermark, characterized in that: The method comprises: Obtaining target audio, wherein the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, when n segments of second audio watermarks are obtained by respectively adding reference numbers to each of the n segments of the first audio watermarks, wherein the reference numbers indicate the order of the first audio watermarks corresponding to the reference numbers in the n segments of first audio watermarks, and the n segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments; Intercepting m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n; Extracting audio watermarks from the m frames of audio frames to be extracted to obtain i first extracted watermarks, where i is less than or equal to m, the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark, and the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions; According to the to-be-confirmed sequence numbers in the i first extracted watermarks, the candidate audio watermarks in the i first extracted watermarks are sorted to obtain a target audio watermark of the target audio.
7. The method according to claim 6, characterized in that The verification audio watermark in the n segments of the second audio watermark includes target verification information, the reference serial number in the verification audio watermark is the target serial number, and the position of the target verification information in the verification audio watermark is the verification position; Before sorting the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the target audio watermark of the target audio, the method further includes: Determine, from the i first extracted watermarks, the first extracted watermark whose sequence number to be confirmed is the target sequence number as the second extracted watermark; determining first verification information according to the information located at the verification position in the second extracted watermark; The step of sorting the first audio watermarks in the i first extracted watermarks according to the sequence numbers to be confirmed in the i first extracted watermarks to obtain the target audio watermark of the target audio includes: Sort the first audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain the to-be-confirmed audio watermarks; In a case where it is determined based on the first verification information that the audio watermark to be confirmed is correct, the audio watermark to be confirmed is used as the target audio watermark.
8. The method according to claim 7, characterized in that The target verification information is obtained by encrypting the audio watermark to be added; The method of using the audio watermark to be confirmed as the target audio watermark when it is determined based on the first verification information that the audio watermark to be confirmed is correct includes: Generate second verification information by performing the encryption process on the audio watermark to be confirmed; When the first verification information is identical to the second verification information, it is determined that the audio watermark to be confirmed is correct.
9. The method according to any one of claims 6 to 8, characterized in that The step of extracting the audio watermarks from the m frames of audio frames to be extracted to obtain i first extracted watermarks includes: For each of the m audio frames to be extracted, extract the audio watermark to obtain m third extracted watermarks, wherein the third extracted watermarks correspond to the audio frames to be extracted one by one; Determine m to-be-confirmed sequence numbers according to the information located at the sequence number position in the m third extracted watermarks, wherein the to-be-confirmed sequence numbers correspond one-to-one to the third extracted watermarks; According to the m to-be-confirmed serial numbers, the i first extracted watermarks are determined from the m third extracted watermarks, and the to-be-confirmed serial number corresponding to the first extracted watermark is the reference serial number.
10. The method according to claim 9, characterized in that Before determining the i first extracted watermarks from the m third extracted watermarks according to the m sequence numbers to be confirmed, the method further includes: Determine m to-be-confirmed identifiers according to the information at the identifier position in the m third extracted watermarks, wherein the to-be-confirmed identifiers correspond one-to-one to the third extracted watermarks; The step of determining the i first extracted watermarks from the m third extracted watermarks according to the m sequence numbers to be confirmed comprises: The i first extracted watermarks are determined from the m third extracted watermarks according to the m to-be-confirmed serial numbers and the m to-be-confirmed identifiers, and the to-be-confirmed identifier corresponding to the first extracted watermark is a preset identifier.
11. A device for adding an audio watermark, characterized in that: The device for adding an audio watermark comprises: An acquisition unit, used to acquire the audio to be processed and the audio watermark to be added; a dividing unit, used for dividing the audio watermark to be added into n segments of first audio watermarks, where n is an integer greater than 1; an adding unit, configured to add a reference serial number to each of the n first audio watermarks to obtain n second audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n first audio watermarks; The adding unit is used to add the n second audio watermarks to the audio to be processed to obtain the target audio with the audio watermark to be added.
12. A device for extracting audio watermark, characterized in that: The device for extracting audio watermark comprises: an acquiring unit, configured to acquire a target audio, wherein the target audio is obtained by adding n segments of second audio watermarks to the audio to be processed, in the case where n segments of second audio watermarks are obtained by respectively adding a reference serial number to each segment of the first audio watermark in n segments of first audio watermarks, wherein the reference serial number indicates an order of the first audio watermark corresponding to the reference serial number in the n segments of first audio watermarks, and the n segments of first audio watermarks are obtained by dividing the audio watermark to be added into n segments; An interception unit, used for intercepting m audio frames to be extracted from the target audio, where m is an integer greater than or equal to n; an extracting unit, configured to extract the audio watermarks from the m frames of audio frames to be extracted, and obtain i first extracted watermarks, where i is less than or equal to m, and the first extracted watermarks include the sequence number to be confirmed and the candidate audio watermark, and the position of the sequence number to be confirmed in the first extracted watermark and the position of the reference sequence number in the second audio watermark are both sequence number positions; A processing unit is used to sort the candidate audio watermarks in the i first extracted watermarks according to the to-be-confirmed sequence numbers in the i first extracted watermarks to obtain a target audio watermark of the target audio.
13. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as claimed in any one of claims 1 to 5, or the electronic device executes the method as claimed in any one of claims 6 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the method described in any one of claims 1 to 5, or the processor is caused to execute the method described in any one of claims 6 to 10.
15. A computer program product, characterized in that The computer program product includes a computer program or instructions; when the computer program or instructions are run on a computer, the computer is enabled to execute the method described in any one of claims 1 to 5, or the computer is enabled to execute the method described in any one of claims 6 to 10.
Citation Information
Cited By
Audio identification method and system and storage medium
CN120299464A
Audio identification method, system and storage medium
CN120299464B
