Watermark processing method and device

By obtaining the page background color value in the office software and searching for the second color point with obvious differences in the color space, the watermark color is determined, and the problem of watermark color is solved, which improves the reminder, shock and traceability effect.

CN114820267BActive Publication Date: 2024-12-06AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210390283.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2024-12-06
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

The watermark color in office software is easily confused by the page background color, making it difficult for users to see clearly and reduce the reminder deterrence effect, and it is difficult to track and trace the source when information is leaked.

Method used

By obtaining the page background color value, search for the second color point in the color space coordinate system that is greater than the preset threshold, determine it as the watermark color value, and adjust the watermark color using the butterfly optimization algorithm or the HSI model to ensure the watermark color It is obvious from the background.

Benefits of technology

It effectively avoids the confusion between watermark color and background color, improves the reminder and shock effect and information tracking and traceability capabilities, and makes the watermark color obviously different from the page background color.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114820267B_ABST
    Figure CN114820267B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for processing a watermark. The display page of office software includes a page background and a watermark. The first color value of the page background is obtained, and a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold is searched in the color space coordinate system. The greater the distance from the first color point, the greater the color difference from the page background, and the easier it is to distinguish. When the distance between the second color point and the first color point is greater than the preset distance threshold, it can be considered that the color represented by the second color point is sufficiently different from the color of the page background, so the second color value of the second color point is determined as the color value of the watermark, and the color of the watermark is set according to the second color value. The present application can avoid the problem that the color of the watermark is confused by the color of the page background, making it difficult for the user to see the watermark clearly, thereby ensuring the reminder and deterrent effect of the watermark on the user and the tracking and tracing function of the watermark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a watermark processing method and device. Background Art

[0002] With the development of information technology and mobile terminals, more and more mobile terminals are used for office work when going to work or on business trips. Especially in the current situation where viruses are easy to spread, the demand for remote office and mobile office is more prominent and more urgent, so mobile terminals are required to support the entire office process. While using mobile terminals for office work brings great convenience to our daily work, it may also bring the risk of work information leakage.

[0003] In order to enhance the deterrent effect of keeping work information confidential and to track the source of information and handle it in a timely manner when work information is leaked, many office software add watermarks to sensitive pages. Generally, the watermarks will have the user's identifier (ID) and nickname to remind employees not to disclose work information at will. The color of the watermark is usually light, so as not to affect the normal reading of emails and documents.

[0004] However, office software can provide users with personalized settings, such as changing the background color, setting dark mode, night mode, etc. In this scenario, when the color of the page background changes, the watermark may be confused with the color of the page background, and the user cannot see it clearly, thereby reducing the reminder and deterrent effect on the user, and once the work information is leaked, it is difficult to trace the source. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a watermark processing method and device to avoid the problem that the color of the watermark is confused by the color of the page background, making it difficult for users to see the watermark clearly, thereby ensuring the watermark's reminder and deterrent effect on users and the watermark's tracking and tracing function.

[0006] In a first aspect, an embodiment of the present application provides a method for processing a watermark, wherein a display page of an office software includes a page background and a watermark, and the method includes:

[0007] Obtaining a first color value of the page background;

[0008] Searching in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0009] Determining a second color value of the second color point as a color value of the watermark;

[0010] The color of the watermark is set according to the second color value.

[0011] Optionally, before obtaining the first color value of the page background, the method further includes:

[0012] receiving update setting information for the page background, wherein the update setting information includes the first color value;

[0013] The obtaining of the first color value of the page background includes:

[0014] In response to the update setting information, obtaining the first color value from the update setting information;

[0015] The step of setting the color of the watermark according to the second color value comprises:

[0016] The color of the watermark is adjusted from a third color value to the second color value, wherein the third color value is the color value of the watermark before receiving the update setting information.

[0017] Optionally, searching in the color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold includes:

[0018] By using the butterfly optimization algorithm, a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold is searched in the color space coordinate system.

[0019] Optionally, searching, in a color space coordinate system, by a butterfly optimization algorithm, for a second color point whose distance from a first color point identified by the first color value is greater than a preset distance threshold comprises:

[0020] Dividing a plurality of color points in the color space coordinate system into a plurality of color point clusters;

[0021] For each color point cluster, determine candidate color points whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0022] A second color point is determined from a plurality of candidate color points.

[0023] Optionally, the color space coordinate system is a three-primary color space coordinate system, and determining the second color point from a plurality of candidate color points includes:

[0024] The color values ​​of multiple candidate color points are converted from the three primary color space to the hue-saturation-intensity HSI space to obtain the target color value of each candidate color point;

[0025] A candidate color point whose target color value meets a preset condition is determined from a plurality of candidate color points as the second color point.

[0026] In a second aspect, an embodiment of the present application provides a watermark processing device, wherein a display page of office software includes a page background and a watermark, and the device includes:

[0027] An acquiring unit, configured to acquire a first color value of the page background;

[0028] A searching unit, configured to search in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0029] a determining unit, configured to determine a second color value of the second color point as a color value of the watermark;

[0030] A setting unit is used to set the color of the watermark according to the second color value.

[0031] Optionally, the device further comprises:

[0032] A receiving unit, configured to receive update setting information for the page background, wherein the update setting information includes the first color value;

[0033] The acquiring unit is specifically configured to acquire the first color value from the updated setting information in response to the updated setting information;

[0034] The setting unit is specifically configured to adjust the color of the watermark from a third color value to the second color value, where the third color value is the color value of the watermark before receiving the update setting information.

[0035] Optionally, the search unit is specifically used to:

[0036] By using the butterfly optimization algorithm, a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold is searched in the color space coordinate system.

[0037] Optionally, the search unit is specifically used to:

[0038] Dividing a plurality of color points in the color space coordinate system into a plurality of color point clusters;

[0039] For each color point cluster, determine candidate color points whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0040] A second color point is determined from a plurality of candidate color points.

[0041] Optionally, the color space coordinate system is a three-primary color space coordinate system, and the search unit is specifically used to:

[0042] The color values ​​of multiple candidate color points are converted from the three primary color space to the hue-saturation-intensity HSI space to obtain the target color value of each candidate color point;

[0043] A candidate color point whose target color value meets a preset condition is determined from a plurality of candidate color points as the second color point.

[0044] It can be seen from the above technical solution that the embodiment of the present application can be used to set the watermark color on the display page of the office software, wherein the display page of the office software includes the page background and the watermark. Specifically, the first color value of the page background can be obtained, and the second color point whose distance from the first color point identified by the first color value is greater than the preset distance threshold is searched in the color space coordinate system. The greater the distance between the second color point and the first color point, the greater the color difference between the second color point and the page background, and the easier it is to distinguish. When the distance between the second color point and the first color point is greater than the preset distance threshold, it can be considered that the color represented by the second color point is sufficiently different from the color of the page background (the color represented by the first color point). Therefore, the second color value of the second color point can be determined as the color value of the watermark, so as to set the color of the watermark according to the second color value. It can be seen from this that the present application can determine the second color value that is sufficiently different from the color of the page background according to the color value of the page background obtained, so as to set the color of the watermark according to the second color value, so that the color of the watermark is clearly different from the color of the page background, and avoid the problem that the color of the watermark is confused by the color of the page background and the user is difficult to see the watermark clearly, thereby ensuring the reminder and deterrence effect of the watermark on the user and the tracking and tracing function of the watermark. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0046] Figure 1 A flowchart of a watermark processing method provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of an HSI model provided in an embodiment of the present application;

[0048] Figure 3 A structural diagram of a watermark processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] At present, in order to enhance the deterrent effect of keeping work information confidential and to track the source of information and deal with it in a timely manner when work information is leaked, many office software add watermarks to sensitive pages to remind employees not to leak work information at will. The color of the watermark is usually light, so as not to affect the normal reading of emails and documents.

[0051] However, office software can provide users with personalized settings, such as changing the background color, setting dark mode, night mode, etc. In this scenario, when the color of the page background changes, the watermark may be confused with the color of the page background, and the user cannot see it clearly, thereby reducing the reminder and deterrent effect on the user, and once the work information is leaked, it is difficult to trace the source.

[0052] In order to solve the above technical problems, the present application provides a watermark processing method, which can be used to set the watermark color on the display page of office software, wherein the display page of the office software includes a page background and a watermark. Specifically, a first color value of the page background can be obtained, and a second color point whose distance from a first color point identified by the first color value is greater than a preset distance threshold is searched in the color space coordinate system. The greater the distance between the second color point and the first color point, the greater the color difference between the second color point and the page background, and the easier it is to distinguish. When the distance between the second color point and the first color point is greater than the preset distance threshold, it can be considered that the color represented by the second color point is sufficiently different from the color of the page background (the color represented by the first color point). Therefore, the second color value of the second color point can be determined as the color value of the watermark, and the color of the watermark is set according to the second color value. It can be seen from this that the present application can determine a second color value that is sufficiently different from the color of the page background based on the color value of the acquired page background, and then set the color of the watermark according to the second color value, so that the color of the watermark is clearly different from the color of the page background, thereby avoiding the problem that the color of the watermark is confused by the color of the page background and the user has difficulty seeing the watermark clearly, thereby ensuring the reminder and deterrent effect of the watermark on the user and the tracking and tracing function of the watermark.

[0053] The method provided in the embodiment of the present application can be executed by a terminal with office software installed, or by a server corresponding to the terminal, which can be an independent server or a server in a cluster. The embodiment of the present application will mainly introduce the watermark processing method executed by the terminal as an example.

[0054] Next, the watermark processing method provided by the present application will be introduced in conjunction with the accompanying drawings. Figure 1 As shown, the method includes:

[0055] S101. Obtain a first color value of the page background.

[0056] In the embodiment of the present application, the color of the watermark is mainly set adaptively according to the color of the page background. For this purpose, the first color value of the page background can be obtained first.

[0057] It should be noted that in the embodiment of the present application, the color of the watermark can be set adaptively according to the color of the page background at various stages, such as the initial setting stage of the watermark, and the stage when the page background changes and the colors of the page background and the watermark are close, and the watermark color needs to be adjusted, so that the color of the watermark dynamically adapts to the color changes of the page background.

[0058] When the method provided in the embodiment of the present application is applied to the stage of adjusting the watermark color, the execution timing of S101 may also include multiple times. In one possible case, the first color value of the page background may be acquired in real time.

[0059] In another possible case, since the color of the watermark is usually adjusted due to a change in the color of the page background, the color of the watermark may be confused with the color of the page background, and the color change of the page background is usually due to the user's setting, before executing S101, the terminal receives update setting information for the page background, and the update setting information includes the first color value. In this case, in order to avoid the waste of processing resources, the implementation of S101 can be in response to the update setting information, and the first color value is obtained from the update setting information, that is, the execution timing of S101 can be when the update setting information is triggered.

[0060] S102: Search in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold.

[0061] In order to avoid the problem that the color of the watermark is confused by the color of the page background and makes it difficult for the user to see the watermark clearly, the color of the watermark needs to be clearly different from the color of the page background. In the color space coordinate system, the greater the distance between the watermark and the first color point, the greater the color difference between the watermark and the page background, and the easier it is to distinguish. Based on this, in the embodiment of the present application, a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold can be searched in the color space coordinate system.

[0062] The color space is a three-dimensional space formed by the value range of red, green, and blue (RGB) in the coordinate system, so the coordinate system of the color space can be called the color space coordinate system, and R, G, and B are the three primary colors, so the color space can be called the three primary color space, and the color space coordinate system can be called the three primary color space coordinate system. The distance can be a distance calculated in various ways, such as the Euclidean distance.

[0063] In the embodiment of the present application, a search can be performed in the color space coordinate system by various methods. In one possible implementation, a butterfly optimization algorithm can be used to search in the color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold.

[0064] The butterfly optimization algorithm (BOA) is a heuristic intelligent algorithm that simulates the behavior of butterflies sensing odors to search the solution space, which mainly includes a global search phase close to companions and a local search phase of random movement.

[0065] The main idea of ​​the butterfly optimization algorithm is that, because butterflies have a very sensitive sense of smell, they can accurately judge the location of the surrounding odor sources and can sense the intensity of the odor. The algorithm simulates the process of butterflies approaching their partners and foraging, assuming that each butterfly has a fitness at each location, which represents the odor. When a butterfly moves from one location to another, its fitness will change accordingly, that is, the odor has changed. When a butterfly senses that another butterfly is emitting more odors, that is, when its fitness is higher, it will approach. This stage is called global search. In another case, when a butterfly senses that there is no odor greater than its own, that is, its fitness reaches a maximum value within a certain range, it will move randomly. This stage is called local search. The algorithm searches in the solution space. When the iteration ends, the solution with the best fitness is the optimal solution. At the same time, by simulating the behavior of butterflies in two situations, the probability of reaching the local optimal solution can be reduced to a certain extent.

[0066] In the butterfly optimization algorithm, global search and local search will switch randomly, and a switch probability p will be set at the beginning of the algorithm to switch between global search and local search. Each iteration uses a random number q to compare with the switch probability p to decide whether to perform global search or local search at this time, but all butterflies eventually converge to a unique optimal solution after the search iteration process, which may be the global optimal solution or the local optimal solution. In order to further avoid obtaining a local optimal solution, the embodiment of the present application adds k candidate solutions, that is, k butterfly populations are divided, and search iterations are performed for the k butterfly populations respectively. After the iteration ends, the k butterfly populations each obtain an optimal solution, a total of k optimal solutions, and then the next step of judgment is performed from the k optimal solutions to obtain the final solution.

[0067] Based on the above ideas, the implementation method of S102 can be to divide the multiple color points in the color space coordinate system into multiple color point clusters, such as k color point clusters. The k color point clusters represent k butterfly populations, and the search iterations are performed for the k butterfly populations respectively, that is, for each color point cluster, the candidate color points whose distance from the first color point identified by the first color value is greater than the preset distance threshold are determined respectively, and the second color point is determined from the multiple candidate color points. Among them, the multiple color point clusters can be randomly divided, and the embodiment of the present application does not limit this.

[0068] Through this method, the butterfly optimization algorithm is improved from converging to a unique solution to converging to k solutions, further reducing the probability of obtaining a local optimal solution.

[0069] Next, the iterative process of the butterfly optimization algorithm will be introduced in detail:

[0070] Assume that the color of the page background of the current office software is the initial point in the color space (i.e., the first color point identified by the first color value), and its coordinates are (r, g, b), where r, g, and b are the values ​​of the three channels of red (R), green (G), and blue (B) of the color of the page background, respectively. The three color channels are superimposed on each other to form color. Generally, the domains of the three channels are [0, 255] and the values ​​are usually integers, such as: (255, 255, 255). Then let the fitness of each solution (i.e., the color point in the color space) be the distance d from the solution to (r, g, b) in the color space. In the embodiment of the present application, the Euclidean distance is used. The distance formula from the color point (x1, x2, ..., xn) to the color point (y1, y2, ..., yn) in the n-dimensional color space coordinate system is as follows:

[0071]

[0072] In the butterfly optimization algorithm, the smell is expressed as a function of stimulus intensity such as:

[0073] f=cI α(2)

[0074] I=d(x,y) (3)

[0075] Among them, f represents odor; c is the sensory factor, and its domain is [0,1]; α is the power exponent, and its domain is [0,1]; I is the stimulus intensity. In the embodiment of the present application, I is the fitness, that is, the distance d from the solution to (r, g, b).

[0076] The iterative process of multiple color point clusters (butterfly groups) in the global search phase is as follows:

[0077]

[0078] Among them, x t+1 1i represents the solution of the i-th butterfly in the first butterfly population in the t+1th iteration; x t 1i represents the solution of the ith butterfly in the first butterfly population in the tth iteration, q1 is a random number between 0 and 1, g * 1 represents the optimal solution in the first butterfly population at this time, f 1i represents the smell of the i-th butterfly in the first butterfly population; x t+1 ki represents the solution of the i-th butterfly in the k-th butterfly population in the t+1-th iteration; x t ki represents the solution of the i-th butterfly in the k-th butterfly population in the t-th iteration, q k is a random number between 0 and 1, g * k represents the optimal solution in the kth butterfly population at this time, f ki represents the scent of the i-th butterfly in the k-th butterfly population.

[0079] The iterative process of multiple color point clusters (butterfly groups) in the local search phase is as follows:

[0080]

[0081] Among them, x t+1 1i represents the solution of the ith butterfly in the first butterfly population in the t+1th iteration, x t 1i represents the solution of the ith butterfly in the first butterfly population in the tth iteration, q1 is a random number between 0 and 1, and x t 1m and x t 1n represents the solution of the mth and nth butterflies randomly selected from the first butterfly population in the tth iteration, f1i represents the smell of the i-th butterfly in the first butterfly population; x t+1 ki represents the solution of the i-th butterfly in the k-th butterfly population in the t+1-th iteration; x t ki represents the solution of the i-th butterfly in the k-th butterfly population in the t-th iteration, q k is a random number between 0 and 1, x t km and x t kn represents the solution of the mth and nth butterflies randomly selected from the kth butterfly population in the tth iteration.

[0082] After the iteration, each of the k butterfly populations obtains an optimal solution, and the k optimal solutions in total are then judged from the k optimal solutions to obtain the final solution.

[0083] The improved butterfly optimization algorithm is combined with the HSI model and the search result color. The HSI model is used to select one final solution from k candidate solutions. The color corresponding to the solution is more natural and intuitive to human color perception. This color is set as the new watermark color to solve the above problem.

[0084] After obtaining multiple candidate color points, since the color space coordinate system is a three-primary color space coordinate system, and the color of the page background and the color of the watermark are displayed to the user, in the embodiment of the present application, the second color point can be selected from the multiple candidate color points based on the perception and feeling of the human visual system to color, so that the color of the watermark is significantly different from the color of the page background and conforms to the intuitive feeling of the person. Based on this, in a possible implementation method, the method of determining the second color point from the multiple candidate color points can be to convert the color values ​​of the multiple candidate color points from the three-primary color space to the hue-saturation-intensity HSI space respectively, obtain the target color value of each candidate color point, and then determine the candidate color point whose target color value meets the preset conditions from the multiple candidate color points as the second color point.

[0085] Hue-Saturation-Intensity (HSI) space, HSI space is based on the human visual system and uses hue (Hue), saturation (Saturation) and intensity (Intensity) to describe color. H describes the color attribute of a pure color (such as red, yellow), S is a measure of the degree to which a pure color is diluted by white light, which can be understood as the degree of brightness, and I is the grayscale of the image.

[0086] The HSI space can be described by a cone space model, namely the HSI model. The advantage of the HSI model for image processing is that it separates color information (H, S) and grayscale information (I), and the H and S components are closely related to the way people perceive color. This feature makes the HSI model very suitable for color feature detection and analysis. The color obtained after analysis by this model is more natural and intuitive to people than the RGB model of the three primary color space. The HSI model is a cone space model, H is the angle value, and the domain is [0,360°], S is the radius, and the domain is [0,1], and I is the intensity value, and the domain is [0,1]. The closer the color is to the central axis, the closer it is to gray. The model is as follows Figure 2 shown.

[0087] If the above-mentioned multiple color point clusters are k color point clusters, then the obtained multiple candidate color points are k candidate color points. If the coordinates of the k candidate color points are (r1, g1, b1), ..., (r k ,g k ,b k ), at this time, the coordinates of the k candidate color points and the initial point are converted into the HSI model. The method of converting RGB to HSI is as follows:

[0088] H stands for Hue:

[0089]

[0090]

[0091] Among them, R, G, and B are the coordinates of each color point in the three primary color space coordinate system in R, G, and B, such as (r1, g1, b1), ..., (r k ,g k ,b k ).

[0092] S stands for saturation:

[0093]

[0094] I stands for intensity or grayscale:

[0095]

[0096] The characteristic of the HSI model in image processing is that the H and S components are closely related to the way people perceive colors, and the I component only represents the brightness and has nothing to do with color information. Therefore, the final solution is determined by the H and S components. For example, the difference between the color represented by each candidate color point and the color represented by the first color point can be determined based on H and S, so as to try to select a candidate color point with a contrasting color close to the color of the page background as the second color point. It can be calculated by the following formula:

[0097]

[0098] Among them, h i are the H components corresponding to the k candidate color points, which are h1,...,h k ,s i are the S components corresponding to the k candidate color points, which are s1,...,s k , α and β are weights. For each candidate color point, P is calculated by formula (10) i ; Then calculate P0 using the complementary angle h' of the S component s0 of the initial point and its H component, h'=180°-h0, the color represented by h' is the contrast color of the page background color. Finally P i Subtract them from P0 respectively, and the absolute value of the difference is recorded as m1, ..., m k The smaller the absolute value, the closer the contrast color is to the background color of the page. i The candidate color point represented by the minimum value is the final solution (ie, the second color point).

[0099] The above method can be used to select the second color point from multiple candidate color points based on the human visual system's perception and feeling of color, so that the color of the watermark is significantly different from the color of the page background and conforms to human intuitive feelings.

[0100] S103: Determine the second color value of the second color point as the color value of the watermark.

[0101] S104: Set the color of the watermark according to the second color value.

[0102] The second color point is determined in the above manner, and the color represented by the second color point is sufficiently different from the color of the page background. Therefore, after the second color point is determined, the second color value of the second color point can be determined as the color value of the watermark, thereby setting the color of the watermark according to the second color value.

[0103] When the execution timing of S101 is to trigger the update setting information, that is, the implementation method of S101 is to respond to the update setting information, when the first color value is obtained from the update setting information, the method of setting the color of the watermark according to the second color value can be to adjust the color of the watermark from the third color value to the second color value, and the third color value is the color value of the watermark before receiving the update setting information.

[0104] Through the above method, the purpose of adaptively and dynamically changing the watermark color when the background color of the office software page changes can be achieved, which can ensure that the color of the watermark is significantly different from the color of the page background to avoid confusion, and the method is not limited by the terminal model.

[0105] It can be seen from the above technical solution that the embodiment of the present application can be used to set the watermark color on the display page of the office software, wherein the display page of the office software includes the page background and the watermark. Specifically, the first color value of the page background can be obtained, and the second color point whose distance from the first color point identified by the first color value is greater than the preset distance threshold is searched in the color space coordinate system. The greater the distance between the second color point and the first color point, the greater the color difference between the second color point and the page background, and the easier it is to distinguish. When the distance between the second color point and the first color point is greater than the preset distance threshold, it can be considered that the color represented by the second color point is sufficiently different from the color of the page background (the color represented by the first color point). Therefore, the second color value of the second color point can be determined as the color value of the watermark, so as to set the color of the watermark according to the second color value. It can be seen from this that the present application can determine the second color value that is sufficiently different from the color of the page background according to the color value of the page background obtained, so as to set the color of the watermark according to the second color value, so that the color of the watermark is clearly different from the color of the page background, and avoid the problem that the color of the watermark is confused by the color of the page background and the user is difficult to see the watermark clearly, thereby ensuring the reminder and deterrence effect of the watermark on the user and the tracking and tracing function of the watermark.

[0106] Based on the watermark processing method provided in the above embodiment, the present application embodiment also provides a watermark processing device. The display page of the office software includes a page background and a watermark. Figure 3 , the device comprises:

[0107] An acquiring unit 301 is used to acquire a first color value of the page background;

[0108] A searching unit 302, configured to search in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0109] A determining unit 303, configured to determine a second color value of the second color point as a color value of the watermark;

[0110] The setting unit 304 is configured to set the color of the watermark according to the second color value.

[0111] Optionally, the device further comprises:

[0112] A receiving unit, configured to receive update setting information for the page background, wherein the update setting information includes the first color value;

[0113] The acquiring unit is specifically configured to acquire the first color value from the updated setting information in response to the updated setting information;

[0114] The setting unit is specifically configured to adjust the color of the watermark from a third color value to the second color value, where the third color value is the color value of the watermark before receiving the update setting information.

[0115] Optionally, the search unit is specifically used to:

[0116] By using the butterfly optimization algorithm, a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold is searched in the color space coordinate system.

[0117] Optionally, the search unit is specifically used to:

[0118] Dividing a plurality of color points in the color space coordinate system into a plurality of color point clusters;

[0119] For each color point cluster, determine candidate color points whose distance from the first color point identified by the first color value is greater than a preset distance threshold;

[0120] A second color point is determined from a plurality of candidate color points.

[0121] Optionally, the color space coordinate system is a three-primary color space coordinate system, and the search unit is specifically used to:

[0122] The color values ​​of multiple candidate color points are converted from the three primary color space to the hue-saturation-intensity HSI space to obtain the target color value of each candidate color point;

[0123] A candidate color point whose target color value meets a preset condition is determined from a plurality of candidate color points as the second color point.

[0124] It can be seen from the above technical solution that the embodiment of the present application can be used to set the watermark color on the display page of the office software, wherein the display page of the office software includes the page background and the watermark. Specifically, the first color value of the page background can be obtained, and the second color point whose distance from the first color point identified by the first color value is greater than the preset distance threshold is searched in the color space coordinate system. The greater the distance between the second color point and the first color point, the greater the color difference between the second color point and the page background, and the easier it is to distinguish. When the distance between the second color point and the first color point is greater than the preset distance threshold, it can be considered that the color represented by the second color point is sufficiently different from the color of the page background (the color represented by the first color point). Therefore, the second color value of the second color point can be determined as the color value of the watermark, so as to set the color of the watermark according to the second color value. It can be seen from this that the present application can determine the second color value that is sufficiently different from the color of the page background according to the color value of the page background obtained, so as to set the color of the watermark according to the second color value, so that the color of the watermark is clearly different from the color of the page background, and avoid the problem that the color of the watermark is confused by the color of the page background and the user is difficult to see the watermark clearly, thereby ensuring the reminder and deterrence effect of the watermark on the user and the tracking and tracing function of the watermark.

[0125] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0126] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which 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 on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A watermark processing method, characterized in that: The display page of the office software includes a page background and a watermark, and the method includes: Obtaining a first color value of the page background; Searching in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold; The step of searching in the color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold comprises: By using a butterfly optimization algorithm, searching in a color space coordinate system for a second color point whose distance from a first color point identified by the first color value is greater than a preset distance threshold; The step of searching, in a color space coordinate system, for a second color point whose distance from a first color point identified by the first color value is greater than a preset distance threshold by using the butterfly optimization algorithm comprises: Dividing a plurality of color points in the color space coordinate system into a plurality of color point clusters; For each color point cluster, determine candidate color points whose distance from the first color point identified by the first color value is greater than a preset distance threshold; determining a second color point from a plurality of candidate color points; Determining a second color value of the second color point as a color value of the watermark; The color of the watermark is set according to the second color value.

2. The method according to claim 1, characterized in that Before obtaining the first color value of the page background, the method further includes: receiving update setting information for the page background, wherein the update setting information includes the first color value; The obtaining of the first color value of the page background includes: In response to the update setting information, obtaining the first color value from the update setting information; The step of setting the color of the watermark according to the second color value comprises: The color of the watermark is adjusted from a third color value to the second color value, wherein the third color value is the color value of the watermark before receiving the update setting information.

3. The method according to claim 1, characterized in that The color space coordinate system is a three-primary color space coordinate system, and determining the second color point from a plurality of candidate color points includes: The color values ​​of multiple candidate color points are converted from the three primary color space to the hue-saturation-intensity HSI space to obtain the target color value of each candidate color point; A candidate color point whose target color value meets a preset condition is determined from a plurality of candidate color points as the second color point.

4. A watermark processing device, characterized in that: The display page of the office software includes a page background and a watermark, and the device includes: An acquiring unit, configured to acquire a first color value of the page background; A searching unit, configured to search in a color space coordinate system for a second color point whose distance from the first color point identified by the first color value is greater than a preset distance threshold; The search unit is specifically used for: By using a butterfly optimization algorithm, searching in a color space coordinate system for a second color point whose distance from a first color point identified by the first color value is greater than a preset distance threshold; The search unit is specifically used for: Dividing a plurality of color points in the color space coordinate system into a plurality of color point clusters; For each color point cluster, determine candidate color points whose distance from the first color point identified by the first color value is greater than a preset distance threshold; determining a second color point from a plurality of candidate color points; a determining unit, configured to determine a second color value of the second color point as a color value of the watermark; A setting unit is used to set the color of the watermark according to the second color value.

5. The device according to claim 4, characterized in that The device also includes: A receiving unit, configured to receive update setting information for the page background, wherein the update setting information includes the first color value; The acquiring unit is specifically configured to acquire the first color value from the updated setting information in response to the updated setting information; The setting unit is specifically configured to adjust the color of the watermark from a third color value to the second color value, where the third color value is the color value of the watermark before receiving the update setting information.

6. The device according to claim 4, characterized in that The color space coordinate system is a three-primary color space coordinate system, and the search unit is specifically used for: The color values ​​of multiple candidate color points are converted from the three primary color space to the hue-saturation-intensity HSI space to obtain the target color value of each candidate color point; A candidate color point whose target color value meets a preset condition is determined from a plurality of candidate color points as the second color point.