Metering material two-dimensional code information steganography method and device based on coding and decoding network
Through the method based on encoding and decoding network, the security and secret problems of traditional QR code steganography technology in metrological material management are solved, and more reliable information steganography effect is achieved, reducing the risk of being attacked.
Patent Information
- Application Number
- CN202411781919.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
Traditional QR code steganography technology has security and secret problems in the management of metrological materials, and information is susceptible to malicious tampering and intercepting, resulting in security risks.
The steganography method of measuring materials QR code information based on the encoding and decoding network is adopted. Through the trained encoder and decoder, the information to be shared is embedded in the QR code, multi-layer feature information is generated and uploaded to the private network storage space, data access links are obtained, embedded in the QR code, and the original information is restored through the decoder.
It improves the security and secrets of QR code information, reduces the risk of being attacked, and achieves a more reliable information steganography effect.
Smart Images

Figure CN119721082A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security, and specifically to a method and device for steganographic information of two-dimensional codes of measuring materials based on a coding and decoding network. Background Art
[0002] With the widespread application of QR code technology in metering materials, the security and confidentiality of metering material management have received increasing attention. Although traditional QR code steganography technology is convenient, the information is vulnerable to malicious tampering and interception, leading to security risks.
[0003] Traditional secret or encrypted sharing of QR code information can be done by directly encrypting the original information or encoding the original information based on prior knowledge. For traditional encryption methods, no matter how complex the encryption or encoding algorithm is, there is always a risk of being cracked. For example, no matter how complex the encoding based on prior knowledge is, no matter how complex the encoding rules agreed with the decoding end are, in theory, it can be exhausted or collided with the database, and there is also a security risk of being cracked.
[0004] Therefore, there is an urgent need to provide a more reliable and secure technical solution for steganographic information of two-dimensional codes of measuring materials to reduce the risk of information being attacked. Summary of the invention
[0005] In view of this, the present application proposes a method and device for steganographic information of two-dimensional code of measuring materials based on a coding and decoding network, aiming to solve the problem of the risk of attack of two-dimensional code information of measuring materials in the prior art.
[0006] In the first aspect, the present application provides a method for steganographic information of a two-dimensional code of a measuring material based on a coding and decoding network, comprising:
[0007] Embed the information to be shared into the QR code of the measured material to obtain the original carrier image;
[0008] Processing the original carrier image using the trained encoder to generate multi-layer feature information;
[0009] Uploading the generated multi-layer feature information to a private network storage space and obtaining a data access link;
[0010] Embed the data access link into the measurement material QR code to obtain an access link carrier image, wherein the access link carrier image is used to attach to the measurement material;
[0011] Acquire an access link carrier image attached to the metering material, process the access link carrier image, and obtain the data access link;
[0012] Acquiring the multi-layer feature information from the private network storage space using the data access link;
[0013] The multi-layer feature information is obtained by processing the trained decoder to restore the original carrier image, and the original carrier image is processed to obtain the information to be shared.
[0014] Furthermore, it also includes:
[0015] Generate a QR code image dataset for measurement materials;
[0016] The generated measurement material two-dimensional code image data set is used to train a U-shaped structure deep encoding and decoding network to determine a trained encoder and a trained decoder.
[0017] Furthermore, the method of using the generated measurement material two-dimensional code image data set to train a U-shaped structure deep encoding and decoding network to determine a trained encoder and a trained decoder includes:
[0018] An encoder of a U-shaped deep encoding and decoding network is defined, wherein the encoder is used to sequentially extract high-level features of an input image through a plurality of stacked encoding basic blocks;
[0019] A decoder of a U-shaped deep encoding and decoding network is defined, wherein the decoder is used to gradually restore the input image by using the acquired high-level features of the input image through a plurality of stacked decoding basic blocks;
[0020] The U-shaped structure deep encoding and decoding network is trained using the measurement material two-dimensional code image data set, and the trained encoder and the trained decoder are respectively determined as the encoding module at the encoding end and the decoding module at the decoding end.
[0021] Furthermore, the encoder is configured with 4 stacked coding basic blocks; each of the coding basic blocks includes a convolution kernel, a ReLU layer and a maximum pooling layer; and the receptive field of the convolution kernel includes 3×3.
[0022] Furthermore, the decoder is provided with 4 stacked decoding basic blocks; each of the decoding basic blocks includes a convolution module, an upsampling module and a splicing module; and the receptive field of the convolution module includes 1×1.
[0023] Furthermore, the method of processing the original carrier image with the trained encoder to generate multi-layer feature information includes:
[0024] The original carrier image is processed by using a trained encoder, and the multiple stacked encoding basic blocks sequentially extract multiple groups of high-level features of the input image as the multi-layer feature information, wherein the multi-layer feature information is stored in a JSON file.
[0025] Furthermore, the process of processing the obtained multi-layer feature information using the trained decoder to restore the original carrier image includes:
[0026] The multi-layer feature information is obtained by processing the trained decoder, and the multiple stacked decoding basic blocks gradually restore the original carrier image by using the multi-layer feature information obtained.
[0027] In the second aspect, the present application provides a device for steganographic information of a two-dimensional code of a measuring material based on a coding and decoding network, comprising:
[0028] Active management module for metering materials, passive management module for metering materials, private network storage space access module, encoding module at the encoding end, and decoding module at the decoding end;
[0029] The metering material active management module is used to embed the information to be shared into the metering material QR code to obtain the original carrier image;
[0030] The encoding module at the encoding end is used to process the original carrier image using the trained encoder to generate multi-layer feature information;
[0031] The private network storage space access module is used to upload the generated multi-layer feature information to the private network storage space and obtain a data access link;
[0032] The metering material active management module is used to embed the data access link into the metering material QR code to obtain an access link carrier image, and the access link carrier image is used to attach to the metering material;
[0033] The metering material passive management module is used to obtain the access link carrier image attached to the metering material, process the access link carrier image, and obtain the data access link;
[0034] The private network storage space access module is used to obtain the multi-layer feature information from the private network storage space using the data access link;
[0035] The decoding module at the decoding end is used to process the obtained multi-layer feature information using the trained decoder to restore the original carrier image;
[0036] The metered material passive management module is used to process the original carrier image to obtain the information to be shared.
[0037] In a third aspect, the present application provides a terminal, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.
[0038] In a fourth aspect, the present application provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method described in the first aspect.
[0039] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0041] Figure 1 A schematic diagram of the flow of a method for steganographic information of a two-dimensional code of a metered material based on a coding and decoding network according to an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a flow chart of a method for steganographic information of a two-dimensional code of a metered material based on a coding and decoding network according to another embodiment of the present application;
[0043] Figure 3A An example image of the encoder extracting multi-layer feature information or high-level features of feature parameters of a two-dimensional code of an original carrier image in an embodiment of the present application;
[0044] Figure 3B This is a schematic diagram of the structure of a U-shaped deep encoding and decoding network in an embodiment of the present application;
[0045] Figure 4 It is a schematic diagram of the composition of the measurement material two-dimensional code information steganography device based on the encoding and decoding network according to an embodiment of the present application;
[0046] Figure 5 The present invention is a schematic diagram of the composition of a terminal to which the method of the present application is applied. DETAILED DESCRIPTION
[0047] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.
[0048] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.
[0049] Specifically, JSON (JavaScript Object Notation) is a lightweight data exchange format. JSON uses a text format that is completely independent of the language, and these features make JSON an ideal data exchange language.
[0050] In the current measurement material management system, QR code technology is widely used in measurement materials. Although the traditional QR code steganography technology is convenient, the information is vulnerable to malicious tampering and interception, resulting in security risks. The security and confidentiality of measurement material management are increasingly receiving attention.
[0051] In view of this, and in view of the security and confidentiality issues of traditional QR code technology in the management of measurement materials, the present application provides a technical solution for information steganography of measurement materials QR codes based on a coding and decoding network. Information steganography is realized based on a coding and decoding network, which is conducive to improving the information security of measurement materials QR codes, and can provide more reliable and secure QR code information steganography services, reduce the risk of attacks, and is conducive to improving the security and confidentiality of measurement materials QR code information.
[0052] like Figure 1 As shown, the method for steganographic information of a two-dimensional code of measured materials based on a coding and decoding network according to an embodiment of the present application includes the following steps S100 to S500.
[0053] S100: embedding the information to be shared into the QR code of the measured material to obtain the original carrier image;
[0054] S200: Processing the original carrier image using the trained encoder to generate multi-layer feature information;
[0055] S300: Uploading the generated multi-layer feature information to a private network storage space to obtain a data access link;
[0056] S400: embedding the data access link into the measurement material QR code to obtain an access link carrier image, wherein the access link carrier image is used to be attached to the measurement material;
[0057] S500: Acquire an access link carrier image attached to a metering material, and process the access link carrier image to obtain a data access link;
[0058] S600: Access the private network storage space using the data access link to obtain multi-layer feature information;
[0059] S700: Processing the obtained multi-layer feature information using the trained decoder to restore the original carrier image;
[0060] S800: Processing the original carrier image to obtain the information to be shared.
[0061] The access link carrier image generated in the above step S400 is embedded with a data access link, that is, the access link carrier image only stores the data access link, and the content corresponding to the data access link is the multi-layer feature information generated in step S200 rather than specific data such as the information to be shared or the original carrier image. Combined with the non-reproducibility of the encoding and decoding network, information security is guaranteed.
[0062] In this way, neural networks with excellent image coding capabilities are introduced into the field of QR code information steganography, achieving more complex and flexible information steganography. In this way, QR code information steganography no longer relies on manual writing and prior knowledge, but focuses more on autonomous learning and data-driven.
[0063] The method for steganographic information of measurement material QR code based on encoding and decoding network provided in the present application is that the attacker can only obtain the data access link or the characteristic parameters of the QR code, such as multi-layer characteristic information. Therefore, compared with the traditional method of encrypting the original information with a key, designing encoding rules, restricting the visitor's authority, etc., it can theoretically ensure the security of secret information sharing and has the characteristic of anti-tampering.
[0064] The method for steganographic information of two-dimensional codes of metering materials based on a coding and decoding network provided in this application is suitable for situations in which the amount of information carried by two-dimensional codes will increase in the future and the scenarios will be complex. It can achieve safe and secret sharing of original information and lay out the next-generation material management system in advance. For example, to support the next-generation flexible calibration lines that are about to be updated by the provincial service centers, the flexible calibration lines operated by the provincial companies generate calibration-qualified two-dimensional codes for metering materials and share them secretly with the provincial service centers. For example, in the on-site operation scenario, the anti-tampering characteristics of the two-dimensional code information steganographic technology solution can also better support the information security of professional marketing operations.
[0065] In some embodiments, in step S100, the information to be shared includes metering material information, such as meter ID and meter calibration results. This information can be recorded as text, pictures, symbols and combinations thereof, carrying a large amount of information and facing complex scenarios.
[0066] In the above step S100, after the information to be shared is embedded into the measurement material QR code to obtain the original carrier image, the information to be shared can be extracted by scanning the original carrier image. Therefore, in order to ensure the security of measurement material information, it is not appropriate to directly transmit the original carrier image as plain text data, nor should it be attached to the measurement material to enter the circulation link.
[0067] Furthermore, in some embodiments, in step S200, the using the trained encoder to process the original carrier image to generate multi-layer feature information includes:
[0068] The original carrier image generated in step S100 is input into the trained encoder, and the encoder extracts high-level features of the original carrier image as generated multi-layer feature information.
[0069] Specifically, the trained encoder includes an encoder in a U-shaped structure deep encoding and decoding network; the U-shaped structure deep encoding and decoding network is a generative network.
[0070] Specifically, a feature map (128×128) in the multi-layer feature information is as follows: Figure 3A As shown; the multi-layer feature information is stored in a JSON file. The generated multi-layer feature information is stored in a JSON file, which has high security and small file capacity.
[0071] Specifically, the original carrier image is input into the encoder trained in step S200, and high-level features corresponding to the high-level features of the original carrier image are extracted, such as multi-layer feature information such as A1, A2, A3, Ai and An output by each of the N basic coding blocks Basicblock in the encoder, such as multiple high-level features after dimensionality reduction.
[0072] Specifically, the multi-layer feature information is recorded in a JSON file, and the storage format of the data inside the JSON file is shown in Table 1.
[0073] Table 1 JSON file data storage style
[0074] Label data Picture 1 torch.tensor([a,b,c,......])
[0075] Among them, torch.tensor is a multidimensional matrix containing elements of a single data type. Python indexing and slicing can be used to obtain and modify the contents of the tensor tensor.
[0076] Specifically, the data type inside a JSON file can be a dictionary (dict):
[0077] dict={key1:value1,key2:value2,......};
[0078] Among them, key is the name of the sample, and value is the multi-layer feature information of the sample.
[0079] In some embodiments, before step S200, the method further includes:
[0080] S910: Generate a QR code image dataset of measured materials;
[0081] S920: Use the generated measurement material two-dimensional code image data set to train a U-shaped structure deep encoding and decoding network to determine a trained encoder and a trained decoder.
[0082] In some embodiments, in step S910, generating a measurement material two-dimensional code image dataset includes:
[0083] Using the DMcode open source code library, a specified number of QR code images (e.g., 1200) containing measurement material information are randomly generated as a measurement material QR code image dataset; wherein the size of each QR code image is [1, 512, 512], that is, each sample is a single-channel image with a size or width and height of 512×512 pixels; the generated measurement material QR code image dataset is divided into a training set and a test set according to a ratio of 8:2.
[0084] It should be understood that the U-shaped deep encoding and decoding network uses a generative network as the network architecture, and there is no need to label each sample in the QR code image dataset.
[0085] In some embodiments, in step S920, the generated measurement material two-dimensional code image data set is used to train the U-shaped structure deep encoding and decoding network, and the trained encoder and the trained decoder are determined, including: defining Figure 3B The U-shaped structure deep encoding and decoding network shown uses the data set (including a training set and a test set) generated in step S910 to train the U-shaped structure deep encoding and decoding network, and the trained encoder and the trained decoder are respectively determined as the encoding module at the encoding end and the decoding module at the decoding end.
[0086] like Figure 3B As shown in FIG. 1 , the U-shaped deep coding and decoding network includes an encoder and a decoder. The encoder extracts high-level features of the input image in sequence through multiple (e.g., M) stacked convolution modules; the decoder gradually restores the input image using the acquired high-level features or multi-layer feature information through multiple (e.g., M or M-1) stacked convolution modules and upsampling modules.
[0087] like Figure 3B As shown, the encoder has a multi-layer repetitive structure, each layer of the repetitive structure includes a coding basic block (Basicblock), and these coding basic blocks are repeated in layers to form multiple (such as M) stacked convolution modules. Each coding basic block Basicblock includes 1 convolution kernel, 1 ReLU layer and 1 maximum pooling layer. In this way, the convolution kernel, ReLU layer and maximum pooling layer are respectively one of the elements constituting the coding basic block Basicblock structure.
[0088] Specifically, the convolution kernel is used to slide on a given input image and generate an output image, which is called a convolution operation on the input image. After a convolution operation, the pixel value of each pixel in the output image is the weighted average of the pixel values of each pixel in a small area in the input image (such as the receptive field of the convolution kernel).
[0089] In some embodiments, an encoder having a multi-layer repetitive structure is designed, including:
[0090] 1) Set the receptive field of each convolution kernel in each coding basic block to 3×3. The convolution kernel performs convolution operations on the receptive field to capture the local features of the image. In this way, the pixel value of each pixel in the output image is the weighted average of the pixel values of the pixels in the corresponding 3×3 regions in the input image.
[0091] 2) Set the number of input channels and output channels of the convolution kernel in each coding basic block Basicblock. In the first coding basic block Basicblock, set the number of input channels of the first layer of convolution kernels, and set the number of output channels of the first layer of convolution kernels. In the second coding basic block or the i-th coding basic block, set the number of input channels of the second layer of convolution kernels or the i-th layer of convolution kernels to the number of output channels of the convolution kernels of the previous layer (such as the i-1th layer), and set the number of output channels of the second layer of convolution kernels or the i-th layer of convolution kernels according to the network structure and task requirements, where i is greater than or equal to 2 and less than M, and M is a natural number greater than 1.
[0092] Figure 3B In the encoder architecture with a 5-layer repetitive structure shown in the figure, the number of input channels of the convolution kernels in the first to fifth coding basic blocks is set to [1, 8, 16, 64, 256], and the number of output channels is set to [8, 16, 64, 256, 512]. That is, in the first coding basic block, the number of input channels of the first layer of convolution kernels is set to 1, and the number of output channels is set to 8; in the second coding basic block, the number of input channels of the second layer of convolution kernels is set to 8, and the number of output channels is set to 16; in the third basic block, the number of input channels of the third layer of convolution kernels is set to 16, and the number of output channels is set to 64; in the fourth basic block, the number of input channels of the fourth layer of convolution kernels is set to 64, and the number of output channels is set to 256; in the fifth basic block, the number of input channels of the fifth layer of convolution kernels is set to 256, and the number of output channels is set to 512.
[0093] 3) Set the sliding step size, number of sliding times and filling range of each convolution operation
[0094] To ensure the consistency of image size before and after the convolution operation, it is necessary to fill the input image with 0 pixels before each convolution operation. The size of the filling range p depends on the size of the convolution kernel (that is, the receptive field of the convolution kernel) and the sliding step size, and the calculation formula is as follows:
[0095]
[0096] Among them, p represents the filling range, and the unit is expressed in circles; k represents the size of the convolution kernel in any direction; s represents the sliding step size.
[0097] In some embodiments, the convolution kernel size (such as the receptive field) is 3×3, the sliding step s is 1, and the calculated filling range p is 1, that is, a circle of 0 pixels is filled around the input image, that is, the pixel value of each pixel is 0.
[0098] The number of times the convolution kernel slides on the input image Y depends on the size of the input image (such as width and height) and the sliding step s. The calculation formula is as follows:
[0099]
[0100] Among them, w and h represent the width and height of the image respectively, and k represents the size of the convolution kernel in any direction; Indicates the number of times the convolution kernel slides in the horizontal direction; Indicates the number of times the convolution kernel slides in the vertical direction. Each time the convolution kernel slides in any direction, it outputs one pixel.
[0101] With the above padding range and sliding times, the image size before and after the convolution operation is consistent, that is, the size of the input image and the output image before and after the convolution operation remains unchanged.
[0102] In some embodiments, the ReLU activation function of the ReLU layer in the encoding basic block Basicblock is used to introduce nonlinear transformation, so that the encoding basic block can learn and represent more complex mapping relationships.
[0103] In some embodiments, the maximum pooling layer in the encoding basic block Basicblock further performs a dimensionality reduction operation on the image output by the convolution operation to reduce the amount of calculation, retain the main features, and improve the translation invariance of the model.
[0104] In some embodiments, the stride of the maximum pooling layer is defined as 2, and the size is 2×2. Thus, after the maximum pooling layer, the image dimension (such as the number of output channels mentioned above) does not change, but the width and height are halved, such as the image size is converted from 256×256 to 128×128, from 128×128 to 64×64, from 64×64 to 32×32, and from 32×32 to 16×16.
[0105] In some embodiments, Figure 3BAs shown in the figure, an image of [1, 512, 512] is input to the encoder, and after passing through 4 layers of repeated structures, that is, four encoding basic blocks, high-level features of size [256, 32, 32] are obtained.
[0106] Furthermore, at the output of the encoder, a 1×1 convolution kernel (with a receptive field of 1×1) is used to further perform cross-channel semantic information interaction on the high-level features to obtain high-level features of [1024, 16, 16].
[0107] Thus, the original carrier image is processed by the trained encoder to generate multi-layer feature information, high-level features or multiple feature maps, including Figure 3B Middle left part.
[0108] like Figure 3B As shown, corresponding to the encoder, the decoder has a multi-layer repetitive structure, each layer of the repetitive structure includes a decoding basic block (Basicblock), and these decoding basic blocks are repeated in layers to form multiple (such as M) stacked convolution modules and upsampling modules. Each decoding basic block Basicblock includes a convolution kernel and an upsampling module, so that the convolution kernel and the upsampling module are respectively one of the elements constituting the structure of the decoding basic block Basicblock.
[0109] Referring to the above description, in the encoder, each time the encoding basic block Basicblock is passed, the image size is halved. Correspondingly, in the decoder, each time the decoding basic block Basicblock is passed, the image size is doubled, so that the feature map is gradually restored to the original size of the image.
[0110] In the decoder, each upsampling module is used to perform an upsampling (UnSampling) operation. The upsampling operation (such as enlarging the feature map by bilinear interpolation) can convert a low-resolution image containing high-level features into a high-resolution image while retaining the high-level features. Figure 3B As shown, through multiple 2x upsampling operations, the resolution of each output image increases successively, such as the resolution increases from [32, 32], [64, 64], [128, 128] to [256, 256] successively, until it is restored to the same resolution as the input image ([1, 512, 512]).
[0111] The convolution kernel size of each convolution module in the decoder is set to 1×1 to adjust the dimension of the input image (such as the number of input channels or the number of output channels). Figure 3BThe architecture of the decoder shown in FIG. 1 includes four decoding basic blocks Basicblock, which have a 4-layer repeated structure. Specifically, the number of input channels of the convolution kernels in each layer of the first to fourth decoding basic blocks is [256, 64, 16, 8], and the number of output channels is set to [64, 16, 8, 1]. One of the functions of the convolution operation in the decoding basic block Basicblock is to adjust the number of channels after splicing.
[0112] The following specifically describes in combination with 3B that the decoder-side decoding module restores multiple high-level features or multiple groups of multi-layer feature maps output by the encoder-side encoding module or the encoder layer by layer until the image is restored to be consistent with the original image originally input to the encoder (such as size, number of channels and pixel values).
[0113] like Figure 3B As shown, at the decoder input, the multi-layer feature information or high-level features of the input [1024, 16, 16] are processed through a 2x upsampling operation to obtain high-level features of [1024, 32, 32].
[0114] like Figure 3B As shown in the figure, each decoding basic block Basicblock first adjusts the dimension of the input feature map through a convolution layer or convolution module with a convolution kernel of 1×1, ensuring that the dimension of the feature map output by the convolution layer or convolution module is the same as the dimension of the feature map output by the encoder basic block at the corresponding position in the encoder; then, through a 2x upsampling module or a 2x upsampling operation, the size or resolution of the input feature map is doubled, such as reducing the number of channels of the feature map and converting the size or resolution of the feature map to twice that before the upsampling operation; finally, the result of the upsampling operation in the decoder is concatenated with the channel part of the feature map output by the encoder basic block at the corresponding position in the encoder, so as to integrate feature information of different scales without changing the feature information. Specifically, the number of channels of the two feature maps involved in the concatenation is different, but the size is the same.
[0115] Specifically, the first decoding basic block Basicblock performs the following operations: convolution (convolution kernel is 1×1) and 2x upsampling on the lowest-level high-level features (that is, the 1024*16*16 feature map) to obtain a 512*32*32 feature map; this 512*32*32 feature map is concatenated for the first time in the channel dimension with the 256*32*32 feature map generated by the fourth encoding basic block Basicblock in the encoder.
[0116] The second decoding basic block Basicblock performs the following operations: convolution (convolution kernel is 1×1) and 2x upsampling on the feature map after the first splicing to obtain a 64*64 feature map, and then performs a second splicing of the channel dimension with the 64*64*64 feature map generated by the third encoding basic block Basicblock in the previous encoder;
[0117] The third decoding basic block Basicblock performs the following operations: convolution (convolution kernel is 1×1) and 2x upsampling on the feature map after the second splicing to obtain a 128*128 feature map, and then performs a third splicing of the channel dimension with the 16*128*128 feature map generated by the second encoding basic block Basicblock in the previous encoder;
[0118] The fourth decoding basic block Basicblock performs the following operations: convolution (convolution kernel is 1×1) and 2x upsampling on the feature map after the third splicing to obtain a 256*256 feature map, and then performs the fourth splicing of the channel dimension with the 8*256*256 feature map generated by the first encoding basic block Basicblock in the previous encoder;
[0119] After performing the above operations, the images output by each decoding basic block Basicblock are [1024, 16, 16], [256, 32, 32], [64, 64, 64], [16, 128, 128] and [8, 256, 256] respectively.
[0120] like Figure 3B As shown in the figure, to ensure the consistency of the number of channels of the feature map, after the last layer of the decoder or the fourth decoding basic block Basicblock, the output feature map dimension is [8,256,256], and a 1×1 convolution kernel is used to adjust the number of channels to obtain a feature map with a dimension of 1 and a size of 256*256. After a 2x upsampling operation, an image of 1*512*512 is obtained. In this way, at the output of the decoder, a feature map of the same size as the original image (1*512*512) is obtained.
[0121] In some embodiments, to ensure the quality of the restored image, a pixel binarization module is used at the end of the encoding and decoding network, that is, after the decoder output, to perform binarization processing on the obtained image. After further binarization processing of the image, the original carrier image can be obtained.
[0122] Specifically, the pixel binarization module performs binarization processing, including: setting a pixel threshold; setting the pixel values below the threshold in the image to 0 (such as the corresponding white pixels in the two-dimensional code image), and converting the pixels above the threshold to 1 (such as the corresponding black pixels in the two-dimensional code image), so as to convert the grayscale image into a black and white binary image.
[0123] In this way, after several convolution operations and upsampling operations in the decoder and equal splicing operations on the feature maps of each layer generated by each encoding basic block of the encoder and the feature maps of each layer restored by each decoding basic block of the decoder, an output result can be obtained, such as an image consistent with the original image originally input to the encoder.
[0124] Thus, in the decoding phase, the decoder uses the high-level features obtained by the encoder in the encoding phase to restore the original image.
[0125] Set as Figure 3B After the U-shaped structure deep encoding and decoding network is constructed, the network is trained using the training set in the data set generated in step S910. The specific software and hardware are listed in Table 2. In the above experimental environment configuration, the initial learning rate is selected as 1e -3 , Adam (Adaptive Moment Estimation) optimizer with weight decay of 0.005. The batch size of each epoch is 8, and a total of 360 epochs are iterated. Finally, the trained encoding and decoding network is obtained.
[0126] Table 2 Software and hardware configuration information
[0127]
[0128] Specifically, the order of magnitude of the encoder and decoder parameters can be obtained by multiplying the number of input channels, the number of output channels, the width and height of the convolution kernel receptive field, etc., which can reach tens of millions or billions. Therefore, the encoding and decoding network is non-reproducible and cannot be replicated.
[0129] In some embodiments, the trained encoder and the trained decoder exist in the form of a combination of software and hardware. For example, after the convolutional network and deconvolutional network are trained, they are burned into the deep learning hardware chip or board, and the board is connected to the camera for acquiring the image.
[0130] In some embodiments, in step S300, the generated multi-layer feature information is uploaded to a private network storage space, and the private network storage space returns a data access link and a security key that can access the multi-layer feature information.
[0131] Specifically, the security key is one of the elements of the security access mechanism. The security access mechanism may also include generating keys, distributing keys, transferring keys and using keys. The security access mechanism is shared by all parties in the information steganography system composed of the encoding end, the decoding end and the private network storage space. If the encoding end acts as a sender to upload the generated multi-layer feature information to the private network storage space, the private network storage space is the receiver. If the private network storage space acts as a sender to send the generated data access link.
[0132] Specifically, a security access mechanism shared by the information steganography device generates a security access key and a legitimacy verification mechanism for the data access link.
[0133] Specifically, private network storage space or private cloud can be network attached storage (NAS). Network attached storage is also called network storage, cloud network storage space or cloud storage. It is connected to the network, has data storage function, and is usually a dedicated data storage server. Private network storage space is data-centric, completely separates storage devices from servers, and centrally manages data, thereby freeing up bandwidth, improving performance, and reducing total cost of ownership.
[0134] Furthermore, the data access link stored in the private network storage space and used to access the multi-layer feature information is transferred to a new QR code, such as embedded in the measurement material QR code, to obtain an access link carrier image, and the access link carrier image is used to attach to the measurement material. In this way, the access link carrier image can be safely and secretly transmitted publicly as an information carrier.
[0135] Specifically, the access link carrier image, as an information carrier, can be printed or sprayed as a picture and attached to measurement materials, such as measurement instruments that have passed the flexible calibration line calibration, and circulate with the measurement instruments in a larger geographical range.
[0136] In this way, in the steganographic stage of the QR code for measuring materials, the data access link is embedded in the generated access link carrier image, that is, the access link carrier image only stores the data access link, and the content corresponding to the data access link is the multi-layer feature information generated in step S200 rather than specific data such as the information to be shared or the original carrier image.
[0137] In some embodiments, in step S500, an access link carrier image attached to the metering material is obtained, and the access link carrier image is processed to obtain a data access link; in step S600, the private network storage space is accessed using the data access link to obtain multi-layer feature information.
[0138] Referring to the above description, the security access mechanism is shared by all parties in the information steganography system composed of the encoding end, the decoding end and the private network storage space. For example, the decoding end, as a sender, uses the data access link to access the private network storage space and as a receiver, obtains the multi-layer feature information corresponding to the data access link.
[0139] In this way, at the decoding end, the data access link is used to obtain the multi-layer feature information from the private network storage space, which is a reciprocal process of uploading the generated multi-layer feature information to the private network storage space and obtaining the data access link. The aforementioned security access mechanism shared by the encoding end, the decoding end and the private network storage space is used to realize the secure uploading and downloading of the multi-layer feature information.
[0140] Naturally, as Figure 2 As shown, a malicious third party can obtain the data access link by reading the access link carrier image, but the above two steps ensure the security of the information to be transmitted or shared:
[0141] 1) If Figure 2 As shown, after a malicious third party obtains a data access link through a new QR code, i.e., an access link carrier image, it cannot pass the legitimacy verification of the security access mechanism and therefore has no authority to read the multi-layer feature information corresponding to the data access link stored in the private network storage space, i.e., it cannot obtain the content corresponding to the data access link;
[0142] 2) Even if the third party passes the legitimacy verification of the security access mechanism and reads the multi-layer feature information stored in the private network storage space and corresponding to the data access link, that is, the JSON file stored in the cloud and recording the multi-layer feature information. However, since the JSON file stores the multi-layer feature information of the original carrier image, there is no plain text information; and the multi-layer feature information is a pseudo-write of the information to be transmitted or shared, the corresponding original carrier image cannot be directly restored by obtaining the multi-layer feature information.
[0143] In some embodiments, in step S700, the multi-layer feature information is obtained by processing the trained decoder to restore the original carrier image. The operations in the aforementioned network training may be referred to and will not be described in detail.
[0144] Referring to the above description, due to the randomness in the training process, the difference in data, the uncertainty of the optimization algorithm, and the complexity of the network structure, in theory, even if the two networks have the same structure, there will be huge differences due to slight differences in the training process. These differences will be amplified during the training process and ultimately lead to significant differences in the performance and behavior of the two networks. Therefore, the decoder is unbreakable. This ensures that even if a third party obtains the JSON file storing multiple layers of feature information, it cannot be deciphered. In this way, in step S700, the non-reproducibility of the encoding and decoding network is utilized to achieve information security assurance.
[0145] In some embodiments, step S800, processing the original carrier image to obtain the information to be shared, is an inverse operation of the aforementioned step S100, and can be performed with reference thereto, and will not be described in detail.
[0146] In this way, in the process of reading the QR code of measured materials, the access link carrier image is identified to obtain the data access link; combined with the data access key recorded in the aforementioned security access mechanism, the multi-layer feature information corresponding to the data access link is obtained; the trained decoder is used to process the obtained multi-layer feature information to restore the original carrier image, and the original carrier image is processed to obtain the information to be shared.
[0147] In summary, in the method for steganography of measurement material QR code information based on the encoding and decoding network proposed in the present invention, a measurement material QR code image dataset is generated, and the generated QR code image dataset is used to train the U-shaped structure deep encoding and decoding network. The information to be shared is embedded into the QR code to obtain the original carrier image, and the encoder extracts the multi-layer feature information of the original carrier image, and then uploads these multi-layer feature information to the private network storage space, and transfers the returned data access link to the new carrier QR code. The decoder uses the multi-layer feature information to restore the original carrier image. Since the newly generated QR code only stores the data access link, and the content corresponding to the data access link is the multi-layer feature information rather than the specific data, coupled with the non-reproducibility of the encoding and decoding network, information security is guaranteed.
[0148] like Figure 2 As shown, another embodiment of the present invention is a method for steganographic information of a two-dimensional code of a metered material based on a coding and decoding network, comprising:
[0149] For the measurement material information that needs to be steganographic, the measurement material information is embedded into the original carrier image as the information to be transmitted;
[0150] Define the encoding-decoding network, generate a QR code dataset, train the encoding-decoding network, and obtain the encoder and decoder;
[0151] The original carrier image is input into the encoder, the encoder extracts the QR code features, and the extracted QR code features are stored in a JSON file;
[0152] Store the JSON file in the database and return the data access link;
[0153] Write the returned data access link into a new QR code;
[0154] On the one hand, for the new QR code attached to the metering materials, the user scans the code to obtain the data access link; the user obtains the JSON file and inputs it into the decoder; the decoder decodes the data to obtain the original carrier image and recognizes the information to be transmitted;
[0155] On the other hand, for the new QR code attached to the measuring materials, the malicious attack obtains the data access link and then invades the database and obtains the JSON file; because the decoder is not crackable, the malicious attack cannot use the decoder to process the obtained JSON file, and naturally, the original carrier image or the information to be transmitted cannot be obtained.
[0156] like Figure 4 As shown, the device for steganographic information of a two-dimensional code of a metered material based on a coding and decoding network in an embodiment of the present application includes:
[0157] Active management module 10 for metered materials, passive management module 20 for metered materials, private network storage space access module, encoding module 30 at the encoding end, and decoding module 40 at the decoding end;
[0158] The metering material active management module is used to embed the information to be shared into the metering material QR code to obtain the original carrier image;
[0159] The encoding module at the encoding end is used to process the original carrier image using the trained encoder to generate multi-layer feature information;
[0160] The private network storage space access module is used to upload the generated multi-layer feature information to the private network storage space and obtain a data access link;
[0161] The metering material active management module is used to embed the data access link into the metering material QR code to obtain an access link carrier image, and the access link carrier image is used to attach to the metering material;
[0162] The metering material passive management module is used to obtain the access link carrier image attached to the metering material, process the access link carrier image, and obtain the data access link;
[0163] The private network storage space access module is used to obtain the multi-layer feature information from the private network storage space using the data access link;
[0164] The decoding module at the decoding end is used to process the obtained multi-layer feature information using the trained decoder to restore the original carrier image;
[0165] The metered material passive management module is used to process the original carrier image to obtain the information to be shared.
[0166] The modules in the above-mentioned device for steganographic information of two-dimensional code of measuring materials based on coding and decoding network cooperate to implement the method for steganographic information of two-dimensional code of measuring materials based on coding and decoding network described in any of the aforementioned embodiments, which has the same concept and technical effect and can be implemented as a reference and will not be described in detail.
[0167] In some embodiments, the active management module for metering materials, the private network storage space access module and the encoding module are deployed at the encoding end and applied to the steganographic link of the metering materials QR code; the passive management module for metering materials, the private network storage space access module and the decoding module are deployed at the decoding end and applied to the reading and writing link of the metering materials QR code; the private network storage space is set up in the cloud as a public resource. In this way, the encoding end, the decoding end and the private network storage space constitute the metering materials QR code steganographic system, and share the aforementioned security access mechanism.
[0168] The method and device for steganographic information of two-dimensional codes of measurement materials based on a coding and decoding network proposed in the present invention successfully solves multiple problems of traditional two-dimensional code steganography technology. First, the security of two-dimensional code steganography technology is significantly improved, and the risk of malicious tampering and interception of information is effectively prevented, providing a more reliable security guarantee for the transmission of two-dimensional code information. Secondly, through the application of deep learning algorithms, the information hiding process is made more intelligent and autonomously learning, which has made significant progress and has a more significant effect compared with traditional manual writing and prior knowledge-dependent methods.
[0169] The method and device for steganographic information of two-dimensional codes of measuring materials based on a coding and decoding network proposed in the present invention not only have obvious technical improvements in the field of information steganography, but also have far-reaching application and promotion value; it provides an example for the organic integration of two-dimensional code technology and deep learning, and opens up new possibilities for academia and industry to explore new research directions and application scenarios in the field of information transmission, and has extremely high academic value and practical application prospects.
[0170] The present application also provides a terminal to execute the method. Figure 5 It shows a schematic diagram of a terminal provided by some embodiments of the present application. Figure 5As shown, the terminal 8 includes: a processor 800, a memory 801, a bus 802 and a communication interface 803, and the processor 800, the communication interface 803 and the memory 801 are connected via the bus 802; the memory 801 stores a computer program that can be run on the processor 800, and the processor 800 executes the method provided by any embodiment described in the present application when running the computer program.
[0171] The memory 801 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0172] The bus 802 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 801 is used to store programs, and the processor 800 executes the program after receiving an execution instruction. The method disclosed in any implementation of the embodiment of the present application may be applied to the processor 800, or implemented by the processor 800.
[0173] The processor 800 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the method can be completed by an integrated logic circuit of hardware in the processor 800 or an instruction in the form of software. The processor 800 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and completes the steps of the method in combination with its hardware.
[0174] The terminal provided in the embodiment of the present application and the method in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, operated or implemented by them.
[0175] The embodiments of the present application also provide a computer-readable storage medium corresponding to the method provided by the embodiments, wherein the computer-readable storage medium is a CD on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the method provided by any of the embodiments.
[0176] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0177] The computer-readable storage medium provided by the embodiments of the present application is based on the same inventive concept as the method of the embodiments of the present application, and has the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0178] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these adjustments and modifications of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these changes and modifications.
Claims
1. A method for steganographic information of a two-dimensional code of a measuring material based on a coding and decoding network, characterized in that: include: Embed the information to be shared into the QR code of the measured material to obtain the original carrier image; Processing the original carrier image using the trained encoder to generate multi-layer feature information; Uploading the generated multi-layer feature information to a private network storage space and obtaining a data access link; Embed the data access link into the measurement material QR code to obtain an access link carrier image, wherein the access link carrier image is used to attach to the measurement material; Acquire an access link carrier image attached to the metering material, process the access link carrier image, and obtain the data access link; Acquiring the multi-layer feature information from the private network storage space using the data access link; Processing the obtained multi-layer feature information using the trained decoder to restore the original carrier image; The original carrier image is processed to obtain the information to be shared.
2. The method according to claim 1, characterized in that Also includes: Generate a QR code image dataset for measurement materials; The generated measurement material two-dimensional code image data set is used to train a U-shaped structure deep encoding and decoding network to determine a trained encoder and a trained decoder.
3. The method according to claim 2, characterized in that The method of using the generated measurement material two-dimensional code image data set to train a U-shaped structure deep encoding and decoding network to determine a trained encoder and a trained decoder includes: An encoder of a U-shaped deep encoding and decoding network is defined, wherein the encoder is used to sequentially extract high-level features of an input image through a plurality of stacked encoding basic blocks; A decoder of a U-shaped deep encoding and decoding network is defined, wherein the decoder is used to gradually restore the input image by using the acquired high-level features of the input image through a plurality of stacked decoding basic blocks; The U-shaped structure deep encoding and decoding network is trained using the measurement material two-dimensional code image data set, and the trained encoder and the trained decoder are respectively determined as the encoding module at the encoding end and the decoding module at the decoding end.
4. The method according to claim 3, characterized in that The encoder is configured with four stacked encoding basic blocks; each of the encoding basic blocks includes a convolution kernel, a ReLU layer and a maximum pooling layer; and the receptive field of the convolution kernel includes 3×3.
5. The method according to claim 4, characterized in that The decoder is provided with 4 stacked decoding basic blocks; each of the decoding basic blocks includes a convolution module, an upsampling module and a splicing module; the receptive field of the convolution module includes 1×1.
6. The method according to claim 5, characterized in that The method of processing the original carrier image with the trained encoder to generate multi-layer feature information includes: The original carrier image is processed by using a trained encoder, and the multiple stacked encoding basic blocks sequentially extract multiple groups of high-level features of the input image as the multi-layer feature information, wherein the multi-layer feature information is stored in a JSON file.
7. The method according to claim 6, characterized in that The method of processing the obtained multi-layer feature information using the trained decoder to restore the original carrier image includes: The multi-layer feature information is obtained by processing the trained decoder, and the multiple stacked decoding basic blocks gradually restore the original carrier image by using the obtained multi-layer feature information.
8. A device for steganographic information of two-dimensional code of measured materials based on coding and decoding network, characterized in that: include: Active management module for metering materials, passive management module for metering materials, private network storage space access module, encoding module at the encoding end, and decoding module at the decoding end; The metering material active management module is used to embed the information to be shared into the metering material QR code to obtain the original carrier image; The encoding module at the encoding end is used to process the original carrier image using the trained encoder to generate multi-layer feature information; The private network storage space access module is used to upload the generated multi-layer feature information to the private network storage space and obtain a data access link; The metering material active management module is used to embed the data access link into the metering material QR code to obtain an access link carrier image, and the access link carrier image is used to attach to the metering material; The metering material passive management module is used to obtain the access link carrier image attached to the metering material, process the access link carrier image, and obtain the data access link; The private network storage space access module is used to obtain the multi-layer feature information from the private network storage space using the data access link; The decoding module at the decoding end is used to process the obtained multi-layer feature information using the trained decoder to restore the original carrier image; The metered material passive management module is used to process the original carrier image to obtain the information to be shared.
9. A terminal, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the method according to any one of claims 1 to 7.