A digital watermark embedding method and related device

By obtaining intermediate data of video clips from the cache database when the client receives video playback requests, and embeds digital watermarks into video clips, the problem of real-time embedding of watermarks in the prior art is solved, and efficient and real-time watermark embedding is achieved.

CN119788933APending Publication Date: 2025-04-08HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510027485.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When the client requests video, inserting hidden digital watermarks into the video in real time has technical problems such as time-consuming and high computing power, and it is difficult to take into account both the real-time and efficiency of embedding.

Method used

By receiving the playback request of the target original video, the intermediate data of the unembedded video clips is obtained from the cache database based on the video identification, and the digital watermark is embedded into the video clip based on the intermediate data, and finally combined into the embedded video.

Benefits of technology

It improves the efficiency and real-timeness of digital watermark embedding, reduces the amount of computing, and achieves the purpose of taking into account both real-timeness and efficiency of embedding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788933A_ABST
    Figure CN119788933A_ABST
Patent Text Reader

Abstract

The present application discloses a method for embedding a digital watermark and a related device, and relates to the field of video processing technology. Since the cache database records the identifier of the original video and the intermediate state data of each video segment, after receiving the playback request of the target original video, the intermediate state data of the non-embedded video segment is obtained in the cache database, and the embedded video segment is obtained according to the intermediate state data, so as to embed the digital watermark into the target original video. Further, the to-be-played video segments of the target original video are sequentially combined to obtain the embedded video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment. In summary, the present application improves the efficiency and real-time performance of digital watermark embedding by caching the intermediate state data of the video segment, and only needs to perform the intermediate state data calculation once on the same video segment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application technology, and in particular to a digital watermark embedding method and related devices. Background Art

[0002] At present, video resources on video platforms are subject to illegal broadcasting or downloading. Usually, a digital watermark containing the unique identification of the client is embedded in the video, and specific text, pictures or logos are added to the video to identify the ownership, thereby reducing the risk of illegal broadcasting or downloading. However, the existing technology has technical difficulties such as time-consuming and large computational complexity when inserting hidden digital watermarks into the video in real time when the client requests the video.

[0003] In summary, there is an urgent need for a digital watermark embedding method to achieve both embedding real-time performance and embedding efficiency. Summary of the invention

[0004] In view of the above problems, the present application provides a digital watermark embedding method and related devices to achieve the purpose of taking into account both embedding real-time performance and embedding efficiency. The specific scheme is as follows:

[0005] The first aspect of the present application provides a method for embedding a digital watermark, comprising:

[0006] Receiving a playback request for a target original video, the playback request including a target digital watermark and an identifier of the target original video;

[0007] Based on the identifier of the target original video, the intermediate state data of the non-embedded video segment of the target original video is obtained from a cache database, wherein the cache database is used to record the identifier of the original video and the intermediate state data of each video segment in correspondence;

[0008] According to the intermediate state data, embedding the target digital watermark into the unembedded video of the target original video to obtain an embedded video segment;

[0009] The video segments to be played of the target original video are combined in sequence to obtain an embedded video of the target original video, wherein the video segments to be played of the target original video include at least one embedded video segment.

[0010] In a possible implementation, the digital watermark embedding method further includes:

[0011] Determining whether it is the first time to receive a request to play the target original video;

[0012] If it is the first time to receive the playback request of the target original video, the target original video is divided into a plurality of video segments according to a preset duration ratio to obtain a video segment sequence, wherein the video segment sequence includes the video segments of the target original video arranged in time sequence;

[0013] Selecting an embedding position from each video segment of the target original video, and obtaining original position information of the embedding position of each video segment;

[0014] Generate task information for each video clip, the task information including a task identifier, the target digital watermark, original position information, and a priority coefficient, the priority coefficient of the video clip is inversely correlated with the sequence of the video clip in the video clip sequence, and the original position information includes the original offset of the embedded position.

[0015] In a possible implementation, the cache database is also used to correspond and record the identifier of the original video, the embedded video segment, and the digital watermark;

[0016] The step of acquiring the intermediate state data of the non-embedded video segment of the target original video from the cache database based on the identifier of the target original video includes:

[0017] If it is not the first time that a request to play the target original video is received, and the cache database contains intermediate data of non-embedded video segments of the target original video, based on the identifier of the target original video, the embedded video segments of the target original video corresponding to the target digital watermark are obtained from the cache database; and the intermediate data of non-embedded video segments of the target original video and task information are obtained from the cache database.

[0018] In a possible implementation, the digital watermark embedding method further includes:

[0019] If the cache database does not contain the intermediate state data of the non-embedded video segment of the target original video, determining whether the sequence of the non-embedded video segment of the target original video in the video segment sequence of the target original video is 1;

[0020] If yes, directly obtain the original offset of the embedding position of the non-embedded video segment of the target original video as the target offset; if no, calculate the target offset of the non-embedded video segment of the target original video based on the video frame length difference of the preceding video segment of the non-embedded video segment of the target original video and the original offset of the embedding position of the non-embedded video segment of the target original video;

[0021] Based on the target offset, intercepting the original video frame at the embedded position from the target original video to obtain an original image;

[0022] According to the YUV data of the original image, a singular decomposition state coefficient sequence of each channel of the original image is obtained, wherein the singular decomposition state coefficient sequence is obtained by aggregating a plurality of singular decomposition state coefficients corresponding to the approximate coefficients of the original image;

[0023] The task information and intermediate state data of the non-embedded video segments of the target original video are cached in a cache database, wherein the intermediate state data include the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel of the original image.

[0024] In a possible implementation, obtaining a singular decomposition state coefficient sequence of each channel of the original image according to the YUV data of the original image includes:

[0025] Performing image preprocessing on the original image to obtain YUV data of the original image;

[0026] Performing wavelet transform on each channel data in the YUV data of the original image to obtain a coefficient matrix of each channel, wherein the coefficient matrix includes an approximate coefficient, a horizontal detail coefficient, a vertical detail coefficient and a diagonal detail coefficient of the original image;

[0027] For each channel, the approximate coefficients of the original image are divided into blocks to obtain a plurality of approximate coefficient blocks;

[0028] For each of the approximate coefficient blocks, singular value decomposition is performed on the approximate coefficient block to obtain singular decomposition state coefficients of the approximate coefficient block;

[0029] The singular decomposition state coefficients of all the approximate coefficient blocks are aggregated to obtain a singular decomposition state coefficient sequence of the approximate coefficients.

[0030] In a possible implementation, embedding the target digital watermark into the unembedded video of the target original video according to the intermediate state data to obtain the embedded video segment includes:

[0031] Execute according to the priority coefficient of the non-embedded video of the target original video from large to small:

[0032] If no embedding task suspension instruction of the non-embedded video of the target original video is received, for each channel, embedding the target digital watermark into the singular decomposition state coefficient sequence of the non-embedded video of the target original video to obtain a singular decomposition state coefficient sequence after watermark embedding;

[0033] Based on the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel after watermark embedding, the YUV data after watermark embedding is obtained;

[0034] Performing a preset video frame encoding on the YUV data after the watermark is embedded to obtain a target video frame of the target original video without the embedded video;

[0035] Using the target video frame to replace the original video frame of the target original video that is not embedded, to obtain an embedded video segment after the target digital watermark is embedded;

[0036] The identifier of the target original video, the embedded video clip and the target digital watermark are correspondingly cached in the cache database.

[0037] In a possible implementation, sequentially combining the to-be-played video segments of the target original video to obtain the embedded video of the target original video includes:

[0038] If the preset playback condition of the target original video is met and there is no un-embedded video segment of the target original video, the embedded video segments of the target original video are combined according to the sequence to obtain the watermark-embedded video of the target original video;

[0039] If the playback conditions of the target original video are met and there is at least one non-embedded video segment of the target original video, the embedded video segments and the non-embedded video segments of the target original video are combined in sequence to obtain the watermark-embedded video of the target original video, and an embedding task suspending instruction for the non-embedded video segment of the target original video is generated.

[0040] A second aspect of the present application provides a digital watermark embedding device, comprising:

[0041] A request receiving unit, configured to receive a playback request of a target original video, wherein the playback request includes a target digital watermark and an identifier of the target original video;

[0042] An intermediate state data acquisition unit, used to acquire the intermediate state data of the non-embedded video segment of the target original video from a cache database based on the identifier of the target original video, wherein the cache database is used to record the identifier of the original video and the intermediate state data of each video segment in correspondence;

[0043] A watermark embedding unit, used for embedding the target digital watermark into the unembedded video of the target original video according to the intermediate state data to obtain an embedded video segment;

[0044] The video combining unit is used to sequentially combine the to-be-played video segments of the target original video to obtain the embedded video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment.

[0045] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the digital watermark embedding method of the first aspect or any implementation of the first aspect.

[0046] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0047] The memory is used to store computer programs;

[0048] The processor is used to execute the computer program so that the electronic device can implement the digital watermark embedding method of the first aspect or any implementation manner of the first aspect.

[0049] By means of the above technical scheme, the present application provides a digital watermark embedding method and related devices, which receive a playback request of a target original video, wherein the playback request includes a target digital watermark and an identifier of the target original video; based on the identifier of the target original video, obtain the intermediate data of the non-embedded video segments of the target original video from a cache database, wherein the cache database is used to record the identifier of the original video and the intermediate data of each video segment; based on the intermediate data, perform embedding tasks of each non-embedded video segment of the target original video to obtain embedded video segments after embedding the target digital watermark; sequentially combine the to-be-played video segments of the target original video to obtain an embedding-completed video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment. Since the cache database records the identifier of the original video and the intermediate state data of each video segment, after receiving the playback request of the target original video, the intermediate state data of the non-embedded video segment is obtained in the cache database, and the embedded video segment is obtained according to the intermediate state data, so as to embed the digital watermark into the target original video. Further, the to-be-played video segments of the target original video are sequentially combined to obtain the embedded video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment. In summary, the present application improves the efficiency and real-time performance of digital watermark embedding and reduces the amount of calculation by caching the intermediate state data of the video segment. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0051] Figure 1A schematic diagram of a system architecture provided for this application;

[0052] Figure 2 An optional hardware structure diagram of the terminal 100 is shown;

[0053] Figure 3 A schematic diagram of the structure of a server 200 is shown;

[0054] Figure 4 A schematic diagram of a flow chart of a digital watermark embedding method provided in an embodiment of the present application;

[0055] Figure 5 A specific implementation flow chart of a digital watermark embedding method provided in an embodiment of the present application;

[0056] Figure 6 A specific implementation flow chart of a method for executing a video clip embedding task provided in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of the structure of a digital watermark embedding device provided in an embodiment of the present application;

[0058] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0060] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0061] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0062] The present application can be applied in the field of video processing technology, and specifically can be applied to embedding a hidden digital watermark into a video, so that the video quality (clarity and fluency) is not affected by the digital watermark, while taking into account the real-time and embedding efficiency of embedding the digital watermark into the video.

[0063] The basic principle of hidden digital watermarking algorithm is to embed the digital watermark into the frequency domain or spatial domain of the video, so that when the video is played, the digital watermark will not affect the video quality.

[0064] An existing digital watermark embedding method specifically includes the following steps:

[0065] A1. Image preprocessing step: read the video and take a screenshot at the specified time position. If the size of the screenshot is not an even number, fill it to make it an even number, normalize the screenshot of the even size, and further convert the screenshot RGB to YUV444 format through the preset YUV color encoding method to obtain YUV data. The YUV444 format is a YUV format that uses the YUV color space. In video processing technology, the YUV format is usually used to separate brightness information and color information, so that different optimizations can be performed on these two parts during transmission or processing.

[0066] A2. Wavelet transform step: Split the YUV data into three separate channels, Y, U, and V, to obtain Y channel data, U channel data, and V channel data. Perform wavelet transform on each channel data, perform low-pass and high-pass filtering in both horizontal and vertical directions, and obtain [a, h, v, d] = dwt(x). Among them, a, h, v, d are matrix cells, half the size of the input matrix, representing the approximate coefficient a, horizontal detail coefficient h, vertical detail coefficient v, and diagonal detail coefficient d of the original image, respectively.

[0067] A3. Hidden watermark information embedding step: For each channel, the approximate coefficient a of the original image corresponding to the channel is processed in blocks (4×4 or 8×8), and one bit in the hidden watermark information is embedded in each block until all the blocks of the approximate coefficient a of the original image corresponding to the channel are processed, and the block processing result corresponding to the channel data is obtained.

[0068] A4, inverse wavelet transform step: restore the channel data, obtain the single channel data as idwt(a, h, v, d), merge the Y channel data, U channel data, and V channel data to restore the YUV data, and obtain the video embedded with the hidden watermark information.

[0069] At present, the above existing technologies for embedding watermarks in real time by inserting digital watermarks into videos have the technical disadvantages of being time-consuming and high in computing power consumption, which becomes a performance bottleneck especially during peak hours. Therefore, the embodiment of the present application provides a digital watermark embedding method, which aims to effectively improve the efficiency of embedding hidden digital watermarks into videos and reduce time consumption and computing power costs.

[0070] This application can be applied to, but is not limited to, cloud services provided by video data processing applications or cloud-side servers, etc., which are introduced below:

[0071] See also Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.

[0072] Among them, a digital watermark embedding application can be installed on the terminal 100. The above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the digital watermark embedding interface and send the above parameters to the server 200. The server 200 can obtain processing results based on the received parameters and return the processing results to the terminal 100.

[0073] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.

[0074] Next describe Figure 1 The product form of the mid-terminal 100;

[0075] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.

[0076] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.

[0077] refer to Figure 2As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.

[0078] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0079] Among them, the input device 132 can receive input data and the like.

[0080] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 may be used to display the embedded interface of the digital watermark, processing results, etc.

[0081] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.

[0082] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.

[0083] The memory 120 may be used to store software codes related to the digital watermark embedding method, the processor 170 may execute the steps of the digital watermark embedding method, and may also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to implement corresponding functions.

[0084] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0085] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.

[0086] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.

[0087] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0088] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .

[0089] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.

[0090] Next describe Figure 1 The product form of the server 200;

[0091] Figure 3 A schematic diagram of the structure of a server 200 is shown. Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.

[0092] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0093] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0094] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard dish drive (HDD), or a solid state drive (SSD).

[0095] The memory 204 may be used to store software codes related to the digital watermark embedding method, and the processor 202 may execute the steps of the digital watermark embedding method of the chip, and may also schedule other units to implement corresponding functions.

[0096] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0097] The embodiment of the present application provides a method for embedding a digital watermark. The method for embedding a digital watermark of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.

[0098] Reference Figure 4 , Figure 4 A schematic diagram of a digital watermark embedding method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, a digital watermark embedding method provided in an embodiment of the present application may include steps 401 to 403, and these steps are described in detail below.

[0099] S401: Receive a request to play a target original video.

[0100] In this embodiment, the play request includes the target digital watermark and the identifier of the target original video. The identifier of the target original video includes the name or code of the target original video. The target digital watermark includes a copyright watermark for uniquely identifying the copyright, such as the identifier of the copyright holder and the copyright duration range.

[0101] S402: Based on the identifier of the target original video, obtain the intermediate state data of the non-embedded video segment of the target original video from the cache database.

[0102] In this embodiment, the intermediate state data is obtained by preprocessing the non-embedded video clips in advance. Optionally, the intermediate state data includes a singular decomposition state coefficient sequence, a horizontal detail coefficient, a vertical detail coefficient and a diagonal detail coefficient of each channel of the target original image.

[0103] In this embodiment, the target original image is an original video frame extracted from a preset embedding position of a non-embedded video segment, and the cache database is used to correspondingly record the identifier of the original video and the intermediate state data of each video segment.

[0104] S403: embed the target digital watermark into the non-embedded video of the target original video according to the intermediate state data to obtain an embedded video segment.

[0105] In this embodiment, according to the intermediate state data, the target digital watermark is embedded in the unembedded video of the target original video to obtain the embedded video segment. The specific method includes:

[0106] A1. For each channel, embed the target digital watermark into the singular decomposition state coefficient sequence to obtain the singular decomposition state coefficient sequence after watermark embedding.

[0107] In this embodiment, for each channel, the singular decomposition state coefficient sequence includes multiple singular decomposition state coefficients, each of which is obtained by performing singular value decomposition on an approximate coefficient block, wherein the approximate coefficient block is obtained by dividing the approximate coefficient into blocks.

[0108] In an optional embodiment, for the singular decomposition state coefficient sequence of the approximate coefficients of each channel, the singular decomposition state coefficients of the approximate coefficient block in the singular decomposition state coefficient sequence are traversed in order, and one bit of the target digital watermark is embedded in each singular decomposition state coefficient to obtain the singular decomposition state coefficient sequence after the watermark is embedded.

[0109] A2. Based on the singular decomposition coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel after watermark embedding, the YUV data after watermark embedding is obtained.

[0110] A3. Perform preset video frame encoding on the YUV data after watermark embedding to obtain a target video frame.

[0111] In an optional embodiment, for each channel, the inverse operation of singular value decomposition is performed on the embedding completion coefficients of the singular decomposition state coefficients of each approximate coefficient block to obtain the approximate coefficient blocks after watermark embedding, and all the approximate coefficient blocks after watermark embedding are aggregated to obtain the approximate coefficients after watermark embedding, and a matrix set after watermark embedding is constructed based on the approximate coefficients after watermark embedding, horizontal detail coefficients, vertical detail coefficients and diagonal detail coefficients, and an inverse wavelet transform is performed on the matrix set after watermark embedding of each channel to obtain YUV data after watermark embedding, and a preset video frame encoding is performed on the YUV data after watermark embedding to obtain a target video frame.

[0112] A4. Use the target video frame to replace the original video frame of the target original video that is not embedded in the video segment, and obtain the embedded video segment after the target digital watermark is embedded.

[0113] S404: Combining the to-be-played video segments of the target original video in sequence to obtain an embedded video of the target original video.

[0114] In this embodiment, the video segments to be played of the target original video include at least one embedded video segment. Specifically, if all video segments of the target original video have been embedded with the target digital watermark, the video segments to be played of the target original video include the embedded video segments corresponding to all video segments; if there are video segments without the target digital watermark embedded in all video segments of the target original video, the video segments to be played of the target original video include the embedded video segments and the non-embedded video segments.

[0115] It can be seen from the above technical scheme that the embodiment of the present application provides a method for embedding a digital watermark. Since the cache database records the identifier of the original video and the intermediate state data of each video segment, after receiving the playback request of the target original video, the intermediate state data of the non-embedded video segment is obtained in the cache database, and the embedded video segment is obtained according to the intermediate state data, so as to embed the digital watermark into the target original video. Further, the video segments to be played of the target original video are sequentially combined to obtain the embedded video of the target original video, wherein the video segments to be played of the target original video include at least one embedded video segment. In summary, the present application improves the efficiency of digital watermark embedding and reduces the amount of calculation by caching the intermediate state data of the video segment.

[0116] See also Figure 5 , Figure 5 A specific implementation flow chart of a digital watermark embedding method provided in an embodiment of the present application. The method is specifically applied to a digital watermark embedding system composed of a client and a server, wherein the client runs in a terminal device and the server runs in a server. The structures of the terminal device and the server can refer to the above embodiments. It should be noted that the server can communicate with multiple distributed clients, and the specific communication method can refer to the prior art.

[0117] like Figure 5 As shown, this method specifically includes S501 to S509, as follows:

[0118] S501: In response to a play request of a target original video sent by a target client, obtain a target original video and a target digital watermark.

[0119] In this embodiment, after receiving the target original video playback instruction sent by the target client, a watermark embedding instruction is generated to instruct to embed the target digital watermark into the target original video. The target digital watermark is a character string containing copyright information and user ID.

[0120] In this embodiment, the target original video is the video requested by the on-demand client, and the target digital watermark is the digital watermark indicating the client information of the on-demand client. For example, if the first client requests to play the first video, and the first client has the copyright of the first video, the digital watermark belonging to the first client is embedded in the first video to indicate that the first video is for playing on the first client. This enables copyright protection and leak tracking of video resources.

[0121] S502: If it is the first time to receive a request to play the target original video, divide the target original video into multiple video segments according to a preset duration ratio to obtain a video segment sequence.

[0122] In this embodiment, the video clip sequence obtained by dividing the target original video according to the preset duration ratio includes N video clips arranged in time sequence. .

[0123] For example, the target original video S is divided into three video segments according to a duration ratio of 1:1:1, that is, the duration of each video segment is one-third of the total duration of the video, rounded up to obtain a video segment sequence, and the video segment sequence includes the first video segment representing the front section of the video in sequence. , indicates the second video segment in the middle of the video and a third video clip representing the latter part of the video , where the total duration of the target original video S is H, the time range of the first video segment is 0~1 / 3H, the time range of the second video segment is 1 / 3H~2 / 3H, and the time range of the third video segment is 2 / 3H~H.

[0124] It can be understood that, in the video clip sequence of the original sequence, the video clips that are ranked first have video duration ranges that are ranked first.

[0125] S503: Select an embedding position from each video segment, and obtain original position information of the embedding position of each video segment.

[0126] In this embodiment, an embedding position is randomly selected from each video clip, and the original position information of the embedding position includes the original offset of the embedding position in the original video and the length of the original video frame at the embedding position, for example, the length of the H.264 video frame after the video frame at the embedding position is encoded as an H.264 video frame.

[0127] For example, , ,and The embedding positions are , ,and , The location information includes the original offset and the length of the original video frame . The location information includes the original offset and the length of the original video frame , The location information includes the original offset and the length of the original video frame .

[0128] S504: Generate task information for each video segment.

[0129] In this embodiment, each video segment corresponds to an embedding task. The task information of the unembedded video segment includes a task identifier, a target digital watermark, original position information, and a priority coefficient. The embedding task of the unembedded video segment indicates to embed the target digital watermark at the embedding position of the unembedded video segment.

[0130] In this embodiment, the method for allocating priority coefficients of video segments of the original video includes:

[0131] The priority coefficient is selected from the priority coefficient range corresponding to the sequence of the video clip in the video clip sequence, that is, if the sequence of the non-embedded video clip in the video clip sequence is the target sequence, the priority coefficient of the non-embedded video clip is selected from the priority coefficient range corresponding to the pre-configured target sequence.

[0132] In this embodiment, a priority coefficient range is pre-configured for each rank, and the lowest value of the priority coefficient range for the front rank is greater than the highest value of the priority coefficient range for the back rank, that is, the rank of the video clip is negatively correlated with the priority coefficient of the video clip, and the priority coefficient is positively correlated with the priority level, and the larger the priority coefficient, the higher the priority level.

[0133] Continuing from the previous example, generate the embedded position , , , generate embedding tasks , ,and , assign priority coefficients to each embedding task , ,and ,and > > , the larger the priority coefficient, the higher the priority of the embedded task. Select from the preset first priority coefficient range, Select from the preset second priority coefficient range, Select from a preset third priority coefficient range, wherein the minimum value in the first priority coefficient range is greater than the maximum value in the second priority coefficient range, and the minimum value in the second priority coefficient range is greater than the maximum value in the third priority coefficient range.

[0134] S505: If it is not the first time that a request for playing the target original video is received, search the cache database for task information of the embedded video segments and the non-embedded video segments of the target original video.

[0135] S506 , executing embedding tasks of each non-embedded video segment according to the priority coefficient from large to small, and obtaining the video segment after the watermark is embedded, that is, the embedded video segment.

[0136] In this embodiment, the unembedded video segment is an unembedded video segment. When the playback request of the target original video is received for the first time, the unembedded video segment includes all video segments of the target original video. When the playback request of the target original video is not received for the first time, the target original video includes all video segments except the video segment embedded with the watermark.

[0137] In this embodiment, a watermark embedding task manager is requested to execute an embedding task, and the task manager allocates multiple embedding tasks of at least one original video according to the priority coefficient from high to low based on the task idle time axis.

[0138] Since, corresponding to an original video, the smaller the original offset of the embedding position of the video segment, the higher the priority of the embedding task, for any two original videos (the first original video and the second original video) among the multiple original videos, the priority coefficient of the nth video segment of the first original video is greater than the priority coefficient of the n+1th video segment of the second original video.

[0139] Therefore, the task manager gives priority to executing the embedding task of the frontmost video segment of each original video, ensuring that when a large number of concurrent embedding tasks are executed, at least one embedding task for each video can be completed on time, ensuring that each original video can be embedded with at least one digital watermark, and the embedding position of the embedded digital watermark is located in the frontmost video segment of the original video.

[0140] S507: If the preset playback condition of the target original video is met and there is no un-embedded video segment, the embedded video segments of the target original video are combined according to the sequence to obtain the watermark-embedded video of the target original video.

[0141] In this embodiment, the playback conditions of the target original video are met, and there are no un-embedded video segments, indicating that all video segments have been embedded with the target digital watermark. Then, the embedded video segments after embedding the target digital watermark are combined in time sequence to obtain the watermark-embedded video of the target original video, and the watermark-embedded video is stored and sent to the target client.

[0142] It should be noted that, corresponding to the cached target original video identifier, the embedded video clip, and the target digital watermark, the next time the client requests to play the target original video with the same target digital watermark, the stored watermark embedded video can be directly obtained and played.

[0143] S508. If the preset playback condition of the target original video is met and there are non-embedded video segments, the embedded video segments and the non-embedded video segments of the target original video are combined in sequence to obtain the watermark-embedded video of the target original video, and the watermark-embedded video is sent to the target client so that the target client plays the watermark-embedded video.

[0144] In this embodiment, the embedded video clip is a video clip that has been embedded with the target digital watermark, and the unembedded video clip is a video clip that has not yet been embedded with the target digital watermark. The playback condition at least includes reaching the preset embedding waiting time threshold and the existence of at least m embedded video clips. Among them, m is a value less than the number of video clips, which is called the minimum embedding number. For example, the minimum embedding number m=1. When the embedding waiting time threshold is reached, the embedding task of two video clips is completed, that is, there are two embedded video clips. Then, the two embedded video clips and the remaining unembedded video clips are combined in time sequence to obtain the watermark embedded video of the target original video. It can be understood that there are two hidden target digital watermarks in the watermark embedded video.

[0145] In this embodiment, if the preset playback conditions of the target original video are met and there are un-embedded video clips, it means that the embedding task of the target original video has not been completed when the delay limit is reached, but the target digital watermark has been embedded in at least one embedding position of the target original video. Therefore, in order to ensure the success rate of video playback and reduce the embedding waiting delay, the embedded video clips and the un-embedded video clips are combined in sequence to obtain the watermark-embedded video of the target original video and play it.

[0146] S509: Generate an embedding task suspending instruction for the non-embedded video segment.

[0147] In this embodiment, the suspend instruction is used to instruct to suspend the embedding task of the non-embedded video segment. Optionally, after the intermediate state data of the non-embedded video segment is acquired, the task information and the intermediate state data of the non-embedded video segment are cached accordingly, and the embedding task of the non-embedded video segment is suspended. The intermediate state data includes the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel of the original image of the non-embedded video segment.

[0148] In this embodiment, the embedding task of the non-embedded video segment is suspended and the intermediate state data is cached, which is equivalent to embedding a hole in the non-embedded video segment, waiting for the next time the client requests to play the target original video, directly obtaining the stored embedded video segment, and restarting the embedding task of the non-embedded video segment, so that based on the intermediate state data, the target digital watermark can be directly embedded at the embedding position of the non-embedded video segment.

[0149] Continuing with the above example, when a playback request of the target original video S is received from the target client for the first time, a first watermark embedding instruction is generated and S501 to S505 are executed. If the embedding waiting time threshold is reached, the first video segment and the second video clip The target digital watermark has been embedded in That is , after embedding the target digital watermark That is , but the third video clip If the target digital watermark is not embedded, , ,as well as Combine in order to get , That is, the first watermark of S is embedded in the video.

[0150] save and and pause If the target client receives a playback request for the target original video S for the second time, it will restart the task directly. The embedding task reaches the embedding waiting time threshold and The target digital watermark has been embedded in That is ,Will , ,as well as Combine in order to get , That is, the second watermark embedded video of S, since the three video clips of S have been embedded with the target digital watermark.

[0151] The identifier of S, the target digital watermark, and Corresponding to the storage, if the target client receives the target original video S playback request for the third time, it will be played directly .

[0152] It can be seen from the above technical scheme that this scheme divides the watermark embedding task of each original video into embedding tasks of multiple video clips, and assigns priority coefficients to the embedding tasks. The embedding tasks of multiple video clips of multiple original videos are scheduled by the priority coefficients, and the embedding tasks of high-priority video clips are executed first. Through the priority coefficient allocation strategy, each original video will have the embedding task of the highest priority video clip executed first. This ensures that when the client requests to play the original video, the embedding task of at least one video clip of the original video is executed first, without waiting for the embedding of other original videos to be completed, preventing a large number of users from making concentrated requests and too many embedding tasks, causing the client to wait too long, reducing the video loading delay, and improving the efficiency of embedding task execution.

[0153] Furthermore, by saving the embedded video segments in the watermark-embedded video of the target original video each time an embedding request is made, there is no need to repeatedly perform the embedding task on the same video segment; by restarting the embedding task of the non-embedded video segment, there is no need to repeatedly generate the embedding task for the same original video, thereby improving the embedding efficiency and reducing the amount of calculation.

[0154] Next, we will take the embedding task of any unembedded video clip as an example to introduce the specific method of embedding task execution. Figure 6 A specific implementation flow chart of a method for executing a video clip embedding task provided in an embodiment of the present application is as follows: Figure 6 As shown, this method specifically includes:

[0155] S601: In response to a watermark embedding instruction for a non-embedded video segment, determine whether the sequence of the non-embedded video segment in a video segment sequence of a target original video is 1.

[0156] In this embodiment, the non-embedded video segment is any non-embedded video segment, also referred to as a target non-embedded video segment.

[0157] S602: If yes, directly obtain the original offset of the embedding position of the non-embedded video segment as the target offset.

[0158] In this embodiment, the non-embedded video segment is any video segment obtained by dividing the target original video.

[0159] In this embodiment, the embedding tasks of various video clips are executed in sequence according to the priority coefficients. When a watermark embedding instruction for a non-embedded video clip is received, it is determined whether the sequence of the non-embedded video clip in the video clip sequence of the target original video is 1. If so, it means that the non-embedded video clip is the frontmost video clip of the target original video, and the original offset of the embedding position of the non-embedded video clip is directly obtained as the target offset.

[0160] S603: If not, calculate the target offset of the embedding position of the non-embedded video segment based on the video frame length difference of the preceding video segment of the non-embedded video segment and the original offset of the embedding position of the non-embedded video segment.

[0161] In this embodiment, the video frame length difference of the preceding video segment of the unembedded video segment is obtained, wherein the preceding video segment includes the video segment located before the unembedded video segment in the video segment sequence, and the video frame length difference is the difference between the length of the encoded video frame (that is, the target video frame) after the digital watermark is embedded at the embedding position of the preceding video segment and the length of the original video frame before the digital watermark is embedded. The original offset of the unembedded video segment is added to the video frame length difference of each preceding video segment to obtain the target offset.

[0162] S604: intercepting the original video frame at the embedding position from the target original video based on the target offset to obtain an original image.

[0163] S605, check whether there is intermediate data not embedded in the video segment in the cache. If so, after obtaining the intermediate data from the cache, if no suspend instruction is received, execute S611; if not, and no suspend instruction is received, execute S606.

[0164] In this embodiment, the intermediate state data of the non-embedded video clip includes the singular decomposition coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel of the original image. It should be noted that the intermediate state data existing in the cache is cached during the last execution of the embedding task of the non-embedded video clip, so as to facilitate the subsequent embedding task execution.

[0165] S606: Perform image preprocessing on the original image to obtain YUV data of the original image.

[0166] In this embodiment, if the size of the original image is not an even number, padding is performed to make the size of the original image an even number, and then the original image of the even size is normalized. Further, the RGB of the original image is converted into YUV444 format through a preset YUV color encoding method to obtain YUV data.

[0167] S607 , performing wavelet transform on each channel data in the YUV data of the original image to obtain a coefficient matrix of each channel.

[0168] In this embodiment, the YUV data is divided into three separate channels of Y, U, and V to obtain Y channel data, U channel data, and V channel data. Wavelet transform is performed on each channel data, and low-pass and high-pass filtering is performed in both horizontal and vertical directions to obtain a wavelet transform matrix set dwt(x)=[a, h, v, d]. Among them, the coefficient matrix includes matrix cells a, matrix cells h, matrix cells v and matrix cells d, and the size of each matrix cell is half of the input matrix, which respectively represent the approximate coefficient a, horizontal detail coefficient h, vertical detail coefficient v and diagonal detail coefficient d of the original image.

[0169] S608 . For each channel, divide the approximate coefficients of the original image into blocks to obtain a plurality of approximate coefficient blocks.

[0170] In this embodiment, the size of the approximate coefficient a of the original image is half the size of the original image. For example, if the size of the original image is M×N, the size of the approximate coefficient a is M / 2*N / 2. The approximate coefficient a is divided into blocks to obtain a plurality of approximate coefficient blocks of size 4×4. The number of approximate coefficient blocks is K. The kth approximate coefficient block of the approximate coefficient a is .

[0171] S609: For each approximate coefficient block, perform singular value decomposition on the approximate coefficient block to obtain singular decomposition state coefficients of the approximate coefficient block.

[0172] In this embodiment, dct represents a discrete cosine transform function, svd represents a singular value decomposition function, and the approximate coefficient block The singular decomposition coefficients of .

[0173] S610, aggregate the singular decomposition state coefficients of all approximate coefficient blocks to obtain the singular decomposition state coefficient sequence of the approximate coefficients, and cache the corresponding task information and intermediate state data into the cache database. If no suspend instruction is received, execute S611.

[0174] In this embodiment, the singular decomposition state coefficient sequence of the approximate coefficient is the result of aggregating the singular decomposition state coefficients of all approximate coefficient blocks, that is, .

[0175] It should be noted that the singular decomposition coefficient sequences of the approximate coefficients of the three channels not embedded in the video clip are obtained, which are the singular decomposition coefficient sequences of the approximate coefficients of the Y channel 、The singular decomposition coefficient sequence of the approximate coefficients of the U channel , and the singular decomposition coefficient sequence of the approximate coefficients of the V channel .

[0176] In this embodiment, the intermediate state data includes a singular decomposition state coefficient sequence, a horizontal detail coefficient, a vertical detail coefficient and a diagonal detail coefficient.

[0177] S611. For the singular decomposition state coefficient sequence of the approximate coefficients of each channel, sequentially traverse the singular decomposition state coefficients of the approximate coefficient block in the singular decomposition state coefficient sequence, embed one bit of the target digital watermark in each singular decomposition state coefficient, and obtain the singular decomposition state coefficient sequence after the watermark is embedded.

[0178] In this embodiment, if the suspend instruction is not received, this step is executed. If the suspend instruction is received, the embedding task of the non-embedded video segment is suspended until the embedding task execution instruction of the non-embedded video segment is received, and then the execution continues.

[0179] In this embodiment, the singular decomposition state coefficient sequence after watermark embedding includes singular decomposition state coefficients each of which is embedded with one bit of the target digital watermark.

[0180] Singular decomposition state coefficient sequence For example, traverse ,exist Embed a bit of the target digital watermark in the , and get the singular decomposition coefficient after watermark embedding . The singular decomposition coefficient sequence after watermark embedding .

[0181] S612: Perform an inverse operation of singular value decomposition on the embedded coefficients of the singular decomposition state coefficients of each approximate coefficient block to obtain each watermark-embedded approximate coefficient block.

[0182] In this embodiment, the singular decomposition coefficients after watermark embedding are Perform the inverse operation of singular value decomposition and get The inverse operation result of the singular value decomposition is the approximate coefficient block after watermark embedding .

[0183] S613: Aggregate all watermark-embedded approximate coefficient blocks to obtain watermark-embedded approximate coefficients.

[0184] In this embodiment, the approximate coefficient after watermark embedding is , Each approximate coefficient block constitute.

[0185] S614: For each channel, a matrix set after watermark embedding is constructed based on the approximate coefficients, horizontal detail coefficients, vertical detail coefficients and diagonal detail coefficients after watermark embedding.

[0186] In this embodiment, for a channel, the approximate coefficient after watermark embedding is , horizontal detail coefficient h, vertical detail coefficient v and diagonal detail coefficient d, construct the matrix set after watermark embedding [ , h, v, d].

[0187] S615, performing inverse wavelet transform on the matrix set after watermark embedding of each channel to obtain YUV data after watermark embedding.

[0188] In this embodiment, for a channel, the matrix set after watermark embedding is [ , h, v, d], perform inverse wavelet transform to obtain the channel data after watermark embedding of one channel. Combine the channel data after watermark embedding of each channel to obtain the YUV data after watermark embedding.

[0189] S616: Perform preset video frame encoding on the YUV data after the watermark is embedded to obtain a target video frame.

[0190] In this embodiment, the target YUV data is encoded into a video frame to obtain a target video frame in an H.264 / 265 encoding format, and the length difference of the target video frame is recorded.

[0191] S617: Use the target video frame to replace the original video frame in the non-embedded video segment to obtain the embedded video segment after the target digital watermark is embedded.

[0192] It can be seen from the above technical scheme that an embodiment of the present application provides a digital watermark embedding method. For a video segment to be embedded with a target digital watermark, the target offset of the embedding position is determined by the difference in video frame length between the preceding video segment of the video segment and the original offset of the embedding position of the non-embedded video segment, thereby avoiding the offset of the embedding position caused by the change in video frame length after the digital watermark information is embedded, thereby improving the accuracy of digital watermark embedding and improving the video fluency.

[0193] Furthermore, by caching the singular decomposition state coefficient sequence of each channel of each video clip, there is no need to repeatedly perform the singular decomposition operation of each channel of the same video clip, thereby reducing the amount of operation and improving the embedding efficiency. It should be noted that if the decomposition value cache time threshold is exceeded and the singular decomposition state coefficient sequence of each channel of the video clip is not accessed, the singular decomposition state coefficient sequence is compressed and persisted to a low-speed storage device such as a disk through matrix compression technology. When accessed again, it is loaded from the low-speed storage device into the cache.

[0194] In summary, the digital watermark embedding method provided in the embodiment of the present application solves the performance bottleneck problem of real-time insertion of hidden digital watermarks, reduces computing time, and saves computing power costs.

[0195] A digital watermark embedding method provided by an embodiment of the present application is introduced above. A device for executing the digital watermark embedding method will be introduced below.

[0196] See also Figure 7 , Figure 7 The structure diagram of a digital watermark embedding device provided in an embodiment of the present application is shown in FIG. The digital watermark embedding device is configured in a client, such as Figure 7 As shown, the digital watermark embedding device 700 includes:

[0197] The request receiving unit 701 is used to receive a play request of a target original video, wherein the play request includes a target digital watermark and an identifier of the target original video;

[0198] The intermediate state data acquisition unit 702 is used to acquire the intermediate state data of the non-embedded video segment of the target original video from the cache database based on the identifier of the target original video, and the cache database is used to record the identifier of the original video and the intermediate state data of each video segment in correspondence;

[0199] The watermark embedding unit 703 is used to embed the target digital watermark into the unembedded video of the target original video according to the intermediate state data to obtain an embedded video segment;

[0200] The video combining unit 704 is used to sequentially combine the to-be-played video segments of the target original video to obtain the embedded video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment.

[0201] In a possible implementation, the digital watermark embedding device further includes: a task generating unit, configured to:

[0202] Determine whether it is the first time to receive a request to play the target original video; if it is the first time to receive a request to play the target original video, divide the target original video into a plurality of video segments according to a preset time length ratio to obtain a video segment sequence, wherein the video segment sequence includes video segments of the target original video arranged in time sequence;

[0203] Selecting an embedding position from each video segment of the target original video, and obtaining original position information of the embedding position of each video segment;

[0204] Generate task information for each video clip, the task information including a task identifier, the target digital watermark, original position information, and a priority coefficient, the priority coefficient of the video clip is inversely correlated with the sequence of the video clip in the video clip sequence, and the original position information includes the original offset of the embedded position.

[0205] In a possible implementation, the cache database is also used to correspond and record the identifier of the original video, the embedded video segment, and the digital watermark;

[0206] When the intermediate state data acquisition unit is used to acquire the intermediate state data of the non-embedded video segment of the target original video from the cache database based on the identifier of the target original video, it is specifically used to:

[0207] If it is not the first time that a request to play the target original video is received, and the cache database contains intermediate data of non-embedded video segments of the target original video, based on the identifier of the target original video, the embedded video segments of the target original video corresponding to the target digital watermark are obtained from the cache database; and the intermediate data of non-embedded video segments of the target original video and task information are obtained from the cache database.

[0208] In a possible implementation, the digital watermark embedding device further includes: a data preprocessing unit, configured to:

[0209] If the cache database does not contain the intermediate state data of the non-embedded video segment of the target original video, determining whether the sequence of the non-embedded video segment of the target original video in the video segment sequence of the target original video is 1;

[0210] If yes, directly obtain the original offset of the embedding position of the non-embedded video segment of the target original video as the target offset; if no, calculate the target offset of the non-embedded video segment of the target original video based on the video frame length difference of the preceding video segment of the non-embedded video segment of the target original video and the original offset of the embedding position of the non-embedded video segment of the target original video;

[0211] Based on the target offset, intercepting the original video frame at the embedded position from the target original video to obtain an original image;

[0212] According to the YUV data of the original image, a singular decomposition state coefficient sequence of each channel of the original image is obtained, wherein the singular decomposition state coefficient sequence is obtained by aggregating a plurality of singular decomposition state coefficients corresponding to the approximate coefficients of the original image;

[0213] The task information and intermediate state data of the non-embedded video segments of the target original video are cached in a cache database, wherein the intermediate state data include the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel of the original image.

[0214] In a possible implementation, the data preprocessing unit is used to obtain the singular decomposition state coefficient sequence of each channel of the original image according to the YUV data of the original image, specifically to:

[0215] Performing image preprocessing on the original image to obtain YUV data of the original image;

[0216] Performing wavelet transform on each channel data in the YUV data of the original image to obtain a coefficient matrix of each channel, wherein the coefficient matrix includes an approximate coefficient, a horizontal detail coefficient, a vertical detail coefficient and a diagonal detail coefficient of the original image;

[0217] For each channel, the approximate coefficients of the original image are divided into blocks to obtain a plurality of approximate coefficient blocks;

[0218] For each of the approximate coefficient blocks, singular value decomposition is performed on the approximate coefficient block to obtain singular decomposition state coefficients of the approximate coefficient block;

[0219] The singular decomposition state coefficients of all the approximate coefficient blocks are aggregated to obtain a singular decomposition state coefficient sequence of the approximate coefficients.

[0220] In a possible implementation, the watermark embedding unit is used to embed the target digital watermark into the non-embedded video of the target original video according to the intermediate state data to obtain the embedded video segment, specifically for:

[0221] Execute according to the priority coefficient of the non-embedded video of the target original video from large to small:

[0222] If no embedding task suspension instruction of the non-embedded video of the target original video is received, for each channel, embedding the target digital watermark into the singular decomposition state coefficient sequence of the non-embedded video of the target original video to obtain a singular decomposition state coefficient sequence after watermark embedding;

[0223] Based on the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel after watermark embedding, the YUV data after watermark embedding is obtained;

[0224] Performing a preset video frame encoding on the YUV data after the watermark is embedded to obtain a target video frame of the target original video without the embedded video;

[0225] Using the target video frame to replace the original video frame of the target original video that is not embedded, to obtain an embedded video segment after the target digital watermark is embedded;

[0226] The identifier of the target original video, the embedded video clip and the target digital watermark are correspondingly cached in the cache database.

[0227] In a possible implementation, the video combining unit is used to sequentially combine the to-be-played video segments of the target original video to obtain the embedded video of the target original video, including:

[0228] If the preset playback condition of the target original video is met and there is no un-embedded video segment of the target original video, the embedded video segments of the target original video are combined according to the sequence to obtain the watermark-embedded video of the target original video;

[0229] If the playback conditions of the target original video are met and there is at least one non-embedded video segment of the target original video, the embedded video segments and the non-embedded video segments of the target original video are combined in sequence to obtain the watermark-embedded video of the target original video, and an embedding task suspending instruction for the non-embedded video segment of the target original video is generated.

[0230] The present application also provides an electronic device in an embodiment. Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0231] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0232] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a memory card, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0233] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any digital watermark embedding method provided in the embodiment of the present application.

[0234] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any digital watermark embedding method provided in the embodiment of the present application.

[0235] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0236] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0237] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0238] 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A digital watermark embedding method, characterized in that: include: Receiving a playback request for a target original video, the playback request including a target digital watermark and an identifier of the target original video; Based on the identifier of the target original video, the intermediate state data of the non-embedded video segment of the target original video is obtained from a cache database, wherein the cache database is used to record the identifier of the original video and the intermediate state data of each video segment in correspondence; According to the intermediate state data, embedding the target digital watermark into the unembedded video of the target original video to obtain an embedded video segment; The video segments to be played of the target original video are combined in sequence to obtain an embedded video of the target original video, wherein the video segments to be played of the target original video include at least one embedded video segment.

2. The digital watermark embedding method according to claim 1, characterized in that: The digital watermark embedding method further comprises: Determining whether it is the first time to receive a request to play the target original video; If it is the first time to receive the playback request of the target original video, the target original video is divided into a plurality of video segments according to a preset duration ratio to obtain a video segment sequence, wherein the video segment sequence includes the video segments of the target original video arranged in time sequence; Selecting an embedding position from each video segment of the target original video, and obtaining original position information of the embedding position of each video segment; Generate task information for each video clip, the task information including a task identifier, the target digital watermark, original position information, and a priority coefficient, the priority coefficient of the video clip is inversely correlated with the sequence of the video clip in the video clip sequence, and the original position information includes the original offset of the embedded position.

3. The digital watermark embedding method according to claim 1, characterized in that: The cache database is also used to record the identification of the original video, the embedded video clips and the digital watermark; The step of acquiring the intermediate state data of the non-embedded video segment of the target original video from the cache database based on the identifier of the target original video includes: If it is not the first time that a request to play the target original video is received, and the cache database contains intermediate data of non-embedded video segments of the target original video, based on the identifier of the target original video, the embedded video segments of the target original video corresponding to the target digital watermark are obtained from the cache database; and the intermediate data of non-embedded video segments of the target original video and task information are obtained from the cache database.

4. The method for embedding a digital watermark according to claim 2, characterized in that: The digital watermark embedding method further comprises: If the cache database does not contain the intermediate state data of the non-embedded video segment of the target original video, determining whether the sequence of the non-embedded video segment of the target original video in the video segment sequence of the target original video is 1; If yes, directly obtain the original offset of the embedding position of the non-embedded video segment of the target original video as the target offset; if no, calculate the target offset of the non-embedded video segment of the target original video based on the video frame length difference of the preceding video segment of the non-embedded video segment of the target original video and the original offset of the embedding position of the non-embedded video segment of the target original video; Based on the target offset, intercepting the original video frame at the embedded position from the target original video to obtain an original image; According to the YUV data of the original image, a singular decomposition coefficient sequence of each channel of the original image is obtained, wherein the singular decomposition coefficient sequence is obtained by aggregating multiple singular decomposition coefficients corresponding to the approximate coefficients of the original image; and task information and intermediate state data of the non-embedded video segment of the target original video are cached in a cache database, wherein the intermediate state data includes the singular decomposition coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel of the original image.

5. The method for embedding a digital watermark according to claim 4, characterized in that: The step of obtaining the singular decomposition state coefficient sequence of each channel of the original image according to the YUV data of the original image includes: Performing image preprocessing on the original image to obtain YUV data of the original image; Performing wavelet transform on each channel data in the YUV data of the original image to obtain a coefficient matrix of each channel, wherein the coefficient matrix includes an approximate coefficient, a horizontal detail coefficient, a vertical detail coefficient and a diagonal detail coefficient of the original image; For each channel, the approximate coefficients of the original image are divided into blocks to obtain a plurality of approximate coefficient blocks; For each of the approximate coefficient blocks, singular value decomposition is performed on the approximate coefficient block to obtain singular decomposition state coefficients of the approximate coefficient block; The singular decomposition state coefficients of all the approximate coefficient blocks are aggregated to obtain a singular decomposition state coefficient sequence of the approximate coefficients.

6. The method for embedding a digital watermark according to claim 4, characterized in that: The method of embedding the target digital watermark into the unembedded video of the target original video according to the intermediate state data to obtain the embedded video segment comprises: Execute according to the priority coefficient of the non-embedded video of the target original video from large to small: If no embedding task suspension instruction of the non-embedded video of the target original video is received, for each channel, embedding the target digital watermark into the singular decomposition state coefficient sequence of the non-embedded video of the target original video to obtain a singular decomposition state coefficient sequence after watermark embedding; Based on the singular decomposition state coefficient sequence, horizontal detail coefficient, vertical detail coefficient and diagonal detail coefficient of each channel after watermark embedding, the YUV data after watermark embedding is obtained; Performing a preset video frame encoding on the YUV data after the watermark is embedded to obtain a target video frame of the target original video without the embedded video; Using the target video frame to replace the original video frame of the target original video that is not embedded, to obtain an embedded video segment after the target digital watermark is embedded; The identifier of the target original video, the embedded video clip and the target digital watermark are correspondingly cached in the cache database.

7. The method for embedding a digital watermark according to any one of claims 1 to 6, characterized in that: The step of sequentially combining the to-be-played video segments of the target original video to obtain the embedded video of the target original video includes: If the preset playback condition of the target original video is met and there is no un-embedded video segment of the target original video, the embedded video segments of the target original video are combined according to the sequence to obtain the watermark-embedded video of the target original video; If the playback conditions of the target original video are met and there is at least one non-embedded video segment of the target original video, the embedded video segments and the non-embedded video segments of the target original video are combined in sequence to obtain the watermark-embedded video of the target original video, and an embedding task suspending instruction for the non-embedded video segment of the target original video is generated.

8. A digital watermark embedding device, characterized in that: include: A request receiving unit, configured to receive a playback request of a target original video, wherein the playback request includes a target digital watermark and an identifier of the target original video; An intermediate state data acquisition unit, used to acquire the intermediate state data of the non-embedded video segment of the target original video from a cache database based on the identifier of the target original video, wherein the cache database is used to record the identifier of the original video and the intermediate state data of each video segment in correspondence; A watermark embedding unit, used for embedding the target digital watermark into the unembedded video of the target original video according to the intermediate state data to obtain an embedded video segment; The video combining unit is used to sequentially combine the to-be-played video segments of the target original video to obtain the embedded video of the target original video, wherein the to-be-played video segments of the target original video include at least one embedded video segment.

9. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the digital watermark embedding method as claimed in any one of claims 1 to 7.

10. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the digital watermark embedding method as described in any one of claims 1 to 7.