Method and device for adding watermark in image, storage medium and program product

By detecting changes in screen images and performing target detection in the cloud computer, watermarks are dynamically added, solving the problem of watermarks remaining active throughout the user session, reducing performance overhead, and improving user experience.

CN121961813APending Publication Date: 2026-05-01ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2024-10-29
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the watermark on cloud computers remains active once enabled in a user session, leading to performance overhead and user experience disruption, and making dynamic control impossible.

Method used

By detecting changes in the cloud computer screen image, target detection is performed and watermarks are dynamically added. Watermarks are only added when sensitive information is detected, including both visible and hidden watermarks.

Benefits of technology

It reduces unnecessary performance overhead and user experience interference, enables dynamic addition of watermarks, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121961813A_ABST
    Figure CN121961813A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for adding a watermark in an image, a storage medium and a program product, and relates to the technical field of image processing, the method comprises the following steps: if it is detected that a screen image of a cloud computer is changed, performing target detection in the changed screen image; if the target is detected, acquiring watermark information to be added; and adding the watermark information into the changed screen image. In the embodiment of the invention, under the condition of detecting that the screen image of the cloud computer is changed, if the target is detected in the changed screen image, the watermark is added, otherwise, the watermark is not added, so that the problems of performance overhead and user experience interference caused by the fact that the watermark always takes effect in a user session once the watermark is started are avoided, and the user experience is improved. Dynamic adding of watermarks is achieved, performance overhead is reduced, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, storage medium, and program product for adding watermarks to images. Background Technology

[0002] Cloud computing is a comprehensive service solution that includes cloud resources, transmission protocols, and cloud terminals. Using open cloud terminals and transmission protocols, it provides users with desktops, applications, hardware, and other resources in an on-demand, elastically allocated service model. Cloud computing typically overlays watermarks on the desktop screen image to counteract and track data leaks caused by methods such as taking photos or screenshots.

[0003] In current industry implementations, it is only possible to set whether to enable watermarks and the content of the watermark for specific users and machines. Once enabled, the watermark will remain active in the user session, which will bring certain performance overhead and user experience interference. Summary of the Invention

[0004] This application provides a method, device, storage medium, and program product for adding watermarks to images, so as to achieve dynamic addition of watermarks, reduce performance overhead, and improve user experience.

[0005] In a first aspect, embodiments of this application provide a method for adding a watermark to an image, comprising: if a change is detected in the screen image of a cloud computer, then performing target detection in the changed screen image; if a target is detected, then obtaining watermark information to be added; and adding the watermark information to the changed screen image.

[0006] Secondly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the methods described above when executing the computer program.

[0007] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described above.

[0008] Fourthly, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, implements any of the methods described above.

[0009] Compared with the prior art, this application has the following advantages:

[0010] This application provides a method, device, storage medium, and program product for adding watermarks to images. If a change is detected in the screen image of a cloud computer, target detection is performed in the changed screen image; if a target is detected, watermark information to be added is obtained; and the watermark information is added to the changed screen image. In this embodiment, when a change in the cloud computer's screen image is detected, if a target is detected in the changed screen image, a watermark is added; otherwise, no watermark is added. This avoids the problem of watermarks remaining active throughout the user session once enabled, leading to performance overhead and user experience interference. It achieves dynamic watermark addition, reduces performance overhead, and improves user experience.

[0011] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0012] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.

[0013] Figure 1 This is a flowchart illustrating the process of adding a watermark to a screen image according to an embodiment of this application.

[0014] Figure 2 This is a flowchart illustrating the process of adding a dark watermark to a screen image according to an embodiment of this application.

[0015] Figure 3 This is a flowchart illustrating a method for adding a watermark to an image according to an embodiment of this application.

[0016] Figure 4 This is a structural block diagram of an apparatus for adding watermarks to an image according to an embodiment of this application.

[0017] Figure 5 This is a block diagram of an electronic device used to implement embodiments of this application. Detailed Implementation

[0018] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0019] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.

[0020] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0021] During cloud computing usage, watermarking can incur performance overhead and disrupt user experience. For example, visible watermarks can affect image compression efficiency, increase the amount of data transmitted via protocols, and interfere with the user's visual experience; hidden watermarks consume significant processor resources (for instance, on a terminal device, overlaying a watermark on a 1080p full-screen image takes more than 10ms). However, in real-world office scenarios, users' screens may not always display confidential information that needs protection.

[0022] Therefore, to avoid the problem that once a watermark is enabled, it will remain active throughout the user session, this application proposes a method for dynamically adding watermarks to screen images. The watermark is only added when confidential information is displayed on the user's screen, thus achieving dynamic watermark addition based on the displayed content. This can minimize unnecessary performance overhead and display interference, achieving the best balance between data security and user experience.

[0023] In practical applications, either visible or hidden watermarks can be added to the screen images of a cloud computer based on preset rules. The processes for adding visible or hidden watermarks to the screen images of a cloud computer are as follows: Figure 1 and Figure 2 As shown, the following sections will introduce them separately.

[0024] Figure 1 This is a flowchart illustrating the process of adding a watermark to a screen image according to an embodiment of this application. Figure 1 As shown, this includes a main thread and a watermarking thread. The main thread is used by the user terminal to continuously retrieve and display the cloud computer screen image from the cloud, while the watermarking thread is used to add a visible watermark to the cloud computer screen image. The specific process includes:

[0025] During cloud computer usage, the user terminal receives various display messages sent from the cloud via the main thread. Until a frame drawing instruction (e.g., a DrawFrame instruction) is received, indicating that the data for one frame of image has been sent, a screen image is generated. At this point, the cloud computer's screen image changes, displaying the newly generated frame, and the watermarking thread is notified. In the generated screen image, target detection is performed in the changed area compared to the previous frame. Specifically, this includes: first, using Optical Character Recognition (OCR) technology to perform text recognition, identifying the text content in the changed area; then, matching the identified text content according to sensitive text rules to determine if it matches preset text content, i.e., sensitive text, such as "ID number" or "quotation." Fuzzy matching is supported, allowing for a certain degree of error or similarity in string comparison to find an approximate match. If no sensitive text is detected, then based on the sensitive object rules, a target detection model is used to detect sensitive objects in the changed area to check if a preset image or code is found, such as "design drawing" or "source code". If no match is found, then it is determined whether the watermark display time of the previous frame's screen image has reached a preset time threshold (e.g., ...). Figure 1 The "Enablement time has reached the threshold" indicator shows that if the threshold is reached, the watermark is deactivated, the watermark layer is updated, and the watermark is no longer displayed. The threshold is used to prevent flickering caused by frequent watermark activation and deactivation. The preset time threshold can be configured as needed; for example, setting it to 3 seconds means the watermark will be deactivated if it has been displayed for 3 seconds. If sensitive text or objects are detected, a semi-transparent layer containing the watermark content is retrieved and overlaid onto the modified screen image for display.

[0026] Figure 2 This is a flowchart illustrating the process of adding a dark watermark to a screen image according to an embodiment of this application. Figure 2 As shown, this includes a main thread and a watermarking thread. The main thread is used by the user terminal to continuously retrieve and display the cloud computer screen image from the cloud, while the watermarking thread is used to add a dark watermark to the cloud computer screen image. The specific process includes:

[0027] During cloud computer usage, the user terminal receives various display messages sent from the cloud via the main thread. Until a frame drawing instruction (e.g., a DrawFrame instruction) is received, indicating that the data for one frame of image has been sent, a screen image is generated. At this point, the cloud computer's screen image changes, displaying the newly generated frame. The system then determines if the current screen image is stable. If stable, the watermarking thread is activated. The purpose of determining screen stability is to avoid frequently activating the watermarking process when the screen image changes frequently, thus avoiding wasted computing resources. Therefore, the watermarking process is only activated after the screen image has remained unchanged for a period of time. In the generated screen image, target detection is performed in the changed areas compared to the previous frame. Specifically, this includes: first, using OCR technology to perform text recognition, identifying the text content in the changed areas; then, matching the identified text content according to sensitive text rules to determine if it matches preset text content, i.e., sensitive text, such as "ID number" or "quotation." Fuzzy matching is supported, allowing for some error or similarity in string comparison to find approximate matching results. If no sensitive text is detected, the system uses a target detection model to perform sensitive object detection in the changed area according to the sensitive object rules, checking for pre-defined images or code, such as "design drawings" or "source code." If no match is found, the process ends, waiting for the watermarking thread to be woken up again. If sensitive text or sensitive objects are detected, an image with an overlaid dark watermark is calculated. Specifically, a dark watermark generation algorithm is used to embed the information to be hidden in the screen image into the changed screen image, resulting in a screen image with a dark watermark. Then, it is determined whether the screen has changed, i.e., whether the next image frame has been generated compared to the image frame used for target detection. If not, the image with the dark watermark is rendered to the screen for display. Since the main thread and the watermarking thread can process in parallel, after the watermarking thread adds the dark watermark, the main thread may have already generated a new screen image frame. If the screen image with the dark watermark has changed compared to the image frame used for target detection, the dark watermarking process is abandoned, and the system waits for the watermarking thread to be woken up again to avoid screen image rollback and affecting user experience.

[0028] in, Figure 1 and Figure 2In a corresponding embodiment, sensitive text rules and sensitive object rules can be configured according to specific data security needs. These rules can be distributed to the user terminal via an existing collaborative channel between the cloud and the user terminal. The user terminal stores these rules in a secure and trusted memory area that cannot be modified by ordinary users. The target detection model can be trained based on a neural network model. When using the target detection model for detection, related software can be used in conjunction with the artificial intelligence chip hardware in the user terminal. This avoids the problem of high processor power consumption and difficulty in achieving low-latency real-time target detection caused by pure software computation.

[0029] This application provides a method for adding watermarks to images. The method in this embodiment can be applied to terminal devices, apparatuses, etc., that have computing and processing capabilities.

[0030] like Figure 3 The diagram shown is a flowchart of a method for adding a watermark to an image according to an embodiment of this application, including:

[0031] Step S301: If a change is detected in the screen image of the cloud computer, target detection is performed in the changed screen image.

[0032] In this embodiment, the execution entity can be a user terminal using a cloud computer. During the use of the cloud computer by the user on the cloud network, the user terminal continuously receives data sent from the cloud, updates the screen image according to a preset update frequency, and performs target detection on the updated screen image. The screen image refers to the image displayed on the desktop of the cloud computer, including the content displayed on the screen after the user opens a file on the desktop while using the cloud computer.

[0033] Optionally, target detection can be performed in the changed region of the modified screen image. The changed region refers to the area in the modified screen image that is different from the screen image before the modification. Compared with performing target detection on the entire modified screen image, performing target detection on the changed region can save computing resources and improve the efficiency of target detection.

[0034] Step S302: If a target is detected, obtain the watermark information to be added.

[0035] The specific type and content of the target can be configured according to specific needs.

[0036] Optionally, rules that pre-configure the target type and target content in the cloud are sent to the user terminal, where the user terminal stores the rules in a secure and trusted memory area that cannot be modified by ordinary users.

[0037] In practical applications, various target detection methods can be used for target detection. Different target detection methods are used for different types of targets.

[0038] Step S303: Add watermark information to the modified screen image.

[0039] The watermark information includes visible watermark information and invisible watermark information. Visible watermark information is used to add visible watermarks, and invisible watermark information is used to add invisible watermarks. Visible watermarks are watermarks that are visible to the naked eye, while invisible watermarks are watermarks that are not visible to the naked eye. Different processing methods are used when adding different types of watermarks.

[0040] The method for adding watermarks to images provided in this application embodiment involves detecting a target in the changed screen image of a cloud computer if a change is detected; if a target is detected, watermark information to be added is obtained; and the watermark information is added to the changed screen image. In this embodiment, if a target is detected in the changed screen image when a change is detected in the cloud computer's screen image, a watermark is added; otherwise, no watermark is added. This avoids the problem of watermarks remaining active throughout the user session once enabled, leading to performance overhead and user experience interference. It achieves dynamic watermark addition, reduces performance overhead, and improves user experience.

[0041] The following describes the specific implementation process of each step above through various implementation methods:

[0042] In one implementation, the target includes preset text content; in step S301, target detection is performed on the modified screen image, including: performing text recognition on the modified screen image and determining whether the recognition result contains preset text content.

[0043] Specifically, for text-based targets, OCR technology is used to recognize text in the changed area of ​​the altered screen image, identifying the text content in the changed area. The recognized text content is then matched according to sensitive text rules to determine whether it contains preset text in the sensitive text rules, such as "ID number" or "quotation".

[0044] Among them, sensitive text rules can be configured according to specific data security needs and distributed to user terminals through existing cloud and user terminal collaborative channels. User terminals store sensitive text rules in a secure and trusted memory area that cannot be modified by ordinary users.

[0045] In this embodiment, text-type targets are detected through text recognition, which offers fast detection speed and high accuracy. In one implementation, the target includes a preset image or code; in step S301, target detection is performed on the modified screen image, including: detecting the preset image or code using a target detection model trained using a neural network model.

[0046] In practical applications, a preset text content detection can be performed first. If no preset text content is detected, then a preset image or code detection can be performed. Alternatively, a target detection model can be directly used to detect the preset image or code. Specifically, based on sensitive object rules, a target detection model is used to detect sensitive objects in the changed areas of the modified screen image to check for the presence of preset images or code, such as "design drawings" or "source code".

[0047] Among them, sensitive object rules can be configured according to specific data security needs and distributed to user terminals through existing cloud and user terminal collaborative channels. User terminals store sensitive object rules in a secure and trusted memory area that cannot be modified by ordinary users.

[0048] The target detection model can be trained based on a neural network model. When using the target detection model for detection, the software related to the target detection model can be used in conjunction with the artificial intelligence chip hardware in the user terminal to avoid the problem that pure software calculation consumes a lot of processor computing power and is difficult to achieve low-latency real-time target detection.

[0049] In this process, different target detection models can be used to detect preset images or codes, or the same target detection model can be used with different training samples. For example, one training sample includes a sample image and a sample image label, where the image label indicates whether the image is a sensitive image. Another training sample includes a sample code and a sample code label, where the sample code label indicates whether the sample code is sensitive code. Different target detection models can be trained using these two types of training samples, resulting in two separate target detection models for detection. Alternatively, the same target detection model can be trained using these two types of training samples, enabling the trained target detection model to detect both types of targets.

[0050] In this embodiment, an object detection model is used to detect objects other than text types. The object detection model is trained using a neural network model, and the detection results are highly accurate.

[0051] In one implementation, before detecting a change in the screen image of the cloud computer, the method further includes: determining whether to add a visible watermark or a hidden watermark according to a preset rule; in step S302, obtaining the watermark information to be added includes: obtaining the visible watermark information or the hidden watermark information to be added.

[0052] The preset rules can be configured according to specific needs, allowing for the addition of either visible or hidden watermarks based on the different requirements of cloud computing products. While the presentation and generation algorithms differ, both involve watermark calculation and overlay. Visible watermarks can be rendered as a separate, static, semi-transparent layer onto the terminal's display area, while hidden watermarks need to be composited with the cloud computing terminal's image frames before being rendered onto the screen. Therefore, the content of visible and hidden watermark information is also different.

[0053] In this embodiment, different watermark information can be obtained according to specific needs to meet the requirements of adding visible or hidden watermarks.

[0054] In one implementation, the watermark information is a semi-transparent layer containing the watermark content; in step S303, adding the watermark information to the modified screen image includes: overlaying the semi-transparent layer containing the watermark content onto the modified screen image.

[0055] The watermark content may include, but is not limited to, at least one of text, symbols, and images.

[0056] Adding a watermark can be achieved by overlaying a semi-transparent layer containing the watermark content onto the modified screen image, making the watermark content visible in the screen image and thus providing the screen image with traceable source information that is visible to the naked eye.

[0057] In one implementation, the method further includes: if no target is detected in the modified screen image and the display time of the watermark in the original screen image reaches a preset time threshold, then the watermark will no longer be displayed in the modified screen image.

[0058] If no target is detected in the changed screen image, the watermark will not be immediately deactivated. Instead, it will determine whether the display time of the watermark in the original screen image has reached a preset time threshold. If not, it will wait until the preset time threshold is reached before deactivating the watermark.

[0059] In this embodiment, to avoid the flickering phenomenon caused by frequently enabling and disabling the watermark, the watermark is disabled only after the display time of the watermark in the previous frame reaches a preset time threshold.

[0060] In one implementation, the dark watermark information includes information that needs to be hidden in the screen image; in step S303, adding the watermark information to the modified screen image includes: using a dark watermark generation algorithm to embed the information that needs to be hidden in the screen image into the modified screen image to obtain a screen image with added dark watermark, and rendering and displaying the screen image with added dark watermark.

[0061] In practical applications, hidden information can be generated by using a dark watermarking algorithm to hide specific information in an image. The hidden information can then be extracted and restored using the algorithm. The types of information to be hidden in a screen image can include, but are not limited to, text, symbols, and at least one of the following: images.

[0062] In one implementation, a dark watermarking generation algorithm is used to embed information that needs to be hidden in a screen image into a modified screen image, including: determining a target dark watermarking generation algorithm from multiple dark watermarking generation algorithms based on at least one of user terminal performance, watermark strength requirements, or the type of information that needs to be hidden in the screen image; and using the target dark watermarking generation algorithm to embed the information that needs to be hidden in the screen image into the modified screen image.

[0063] In practical applications, depending on at least one of the following factors, such as user terminal performance, watermark strength requirements, or the type of information to be hidden, different dark watermark generation algorithms can be selected, including but not limited to: the least significant bit (LSB) algorithm based on the spatial domain, the discrete cosine transform (DCT) algorithm or the discrete wavelet transform (DWT) algorithm based on the transform domain, and algorithms based on deep learning, etc.

[0064] The performance of the user terminal may include, but is not limited to: the speed at which the central processing unit (CPU) performs computing tasks, the ability of the graphics processing unit (GPU) to process graphics and video rendering, and the size and speed of the random access memory.

[0065] Furthermore, different dark watermarking algorithms generate watermarks of varying strengths. Some algorithms embed watermarks with higher extraction success rates and stronger resistance to modification. Extraction success rate refers to the probability of successfully recovering hidden information from a watermark carrier that has undergone various processing steps (such as cropping, rotation, stretching, recompression, and photographing). Resistance to modification refers to the watermark's ability to maintain its integrity and recognizability after various processing steps. Different dark watermarking algorithms also have varying performance overhead and image perturbation effects, allowing for selection based on specific watermark strength requirements.

[0066] In practical applications, different watermarking algorithms can be selected based on the type of information to be hidden. For example, different watermarking algorithms can be selected for information that is text or images.

[0067] In this embodiment, in order to provide traceable source information that is invisible to the naked eye for the screen image, a dark watermark generation algorithm is used to add a dark watermark to the screen image. The dark watermark is a watermark that is invisible to the naked eye, and compared with the light watermark, it can avoid obstructing the screen.

[0068] In one implementation, before rendering and displaying the screen image with the added dark watermark, the method further includes: determining that the screen image with the added dark watermark has not changed again compared to the image frame used for object detection.

[0069] In practical applications, before rendering and displaying the screen image with the added dark watermark, it is determined whether the image has changed. That is, it is determined whether the next image frame has been generated compared with the image frame used for object detection. If not, the image with the added dark watermark is rendered to the screen for display.

[0070] Since the main thread and the watermarking thread can process in parallel, after the watermarking thread adds the dark watermark, the main thread may have already generated a new screen image. If the screen image after adding the dark watermark has changed compared to the image frame used for object detection, then the addition of the dark watermark will be abandoned, and the watermarking thread will be woken up again to avoid screen image rollback and affecting user experience.

[0071] In one implementation, if a dark watermark is determined to be added according to a preset rule, before target detection is performed in the changed screen image, the method further includes: determining that the screen image of the cloud computer has changed and will not change for a preset duration.

[0072] In practical applications, before performing target detection on the changed screen image, it's determined whether the cloud computer's screen image has remained unchanged for a preset time; that is, whether the current screen image is stable. If the image is stable, the watermarking process is activated for target detection. Determining image stability avoids frequently activating the watermarking process when the screen image changes rapidly, thus preventing wasted computing resources. Furthermore, screenshots or photographs are typically easier to perform when the screen image is stable, rather than rapidly changing. Therefore, the need for watermarking for protection arises only when the image is stable. Thus, the watermarking process is activated only after the image has remained unchanged for a certain period.

[0073] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide an apparatus for adding watermarks to images. For example... Figure 4The diagram shown is a structural block diagram of an apparatus for adding watermarks to an image according to an embodiment of this application. The apparatus includes:

[0074] The target detection module 401 is used to perform target detection in the changed screen image if a change in the screen image of the cloud computer is detected.

[0075] The information acquisition module 402 is used to acquire the watermark information to be added if a target is detected.

[0076] The watermark adding module 403 is used to add watermark information to the changed screen image.

[0077] The device for adding watermarks to images provided in this application embodiment detects a change in the screen image of a cloud computer, performs target detection in the changed screen image, obtains watermark information to be added, and adds the watermark information to the changed screen image. In this embodiment, when a change in the screen image of the cloud computer is detected, a watermark is added if a target is detected in the changed screen image; otherwise, no watermark is added. This avoids the problem of watermarks remaining active throughout the user session once enabled, leading to performance overhead and user experience interference. It achieves dynamic watermark addition, reduces performance overhead, and improves user experience.

[0078] In one implementation, the target includes preset text content; when the target detection module 401 performs target detection in the modified screen image, it is used to: perform text recognition on the modified screen image and determine whether the recognition result contains preset text content.

[0079] In one implementation, the target includes a preset image or code; when the target detection module 401 performs target detection in the modified screen image, it is used to: use a target detection model to detect the preset image or code, the target detection model being trained using a neural network model.

[0080] In one implementation, the device is further configured to: determine whether to add a visible watermark or a hidden watermark according to preset rules before detecting a change in the screen image of the cloud computer; the information acquisition module 402 is configured to: acquire the visible watermark information or the hidden watermark information to be added.

[0081] In one implementation, the watermark information is a semi-transparent layer containing the watermark content; the watermark adding module 403 is used to: overlay the semi-transparent layer containing the watermark content onto the modified screen image.

[0082] In one implementation, the device is further configured to: if no target is detected in the modified screen image and the display time of the watermark in the original screen image reaches a preset time threshold, then the watermark will no longer be displayed in the modified screen image.

[0083] In one implementation, the dark watermark information includes information that needs to be hidden in the screen image; the watermark adding module 403 is used to: use a dark watermark generation algorithm to embed the information that needs to be hidden in the screen image into the modified screen image to obtain a screen image with added dark watermark, and render and display the screen image with added dark watermark.

[0084] In one implementation, the watermark adding module 403 is used to: determine a target dark watermark generating algorithm from multiple dark watermark generating algorithms based on at least one of user terminal performance, watermark strength requirements, or information types that need to be hidden in the screen image; and use the target dark watermark generating algorithm to embed the information that needs to be hidden in the screen image into the modified screen image.

[0085] In one implementation, the device is further configured to: determine, before rendering and displaying the screen image with the added dark watermark, that the screen image has not changed again compared to the image frame used for object detection.

[0086] In one implementation, if a dark watermark is determined to be added according to a preset rule, the device is also used to: determine that the screen image of the cloud computer has changed and will not change for a preset duration before performing target detection in the changed screen image.

[0087] The functions of each module in the embodiments of this application can be found in the corresponding descriptions in the above methods, and they have corresponding beneficial effects, which will not be repeated here.

[0088] Figure 5 This is a block diagram of an electronic device used to implement embodiments of this application. For example... Figure 5 As shown, the electronic device includes a memory 510 and a processor 520. The memory 510 stores a computer program that can run on the processor 520. When the processor 520 executes the computer program, it implements the method described in the above embodiments. The number of memories 510 and processors 520 can be one or more.

[0089] The electronic device also includes:

[0090] The communication interface 530 is used to communicate with external devices and exchange and transmit data.

[0091] If the memory 510, processor 520, and communication interface 530 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0092] Optionally, in a specific implementation, if the memory 510, processor 520, and communication interface 530 are integrated on a single chip, then the memory 510, processor 520, and communication interface 530 can communicate with each other through an internal interface.

[0093] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.

[0094] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the method provided in this application.

[0095] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform the method provided in this application.

[0096] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.

[0097] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0098] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0099] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0100] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0101] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0102] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0103] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0104] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0106] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for adding a watermark to an image, characterized in that, include: If a change is detected in the screen image of the cloud computer, then target detection is performed in the changed screen image. If the target is detected, the watermark information to be added is obtained; Add the watermark information to the modified screen image.

2. The method according to claim 1, characterized in that, The target includes preset text content; the target detection in the modified screen image includes: The modified screen image is subjected to text recognition to determine whether the recognition result contains the preset text content.

3. The method according to claim 1 or 2, characterized in that, The target may include a preset image or code; The step of performing target detection in the modified screen image includes: A target detection model is used to detect preset images or code. The target detection model is trained using a neural network model.

4. The method according to claim 1, characterized in that, Before detecting a change in the screen image of the cloud computer, the method further includes: The decision to add a visible or hidden watermark is based on preset rules. The process of obtaining the watermark information to be added includes: Get the watermark information to be added, whether it is a visible or hidden watermark.

5. The method according to claim 4, characterized in that, The method further includes: If the target is not detected in the modified screen image, and the display time of the watermark in the original screen image reaches a preset time threshold, then the watermark will no longer be displayed in the modified screen image.

6. The method according to claim 4, characterized in that, The watermark information includes information that needs to be hidden in the screen image; adding the watermark information to the modified screen image includes: Using a dark watermark generation algorithm, the information that needs to be hidden in the screen image is embedded into the modified screen image to obtain a screen image with a dark watermark. The screen image with a dark watermark is then rendered and displayed.

7. The method according to claim 6, characterized in that, The method of using a dark watermark generation algorithm to embed the information that needs to be hidden in the screen image into the modified screen image includes: Based on at least one of the following: user terminal performance, watermark strength requirements, or information type that needs to be hidden in the screen image, determine the target dark watermark generation algorithm from multiple dark watermark generation algorithms. Using a target dark watermark generation algorithm, the information that needs to be hidden in the screen image is embedded into the modified screen image.

8. The method according to claim 7, characterized in that, Before rendering and displaying the screen image with the added dark watermark, the method further includes: It was determined that the screen image after adding the dark watermark did not change again compared to the image frame used for target detection.

9. The method according to claim 4, characterized in that, If a dark watermark is determined to be added according to the preset rules, the method further includes the following steps before target detection is performed on the modified screen image: It is determined that the screen image of the cloud computer changes and remains unchanged for a preset time.

10. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1-9.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-9.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1-9.