Method and device for adding anti-theft watermark in data chart report
By generating and embedding visible and invisible watermarks based on feature vectors in the data chart report, the problems of watermarks being easily overlooked or removed in the prior art and affecting visual effects are solved, and strong concealment, visual interference-free and multi-dimensional The effect of hierarchical protection.
Patent Information
- Application Number
- CN202411620311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The prior art of adding anti-theft watermarks in data chart reports has problems such as being easily overlooked or removed, affecting visual effects, lack of anti-theft ability, and insufficient association of watermarks with data content.
By acquiring the chart data and performing structural analysis, watermark data based on feature vectors is generated, including visible watermarks and invisible watermarks. The visible watermark is directly embedded in the chart display area, and the invisible watermark is embedded through encryption functions and perturbing data point values or adjusting the chart elements.
It realizes watermarks that are difficult to identify and remove, maintains the visual aesthetics and readability of the chart, provides a dual protection mechanism, and enhances the anti-theft and copyright protection capabilities of the chart.
Smart Images

Figure CN119128833B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, device and electronic equipment for adding anti-theft watermarks in data chart reports. Background Art
[0002] An anti-piracy watermark is a digital mark used to protect digital content (such as images, videos, audio, documents, and charts) from unauthorized copying and distribution. There are two main types of anti-piracy watermarks: visible watermarks and invisible watermarks. Visible watermarks are directly embedded in the content and can be seen by the naked eye. They are usually used to indicate copyright ownership and prevent illegal use, such as adding the words "Copyright" to a picture. Invisible watermarks are embedded in the content through steganography to track the source of the content and detect unauthorized tampering. Together, these two watermarks improve the security and copyright protection capabilities of digital content.
[0003] The prior art has the following problems in the process of adding anti-theft watermarks to data chart reports:
[0004] 1. Easy to be ignored or removed: Existing watermarks are usually embedded in obvious text or images, which can be easily tampered with intentionally or removed by simple image processing tools.
[0005] 2. Impact on visual effects: Adding a noticeable watermark to a data chart may interfere with the visual beauty of the chart and the readability of the data, affecting the user experience.
[0006] 3. Lack of anti-theft capabilities: Many watermark technologies are limited to surface marking and cannot effectively prevent the illegal copying and dissemination of graphic content.
[0007] 4. Insufficient association between watermark and data content: Some watermark technologies are weakly associated with the data content of the chart and cannot provide targeted protection.
[0008] The above problems become technical problems that need to be solved. Summary of the invention
[0009] In view of this, the embodiments of the present invention provide a method, device and electronic device for adding an anti-theft watermark in a data chart report, which at least partially solve the problems existing in the prior art.
[0010] In a first aspect, an embodiment of the present invention provides a method for adding an anti-theft watermark in a data chart report, comprising:
[0011] After obtaining the chart data, the chart is structurally analyzed to obtain the chart type T, the number NE of key elements E in the chart is calculated, the data distribution characteristics D are analyzed, and the data point density Dd=Np / A in the chart is calculated, where Np is the number of data points in the chart and A is the effective area of the chart;
[0012] Based on the feature vector KT=[T,NE,D,Dd], watermark data is generated, wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function;
[0013] The visible watermark is directly embedded into the display area of the chart, and the invisible watermark is embedded into the chart data point by the formula Wi=E(K,Mi)⊕Di, where K represents the key, Mi represents the i-th watermark information, Di represents the i-th data point in the chart, and E represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the data point value is perturbed and embedded. The perturbed value of the data point Di is Di'=Di+Δi, where Δi is the perturbation value, and the perturbation value satisfies |Δi|< , For non-numerical charts, watermarks are embedded by adjusting the chart color C, chart line thickness L, and chart texture TL. The color brightness adjustment ΔC=f(C)*α, where f(C) is an adjustment function based on the original color brightness and α is the adjustment coefficient.
[0014] Extracting invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart;
[0015] The drift distance calculation function H() is used to calculate the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi, and detect whether the chart has been tampered with without authorization.
[0016] According to a specific implementation of an embodiment of the present invention, after obtaining the chart data, performing structural analysis on the chart to obtain a chart type T, calculating the number NE of key elements E in the chart, analyzing the data distribution feature D, and calculating the data point density Dd=Np / A in the chart, including:
[0017] Set the chart dataset Dgf, which contains all the data points of the chart;
[0018] The data points and retrograde types in the chart data set Dgf are analyzed by the type analysis function to obtain the chart type T;
[0019] Count the number of key elements E in the graph by traversing the dataset:
[0020]
[0021] It represents the sum of all elements belonging to the set E.
[0022] According to a specific implementation of an embodiment of the present invention, after obtaining the chart data, performing structural analysis on the chart to obtain a chart type T, calculating the number NE of key elements E in the chart, analyzing the data distribution feature D, and calculating the data point density Dd=Np / A in the chart, further comprising:
[0023] By constructing a binary array {μ,σ}, we can calculate the data distribution characteristics of the chart dataset:
[0024]
[0025]
[0026] xi represents the i-th data point of the chart data set Dgf, and Np represents the total number of data points in the chart data set Dgf;
[0027] Get the width w and height h of the chart, and calculate the chart area A=w*h;
[0028] Calculate the data point density Dd:
[0029] .
[0030] According to a specific implementation of the embodiment of the present invention, the watermark data is generated based on the feature vector KT=[T, NE, D, Dd], including:
[0031] Combine the feature vector KT=[T,NE,D,Dd] into a string S=T∥NE∥D∥Dd, where ∥ represents the string concatenation operation;
[0032] Use the eigenvalue calculation function SA to calculate the eigenvalue of the combined string S, and obtain the eigenvalue H = SA-256(S) of the string;
[0033] A part of the data is extracted from the generated eigenvalue H as the watermark data W=H[:Nw], where H is the data extraction function and Nw is the number of data extracted by the eigenvalue H.
[0034] According to a specific implementation of an embodiment of the present invention, the process of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by using the formula Wi=E(K,Mi)⊕Di includes:
[0035] For visible watermark embedding, determine the text content to be displayed and select the display position in the chart;
[0036] Set the font, size, color, and transparency for the visible watermark.
[0037] According to a specific implementation of an embodiment of the present invention, the method of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by the formula Wi=E(K,Mi)⊕Di also includes:
[0038] Generate a unique watermark information M for invisible watermark embedding;
[0039] Use the key K to encrypt the watermark information M to generate the encrypted watermark information E(K,M);
[0040] Using the bitwise XOR operation ⊕, the encrypted watermark information is embedded into the data points of the chart.
[0041] According to a specific implementation of the embodiment of the present invention, the method of extracting invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart includes:
[0042] Collect all data points Di′ in the graph, apply the inverse perturbation process, and recover the original data points Di=Di′−Δi;
[0043] Use the decryption algorithm Df to decrypt the information hidden in each data point:
[0044] Mi′=Df(K,Di).
[0045] According to a specific implementation of the embodiment of the present invention, the drift distance calculation function H() is used to calculate the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi, including:
[0046] Set the extracted watermark information Mi′ and the original watermark information Mi to the same length n;
[0047] For each position j, compare whether Mi'[j] and Mi[j] are the same, count the number of different positions, and get the drift distance Dp:
[0048] .
[0049] In a second aspect, an embodiment of the present invention provides a device for adding an anti-theft watermark to a data chart report, comprising:
[0050] The acquisition module, after acquiring the chart data, performs structural analysis on the chart to obtain the chart type T, calculates the number NE of key elements E in the chart, analyzes the data distribution characteristics D, and calculates the data point density Dd=Np / A in the chart, where Np is the number of data points in the chart and A is the effective area of the chart;
[0051] A generating module, based on the feature vector KT=[T,NE,D,Dd], generates watermark data, wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function;
[0052] The embedding module embeds the visible watermark directly into the display area of the chart, and embeds the invisible watermark into the chart data point through the formula Wi=E(K,Mi)⊕Di, where K represents the key, Mi represents the i-th watermark information, Di represents the i-th data point in the chart, and E represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the embedding is performed by perturbing the data point value, and the perturbed value of the data point Di is Di'=Di+Δi, where Δi is the perturbation value, and the perturbation value satisfies |Δi|< For non-numerical charts, watermarks are embedded by adjusting the chart color C, chart line thickness L, and chart texture TL. The color brightness adjustment ΔC=f(C)*α, where f(C) is an adjustment function based on the original color brightness and α is the adjustment coefficient.
[0053] An extraction module, which extracts invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart;
[0054] The detection module calculates the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi through the drift distance calculation function H(), and detects whether the chart has been tampered with without authorization.
[0055] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0056] at least one processor; and,
[0057] a memory communicatively connected to the at least one processor; wherein,
[0058] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of adding an anti-theft watermark in a data chart report in any of the aforementioned first aspects or any of the implementations of the first aspect.
[0059] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the method of adding an anti-theft watermark in a data chart report in the aforementioned first aspect or any implementation of the first aspect.
[0060] In the fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the method of adding an anti-theft watermark in a data chart report in the aforementioned first aspect or any implementation of the first aspect.
[0061] The solution for adding an anti-theft watermark to a data chart report in an embodiment of the present invention includes: after obtaining chart data, performing structural analysis on the chart to obtain a chart type T, calculating the number NE of key elements E in the chart, analyzing data distribution characteristics D, and calculating the data point density Dd=Np / A in the chart, where Np is the number of data points in the chart and A is the effective area of the chart; based on a feature vector KT=[T,NE,D,Dd], generating watermark data, where the watermark data includes a visible watermark and an invisible watermark, where the visible watermark includes a preset display text, and the watermark data includes a visible watermark and an invisible watermark. The invisible watermark is generated by using an encryption function; the visible watermark is directly embedded into the display area of the chart, and the invisible watermark is embedded into the chart data point by the formula Wi=E(K,Mi)⊕Di, where K represents the key, Mi represents the i-th watermark information, Di represents the i-th data point in the chart, and E represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the data point value is perturbed and embedded. The perturbed value of the data point Di is Di'=Di+Δi, where Δi is the perturbation value, and the perturbation value satisfies |Δi|< The filter value is used. For non-numerical charts, watermarks are embedded by adjusting the chart color C, the chart line thickness L, and the chart texture TL. The color brightness adjustment amount ΔC=f(C)*α, where f(C) is an adjustment function based on the original color brightness and α is an adjustment coefficient. The invisible watermark is extracted from the chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain the watermark information Mi' embedded in the chart. The drift distance calculation function H() is used to calculate the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi to detect whether the chart has been tampered with without authorization. The present invention has the following beneficial effects:
[0062] aHigh concealment:
[0063] The watermark embedding method of the present invention is based on steganography and encryption technology, the watermark is difficult to be identified and removed, and the anti-theft property of the chart is enhanced.
[0064] b. No visual interference:
[0065] Through slight disturbances and clever graphic adjustments, the watermark embedding has almost no impact on the visual effect of the chart, maintaining the beauty and readability of the data chart.
[0066] cMulti-level protection:
[0067] The present invention provides dual protection for the chart through the combination of visible and invisible watermarks, which can not only serve as a warning, but also enable tracing and verification when theft occurs.
[0068] dDynamic update capability:
[0069] By regularly updating watermarks and versioning, the system can adapt to changing chart data and usage scenarios, maintaining the effectiveness and protection capabilities of watermarks. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0071] Figure 1 A schematic flow chart of a method for adding an anti-theft watermark to a data chart report provided by an embodiment of the present invention;
[0072] Figure 2 A schematic flow chart of another method for adding an anti-theft watermark to a data chart report provided by an embodiment of the present invention;
[0073] Figure 3 A schematic diagram of the structure of a device for adding an anti-theft watermark to a data chart report provided by an embodiment of the present invention;
[0074] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0076] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0077] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0078] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0079] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0080] The disclosed embodiment provides a method for adding an anti-theft watermark to a data chart report. The method for adding an anti-theft watermark to a data chart report provided in the embodiment can be performed by a computing device, which can be implemented as software, or as a combination of software and hardware, and the computing device can be integrated in a server, a terminal device, etc.
[0081] See also Figure 1 and Figure 2 The present disclosure provides a method for adding an anti-theft watermark to a data chart report, comprising:
[0082] S101, after obtaining the chart data, perform structural analysis on the chart to obtain the chart type T, calculate the number NE of key elements E in the chart, analyze the data distribution characteristics D, and calculate the data point density Dd=Np / A in the chart, where Np is the number of data points in the chart and A is the effective area of the chart.
[0083] The data set Dgf of the chart can be obtained, which contains all data points and other related information. For the chart type T, the chart type can be determined based on the data layout of the chart and the chart type specified by the user (such as a bar chart, a line chart, a scatter chart, etc.). For example, if the data set is a set of discrete points, it may be a scatter chart; if the data changes over time, it may be a line chart.
[0084] The key elements E in the chart can be specific components of the chart, such as labels, legends, titles, etc. The number of these key elements can be counted by traversing the data set.
[0085]
[0086] in, It means to sum all the elements belonging to set E, that is, to count the number of elements in set E.
[0087] The data distribution characteristics of the chart dataset can be calculated by constructing a binary array {μ,σ}:
[0088]
[0089]
[0090] xi represents the i-th data point of the chart data set Dgf, and Np represents the total number of data points in the chart data set Dgf;
[0091] Get the width w and height h of the chart, and calculate the chart area A=w*h;
[0092] Calculate the data point density Dd:
[0093] .
[0094] Through the above steps, we can perform structural analysis on the chart, obtain the chart type T, calculate the number NE of key elements E in the chart, analyze the data distribution characteristics D, and calculate the data point density Dd in the chart. These feature vectors K_T=[T,NE,D,Dd] can be used to generate and embed watermarks to improve the security and copyright protection capabilities of the chart.
[0095] S102, based on the feature vector KT=[T,NE,D,Dd], generating watermark data, wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function;
[0096] The feature vector KT=[T,NE,D,Dd] can be combined into a string S=T∥NE∥D∥Dd, where ∥ represents a string concatenation operation. The eigenvalue calculation function SA is used to calculate the eigenvalue of the combined string S, and the eigenvalue of the string is obtained as H=SA-256(S). A part of the data is extracted from the generated eigenvalue H as the watermark data W=H[:Nw], where H is the data extraction function and Nw is the number of data extracted by the eigenvalue H.
[0097] For example, a part of the generated feature value can be extracted as watermark data, for example, the first 16 bits can be taken as watermark data.
[0098] W=H[:16]
[0099] Through the above formula, unique watermark data W can be generated based on the feature vector KT=[T,NE,D,Dd] to ensure the uniqueness and security of the watermark.
[0100] S103, embedding the visible watermark directly into the display area of the chart, and embedding the invisible watermark into the chart data point by the formula Wi=E(K,Mi)⊕Di, wherein K represents the key, Mi represents the i-th watermark information, Di represents the i-th data point in the chart, and E represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the watermark is embedded by perturbing the data point value, and the perturbed value of the data point Di is Di'=Di+Δi, where Δi is the perturbation value, and the perturbation value satisfies |Δi|< For non-numerical charts, watermarks are embedded by adjusting the chart color C, chart line thickness L, and chart texture TL. The color brightness adjustment ΔC=f(C)*α, where f(C) is an adjustment function based on the original color brightness and α is the adjustment coefficient.
[0101] You can add text or graphic marks to an area of a chart to form a visible watermark.
[0102] For invisible watermarks, the formula can be used:
[0103]
[0104] Wi is the i-th generated watermark data, E(K,Mi) is the result of encrypting the i-th watermark information Mi using the key K, Di is the i-th data point in the graph, Represents the exclusive OR operation.
[0105] In order to embed the watermark into the data point, a small perturbation Δi is made to each data point Di so that the new data point Di' satisfies:
[0106] Di'=Di+Δi
[0107] Among them, Δi is small enough, that is, |Δi|<ε, to ensure that the overall trend of the original data is not affected.
[0108] In addition, you can also embed invisible watermarks by adjusting the color brightness, line thickness or texture of the chart. The specific method is as follows:
[0109] Color brightness adjustment: For a given color C, adjusting its brightness ΔC can be achieved by the following formula:
[0110] ΔC=f(C)*α
[0111] Where f(C) is an adjustment function based on the brightness of the original color, and α is the adjustment coefficient. f(C) may be a simple linear function or a more complex function, depending on the desired effect.
[0112] For lines in a chart, watermark information can be embedded by slightly changing the line width, which is usually imperceptible to the naked eye. For parts of a chart with texture, watermark information can be embedded by slightly changing the texture pattern, which is more covert.
[0113] S104, extracting the invisible watermark from the chart data and graphic elements using the preset key K and the decryption algorithm Df, and obtaining the watermark information Mi' embedded in the chart.
[0114] The same key K as used when embedding the watermark can be used, and a decryption algorithm Df can be selected that matches the encryption algorithm E used when embedding.
[0115] Extract all data points Di' from the graph and restore the original data points Di:
[0116] Di=Di'-Δi
[0117] Where Δi is the perturbation value of the data point during embedding, and the watermark information in each data point can be decrypted using the decryption algorithm Df:
[0118] Mi'=Df(K,Di)
[0119] Furthermore, graphic attributes such as color C, line thickness L, and texture TL can be extracted from the chart. The original graphic attributes can be restored through reverse adjustment processing:
[0120] C=C'-ΔC
[0121] Where ΔC is the color brightness adjustment value during embedding.
[0122] Extract the hidden information from the adjusted graph attributes and decrypt it using the decryption algorithm Df:
[0123] Mi'=D_f(K,\text{Graphic properties})
[0124] All information Mi' extracted from various data points or graphic attributes are combined into a complete watermark information set.
[0125] S105, using a drift distance calculation function H(), calculate the drift distance Dp=H(Mi', Mi) between the extracted watermark information Mi' and the original watermark information Mi, and detect whether the chart has been tampered with without authorization.
[0126] In order to ensure the validity and security of the watermark information embedded in the chart, a drift distance calculation function H() can be used to compare the difference between the extracted watermark information Mi' and the original watermark information Mi. This process can help detect whether the chart has undergone unauthorized tampering. The following are the specific steps and methods:
[0127] The drift distance calculation function H() can be selected in a variety of forms. For example, the watermark information can be converted into binary data, and the drift distance can be used to calculate the difference between two strings. The drift distance is defined as the number of different characters at corresponding positions between two strings of equal length. For example, for two binary strings Mi and Mi', the drift distance H(Mi, Mi') is calculated as follows:
[0128]
[0129] Here n is the length of the string, and Mi[j] represents the jth character of the string Mi.
[0130] As another way, if the watermark information is stored in the form of a numerical vector, the drift distance can be used to measure the similarity between two vectors. The drift distance H(Mi,Mi') is calculated as follows:
[0131]
[0132] Here n is the dimension of the vector, and Mi[j] represents the j-th element of the vector Mi.
[0133] A reasonable threshold Ty can be set according to the application requirements to determine whether the watermark information has changed significantly.
[0134] If Dp>T, it is considered that the chart may have undergone unauthorized tampering; otherwise, if , it is considered that the chart has not been tampered with or the degree of tampering is within an acceptable range.
[0135] Through this method, not only can the copyright of the chart be protected, but the dissemination process of the chart can also be effectively monitored and managed.
[0136] According to a specific implementation of an embodiment of the present invention, after obtaining the chart data, performing structural analysis on the chart to obtain a chart type T, calculating the number NE of key elements E in the chart, analyzing the data distribution feature D, and calculating the data point density Dd=Np / A in the chart, including:
[0137] Set the chart dataset Dgf, which contains all the data points of the chart;
[0138] The data points and retrograde types in the chart data set Dgf are analyzed by the type analysis function to obtain the chart type T;
[0139] Count the number of key elements E in the graph by traversing the dataset:
[0140]
[0141] It represents the sum of all elements belonging to the set E.
[0142] According to a specific implementation of an embodiment of the present invention, after obtaining the chart data, performing structural analysis on the chart to obtain a chart type T, calculating the number NE of key elements E in the chart, analyzing the data distribution feature D, and calculating the data point density Dd=Np / A in the chart, further comprising:
[0143] By constructing a binary array {μ,σ}, we can calculate the data distribution characteristics of the chart dataset:
[0144]
[0145]
[0146] xi represents the i-th data point of the chart data set Dgf, and Np represents the total number of data points in the chart data set Dgf;
[0147] Get the width w and height h of the chart, and calculate the chart area A=w*h;
[0148] Calculate the data point density Dd:
[0149] .
[0150] According to a specific implementation of the embodiment of the present invention, the watermark data is generated based on the feature vector KT=[T, NE, D, Dd], including:
[0151] Combine the feature vector KT=[T,NE,D,Dd] into a string S=T∥NE∥D∥Dd, where ∥ represents the string concatenation operation;
[0152] Use the eigenvalue calculation function SA to calculate the eigenvalue of the combined string S, and obtain the eigenvalue H = SA-256(S) of the string;
[0153] A part of the data is extracted from the generated eigenvalue H as the watermark data W=H[:Nw], where H is the data extraction function and Nw is the number of data extracted by the eigenvalue H.
[0154] According to a specific implementation of an embodiment of the present invention, the process of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by using the formula Wi=E(K,Mi)⊕Di includes:
[0155] For visible watermark embedding, determine the text content to be displayed and select the display position in the chart;
[0156] Set the font, size, color, and transparency for the visible watermark.
[0157] According to a specific implementation of an embodiment of the present invention, the method of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by the formula Wi=E(K,Mi)⊕Di also includes:
[0158] Generate a unique watermark information M for invisible watermark embedding;
[0159] Use the key K to encrypt the watermark information M to generate the encrypted watermark information E(K,M);
[0160] Using the bitwise XOR operation ⊕, the encrypted watermark information is embedded into the data points of the chart.
[0161] According to a specific implementation of the embodiment of the present invention, the method of extracting invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart includes:
[0162] Collect all data points Di′ in the graph, apply the inverse perturbation process, and recover the original data points Di=Di′−Δi;
[0163] Use the decryption algorithm Df to decrypt the information hidden in each data point:
[0164] Mi′=Df(K,Di).
[0165] According to a specific implementation of the embodiment of the present invention, the drift distance calculation function H() is used to calculate the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi, including:
[0166] Set the extracted watermark information Mi′ and the original watermark information Mi to the same length n;
[0167] For each position j, compare whether Mi'[j] and Mi[j] are the same, count the number of different positions, and get the drift distance Dp:
[0168] .
[0169] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention also discloses a device 30 for adding an anti-theft watermark to a data chart report, comprising:
[0170] The acquisition module 301, after acquiring the chart data, performs structural analysis on the chart to obtain the chart type T, calculates the number NE of key elements E in the chart, analyzes the data distribution characteristics D, and calculates the data point density Dd=Np / A in the chart, where Np is the number of data points in the chart and A is the effective area of the chart;
[0171] A generating module 302 generates watermark data based on the feature vector KT=[T, NE, D, Dd], wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function;
[0172] The embedding module 303 directly embeds the visible watermark into the display area of the chart, and embeds the invisible watermark into the chart data point through the formula Wi=E(K,Mi)⊕Di, where K represents the key, Mi represents the i-th watermark information, Di represents the i-th data point in the chart, and E represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the embedding is performed by perturbing the data point value, and the perturbed value of the data point Di is Di'=Di+Δi, where Δi is the perturbation value, and the perturbation value satisfies |Δi|< For non-numerical charts, watermarks are embedded by adjusting the chart color C, chart line thickness L, and chart texture TL. The color brightness adjustment ΔC=f(C)*α, where f(C) is an adjustment function based on the original color brightness and α is the adjustment coefficient.
[0173] The extraction module 304 extracts the invisible watermark from the chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain the watermark information Mi' embedded in the chart;
[0174] The detection module 305 calculates the drift distance Dp=H(Mi', Mi) between the extracted watermark information Mi' and the original watermark information Mi through the drift distance calculation function H(), and detects whether the chart has been tampered with without authorization.
[0175] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:
[0176] at least one processor; and,
[0177] a memory communicatively connected to the at least one processor; wherein,
[0178] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of adding an anti-theft watermark in a data chart report in the aforementioned method embodiment.
[0179] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the aforementioned method embodiment.
[0180] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, enable the computer to execute the method of adding an anti-theft watermark to a data chart report in the aforementioned method embodiment.
[0181] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 60 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0182] like Figure 4As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0183] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, a gage, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0184] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0185] The above is only a specific embodiment of the present invention, but the protection scope of the present invention 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 by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for adding an anti-theft watermark to a data chart report, characterized in that: include: After obtaining the chart data, the chart is structurally analyzed to obtain the chart type T, the number NE of key elements E in the chart is calculated, the data distribution characteristics D are analyzed, and the data point density Dd=Np / A in the chart is calculated, where Np is the number of data points in the chart and A is the effective area of the chart; Based on the feature vector KT=[T,NE,D,Dd], watermark data is generated, wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function; The visible watermark is directly embedded into the display area of the chart, and the invisible watermark is embedded into the chart data point through the formula Ef(K,Mi)⊕Di, where K represents the key, Mi represents the watermark information of the i-th invisible watermark, Di represents the i-th data point in the chart, and Ef represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the data point value is perturbed for embedding, and the perturbed value of the data point Di is Di'=Di+Δi, Δi is the perturbation value, and the perturbation value satisfies |Δi|< , is the filter value; Extracting invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart; By using the drift distance calculation function H(), the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi is calculated to detect whether the chart has been tampered with without authorization; in The method of generating watermark data based on the feature vector KT=[T,NE,D,Dd] includes: Combine the feature vector KT=[T,NE,D,Dd] into a string S=T∥NE∥D∥Dd, where ∥ represents the string concatenation operation; Use the eigenvalue calculation function SA to calculate the eigenvalue of the combined string S, and obtain the eigenvalue H0=SA-256(S) of the string; A part of the data is extracted from the generated eigenvalue H0 as the watermark data W=Hf[:Nw], where Hf is the data extraction function and Nw is the number of data extracted from the eigenvalue H0.
2. The method according to claim 1, characterized in that After obtaining the chart data, the chart is structurally analyzed to obtain the chart type T, the number NE of key elements E in the chart is calculated, the data distribution characteristics D are analyzed, and the data point density Dd=Np / A in the chart is calculated, including: Set the chart dataset Dgf, which contains all the data points of the chart; The data points and retrograde types in the chart data set Dgf are analyzed by the type analysis function to obtain the chart type T; Count the number of key elements E in the graph by traversing the dataset: It represents the sum of all elements belonging to the set E.
3. The method according to claim 2, characterized in that After obtaining the chart data, the chart is structurally analyzed to obtain the chart type T, the number NE of key elements E in the chart is calculated, the data distribution feature D is analyzed, and the data point density Dd=Np / A in the chart is calculated, which also includes: By constructing a binary array {μ,σ}, we can calculate the data distribution characteristics of the chart dataset: xi represents the i-th data point of the chart data set Dgf, and Np represents the total number of data points in the chart data set Dgf; Get the width w and height h of the chart, and calculate the chart area A=w*h; Calculate the data point density Dd: 。 4. The method according to claim 1, characterized in that: The method of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by using the formula Ef(K, Mi)⊕Di includes: For visible watermark embedding, determine the text content to be displayed and select the display position in the chart; Set the font, size, color, and transparency for the visible watermark.
5. The method according to claim 4, characterized in that The method of directly embedding the visible watermark into the display area of the chart and embedding the invisible watermark into the chart data point by the formula Ef(K, Mi)⊕Di also includes: Generate a unique watermark information Mi for invisible watermark embedding; Use the key K to encrypt the watermark information Mi to generate the encrypted watermark information Ef(K,Mi); Using the bitwise XOR operation ⊕, the encrypted watermark information is embedded into the data points of the chart.
6. The method according to claim 5, characterized in that The method of extracting invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart includes: Collect all data points Di′ in the graph, apply the inverse perturbation process, and recover the original data points Di=Di′−Δi; Use the decryption algorithm Df to decrypt the information hidden in each data point: Mi′=Df(K,Di).
7. The method according to claim 6, characterized in that The drift distance calculation function H() is used to calculate the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi, including: Set the extracted watermark information Mi′ and the original watermark information Mi to the same length n; For each position j, compare whether Mi'[j] and Mi[j] are the same, count the number of different positions, and get the drift distance Dp: 。 8. A device for adding an anti-theft watermark to a data chart report, characterized in that: include: The acquisition module, after acquiring the chart data, performs structural analysis on the chart to obtain the chart type T, calculates the number NE of key elements E in the chart, analyzes the data distribution characteristics D, and calculates the data point density Dd=Np / A in the chart, where Np is the number of data points in the chart and A is the effective area of the chart; A generating module, based on the feature vector KT=[T,NE,D,Dd], generates watermark data, wherein the watermark data includes a visible watermark and an invisible watermark, wherein the visible watermark includes a preset display text, and the invisible watermark is generated by using an encryption function; The embedding module embeds the visible watermark directly into the display area of the chart, and embeds the invisible watermark into the chart data point through the formula Ef(K,Mi)⊕Di, where K represents the key, Mi represents the watermark information of the i-th invisible watermark, Di represents the i-th data point in the chart, and Ef represents the watermark data generated by the encryption function embedded into the chart. For numerical charts, the embedding is performed by perturbing the data point value, and the perturbed value of the data point Di is Di'=Di+Δi, Δi is the perturbation value, and the perturbation value satisfies |Δi|< , is the filter value; An extraction module, which extracts invisible watermarks from chart data and graphic elements using a preset key K and a decryption algorithm Df to obtain watermark information Mi' embedded in the chart; The detection module calculates the drift distance Dp=H(Mi',Mi) between the extracted watermark information Mi' and the original watermark information Mi through the drift distance calculation function H(), and detects whether the chart has been tampered with without authorization; in The method of generating watermark data based on the feature vector KT=[T,NE,D,Dd] includes: Combine the feature vector KT=[T,NE,D,Dd] into a string S=T∥NE∥D∥Dd, where ∥ represents the string concatenation operation; Use the eigenvalue calculation function SA to calculate the eigenvalue of the combined string S, and obtain the eigenvalue H0=SA-256(S) of the string; A part of the data is extracted from the generated eigenvalue H0 as the watermark data W=Hf[:Nw], where Hf is the data extraction function and Nw is the number of data extracted from the eigenvalue H0.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of adding an anti-theft watermark to a data chart report as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Electronic chart security watermarking technology based on semantic feature
CN106327418A
Dual zero watermark method and system of vector map, storage medium and server
CN108961141A