Electronic bill encryption method, device, equipment, storage medium and program product
By filling different digital watermark images in key areas of electronic bills, the problem of electronic bills being easily tampered with is solved, achieving higher security.
Patent Information
- Application Number
- CN202210640112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-06-08
AI Technical Summary
In the prior art, the digital watermark of electronic bills is easily cracked, resulting in the risk of electronic bills being tampered with.
The key areas are determined in the image of the target electronic bill, and each key area is filled with a different digital watermark image, and the encrypted target electronic bill is generated through feature extraction and fusion processing.
It improves the difficulty of cracking digital watermark images and reduces the risk of electronic receipts being tampered with.
Smart Images

Figure CN114913052B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to an electronic bill encryption method, apparatus, device, storage medium and program product. Background Art
[0002] With the development and progress of the Internet, the transmission of digital information is becoming more and more abundant. In the fields of banking, finance, e-government, etc., the transmission of electronic bills is a basic demand.
[0003] Typically, during the transmission of electronic bills, in order to prevent the electronic bills from being tampered with, an anti-tampering digital watermark is embedded in the image of the electronic bill. Digital watermark is a special information hiding technology that can achieve the purpose of protecting electronic bills.
[0004] However, the conventional method of embedding a digital watermark into an image of an electronic bill is easily cracked, resulting in the risk of the electronic bill being tampered with. Summary of the Invention
[0005] Based on this, it is necessary to provide an electronic bill encryption method, device, equipment, storage medium and program product to address the above technical problems, which can reduce the risk of electronic bills being tampered with.
[0006] In a first aspect, the present application provides an electronic bill encryption method, the method comprising:
[0007] determining at least one key area in the image of the target electronic bill based on key content in the target electronic bill;
[0008] Determine the digital watermark image of each key area; each key area corresponds to a different digital watermark image;
[0009] Each digital watermark image is filled into the corresponding key area in the image of the target electronic bill to obtain the encrypted target electronic bill.
[0010] In one embodiment, filling each digital watermark image into a corresponding key area of an image of a target electronic receipt to obtain an encrypted target electronic receipt includes:
[0011] Fill each digital watermark image into the corresponding key area to obtain the watermarked key area of each key area;
[0012] Based on the watermarked key areas of each key area, an encrypted target electronic receipt is generated.
[0013] In one embodiment, each digital watermark image is filled into each corresponding key area to obtain a watermarked key area of each key area, including:
[0014] Extract features from each key area to obtain feature information of each key area;
[0015] Perform feature extraction on each digital watermark image to obtain feature information of each digital watermark image;
[0016] The characteristic information of each key area and the characteristic information of the corresponding digital watermark image are fused to generate the watermarked key area of each key area.
[0017] In one embodiment, feature extraction is performed on each key area to obtain feature information of each key area, including:
[0018] Perform grayscale conversion on each key area to obtain a grayscale image of each key area;
[0019] Decompose the grayscale image of each key area to obtain the feature information of each key area.
[0020] In one embodiment, a decomposition operation is performed on the grayscale image of each key area to obtain feature information of each key area, including:
[0021] Perform multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area;
[0022] Perform singular value decomposition on each wavelet coefficient to obtain the characteristic information of each key area.
[0023] In one embodiment, feature extraction is performed on each digital watermark image to obtain feature information of each digital watermark image, including:
[0024] Performing encryption operation on each digital watermark image to obtain an encrypted digital watermark image of each digital watermark image;
[0025] Performing multi-layer wavelet decomposition on the encrypted digital watermark image of each digital watermark image to obtain the wavelet coefficients of each digital watermark image;
[0026] The singular value decomposition is performed on the wavelet coefficients of each digital watermark image to obtain the characteristic information of each digital watermark image.
[0027] In one embodiment, the feature information includes feature values and feature vectors;
[0028] The characteristic information of each key area and the characteristic information of the corresponding digital watermark image are fused to generate the watermarked key area of each key area, including:
[0029] Determine the watermarked feature value of each key area according to the feature value of each key area and the feature value of the corresponding digital watermark image;
[0030] According to the watermarked eigenvalues and eigenvectors of each key area, the watermarked wavelet coefficients of each key area are obtained;
[0031] Perform multi-layer wavelet reconstruction on the watermarked wavelet coefficients of each key area to obtain the watermarked grayscale image of each key area;
[0032] Image processing is performed on each watermarked grayscale image to obtain a color image of each watermarked grayscale image, and the color image of each watermarked grayscale image is determined as a watermarked key area of each key area.
[0033] In one embodiment, determining the digital watermark image of each key area includes:
[0034] Obtain identification information for each key area;
[0035] According to the identification information of each key area, the digital watermark image corresponding to each key area is obtained from the database; the database stores identification information of multiple key areas and the corresponding digital watermark images.
[0036] In one embodiment, determining at least one key area in an image of a target electronic bill based on key content in the target electronic bill includes:
[0037] The target electronic receipt is input into a text detection model to obtain at least one key area.
[0038] In one embodiment, the process of building a text detection model includes:
[0039] Acquire a plurality of sample electronic receipts, each sample electronic receipt including at least one marked key area;
[0040] Each sample electronic receipt is input into the initial text detection model, and the initial text detection model is trained until the test key area output by the initial text detection model meets the preset convergence condition, thereby obtaining a text detection model.
[0041] In one embodiment, the method further comprises:
[0042] Inputting the encrypted target electronic bill into a text detection model to obtain at least one key area containing a watermark;
[0043] Decryption processing is performed on each key area containing watermarks to obtain digital watermark images of each key area containing watermarks.
[0044] In one embodiment, decrypting each key area containing a watermark to obtain a digital watermark image of each key area containing a watermark includes:
[0045] Extract features from each key area to obtain feature information of each key area;
[0046] Extract features of each key area containing watermarks to obtain feature information of each key area containing watermarks;
[0047] According to the characteristic information of each key area, the characteristic information of the key area containing watermark corresponding to each key area is restored to generate the digital watermark image of each key area containing watermark.
[0048] In one embodiment, feature extraction is performed on each key area to obtain feature information of each key area, including:
[0049] Perform grayscale conversion on each key area to obtain a grayscale image of each key area;
[0050] Perform multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area;
[0051] Perform singular value decomposition on each wavelet coefficient to obtain the characteristic information of each key area.
[0052] In one embodiment, feature extraction is performed on each key area containing a watermark to obtain feature information of each key area containing a watermark, including:
[0053] Performing grayscale conversion on each key area containing watermarks to obtain grayscale images of each key area containing watermarks;
[0054] Perform multi-layer wavelet decomposition on the grayscale image of each key area containing watermarks to obtain the wavelet coefficients of the grayscale image of each key area containing watermarks;
[0055] The feature extraction is performed on each wavelet coefficient to obtain the feature information of each key area containing watermark.
[0056] In one embodiment, the characteristic information includes characteristic values and characteristic vectors; based on the characteristic information of each key area, the characteristic information of the watermarked key area corresponding to each key area is restored to generate a digital watermark image of each watermarked key area, including:
[0057] Determine the watermark feature value of each key area containing watermark according to the feature value of each key area and the feature value of the corresponding key area containing watermark;
[0058] Determine the watermark wavelet coefficients of each key watermark region according to the eigenvectors of each key watermark region and the corresponding watermark eigenvalues;
[0059] Perform multi-layer wavelet reconstruction on the watermark wavelet coefficients of each key watermark area to obtain the encrypted digital watermark image of each key watermark area;
[0060] Decrypt each encrypted digital watermark image to obtain each digital watermark image containing the watermark key area.
[0061] In a second aspect, the present application further provides an electronic bill encryption device, the device comprising:
[0062] A first determining module is configured to determine at least one key area in the image of the target electronic bill according to key content in the target electronic bill;
[0063] The second determining module is used to determine the digital watermark image of each key area; the digital watermark image corresponding to each key area is different;
[0064] The filling module is used to fill each digital watermark image into the corresponding key area in the image of the target electronic bill to obtain the encrypted target electronic bill.
[0065] In a third aspect, an embodiment of the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods provided in the embodiment of the first aspect are implemented.
[0066] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods provided in the embodiment of the first aspect above.
[0067] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the methods provided in the embodiments of the first aspect above.
[0068] The embodiments of the present application provide an electronic invoice encryption method, apparatus, device, storage medium, and program product. Based on key content in a target electronic invoice, at least one key area is determined in the image of the target electronic invoice, a digital watermark image for each key area is determined, and each digital watermark image is filled into the corresponding key area in the image of the target electronic invoice to obtain an encrypted target electronic invoice. In this method, at least one key area in the image of the target electronic invoice is first obtained, and then different digital watermark images are filled into each key area to obtain the encrypted target electronic invoice. Digital watermark images are added to the key areas of the target electronic invoice, and each key area corresponds to a different digital watermark image. Because different methods of obtaining the key areas in the target electronic invoice result in different sizes of the obtained key areas, and each key area corresponds to a different digital watermark image, this method increases the difficulty of cracking the digital watermark image, reduces the risk of the digital watermark image being cracked, and thus reduces the risk of the target electronic invoice being tampered with. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A diagram illustrating an application environment of an electronic bill encryption method in one embodiment;
[0070] Figure 2 1. A schematic flow chart of an electronic bill encryption method according to an embodiment;
[0071] Figure 3 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0072] Figure 4 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0073] Figure 5 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0074] Figure 6 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0075] Figure 7 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0076] Figure 8 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0077] Figure 9 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0078] Figure 10 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0079] Figure 11 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0080] Figure 12 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0081] Figure 13 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0082] Figure 14 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0083] Figure 15 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0084] Figure 16 A schematic flow chart of an electronic bill encryption method according to another embodiment;
[0085] Figure 17 A structural block diagram of an electronic bill encryption device in one embodiment;
[0086] Figure 18 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0088] The electronic bill encryption method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed on a cloud or other network server. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, etc. Server 104 can be implemented as a standalone server or a server cluster consisting of multiple servers.
[0089] The embodiments of the present application provide an electronic bill encryption method, apparatus, device, storage medium, and program product, which can reduce the risk of electronic bills being tampered with.
[0090] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The technical solutions 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 part of the embodiments of the present application, not all of the embodiments.
[0091] In one embodiment, an electronic bill encryption method is provided for use in Figure 1 Taking the application environment in the example, this embodiment involves determining at least one key area in the image of the target electronic bill according to the key content in the target electronic bill, and then filling the digital watermark image corresponding to each key area into the corresponding key area in the image of the target electronic bill to obtain the specific process of the encrypted target electronic bill, as shown in FIG. Figure 2 As shown, this embodiment includes the following steps:
[0092] S201 : determining at least one key area in an image of a target electronic bill according to key content in the target electronic bill.
[0093] An electronic bill, created by the drawee in the form of a data message, mandates the payee to unconditionally pay a fixed amount to the payee or holder on a specified date. It is an important new financing tool. Its primary function is to provide services related to electronic bill payment and fund settlement, as well as comprehensive services such as paper commercial bill registration, inquiry, and public quotation services for commercial bills (including paper and electronic commercial bills). The transmission of electronic bills is a fundamental requirement in applications such as checks, bills of exchange, promissory notes, invoices, and contracts. Electronic bills are commonly used in banking, finance, e-government, and other fields, making their security particularly important. Therefore, they must be protected.
[0094] When protecting electronic bills, you can directly protect key areas of the electronic bill, such as the amount, date, issuer, and issuing bank in the electronic bill.
[0095] The target electronic bill is an electronic bill that needs to be protected. When protecting the target electronic bill, it is first necessary to obtain the key area in the target electronic bill image. The target electronic bill image includes at least one key area.
[0096] Therefore, when determining at least one key area in the image of the target electronic bill, it can be determined based on the key content in the target electronic bill.
[0097] Electronic bills may include financial documents, commercial documents, shipping documents, insurance documents and other documents. Financial documents include bills of exchange, promissory notes and checks; commercial documents include commercial invoices and customs invoices; shipping documents include ocean bills of lading, charter party bills of lading, multimodal transport documents, air waybills, etc. Other documents include commodity inspection documents, certificates of origin, and other documents (proof of mailing, proof of sample mailing, shipping notice, proof of vessel age, etc.).
[0098] The image of the target electronic bill includes at least one key area. For example, if the electronic bill is of the "ocean bill of lading" type, the key areas of the electronic bill may include "bill of lading number", "shipping company name", "carrier", "loading port", "unloading port", "departure date", "product name", etc.
[0099] S202, determining the digital watermark image of each key area; each key area corresponds to a different digital watermark image.
[0100] Digital watermarking is a special information hiding technology that can embed specific digital signals into digital products to protect the copyright, integrity, anti-copying or whereabouts tracking of digital products.
[0101] Digital watermarks can be divided into robust watermarks, fragile watermarks and annotated watermarks according to their application areas; among them, robust watermarks are usually used for copyright protection of digital images, videos, audio or electronic documents. Specific information representing the identity of the copyright owner, such as a piece of text, logo, serial number, etc., is embedded in the digital product in some way. When a copyright dispute occurs, the digital watermark is extracted through the corresponding algorithm to verify the ownership of the copyright, ensure the legitimate interests of the copyright owner, and avoid the threat of illegal piracy; fragile watermarks, also known as fragile watermarks, are usually used for data integrity protection. When the data content changes, the fragile watermark will change accordingly, thereby identifying whether the data is complete; annotated watermarks are usually used to indicate data content.
[0102] Therefore, tamper-proof digital watermark information can be embedded in the image of the electronic bill to achieve the purpose of protecting the electronic bill. Specifically, the digital watermark image can be embedded in each key area of the image in the target electronic bill to achieve the purpose of protecting the target electronic bill.
[0103] The main characteristics of digital watermarks are transparency, robustness, security and identification; among them, transparency means that the watermark is closely integrated with the original data and hidden in it, and the existence of the watermark cannot destroy the appreciation value and use value of the original data; robustness means that the watermark can still be detected after conventional processing operations such as lossy compression, recording, printing, scanning, rotation, and translation; security refers to the ability to resist attacks such as unauthorized deletion, embedding and detection by attackers, and is mainly used for information integrity authentication; identification means that the watermark should carry an identification to mark the current copy of the digital work, in order to identify the purchaser, authorized party, etc. of the work.
[0104] According to the carrier on which it is loaded, digital watermarks can be divided into multiple types of watermarks. Among them, the watermark that embeds the digital watermark into the electronic bill can be called an image watermark.
[0105] Before embedding watermark images into each key area of the target electronic bill, it is necessary to obtain the digital watermark images corresponding to each key area, and the digital watermark images corresponding to each key area are different.
[0106] The digital watermark image corresponding to each key area may be determined by first generating a plurality of digital watermark images corresponding to the plurality of key areas, and then randomly assigning the plurality of digital watermark images to each key area.
[0107] Optionally, the digital watermark image can be a binary image that can reflect the overall and local features of the digital watermark image. Image binarization is the process of setting the grayscale value of the pixel points on the image to 0 or 255, that is, making the entire image appear in obvious black and white. It can reduce the amount of data in the image, thereby highlighting the outline of the target.
[0108] S203, filling each digital watermark image into the corresponding key area in the image of the target electronic bill to obtain an encrypted target electronic bill.
[0109] The digital watermark images corresponding to the key areas obtained above are filled into their corresponding key areas respectively. Since each key area has been filled with the digital watermark image, the encrypted target electronic bill is obtained, that is, the key areas in the image of the target electronic bill have been filled with different digital watermark images.
[0110] From the implementation level, digital watermarking technology can be divided into spatial domain-based implementation and variable domain-based implementation. From the perspective of watermark embedding area, it can also be divided into global watermark and local watermark. From the perspective of the number of watermark embeddings, it can be divided into single-value watermark and multiple watermark.
[0111] Optionally, the method of filling each digital watermark image into the corresponding key area in the image of the target electronic invoice may be to directly load each digital watermark image onto the corresponding key area in the target electronic invoice; the method of filling each digital watermark image into the corresponding key area in the image of the target electronic invoice may be to load each digital watermark image onto data in a transform domain such as a Fourier transform domain, a wavelet transform domain, etc. of the corresponding key area in the image of the target electronic invoice.
[0112] The above-mentioned electronic receipt encryption method determines at least one key area in the image of the target electronic receipt based on the key content in the target electronic receipt, determines a digital watermark image for each key area, and then fills each digital watermark image into the corresponding key area in the image of the target electronic receipt to obtain the encrypted target electronic receipt. In this method, at least one key area in the image of the target electronic receipt is first obtained, and then different digital watermark images are filled into each key area to obtain the encrypted target electronic receipt. The digital watermark image is added to the key area of the target electronic receipt, and the digital watermark image corresponding to each key area is different. Due to different methods of obtaining the key areas in the target electronic receipt, the size of the obtained key areas may vary, and the digital watermark images corresponding to each key area are different. This method increases the difficulty of deciphering the digital watermark image, reduces the risk of the digital watermark image being deciphered, and thus reduces the risk of the target electronic receipt being tampered with.
[0113] In one embodiment, Figure 3 As shown, filling each digital watermark image into the corresponding key area in the image of the target electronic bill to obtain the encrypted target electronic bill includes the following steps:
[0114] S301, filling each digital watermark image into the corresponding key area to obtain a watermarked key area in each key area.
[0115] Each digital watermark image is filled into the corresponding key area, and then each key area is embedded with the digital watermark image, that is, the watermarked key area corresponding to each key area can be obtained.
[0116] The method for obtaining the watermarked area of each key area can be to use the grayscale strength of each key area as the frequency domain of each key area, transform each key area into the frequency domain through Fourier transform, discrete cosine transform or wavelet transform, add a corresponding digital watermark image to each key area in the frequency domain, and then convert each key area into the spatial domain through inverse transform; thereby obtaining the watermarked key area corresponding to each key area.
[0117] S302: Generate an encrypted target electronic receipt based on the watermarked key area of each key area.
[0118] Based on the watermarked key areas of each key area obtained above and combined with the background area of the target electronic bill, an encrypted target electronic bill is obtained, where the background area of the target electronic bill is a non-key area in the target electronic bill.
[0119] The above-mentioned electronic receipt encryption method fills each digital watermark image into the corresponding key region to obtain a watermarked key region for each key region. Based on the watermarked key region for each key region, an encrypted target electronic receipt is generated. In this method, each key region in the target electronic receipt is filled with a different digital watermark image to obtain the encrypted target electronic receipt. This increases the difficulty of decrypting the digital watermark image in the encrypted target electronic receipt and reduces the risk of tampering with the target electronic receipt.
[0120] Based on the above, each digital watermark image is filled into each corresponding key area to obtain the watermarked key area of each key area. The method of obtaining the watermarked key area is described in detail below. In one embodiment, Figure 4 As shown, filling each digital watermark image into the corresponding key area to obtain the watermarked key area of each key area includes the following steps:
[0121] S401: Extract features from each key area to obtain feature information of each key area.
[0122] Feature extraction involves using computers to extract image information and determine whether each image point belongs to an image feature. The result of feature extraction is to classify the points in the image into different subsets. These subsets often belong to isolated points, continuous curves, or continuous regions. Common image features include color, texture, shape, and spatial relationship features.
[0123] Among them, color feature is a global feature that describes the surface properties of the scene corresponding to the image or image area. The color feature is based on the characteristics of the pixel points. When color features are used to extract each key area, the feature information of each key area can be a color histogram, color set, color torch, color aggregation vector, and color correlation graph.
[0124] Texture features are also global features that describe the surface properties of the scene corresponding to an image or image region. However, texture features are not pixel-based; they require statistical calculations within a region containing multiple pixels. Texture feature extraction for each key region can be performed using texture feature analysis using a gray-level co-occurrence matrix. The resulting feature information for each key region can include energy, inertia, entropy, and correlation.
[0125] Shape features include contour features and area features. The contour features of an image are mainly aimed at the outer boundaries of the object, while the area features of an image are aimed at the entire shape area. When extracting shape features from each key area, the Fourier shape descriptor method can be used to extract features from each key area. It mainly uses the Fourier transform of the object boundary as the shape description, and uses the closedness and periodicity of the area boundary to transform the two-dimensional problem into a one-dimensional problem.
[0126] Spatial relationship features refer to the mutual spatial position or relative direction relationship between multiple targets segmented from an image. These relationships can also be divided into connection / adjacency relationships, overlap / overlapping relationships, and inclusion / inclusion relationships. The use of spatial relationship features can enhance the ability to describe and distinguish image content. There are two ways to extract spatial relationship features from each key area. One way is to first automatically segment each key area, divide the objects or color areas contained in each key area, and then extract the features of each key area based on these areas and establish an index. The other way is to evenly divide each key area into several regular sub-blocks, and then extract features from each sub-block and establish an index.
[0127] The main purpose of feature extraction is dimensionality reduction. The main idea of feature extraction is to project the original sample into a low-dimensional feature space to obtain low-dimensional sample features that can best reflect the essence of the sample or distinguish the samples.
[0128] Image features can also be divided into four categories: intuitive features, grayscale statistical features, transformation coefficient features and algebraic features.
[0129] The transformation coefficient feature refers to the coefficients obtained by performing Fourier transform or wavelet transform on the image, which are then used as features for identification. Therefore, when extracting the transformation coefficient features of each key area, the Fourier transform or wavelet coefficient transform can be used to extract the coefficients of each key area, and the obtained coefficients of each key area can be used as the feature information of each key area.
[0130] It is understandable that the method of extracting features from each key area may be different or the same, and this application does not limit this.
[0131] S402: Extract features of each digital watermark image to obtain feature information of each digital watermark image.
[0132] The method of extracting features from each digital watermark image may be the same as the method of extracting features from each key area, which will not be described in detail here.
[0133] S403: Fusing the feature information of each key region with the feature information of the corresponding digital watermark image to generate a watermarked key region of each key region.
[0134] Feature fusion is to put all features together and then use certain mathematical methods to transform them into a new feature expression. In feature fusion in image processing, for multi-scale fusion, the corresponding features in the two images can be directly added or spliced together.
[0135] Optionally, the feature information of each key area is added to the feature information of the corresponding digital watermark image to obtain new feature information, and the watermarked key area of each key area is obtained based on the new feature information; for example, the feature information of a key area is (a, b), and the feature information of the digital watermark image corresponding to the key area is (c, d), then the new feature information obtained is (a+b, c+d), and the inverse operation of feature extraction can be performed based on the new feature information to obtain the watermarked area of the key area, that is, the new feature information obtained is the feature information of the watermarked key area.
[0136] The electronic receipt encryption method described above performs feature extraction on each key region to obtain feature information for each key region, performs feature extraction on each digital watermark image to obtain feature information for each digital watermark image, and then fuses the feature information of each key region with the feature information of the corresponding digital watermark image to generate a watermarked key region for each key region. In this method, feature extraction is performed on each key region and the corresponding digital watermark image separately to map each key region and each digital watermark image from a high-dimensional feature space to a low-dimensional feature space. This ensures good separability between each key region and each digital watermark image, facilitating feature fusion and ensuring the quality of the watermarked key region.
[0137] Based on the above embodiment, the following describes in detail how to obtain the characteristic information of each key area through an embodiment. In one embodiment, Figure 5 As shown, feature extraction is performed on each key area to obtain feature information of each key area, including the following steps:
[0138] S501 , performing grayscale conversion on each key area to obtain a grayscale image of each key area.
[0139] When extracting features from each key area, each key area must first be converted into a grayscale image corresponding to the key area.
[0140] The key areas obtained from the image of the target electronic receipt are color images. The method of converting the color images of each key area into a grayscale image can be to convert the three channels corresponding to each pixel point of each key area into one channel, wherein each pixel point of the color image of each key area corresponds to three channels: R (red), G (green), and B (blue).
[0141] Therefore, each key region can be converted into a grayscale image by averaging the RGB values of the three channels at each pixel location corresponding to the color image of each key region. The resulting average value is used as the value of each pixel at the grayscale image of each key region, and the grayscale image of each key region is determined accordingly. Alternatively, the grayscale image of each key region can be determined by averaging the maximum and minimum luminance values of the RGB values at the same pixel location, or by taking a weighted average of the RGB channel values at the same pixel location.
[0142] In another embodiment, the grayscale image of each key area can also be determined by converting each key area from the RGB color space to the YCbCr color space, then performing three-color separation in the YCbCr color space, and outputting the Y component of the YCbCr color space. The resulting image is the grayscale image of each key area.
[0143] The RGB format of each key area is converted into the YCbCr format. The YCbCr format is represented by a triplet consisting of Y (Luminance), Cb (Chrominance-Blue), and Cr (Chrominance-Red). Y represents the brightness and concentration of the color, while Cb and Cr represent the blue concentration offset and red concentration offset of the color respectively. The relationship between the RGB value and the Y component, Cb component, and Cr component can be shown in formula (1).
[0144]
[0145] S502 , performing a decomposition operation on the grayscale image of each key area to obtain feature information of each key area.
[0146] Image decomposition is to decompose the original image into two parts: structure and texture. The structure represents the larger-scale objects in the image, and the texture represents the fine-scale details.
[0147] The grayscale image of each key area can be decomposed in an operator signal-based manner. First, the grayscale image is divided into blocks to convert the image block series into a one-dimensional signal. Combined with the characteristics of the texture image, the local total variation change rate is used as the basis for adaptive parameter selection to decompose the image blocks. Finally, the decomposition results of each image block are combined to obtain the decomposition result of the entire grayscale image, thereby obtaining the decomposition signal of the grayscale image of each key area, that is, the feature information of each key area.
[0148] Optionally, the grayscale image of each key area may be decomposed by Fourier transform to obtain high-frequency components and low-frequency components of each key area, that is, to obtain feature information of each key area.
[0149] The electronic receipt encryption method described above performs grayscale conversion on each key region to obtain a grayscale image of each key region, and then decomposes the grayscale image of each key region to obtain feature information for each key region. By decomposing the grayscale image of each key region to obtain feature information for each key region, this method ensures the quality of the watermarked key region obtained when the features of each key region are fused with those of each digital image.
[0150] In the above embodiment, the grayscale image of each key area is decomposed to obtain the characteristic information of each key area. The following is a specific implementation method of decomposing the grayscale image of each key area to obtain the characteristic information of each key area through an embodiment. In one embodiment, Figure 6 As shown, this embodiment includes the following steps:
[0151] S601 , performing multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area.
[0152] An image is a region connected by similar textures and grayscale levels. If the object is small or has low contrast, it is usually studied at a higher resolution. If the object is large or has high contrast, a rough observation is sufficient. If large and small objects exist at the same time, it is more advantageous to study them at different resolutions, which is called multi-resolution analysis.
[0153] Multi-resolution analysis is one of the important methods for correctly understanding objects and phenomena. Analyzing objects in different resolutions, from coarse to fine or from fine to coarse, is called multi-resolution analysis, sometimes also called multi-scale analysis. The idea of multi-scale analysis is introduced into wavelet analysis.
[0154] When performing wavelet decomposition on an image, high-frequency wavelet coefficients and low-frequency wavelet coefficients can be obtained. The high-frequency wavelet coefficients reflect the detailed changes of the image signal sequence, and the low-frequency wavelet coefficients reflect the overview and change trend of the image signal sequence; the high-frequency wavelet coefficients and the low-frequency wavelet coefficients are collectively referred to as wavelet coefficients.
[0155] In wavelet decomposition, high-frequency wavelet coefficients increase with the increase of decomposition layers, while there is only one low-frequency wavelet coefficient, and it becomes smoother and smoother with the increase of decomposition layers. Therefore, it is unreasonable to have too many or too few decomposition layers for the image, because too many decomposition layers will reduce the intrinsic change law and trend of the signal sequence, and too few decomposition layers cannot effectively separate the overview sequence and the detail sequence.
[0156] Therefore, in practical applications, the number of wavelet decomposition layers should be determined based on a comprehensive consideration of the actual change trend of the sequence signal and its theoretical change law.
[0157] Multi-layer wavelet decomposition is performed on the grayscale image of each key area to obtain the wavelet coefficients of each key area. It should be noted that when multi-layer wavelet decomposition is performed on the grayscale image of each key area, there is no limitation on the number of decomposition layers used. In actual situations, the number of wavelet decomposition layers should be determined according to the actual situation.
[0158] S602: Perform singular value decomposition on each wavelet coefficient to obtain feature information of each key area.
[0159] Singular Value Decomposition (SVD) can be used for eigendecomposition in dimensionality reduction algorithms.
[0160] First, if the matrix A is decomposed, the n eigenvalues corresponding to the matrix A can be solved λ1≤λ2≤…≤λ n The eigenvectors ω1, ω2, ..., ω corresponding to these n eigenvalues n , then the matrix A can be expressed by the characteristic decomposition of formula (1):
[0161] A=WΣW -1 (2)
[0162] Where W is the n×n dimensional matrix corresponding to the n eigenvectors, and Σ is an n×n dimensional matrix with n eigenvalues as the main diagonal. However, for this eigendecomposition method, the matrix A must be a square matrix.
[0163] For the wavelet coefficients corresponding to each key area, the obtained wavelet coefficients are not necessarily in the form of a square matrix. In this case, the SVD method can be used. The SVD does not require the matrix to be decomposed to be a square matrix. For example, if the matrix A is an m×n matrix, then the SVD of the matrix A is:
[0164] A=UΣV T (3)
[0165] Among them, U is an m×m matrix, Σ is an m×n matrix, all elements except the elements on the main diagonal are 0, and each element on the main diagonal is called a singular value, and V is an n×n matrix. When the singular value decomposition is performed on the wavelet coefficients of each key area, the characteristic information of each key area is obtained, namely, U, Σ and V T , that is, the elements on the main diagonal of Σ are eigenvalues, U and V T is the feature vector.
[0166] The electronic receipt encryption method described above performs multi-layer wavelet decomposition on the grayscale images of each key region to obtain wavelet coefficients for each key region. Singular value decomposition is then performed on each wavelet coefficient to obtain feature information for each key region. This method, by performing multi-layer wavelet decomposition on the grayscale images of each key region and then performing singular value decomposition on the wavelet coefficients obtained after the wavelet decomposition, can further improve the accuracy of the feature information obtained for each key region, thereby ensuring the quality of the encrypted target electronic receipt.
[0167] The above embodiment describes in detail the method of obtaining the characteristic information of each key area. The following embodiment describes in detail the method of obtaining the characteristic information of each digital watermark image. In one embodiment, Figure 7 As shown, feature extraction is performed on each digital watermark image to obtain feature information of each digital watermark image, including the following steps:
[0168] S701, performing an encryption operation on each digital watermark image to obtain an encrypted digital watermark image of each digital watermark image.
[0169] Before filling the digital watermark image into each key area, each digital watermark image can be encrypted, which increases the difficulty of cracking the digital watermark image.
[0170] Image encryption is to reconstruct image information that can be recognized by the naked eye into a noise-like image. The encrypted image does not contain any useful information of the original image. Therefore, all image encryption needs to do is to process the matrix to achieve the final encryption purpose.
[0171] Image encryption usually includes two operations: obfuscation and diffusion. Obfuscation means disrupting the original positions of pixel values in a two-dimensional matrix, while diffusion means that a small change in a pixel in the original image will lead to a huge change in the pixel value of the entire image.
[0172] Therefore, when performing encryption operation on each digital watermark image, the obfuscation method or the diffusion method can be used to encrypt each digital watermark image, and each encrypted digital watermark image is used as the encrypted digital watermark image of each digital watermark image.
[0173] Optionally, the obfuscation method includes sorting, circular shift, scrambling (Arnold) transformation and magic square transformation; the diffusion method includes XOR operation, that is, the image is converted into a one-dimensional array, and the pixel values in the array are XORed in sequence from left to right.
[0174] Furthermore, the embodiment of the present application does not limit the method for performing encryption operations on each digital watermark image, and the encryption methods used between the digital watermark images can be the same or different.
[0175] S702, performing multi-layer wavelet decomposition on the encrypted digital watermark image of each digital watermark image to obtain the wavelet coefficients of each digital watermark image.
[0176] S703, performing singular value decomposition on the wavelet coefficients of each digital watermark image to obtain feature information of each digital watermark image.
[0177] In this embodiment, multi-layer wavelet decomposition is performed on the encrypted digital watermark image of each digital watermark image to obtain the wavelet coefficients of each digital watermark image, and singular value decomposition is performed on the wavelet coefficients of each digital watermark image to obtain the characteristic information of each digital watermark image. The method can be the same as the method of performing multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area, and singular value decomposition is performed on each wavelet coefficient to obtain the characteristic information of each key area in the above embodiment, and the embodiment of this application will not be repeated here.
[0178] The electronic receipt encryption method described above performs an encryption operation on each digital watermark image to obtain an encrypted digital watermark image of each digital watermark image. It then performs multi-layer wavelet decomposition on the encrypted digital watermark image of each digital watermark image to obtain the wavelet coefficients of each digital watermark image. Singular value decomposition is then performed on the wavelet coefficients of each digital watermark image to obtain the characteristic information of each digital watermark image. In this method, each digital watermark image is first encrypted, increasing the difficulty of decrypting the digital watermark image. Furthermore, multi-layer wavelet decomposition and singular value decomposition are performed on the encrypted digital watermark image to further refine the characteristic information of each digital watermark image, thereby ensuring the quality of the encrypted target electronic receipt.
[0179] Based on the feature information of each key area and the feature information of each corresponding digital watermark image obtained in the above embodiment, the following provides a method for obtaining the watermarked key area of each key area through the feature information of each key area and the features of each digital watermark image. In one embodiment, Figure 8 As shown, the characteristic information includes characteristic values and characteristic vectors. The characteristic information of each key area and the characteristic information of the corresponding digital watermark image are fused to generate the watermarked key area of each key area, including the following steps:
[0180] S801, determining the watermarked feature value of each key area according to the feature value of each key area and the feature value of the corresponding digital watermark image.
[0181] Based on the above embodiment, the characteristic information of each key area is obtained by performing singular value decomposition on the wavelet coefficients of each key area, and the characteristic information includes eigenvalues and eigenvectors. As shown in formula (3), U and V can be regarded as eigenvectors, and the elements on the main diagonal of Σ can be regarded as eigenvalues.
[0182] Based on the characteristic values of each key area and the characteristic values of the corresponding digital watermark image, the method for determining the watermarked characteristic values of each key area can be to add the characteristic values of each key area and the characteristic values corresponding to the corresponding digital watermark image through the addition criterion of the watermark embedding algorithm to obtain the watermarked characteristic values of each key area, that is, the characteristic values of each key area after the watermark is embedded.
[0183] Optionally, an embedding factor can also be set, that is, the strength of embedding the eigenvalues of each digital watermark image into the eigenvalues of each key area. For example, if the eigenvalue of each key area is χ0(k), the eigenvalue of the digital watermark image corresponding to each key area is ω0(k), and the embedding factor is α, then the corresponding watermarked eigenvalue of each key area is χW=χ0(k)+αω(k).
[0184] S802: Obtain the watermarked wavelet coefficients of each key region according to the watermarked feature values and feature vectors of each key region.
[0185] Based on the watermarked eigenvalues and eigenvectors of each key area obtained above, the watermarked wavelet coefficients of each key area are obtained by using the inverse transformation of singular value decomposition, that is, the wavelet coefficients of each key area after embedding the watermark are obtained.
[0186] The singular value decomposition inverse transformation method is the inverse process of the method of performing singular value decomposition on the wavelet coefficients of each key area in the above embodiment. The singular value decomposition inverse transformation can restore the original signal and achieve the purpose of denoising.
[0187] S803, performing multi-layer wavelet reconstruction on the watermarked wavelet coefficients of each key area to obtain a watermarked grayscale image of each key area.
[0188] Wavelet reconstruction is to reconstruct a signal using the processed wavelet coefficients. That is, in this embodiment, the wavelet coefficients can be used to reconstruct an image.
[0189] The wavelet coefficients of each key area are obtained by performing multi-layer wavelet decomposition on the grayscale image of each key area. Therefore, the reconstructed image should also be a grayscale image, that is, multi-layer wavelet reconstruction is performed using the watermarked wavelet coefficients of each key area to obtain a watermarked grayscale image. Each watermarked grayscale image is represented as a grayscale image after the digital watermark image is embedded in each key area.
[0190] S804: Perform image processing on each watermarked grayscale image to obtain a color image of each watermarked grayscale image, and determine the color image of each watermarked grayscale image as a watermarked key area of each key area.
[0191] Based on the watermarked grayscale images of each key area obtained above, each watermarked grayscale image is subjected to image processing, that is, each watermarked grayscale image is subjected to color conversion to obtain a color image of each watermarked grayscale image, and the color image of each watermarked grayscale image is the watermarked key area of each key area, that is, the area after each key area is embedded in the corresponding digital watermark image.
[0192] The method for performing image processing on each watermarked grayscale image can be to convert from the YCbCr color space to the RGB color space, first using the Y component corresponding to the YCbCr format of each watermarked grayscale image, and the Cb component and Cr component corresponding to each key area to obtain the RGB value of the watermarked key area of each key area, thereby obtaining the watermarked key area of each key area.
[0193] The electronic receipt encryption method described above determines the watermarked eigenvalues of each key region based on the eigenvalues of the key region and the eigenvalues of the corresponding digital watermark image. Based on the watermarked eigenvalues and eigenvectors of each key region, the watermarked wavelet coefficients of each key region are obtained. Multi-layer wavelet reconstruction is performed on the watermarked wavelet coefficients of each key region to obtain a watermarked grayscale image of each key region. Image processing is then performed on each watermarked grayscale image to obtain a color image of each watermarked grayscale image. The color image of each watermarked grayscale image is then determined as the watermarked key region of each key region. In this method, by calculating the watermarked eigenvalues of each key region and then obtaining the watermarked key region of each key region, the risk of tampering with the target electronic receipt is reduced.
[0194] In one embodiment, Figure 9As shown, determining the digital watermark image of each key area includes the following steps:
[0195] S901: Obtain identification information of each key area.
[0196] The identification information of each key area may be a name that can identify the key area in the target electronic bill. For example, the identifier of the key area may be a name such as amount, date, or name.
[0197] S902, according to the identification information of each key area, obtaining the digital watermark image corresponding to each key area from the database; the database stores identification information of multiple key areas and the corresponding digital watermark images.
[0198] First, before protecting the target electronic bill, digital watermark images corresponding to multiple key areas are stored in the database, and the digital watermark images correspond to the identifiers of the key areas one by one.
[0199] For example, if the key area obtained from the target electronic receipt includes an identifier such as a name, the digital watermark image corresponding to the name is obtained from the database.
[0200] The electronic receipt encryption method described above obtains identification information for each key area and, based on the identification information, retrieves a corresponding digital watermark image for each key area from a database. The database stores identification information for multiple key areas and their corresponding digital watermark images. This method ensures that each key area corresponds to a different digital watermark image. This results in different digital watermark images corresponding to different key areas, making the digital watermark image more difficult to decipher, thereby reducing the risk of tampering with the target electronic receipt.
[0201] In one embodiment, determining at least one key area in an image of a target electronic bill according to key content in the target electronic bill includes: inputting the target electronic bill into a text detection model to obtain the at least one key area.
[0202] When protecting the target electronic bill, a digital watermark image is filled in each key area of the target electronic bill. Then, the key area can be obtained from the image of the target electronic bill by using a text detection model. Specifically, the image of the target electronic bill is directly input into the text detection model. After analysis by the text detection model, the key area of the target electronic bill is directly obtained, and the key area at least includes the key area.
[0203] The above embodiment is a method of obtaining the key area in the target electronic receipt image based on the text detection model. The following is an example of the construction process of the text detection model. In one embodiment, Figure 10As shown in Figure 2, the process of building a text detection model includes the following steps:
[0204] S1001: Acquire multiple sample electronic receipts, each sample electronic receipt including at least one marked key area.
[0205] Before building a text detection model, you need to first obtain multiple sample electronic invoices, namely the training set data. Each sample electronic invoice includes at least one marked key area. The at least one marked key area is used as a positive sample, and the background area without a marked key area is used as a negative sample. The key areas include the amount, date, issuer, and issuing bank.
[0206] S1002: Input each sample electronic receipt into an initial text detection model, train the initial text detection model until the test key area output by the initial text detection model meets a preset convergence condition, and obtain a text detection model.
[0207] The initial text detection model can be a TextBoxes model. The TextBoxes model is a 28-layer fully convolutional neural network. For the feature extraction layer, VGG16 is used as the backbone network, and 9 additional convolutional layers are added to form the entire model.
[0208] Based on the initial text detection model, the multiple sample electronic receipts obtained above are input into the initial text detection model, and the initial text detection model is trained until the test key area output by the initial text detection model meets the preset convergence condition, thereby obtaining a text detection model; wherein, the convergence condition may be that the accuracy of the output test key area is higher than a preset percentage; or, the initial text detection model may be trained until a preset number of iterations is reached, thereby obtaining a text detection model.
[0209] When the initial text detection model is trained, the size of each sample electronic receipt image can be adjusted by bilinear interpolation. For example, the image size of each sample electronic receipt is transformed to a height of H = 512 and a width of W = 400. In addition, the loss function in the text detection model is defined as:
[0210]
[0211] Where N represents the number of key areas of the sample electronic bill, α is set to 0.2, and the binary classification loss function L of the text detection model is conf Using the soft-max function, the bounding box regression loss function L of the text detection model is loc Use Smooth L1 function.
[0212] During the initial text detection model training process, multiple sample electronic invoices can be divided into a group with a batch_size size. Batch_size indicates the number of sample electronic invoices that are grouped together. For example, batch_size can be 8, that is, 8 sample electronic invoices are taken as a group, and the initial text detection model is iteratively trained. Among them, the iterative training of the multiple groups of sample electronic invoices into which the multiple sample electronic invoices are divided is completed, which is considered as one iteration.
[0213] All trainable parameters in the initial text detection model can be uniformly expressed as θ R ,θ R It is randomly initialized before the start of the iteration, and then continuously updated during the training process, and θ is adjusted by the gradient descent method. R To update: Where ε is the learning rate of the network, which is generally set to 0.0001.
[0214] The electronic receipt encryption method described above obtains multiple sample electronic receipts, each containing at least one labeled key region. Each sample electronic receipt is then fed into an initial text detection model, which is then trained until the test key regions output by the initial text detection model meet preset convergence criteria, thereby generating a text detection model. This method, through training the text detection model, improves the accuracy and simplicity of extracting key regions from target electronic receipts, thereby reducing the risk of tampering with the target electronic receipts.
[0215] The above embodiments are all about how to obtain the encrypted target electronic bill, and do not consider how to decrypt the encrypted electronic bill. The following is an embodiment of how to decrypt the encrypted electronic bill. In one embodiment, Figure 11 As shown, this embodiment includes the following steps:
[0216] S1101: Input the encrypted target electronic receipt into a text detection model to obtain at least one key area containing a watermark.
[0217] Decrypting the encrypted target electronic bill means obtaining the digital watermark image embedded in the target electronic bill. When encrypting the target electronic bill, the digital watermark images corresponding to the key areas of the target electronic bill are filled in the key areas. Decrypting the encrypted target electronic bill means decrypting the key areas containing watermarks in the encrypted target electronic bill image.
[0218] Therefore, before decrypting the encrypted target electronic bill, it is necessary to obtain at least one key area containing a watermark from the encrypted target electronic bill, which can be directly obtained through the text detection model constructed above. Specifically, the encrypted target electronic bill is input into the text detection model, and after analysis by the text detection model, at least one key area containing a watermark in the encrypted target electronic bill image is directly output.
[0219] The text detection model used to obtain the key area containing the watermark in the encrypted target electronic bill is the same as the text detection model used to obtain the key area when encrypting the target electronic bill.
[0220] S1102: Decrypt each key area containing a watermark to obtain a digital watermark image of each key area containing a watermark.
[0221] The decryption processing of each key watermark area can be performed using a preset decryption model to obtain a digital watermark image of each key watermark area. Specifically, each key watermark area is input into the preset decryption model respectively, and the decryption model is used for analysis to finally output the digital watermark image corresponding to each key watermark area.
[0222] The electronic receipt encryption method described above inputs the encrypted target electronic receipt into a text detection model to obtain at least one key watermark region; each key watermark region is then decrypted to obtain a digital watermark image for that key watermark region. This method uses the text detection model to obtain each key watermark region, then decrypts each key watermark region to obtain the corresponding digital watermark image, ensuring the accuracy of each digital watermark image and the accuracy of the decryption.
[0223] In one embodiment, Figure 12 As shown, decrypting each key area containing a watermark to obtain a digital watermark image of each key area containing a watermark includes the following steps:
[0224] S1201: Extract features from each key area to obtain feature information of each key area.
[0225] The manner of extracting features from each key area and obtaining feature information of each key area is the same as described in the above embodiment and will not be elaborated here.
[0226] S1202: Extract features of each key area containing watermarks to obtain feature information of each key area containing watermarks.
[0227] Optionally, the method of extracting features from each watermarked key area to obtain feature information of each watermarked key area can be the same as the method of extracting features from each key area to obtain feature information of each key area in the above embodiment, which will not be repeated here.
[0228] S1203 , based on the characteristic information of each key area, restore the characteristic information of the watermarked key area corresponding to each key area to generate a digital watermark image of each watermarked key area.
[0229] According to the characteristic information of each key area and the characteristic information of the watermarked key area corresponding to each key area, the digital watermark image of each watermarked key area is obtained. The digital watermark image is the digital watermark image filled into the key area. Therefore, the characteristic information of each key area is removed from the characteristic information of the corresponding watermarked key area to obtain the characteristic information of the digital watermark image corresponding to each watermarked key area. Then, according to the characteristic information of the digital watermark image corresponding to each watermarked key area, the corresponding digital watermark image is obtained.
[0230] The restoration process can be performed by subtracting the characteristic information of each key area from the characteristic information of the watermarked key area corresponding to each key area, thereby obtaining the characteristic information of the digital watermark image of each watermarked key area, and obtaining the corresponding digital watermark image based on the characteristic information of the digital watermark image corresponding to each watermarked key area.
[0231] The electronic invoice encryption method described above extracts features from each key area to obtain feature information for each key area. Feature extraction is then performed on each watermarked key area to obtain feature information for each watermarked key area. Based on the feature information for each key area, the feature information of the watermarked key area corresponding to each key area is restored to generate a digital watermark image for each watermarked key area. This method utilizes the feature information of each key area and the feature information of the watermarked key area corresponding to each key area to obtain a digital watermark image for each watermarked key area. This method can verify each watermarked key area to determine whether it has been tampered with.
[0232] In one embodiment, Figure 13 As shown, feature extraction is performed on each key area to obtain feature information of each key area, including the following steps:
[0233] S1301, performing grayscale conversion on each key area to obtain a grayscale image of each key area.
[0234] S1302 , performing multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area.
[0235] S1303: Perform singular value decomposition on each wavelet coefficient to obtain feature information of each key area.
[0236] In the embodiment of the present application, grayscale conversion is performed on each key area to obtain a grayscale image of each key area, multi-layer wavelet decomposition is performed on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area, and then singular value decomposition is performed on each wavelet coefficient to obtain the specific implementation method of characteristic information of each key area. The method is the same as that in the above-mentioned embodiment, grayscale conversion is performed on each key area to obtain a grayscale image of each key area, multi-layer wavelet decomposition is performed on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area, and then singular value decomposition is performed on each wavelet coefficient to obtain the characteristic information of each key area, and will not be repeated here.
[0237] The electronic receipt encryption method described above performs grayscale conversion on each key area to obtain a grayscale image of each key area. Multi-layer wavelet decomposition is then performed on the grayscale image to obtain wavelet coefficients of each key area's grayscale image. Singular value decomposition is then performed on each wavelet coefficient to obtain feature information for each key area. This method can accurately extract feature information from each key area.
[0238] In one embodiment, Figure 14 As shown, feature extraction is performed on each key area containing watermarks to obtain feature information of each key area containing watermarks, including:
[0239] S1401: Perform grayscale conversion on each key area containing watermarks to obtain grayscale images of each key area containing watermarks.
[0240] S1402: Perform multi-layer wavelet decomposition on the grayscale image of each key watermark region to obtain the wavelet coefficients of the grayscale image of each key watermark region.
[0241] S1403: Extract features from each wavelet coefficient to obtain feature information of each key area containing a watermark.
[0242] In the embodiment of the present application, the specific implementation method of extracting features from each key watermark area to obtain feature information of each key watermark area is the same as the method of extracting features from each key area to obtain feature information of each key area in the above embodiment, and will not be repeated here.
[0243] The electronic receipt encryption method described above converts the grayscale of each key watermark region to obtain a grayscale image of each key watermark region; performs multi-layer wavelet decomposition on the grayscale image of each key watermark region to obtain wavelet coefficients of the grayscale image of each key watermark region; and performs feature extraction on each wavelet coefficient to obtain feature information of each key watermark region. This method can accurately extract the feature information of each key watermark region.
[0244] In one embodiment, Figure 15 As shown, the characteristic information includes characteristic values and characteristic vectors; according to the characteristic information of each key area, the characteristic information of the key area containing watermark corresponding to each key area is restored to generate a digital watermark image of each key area containing watermark, including the following steps:
[0245] S1501: Determine the watermark feature value of each key area containing watermark according to the feature value of each key area and the feature value of the corresponding key area containing watermark.
[0246] According to the characteristic values of each key area and the characteristic values of the corresponding watermarked key area, the watermark characteristic values of each key area containing watermark can be determined by subtracting the characteristic values of each key area containing watermark from the characteristic values corresponding to each key area through the subtraction criterion of the watermark embedding algorithm to obtain the watermark characteristic values of each key area containing watermark, that is, the characteristic values of the digital watermark image embedded in each key area containing watermark.
[0247] Optionally, according to the embedding factor, after obtaining the value of subtracting the characteristic value of each key area containing watermark from the characteristic value corresponding to each key area, the obtained value is divided by the embedding factor to obtain the watermark characteristic value of each key area containing watermark.
[0248] It can be understood that the process of obtaining the watermark eigenvalue is the inverse process of adding the eigenvalue of the digital watermark image to the eigenvalue of the corresponding key areas.
[0249] S1502: Determine the watermark wavelet coefficients of each key watermark region according to the eigenvectors of each key watermark region and the corresponding watermark eigenvalues.
[0250] Based on the characteristic vectors and corresponding watermark eigenvalues of each key watermark area obtained above, the watermark wavelet coefficients of each key watermark area are obtained by using the inverse transformation of singular value decomposition, that is, the wavelet coefficients of the digital watermark image corresponding to each key watermark area are obtained.
[0251] The singular value decomposition inverse transformation method is the inverse process of the method of performing singular value decomposition on the wavelet coefficients of each key area containing watermark in the above embodiment.
[0252] S1503, performing multi-layer wavelet reconstruction on the watermark wavelet coefficients of each key watermark region to obtain an encrypted digital watermark image of each key watermark region.
[0253] The multi-layer wavelet reconstruction is performed on the watermark wavelet coefficients of each water-containing key area, which is to reconstruct the signal using each watermark wavelet coefficient. Among them, the multi-layer wavelet reconstruction is the inverse process of the multi-layer wavelet decomposition, and the encrypted digital watermark image of each watermark key area is obtained.
[0254] S1504: decrypt each encrypted digital watermark image to obtain each digital watermark image containing a watermark key area.
[0255] The encrypted digital watermark images are decrypted. The decryption method is the reverse process of the encryption operation on the digital watermark images in the above embodiment, which will not be described in detail in the embodiment of the present application.
[0256] The electronic invoice encryption method described above determines the watermark characteristic value of each key area containing watermarks based on the characteristic value of each key area and the characteristic value of the corresponding key area containing watermarks. It also determines the watermark wavelet coefficient of each key area containing watermarks based on the characteristic vector of each key area containing watermarks and the corresponding watermark characteristic value. Multi-layer wavelet reconstruction is then performed on the watermark wavelet coefficients of each key area containing watermarks to obtain an encrypted digital watermark image of each key area containing watermarks. Each encrypted digital watermark image is then decrypted to obtain a digital watermark image of each key area containing watermarks. This method, which obtains each digital watermark image based on the characteristic information of each key area and the characteristic information of the corresponding key area containing watermarks, can effectively detect whether the encrypted target electronic watermark has been tampered with.
[0257] In one embodiment, Figure 16 As shown, this embodiment includes:
[0258] S1601, first, based on a pre-trained text detection model, determine multiple key areas in the target electronic receipt image;
[0259] Among them, training set data is obtained, and the initial text detection model is trained using the training set data until a preset number of iterations is reached to obtain a trained text detection model. When training the initial text detection model, the gradient descent method is used to update the parameters in the model; wherein the training set data includes multiple sample electronic receipts with key areas and background areas marked.
[0260] S1602: Convert each key region into a corresponding grayscale image, perform three-layer discrete wavelet decomposition on each grayscale image to obtain wavelet coefficients of each key region, perform singular value decomposition on each wavelet coefficient to obtain feature information of each key region;
[0261] The conversion into a grayscale image may be performed by obtaining the Y component of each key area in the YCbCr color space from the RGB color space through the YCbCr format, and the characteristic information includes the characteristic value and the characteristic matrix.
[0262] S1603, performing Anrold scrambling transformation on the binary watermark image corresponding to each key area, performing multi-layer discrete wavelet decomposition on the binary watermark image after scrambling transformation, and performing singular value decomposition on the binary watermark image after multi-layer discrete wavelet decomposition to obtain feature information of each binary watermark image;
[0263] The characteristic information includes eigenvalues and characteristic matrices.
[0264] S1604, using the addition rule of the watermark embedding algorithm, according to the embedding factor, the characteristic value of each key area and the characteristic value of each corresponding binary watermark image, obtain the characteristic value of the watermarked key area of each key area;
[0265] S1605, according to the eigenvalues of the watermarked key areas of each key area and the corresponding eigenvectors of each key area, the wavelet coefficients of each watermarked key area are obtained by inverse singular value decomposition transformation, and each wavelet coefficient is reconstructed by wavelet to obtain the watermarked key area of each key area.
[0266] S1606: Convert the key area containing the watermark into an RGB color image to obtain an encrypted target electronic receipt image, that is, the target electronic receipt containing the watermark.
[0267] S1607: Analyze the encrypted target electronic bill image and the target electronic bill image through a text detection model to obtain at least one watermark-containing key area and a key area.
[0268] S1608: Convert each watermarked key region and key region into a grayscale image to obtain a grayscale image of each watermarked key region and key region, perform multi-layer discrete wavelet decomposition on each grayscale image to obtain wavelet coefficients of each watermarked key region and key region, and perform singular value decomposition on each wavelet coefficient to obtain feature information of each watermarked key region and key region.
[0269] The characteristic information includes eigenvalues and characteristic matrices.
[0270] S1609, according to the eigenvalues of each watermarked key area and the key area, the watermark eigenvalues are extracted using the subtraction rule of the watermark embedding algorithm to obtain the eigenvalues of each watermarked image; the eigenvalues of each watermarked image and the corresponding characteristic matrices of each watermarked key area are subjected to inverse singular value transformation to obtain each watermark wavelet coefficient, each watermark wavelet coefficient is subjected to wavelet reconstruction to obtain a watermarked scrambled image, and the watermarked scrambled image is subjected to inverse scrambling transformation to obtain the original binary watermarked image.
[0271] The specific limitations of the electronic bill encryption method provided in this embodiment can be found in the above step limitations of each embodiment of the electronic bill encryption method, which will not be repeated here.
[0272] It should be understood that, although each step in the attached flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless clearly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the attached figure in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
[0273] In one embodiment, Figure 17 As shown, the embodiment of the present application further provides an electronic bill encryption device 1700, which includes: a first determination module 1701, a second determination module 1702 and a filling module 1703, wherein:
[0274] A first determining module 1701 is configured to determine at least one key area in the image of the target electronic bill according to key content in the target electronic bill;
[0275] The second determining module 1702 is used to determine the digital watermark image of each key area; each key area corresponds to a different digital watermark image;
[0276] The filling module 1703 is configured to fill each digital watermark image into the corresponding key area of the target electronic receipt image to obtain an encrypted target electronic receipt.
[0277] In one embodiment, the filling module 1703 includes:
[0278] A filling unit, configured to fill each digital watermark image into the corresponding key area to obtain a watermarked key area of each key area;
[0279] The first generating unit is configured to generate an encrypted target electronic receipt based on the watermarked key area of each key area.
[0280] In one embodiment, the filling unit comprises:
[0281] The first extraction subunit is used to extract features from each key area to obtain feature information of each key area;
[0282] The second extraction subunit is used to extract features from each digital watermark image to obtain feature information of each digital watermark image;
[0283] The fusion subunit is used to fuse the feature information of each key area with the feature information of the corresponding digital watermark image to generate a watermarked key area of each key area.
[0284] In one embodiment, the first extraction subunit includes:
[0285] The first conversion subunit is used to perform grayscale conversion on each key area to obtain a grayscale image of each key area;
[0286] The first decomposition subunit is used to perform a decomposition operation on the grayscale image of each key area to obtain feature information of each key area.
[0287] In one embodiment, the first decomposition subunit includes:
[0288] The second decomposition subunit is used to perform multi-layer wavelet decomposition on the grayscale image of each key area to obtain the wavelet coefficients of the grayscale image of each key area;
[0289] The third decomposition subunit is used to perform singular value decomposition on each wavelet coefficient to obtain feature information of each key area.
[0290] In one embodiment, the second extraction subunit includes:
[0291] The first encryption subunit is used to perform an encryption operation on each digital watermark image to obtain an encrypted digital watermark image of each digital watermark image;
[0292] a fourth decomposition subunit, configured to perform multi-layer wavelet decomposition on the encrypted digital watermark image of each digital watermark image to obtain wavelet coefficients of each digital watermark image;
[0293] The fifth decomposition subunit is used to perform singular value decomposition on the wavelet coefficients of each digital watermark image to obtain feature information of each digital watermark image.
[0294] In one embodiment, the fusion subunit comprises:
[0295] The first determining subunit is configured to determine the watermarked feature value of each key area according to the feature value of each key area and the feature value of the corresponding digital watermark image;
[0296] The second determining subunit is used to obtain the watermarked wavelet coefficients of each key area according to the watermarked feature values of each key area and the feature vectors of each key area;
[0297] The first reconstruction subunit is used to perform multi-layer wavelet reconstruction on the watermarked wavelet coefficients of each key area to obtain a watermarked grayscale image of each key area;
[0298] The third determining subunit is configured to perform image processing on each watermarked grayscale image to obtain a color image of each watermarked grayscale image, and determine the color image of each watermarked grayscale image as a watermarked key area of each key area.
[0299] In one embodiment, the second determining module 1702 includes:
[0300] A first acquiring unit, configured to acquire identification information of each key area;
[0301] The second acquisition unit is used to acquire the digital watermark image corresponding to each key area from the database according to the identification information of each key area; the database stores identification information of multiple key areas and corresponding digital watermark images.
[0302] In one embodiment, the first determining module 1701 includes:
[0303] The input unit is used to input the target electronic receipt into the text detection model to obtain at least one key area.
[0304] In one embodiment, the apparatus 1700 further includes:
[0305] An acquisition module, configured to acquire a plurality of sample electronic receipts, each sample electronic receipt including at least one marked key area;
[0306] The training module is used to input each sample electronic receipt into the initial text detection model and train the initial text detection model until the test key area output by the initial text detection model meets the preset convergence condition to obtain the text detection model.
[0307] In one embodiment, the apparatus 1700 further includes:
[0308] An input module, configured to input the encrypted target electronic receipt into a text detection model to obtain at least one key area containing a watermark;
[0309] The decryption module is used to decrypt each key area containing watermarks to obtain digital watermark images of each key area containing watermarks.
[0310] In one embodiment, the decryption module includes:
[0311] The first extraction unit is used to extract features from each key area to obtain feature information of each key area;
[0312] The second extraction unit is used to extract features from each key area containing watermarks to obtain feature information of each key area containing watermarks;
[0313] The restoration unit is used to restore the characteristic information of the watermarked key area corresponding to each key area according to the characteristic information of each key area, and generate a digital watermark image of each watermarked key area.
[0314] In one embodiment, the first extraction unit includes:
[0315] The second conversion subunit is used to perform grayscale conversion on each key area to obtain a grayscale image of each key area;
[0316] a sixth decomposition subunit, configured to perform multi-layer wavelet decomposition on the grayscale image of each key area to obtain wavelet coefficients of the grayscale image of each key area;
[0317] The seventh decomposition subunit is used to perform singular value decomposition on each wavelet coefficient to obtain feature information of each key area.
[0318] In one embodiment, the second extraction unit includes:
[0319] The third conversion subunit is used to perform grayscale conversion on each key area containing watermarks to obtain a grayscale image of each key area containing watermarks;
[0320] an eighth decomposition subunit, configured to perform multi-layer wavelet decomposition on the grayscale images of each key watermark region to obtain wavelet coefficients of the grayscale images of each key watermark region;
[0321] The ninth decomposition subunit is used to extract features from each wavelet coefficient to obtain feature information of each key area containing a watermark.
[0322] In one embodiment, the reduction unit comprises:
[0323] a fourth determining subunit, configured to determine the watermark characteristic value of each key area containing watermark according to the characteristic value of each key area and the characteristic value of the corresponding key area containing watermark;
[0324] a fifth determining subunit, configured to determine the watermark wavelet coefficients of each key watermark region according to the feature vectors of each key watermark region and the corresponding watermark feature values;
[0325] The second reconstruction subunit is used to perform multi-layer wavelet reconstruction on the watermark wavelet coefficients of each key watermark region to obtain the encrypted digital watermark image of each key watermark region;
[0326] The decryption subunit is used to decrypt each encrypted digital watermark image to obtain each digital watermark image containing a watermark key area.
[0327] The specific definitions of the electronic receipt encryption device can be found in the definitions of the various steps in the electronic receipt encryption method above and will not be repeated here. Each module in the aforementioned electronic receipt encryption device may be implemented in whole or in part through software, hardware, or a combination thereof. Each of these modules may be embedded in or independent of the target device in hardware form, or may be stored in memory within the target device in software form, allowing the target device to call and execute the corresponding operations of each module.
[0328] In one embodiment, a computer device is provided, such as Figure 18 As shown, the computer device includes a processor, memory, communication interface, display screen and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an electronic ticket encryption method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0329] Those skilled in the art will understand that Figure 18 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0330] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0331] The implementation principles and technical effects of each step implemented by the processor in this embodiment are similar to those of the above-mentioned electronic bill encryption method and will not be repeated here.
[0332] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0333] The implementation principles and technical effects of the steps implemented when the computer program in this embodiment is executed by the processor are similar to the principles of the above-mentioned electronic bill encryption method and will not be repeated here.
[0334] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0335] The implementation principles and technical effects of the various steps implemented when the computer program in this embodiment is executed by the processor are similar to the principles of the above-mentioned electronic bill encryption method and will not be repeated here.
[0336] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0337] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0338] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0339] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. An electronic bill encryption method, characterized in that: The method comprises: determining at least one key area in an image of the target electronic bill based on key content in the target electronic bill; Determining a digital watermark image for each key area; wherein each key area corresponds to a different digital watermark image; Performing feature extraction on each of the key areas to obtain feature information of each of the key areas; the feature information includes a feature value and a feature vector; Performing feature extraction on each of the digital watermark images to obtain feature information of each of the digital watermark images; Fusing the characteristic information of each key area with the characteristic information of the corresponding digital watermark image to generate a watermarked key area for each key area; generating the encrypted target electronic receipt based on the watermarked key area of each key area; The step of fusing the characteristic information of each key area with the characteristic information of the corresponding digital watermark image to generate the watermarked key area of each key area includes: Determining the watermark-containing characteristic value of each key region by adding the characteristic value of each key region to the product of the characteristic value corresponding to the corresponding digital watermark image and the embedding factor according to the addition criterion of the watermark embedding algorithm; wherein the embedding factor is the strength of embedding the characteristic value of each digital watermark image into the characteristic value of each key region; Obtaining the watermarked wavelet coefficients of each key region according to the watermarked feature values of each key region and the feature vectors of each key region; Performing multi-layer wavelet reconstruction on the watermarked wavelet coefficients of each key area to obtain a watermarked grayscale image of each key area; Image processing is performed on each of the watermarked grayscale images to obtain a color image of each of the watermarked grayscale images, and the color image of each of the watermarked grayscale images is determined as a watermarked key area of each of the key areas.
2. The method according to claim 1, characterized in that The extracting features of each key area to obtain feature information of each key area includes: Performing grayscale conversion on each of the key areas to obtain a grayscale image of each of the key areas; Decomposition operations are performed on the grayscale images of the key areas to obtain feature information of the key areas.
3. The method according to claim 2, characterized in that The decomposing operation on the grayscale image of each key area to obtain feature information of each key area includes: Performing multi-layer wavelet decomposition on the grayscale image of each key area to obtain wavelet coefficients of the grayscale image of each key area; Performing singular value decomposition on each of the wavelet coefficients to obtain feature information of each of the key areas.
4. The method according to claim 1, wherein The extracting features of each digital watermark image to obtain feature information of each digital watermark image includes: Performing an encryption operation on each of the digital watermark images to obtain an encrypted digital watermark image of each of the digital watermark images; Performing multi-layer wavelet decomposition on the encrypted digital watermark image of each digital watermark image to obtain wavelet coefficients of each digital watermark image; The wavelet coefficients of each digital watermark image are subjected to singular value decomposition to obtain characteristic information of each digital watermark image.
5. The method according to claim 1, wherein Determining the digital watermark image of each key area includes: Obtaining identification information of each of the key areas; According to the identification information of each key area, a digital watermark image corresponding to each key area is obtained from a database; the database stores identification information of multiple key areas and corresponding digital watermark images.
6. The method according to claim 1, characterized in that The determining of at least one key area in the image of the target electronic bill according to the key content in the target electronic bill includes: The target electronic receipt is input into a text detection model to obtain the at least one key area.
7. The method according to claim 6, characterized in that The construction process of the text detection model includes: Acquire a plurality of sample electronic receipts, each sample electronic receipt including at least one marked key area; Each of the sample electronic receipts is input into an initial text detection model, and the initial text detection model is trained until the test key area output by the initial text detection model meets a preset convergence condition, thereby obtaining the text detection model.
8. The method according to claim 6, characterized in that The method further comprises: Inputting the encrypted target electronic bill into the text detection model to obtain at least one key area containing a watermark; Decryption processing is performed on each of the key watermarked areas to obtain a digital watermark image of each of the key watermarked areas.
9. The method according to claim 8, characterized in that The decrypting process is performed on each of the key watermark regions to obtain a digital watermark image of each of the key watermark regions, including: Performing feature extraction on each of the key watermark regions to obtain feature information of each of the key watermark regions; According to the characteristic information of each key area, the characteristic information of the watermarked key area corresponding to each key area is restored to generate a digital watermark image of each watermarked key area.
10. The method according to claim 9, characterized in that The extracting features of each key area to obtain feature information of each key area includes: Performing grayscale conversion on each of the key areas to obtain a grayscale image of each of the key areas; Performing multi-layer wavelet decomposition on the grayscale image of each key area to obtain wavelet coefficients of the grayscale image of each key area; Performing singular value decomposition on each of the wavelet coefficients to obtain feature information of each of the key areas.
11. The method according to claim 10, characterized in that The feature extraction of each key area containing watermarks to obtain feature information of each key area containing watermarks includes: Performing grayscale conversion on each of the key watermark regions to obtain a grayscale image of each of the key watermark regions; Performing multi-layer wavelet decomposition on the grayscale image of each key watermark region to obtain wavelet coefficients of the grayscale image of each key watermark region; Feature extraction is performed on each of the wavelet coefficients to obtain feature information of each of the key watermark-containing areas.
12. The method according to claim 11, characterized in that The characteristic information includes characteristic values and characteristic vectors; and the method of restoring the characteristic information of the watermarked key areas corresponding to the key areas according to the characteristic information of the key areas to generate digital watermark images of the watermarked key areas includes: Determining the watermark feature value of each key area containing watermark according to the feature value of each key area and the feature value of the corresponding key area containing watermark; Determining the watermark wavelet coefficients of each key watermark region according to the eigenvectors of each key watermark region and the corresponding watermark eigenvalues; Performing multi-layer wavelet reconstruction on the watermark wavelet coefficients of each watermark-containing key area to obtain an encrypted digital watermark image of each watermark-containing key area; Decrypt each of the encrypted digital watermark images to obtain each of the digital watermark images containing the watermark key areas.
13. An electronic bill encryption device, characterized in that: The device comprises: A first determining module is configured to determine at least one key area in an image of a target electronic bill according to key content in the target electronic bill; The second determining module is used to determine the digital watermark image of each key area; the digital watermark image corresponding to each key area is different; Filling modules include: A filling unit, configured to fill each digital watermark image into the corresponding key area to obtain a watermarked key area of each key area; A first generating unit is configured to generate an encrypted target electronic receipt based on the watermarked key area of each key area; Filling units include: A first extraction subunit is configured to extract features from each key area to obtain feature information of each key area; the feature information includes a feature value and a feature vector; The second extraction subunit is used to extract features from each digital watermark image to obtain feature information of each digital watermark image; The fusion subunit is used to fuse the characteristic information of each key area with the characteristic information of the corresponding digital watermark image to generate the watermarked key area of each key area; The fusion subunits include: a first determining subunit, configured to determine the watermarked characteristic value of each key region by adding the characteristic value of each key region to the product of the characteristic value corresponding to the corresponding digital watermark image and an embedding factor according to an addition criterion of a watermark embedding algorithm; wherein the embedding factor is the strength with which the characteristic value of each digital watermark image is embedded into the characteristic value of each key region; The second determining subunit is used to obtain the watermarked wavelet coefficients of each key area according to the watermarked feature values of each key area and the feature vectors of each key area; The first reconstruction subunit is used to perform multi-layer wavelet reconstruction on the watermarked wavelet coefficients of each key area to obtain a watermarked grayscale image of each key area; The third determining subunit is configured to perform image processing on each watermarked grayscale image to obtain a color image of each watermarked grayscale image, and determine the color image of each watermarked grayscale image as a watermarked key area of each key area.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
PNG electronic invoice image watermark embedding and authentication method based on block sorting
CN104036447A
Electronic document digital watermark processing method and system
CN111861846A
Identification method and device, computer equipment and storage medium
CN114299500A