A text watermarking method, system, device and storage medium based on character size in the financial field

By using the adaptive K-means algorithm based on density and distance in the financial field to determine the range of commonly used words, and by adjusting the font size to achieve watermark embedding and extraction, the problem of difficulty in applying text digital watermarks in the financial field in the existing technology is solved, and Efficient and secure transmission of text data.

CN117876203BActive Publication Date: 2024-09-20BEIJING XINSHU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410016851.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-04
Publication Date
2024-09-20
Estimated Expiration
2044-01-04

AI Technical Summary

Technical Problem

Existing text digital watermarking methods are difficult to effectively apply to text data in the financial field, especially in traditional printing, scanning, and photographing scenarios, and often require modification of the system font library, resulting in compatibility, stability, and font rendering issues.

Method used

The adaptive K-means algorithm based on density and distance is used to determine the range of commonly used words, and watermark embedding and extraction is achieved by adjusting the font size of commonly used words, avoiding modifications to the system font library, and is suitable for printing, scanning, taking photos and other scenarios.

Benefits of technology

It realizes efficient and simple embedding and extraction of watermarks in text data, ensures the security during text transmission, avoids negative effects on the stability of the operating system, and is suitable for text data protection in the financial field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117876203B
    Figure CN117876203B
Patent Text Reader

Abstract

The present invention proposes a text watermarking method and system based on character font size in the financial field, a device and a storable medium, and uses a commonly used Chinese character determination algorithm based on K-means clustering. The algorithm regards Chinese characters as data points, introduces density, and avoids merging small clusters in high-density areas with large clusters in low-density areas; the K value is adaptively adjusted according to the distribution of data. The present invention does not need to modify the system font library, but only needs to regenerate a text based on the user's identity information. For commonly used characters in work, the text will be modified in font size, and the font size modification rule is the embedded watermark information. The method is simple and efficient, suitable for printing, scanning, taking pictures, screenshots and other scenarios, and does not need to add hidden watermark information to the text. It only modifies the font size of commonly used characters, avoiding the impact of the font library replacement method on the stability of the operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a text watermark method and system based on character size in the financial field, a device and a storable medium, and belongs to the field of digital watermark. Background Art

[0002] The development of information technology has injected vitality and power into all walks of life. The exponential growth trend of data volume is bound to lead to the phenomenon of "information overload". Users have emerged from the predicament of lack of data in the past, but are easily overwhelmed by massive data. Massive data brings many new challenges, such as data storage, management, query, etc. Among these challenges, data security issues have also attracted much attention. In the financial field, data security is very important and data dissemination needs to be strictly restricted. In the necessary data dissemination process, in order to ensure data security, it is necessary to avoid data leakage and illegal dissemination. In this process, digital watermarking technology has been widely studied and applied. The application of digital watermarks is closely related to the data type. There are many existing data types, including video, audio, image and text. For video, audio and image data, because they contain a lot of redundant information, it is relatively easy to add watermarks to the data; but there is very little redundant information in text data, which poses a great challenge to adding watermarks.

[0003] Currently, existing text digital watermarking methods are mostly based on the geometric features of characters to perturb and deform the characters, and then replace the system font library. This method often requires modifying the font library of the operating system. Modifying the font library may cause some negative effects, including: (1) Compatibility issues: Modifying the font library may cause some applications or system components to fail to display or run properly, because they may rely on specific fonts or characters in the original font library; (2) System stability issues: Font library modification may affect system stability, causing system crashes or abnormal behavior; (3) Font rendering issues: Modifying the font library may affect the rendering effect of the font, making the font appear blurry, unclear, or have other visual effects problems when displayed; (4) Font size issues: Modifying the font library may affect the font size, causing problems with some applications or web page layouts.

[0004] In fact, for some important text transmission, it is often transmitted through printing, scanning on paper carriers, or through taking photos or other screen shots. This transmission method limits the use of some digital watermarking technologies, because simply adding some hidden content to the text content cannot play a role in such usage scenarios. Although modifying the font library can remain effective in such scenarios, it is relatively complex and affects the stability of the system. The printing method can save the font size information relatively completely, and can avoid the problems of font tilt and deformation caused by the photography method, so it has the conditions for simple processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0005] Figure 1 This is the flow chart of the present invention.

[0006] Figure 2 This is the watermark embedding diagram of the present invention. Summary of the Invention

[0007] To solve the problems existing in the prior art, the present invention proposes a text watermarking method based on character font size in the financial field. The specific steps are as follows:

[0008] (1) Determine the range of common characters based on character density and distance;

[0009] (2) Watermark embedding;

[0010] (3) Watermark extraction.

[0011] Furthermore, in step (1), an adaptive K-means algorithm based on density and distance is used to determine the range of common characters. The specific process is as follows:

[0012] 1.1 Collect Chinese texts in the financial field to form a data set;

[0013] 1.2 Calculate the weight TF-IDF value of each data point in the data set. Denote the weight of the i-th data point as t i .

[0014] 1.3 For each data point i, calculate the density around it where d ij is the distance between point i and point j, and d ij =|t i -t j |, σ is the width parameter of the Gaussian kernel, Neighbors(i) represents the set of neighbors of point i, and all data points j with d ij <T are neighbors of point i. T is the distance threshold, α is the parameter for adjusting the influence of distance; β is the parameter for adjusting the attenuation speed.

[0015] 1.4 Select the top K data points with the highest density as the initial clustering centers, where K is a natural number.

[0016] 1.5 Calculate the weighted distance

[0017] 1.6 During the iteration process, if the density of a certain cluster is lower than a certain threshold of the overall average density, then delete this cluster and reduce the value of K; if there are relatively scattered data points, add new clustering centers and increase the value of K.

[0018] 1.7 Among the clustering results, select several clusters that contain the most data points, and the characters corresponding to the cluster centers are the selected common characters.

[0019] Further, in step (2), when embedding the watermark, according to the user identity information, the font sizes of different common characters are adjusted respectively to form the watermark information, so as to realize watermark embedding.

[0020] The present invention also proposes a text watermarking system based on character font size in the financial field, and the system includes:

[0021] (1) A common character determination module, which determines the range of common characters based on character density and distance;

[0022] (2) A watermark embedding module, which completes watermark embedding according to the above range of common characters;

[0023] (3) A watermark extraction module, which completes watermark extraction.

[0024] Further, in the common character determination module, an adaptive K-means algorithm based on density and distance is used to determine the range of common characters, and the specific process is as follows:

[0025] 1.1 Collect Chinese texts in the financial field to form a data set;

[0026] 1.2 Calculate the weight TF-IDF value of each data point in the data set; denote the weight of the i-th data point as t i .

[0027] 1.3 For each data point i, calculate the density around it where d ij is the distance between point i and point j, and d ij =|t i -t j |, σ is the width parameter of the Gaussian kernel, Neighbors(i) represents the neighbor set of point i, and all data points j with d ij <T are neighbors of point i, T is the distance threshold, α is the parameter for adjusting the influence of distance; β is the parameter for adjusting the attenuation speed.

[0028] 1.4 Select the top K data points with the highest density as the initial cluster centers, and K is a natural number.

[0029] 1.5 Calculate the weighted distance

[0030] 1.6 During the iteration process, if the density of a certain cluster is lower than a certain threshold of the overall average density, then delete the cluster and reduce the value of K; if there are relatively scattered data points, add new cluster centers and increase the value of K.

[0031] 1.7 In the clustering results, select several clusters containing the most data points. The characters corresponding to these cluster centers are the selected common characters.

[0032] Furthermore, in the watermark embedding module, when embedding the watermark, the font sizes of different commonly used characters are adjusted according to the user identity information to form the watermark information, thereby realizing watermark embedding.

[0033] The present invention also provides a device, which includes: a data acquisition device, a processor and a memory; the data acquisition device is used to collect data; the memory is used to store one or more program instructions; the processor is used to execute one or more program instructions to execute any of the above methods.

[0034] The present invention further provides a computer-readable storage medium, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used to execute any of the above methods.

[0035] The present invention uses a commonly used Chinese character determination algorithm based on K-means clustering. The algorithm regards Chinese characters as data points. Its main features are: (1) Introducing density: In addition to considering the distance between data points, the density around the data points is also considered, so as to avoid merging small clusters in high-density areas with large clusters in low-density areas; (2) Adaptive K value: Traditional K-means requires pre-setting of the K value, while the improved algorithm will adaptively adjust the K value according to the distribution of the data. The present invention does not need to modify the system font library, but only needs to regenerate a text based on the user's identity information. For commonly used characters in work, the text will be modified in font size, and the font size modification rule is the embedded watermark information. The method is simple and efficient, and is suitable for printing, scanning, taking pictures, screenshots and other scenarios. It does not need to add hidden watermark information to the text, but only modifies the font size of commonly used characters, avoiding the impact of the font library replacement method on the stability of the operating system. DETAILED DESCRIPTION

[0036] Depend on Figure 1 It can be seen that the present invention mainly includes two parts: watermark embedding and watermark extraction. Before watermark embedding and watermark extraction, the range of commonly used characters must be determined first. The present invention designs an algorithm for determining commonly used Chinese characters based on K-means clustering, which can more accurately reflect the internal structure of the data and achieve better results in selecting commonly used characters. The specific process of the algorithm is as follows:

[0037] (1) Collect Chinese texts in the financial field to form a data set, such as contract texts, financial reports, risk assessment reports, investment research reports, policy and regulatory documents, news and announcements, etc.

[0038] (2) Calculate the weights of each data point in the dataset, i.e., the TF-IDF value of each Chinese character in the dataset; denote the weight of the i-th data point as t i 。

[0039] (3) Calculate the density: For each data point i, calculate its surrounding density ρ i 。The improved Gaussian kernel function can be used to estimate the local density, and the density formula is:

[0040]

[0041] where d ij is the distance between point i and point j, and d ij =|t i -t j |, σ is the width parameter of the Gaussian kernel, Neighbors(i) represents the set of neighbors of point i, and it is stipulated that all data points j with d ij <T are neighbors of point i, where T is the distance threshold. α is a parameter to adjust the influence of distance. By changing the value of α, the influence degree of distance on density can be controlled. A larger α value will reduce the sensitivity of density to distance, while a smaller α value will increase the sensitivity of density to distance. β is a parameter to adjust the attenuation rate. By changing the value of β, the attenuation rate of density with the increase of distance can be controlled. A larger β value will cause the density to decay faster, while a smaller β value will slow down the attenuation rate of density.

[0042] (4) Initial center selection: Select the top K data points with the highest density as the initial clustering centers, where K is a natural number.

[0043] (5) K-means clustering: Use the traditional K-means algorithm for clustering, but when calculating the distance between point i and point j, combine the density information for weighting, and the weighted distance is denoted as D ij ,and its calculation formula is:

[0044]

[0045] (6) Adaptive adjustment of K value: During the iteration process, if the density of a certain cluster is lower than a certain threshold of the overall average density, then delete this cluster and reduce the value of K; conversely, if there are relatively scattered data points, new clustering centers can be added and the value of K can be increased.

[0046] (7) Select common characters: In the clustering results, according to the number of common characters that are expected to be selected, select several clusters that contain the most data points, and the characters corresponding to these clustering centers are the selected common characters. Denote the number of common characters as N.

[0047] After selecting the commonly used characters, the watermark embedding and watermark extraction stages begin.

[0048] 1. Watermark embedding:

[0049] According to the user's identity information, the font size of commonly used words is adjusted. As shown in the figure, for commonly used words, the font size changes by ±0.5 or ±1 relative to the standard font size (e.g. Figure 2 As shown), it does not affect the reading of the content, but the slight change in font size can embed a watermark in the text content based on the user's personal information to ensure the security of the text during transmission.

[0050] According to the user's identity information, the font sizes of N commonly used characters are adjusted differently to form watermark information, thereby realizing watermark embedding.

[0051] 2. Watermark extraction:

[0052] Watermark extraction is to extract the watermark logo from the above text containing watermark. This process usually includes preprocessing, feature extraction and matching steps in order to accurately find and extract the watermark information.

[0053] (1) Pretreatment

[0054] Scan the printed manuscript into a digital image and convert the image into grayscale to reduce the computational complexity.

[0055] (2) Feature extraction

[0056] The text region is located using edge detection methods and the text is segmented by vertical and horizontal projection methods. For each segmented character, its bounding box is calculated and its width and height are used to estimate the size of the character.

[0057] (3) Matching

[0058] Create a reference dataset containing character images of commonly used characters of known sizes and their corresponding size measurements. For each character in the processed print, compare its size measurement with the value in the reference dataset and find the closest match. The matching size is the estimated font size.

[0059] Each character of the uncommon characters in the printed manuscript is traversed, and if there is a significant difference between the estimated font sizes of the uncommon characters and the common characters, the adjustment margin of the uncommon characters is calculated. Finally, the characters whose font sizes have been adjusted and their adjustment margins relative to the adjacent characters are output.

[0060] According to the adjustment range of the commonly used font sizes, a complete watermark sequence is obtained to complete the extraction of watermark information.

[0061] More specific example:

[0062] Suppose there are 10 Chinese characters a, b, c, d, e, f, g, h, i, j, and the corresponding weight values ​​are 0.01, 0.05, 0.5, 0.03, 0.12, 0.26, 0.08, 0.38, 0.52, and 0.56 respectively. The distance is calculated by the absolute value of the difference between the values, and the density value of each point can be calculated based on this, where the density is the local density estimated by the Gaussian kernel function.

[0063] The density calculation results of each point are as follows:

[0064] The density value of point a is: 9.5182

[0065] The density value of point b is: 9.5985

[0066] The density value of point c is: 9.4944

[0067] The density value of point d is: 9.5601

[0068] The density value of point e is: 9.7049

[0069] The density value of point f is: 9.7827

[0070] The density value of point g is: 9.6495

[0071] The density value of point h is: 9.704

[0072] The density value of point i is: 9.4472

[0073] The density value of point j is: 9.3429

[0074] After K-means clustering, the above 10 clusters are divided into 2 clusters, and the results are as follows:

[0075] Cluster 1: point a, point b, point d, point i

[0076] Cluster 2: point c, point e, point g, point j, point f, point h

[0077] Because cluster 2 has more points, the Chinese characters represented by the 6 points in cluster 2 are finally selected as commonly used characters.

[0078] Based on these six common characters, watermark embedding and extraction can be performed.

[0079] When embedding the watermark, the font size of the six commonly used characters is adjusted according to the user's identity information, and the magnitude of the font size adjustment is used as the watermark information. After the adjustment, the font size of the six commonly used characters in the generated document changes by ±0.5 or ±1, thereby realizing the embedding of the watermark.

[0080] In the watermark extraction process, the watermark logo is extracted from the above text containing the watermark. This process usually includes steps such as preprocessing, feature extraction and matching, calculating the adjustment range of common characters, and obtaining a complete watermark sequence based on the adjustment range of the common character size, thus completing the extraction of watermark information.

[0081] The present invention also provides a device, which includes: a data acquisition device, a processor and a memory; the data acquisition device is used to collect data; the memory is used to store one or more program instructions; the processor is used to execute one or more program instructions to execute any of the above methods.

[0082] The present invention further provides a computer-readable storage medium, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used to execute any of the above methods.

[0083] The units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this application, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0084] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0085] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0086] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0087] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0088] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A text watermarking method based on character font size in the financial field, characterized in that the specific steps are as follows: (1) Determine the range of common characters based on character density and distance; (2) Watermark embedding; (3) Watermark extraction; In step (1), an adaptive K-means algorithm based on density and distance is used to determine the range of common characters. The specific process is as follows: 1.1 Collect Chinese texts in the financial field to form a dataset; 1.2 Calculate the weight TF-IDF value of each data point in the dataset. Denote the weight of the i-th data point as t i ; 1.3 For each data point i, calculate the density around it where d ij is the distance between point i and point j, and d ij =|t i -t j |, σ is the width parameter of the Gaussian kernel, Neighbors(i) represents the set of neighbors of point i, and all data points j with d ij <T are neighbors of point i. T is the distance threshold, α is the parameter for adjusting the influence of distance; β is the parameter for adjusting the attenuation speed; 1.4 Select the top K data points with the highest density as the initial clustering centers, where K is a natural number; 1.5 Calculate the weighted distance 1.6 During the iteration process, if the density of a cluster is lower than a certain threshold of the overall average density, the cluster is deleted and the K value is reduced; if there are relatively scattered data points, a new cluster center is added and the K value is increased; 1.7 In the clustering results, select several clusters containing the most data points. The characters corresponding to these cluster centers are the selected common characters.

2. A text watermarking method based on character size in the financial field as claimed in claim 1, characterized in that: In step (2), when embedding the watermark, the font sizes of different commonly used characters are adjusted according to the user identity information to form watermark information, thereby achieving watermark embedding.

3. A text watermark system based on character size in the financial field, characterized by: The system includes: (1) a commonly used character determination module, which determines the range of commonly used characters based on character density and distance; (2) a watermark embedding module, which completes watermark embedding according to the above-mentioned common character range; (3) Watermark extraction module, which completes watermark extraction; In the common word determination module, an adaptive K-means algorithm based on density and distance is used to determine the common word range. The specific process is as follows: 1.1 Collect Chinese text data sets in the financial field; 1.2 Calculate the weighted TF-IDF value of each data point in the data set, and let the weight of the i-th data point be t i ; 1.3 For each data point i, calculate the density around it where d ij is the distance between point i and point j, and d ij = |t i - t j |, σ is the width parameter of the Gaussian kernel, Neighbors(i) represents the set of neighbors of point i, and all data points j with d ij < T are neighbors of point i, T is the distance threshold, α is the parameter for adjusting the influence of distance; β is the parameter for adjusting the attenuation rate; 1.4 Select the first K data points with the highest density as the initial cluster centers, where K is a natural number; 1.5 Calculate the weighted distance 1.6 During the iteration process, if the density of a cluster is lower than a certain threshold of the overall average density, the cluster is deleted and the K value is reduced; if there are relatively scattered data points, a new cluster center is added and the K value is increased; 1.7 In the clustering results, select several clusters containing the most data points. The characters corresponding to these cluster centers are the selected common characters.

4. A text watermark system based on character size in the financial field as claimed in claim 3, characterized in that: In the watermark embedding module, when embedding the watermark, the font sizes of different commonly used characters are adjusted according to the user identity information to form the watermark information and realize the watermark embedding.

5. A text watermark device based on character size in the financial field, the device comprising: Data acquisition device, processor and memory; The data acquisition device is used to collect data; The memory is used to store one or more program instructions; The processor is used to execute one or more program instructions to perform any method of claims 1-2 above.

6. A computer-readable storage medium for text watermarking based on character size in the financial field, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used to execute any one of the methods of claims 1-2 above.

Citation Information

Patent Citations

  • Method and device for embedding and detecting watermark in document by using computer system

    CN101957810A

  • Digital watermark processing method and device

    CN112150340A

  • Method for watermarking the text portion of a document

    US20160035060A1