Data Encryption Transmission Method and Device

By dividing image blocks and evaluating importance of encrypted image data, converting them into bitplane data and encrypting them, the problem of inefficient encryption in the prior art is solved, and efficient data encryption transmission is achieved in resource-constrained environments.

CN119728875BActive Publication Date: 2025-06-20SHANGHAI JIZHANG INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510213347.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-20
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

Existing data encryption technologies have inefficiency in computing complexity and resource consumption, especially when dealing with large-scale data or tasks with high real-time requirements, which affect system performance.

Method used

By dividing the image data to be encrypted into multiple image blocks, and determining the image block to be encrypted based on the importance score of each image block, converting it into multiple bit plane data, and determining the bit plane to be encrypted based on the information ratio.

Benefits of technology

While ensuring data security, it significantly improves encryption efficiency and reduces the consumption of computing resources, especially in resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728875B_ABST
    Figure CN119728875B_ABST
Patent Text Reader

Abstract

The present invention provides a data encryption transmission method and apparatus. By dividing the image data to be encrypted into multiple image blocks, determining the importance scores of each image block, and determining the image blocks to be encrypted based on the importance scores of each image block; then for any image block to be encrypted, obtaining the pixel values of each pixel point in the image block to be encrypted, converting the pixel value of each pixel point into a binary sequence, and converting the image block to be encrypted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point, so as to determine the bit plane to be encrypted of the image block to be encrypted based on the information ratio of each bit-plane data of any image block to be encrypted; further encrypting the bit planes to be encrypted of each image block to be encrypted, and constructing the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks and the remaining image blocks corresponding to each image block to be encrypted, which can improve the encryption efficiency while ensuring data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and particularly to a data encryption and transmission method and device. Background Art

[0002] With the rapid development of information technology and the popularization of the Internet, the importance of data in various application scenarios has become increasingly prominent. From the real-time data transmitted by Internet of Things sensors to the sensitive transaction information in enterprise systems, and then to the personal privacy files in cloud storage services, the generation and transmission of data have covered all aspects of social life. However, along with the increasing data mobility, the potential security threats are also intensifying. In order to ensure the security of data during transmission, encryption technology is widely used to protect the confidentiality of data, prevent unauthorized access and tampering.

[0003] Existing data encryption technologies can generally be divided into two categories: symmetric encryption and asymmetric encryption. Symmetric encryption algorithms (such as AES and DES) are widely used for large-scale data transmission due to their high encryption speed and processing efficiency, while asymmetric encryption algorithms (such as RSA and ECC) are mostly used in authentication and key distribution scenarios due to their superiority in key management. However, whether it is symmetric encryption or asymmetric encryption, their cores rely on complex mathematical operations. Although complex operations improve the security of the algorithm, they inevitably increase the computational burden and resource consumption, which exposes the problem of low efficiency in specific application scenarios.

[0004] First of all, the computational complexity of modern encryption algorithms is generally high. For example, the commonly used large number modular exponentiation operation and elliptic curve calculation in asymmetric encryption are time-consuming and require high hardware performance; symmetric encryption also has a non-negligible demand for computing resources due to multiple rounds of encryption and decryption processes. The direct consequence of these high computational complexities is the reduction of encryption efficiency, especially when dealing with large-scale data or tasks with high real-time requirements. Secondly, the consumption of system resources during the encryption process cannot be ignored. In resource-constrained environments such as embedded devices and edge computing nodes, encryption operations often occupy most of the CPU and memory resources of the system, and may even shorten the operating life of the device or limit its performance. In addition, in high-frequency data transmission tasks, the computing resources required for encryption may compete with the application itself for hardware resources, further affecting the overall performance of the system. Against the above background, how to improve encryption efficiency while ensuring data security is an important topic in current data transmission encryption research. Summary of the Invention

[0005] The present invention provides a data encryption and transmission method and device to solve the defects in the prior art of low data encryption efficiency and large amount of computing resources required.

[0006] The present invention provides a data encryption and transmission method, including:

[0007] Determine the image data to be encrypted, and divide the image data to be encrypted into multiple image blocks; the image data to be encrypted is a grayscale image;

[0008] Determine the importance scores of each image block, and determine the image blocks to be encrypted based on the importance scores of each image block;

[0009] For any image block to be encrypted, obtain the pixel value of each pixel point in the any image block to be encrypted, convert the pixel value of each pixel point into a binary sequence, and convert the any image block to be encrypted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point; wherein, any bit-plane data is composed of binary numbers at the same position in the binary sequence corresponding to the pixel value of each pixel point;

[0010] Based on the information ratio of each bit-plane data of any image block to be encrypted, determine the bit-plane to be encrypted of the any image block to be encrypted;

[0011] Encrypt the bit-planes to be encrypted of each image block to be encrypted to obtain the encrypted image blocks corresponding to each image block to be encrypted, and construct the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0012] According to the data encryption and transmission method provided by the present invention, the information ratio of any bit-plane data of any image block to be encrypted is determined based on the number of bit-plane data of the any image block to be encrypted and the position of the data in the any bit-plane data in the binary sequence corresponding to the pixel value of each pixel point in the any image block to be encrypted.

[0013] According to the data encryption and transmission method provided by the present invention, the determining the importance scores of each image block includes:

[0014] Extract features from any image block based on multiple feature extraction modules to obtain the image feature representation of the any image block;

[0015] Classify the image feature representation of the any image block based on a classification module to obtain the probability that the any image block contains a preset target, and determine the importance score of the any image block based on the probability that the any image block contains the preset target;

[0016] Among them, the first feature extraction module and the last feature extraction module are constructed based on lightweight convolutional layers, and the non-first-and-last feature extraction modules are constructed based on the lightweight convolutional layers, the multi-head self-attention layer, and the feed-forward neural network in the Transformer model.

[0017] According to a data encryption and transmission method provided by the present invention, the lightweight convolutional layer is used to perform the following operations on the input feature map:

[0018] Scale the input feature map based on a preset scale factor to obtain a scaled feature map;

[0019] Based on the input feature map and the scaled feature map, determine a difference feature map;

[0020] Perform a depth convolution operation on the scaled feature map to obtain a first convolution result, and perform a point convolution operation on the difference feature map to obtain a second convolution result;

[0021] Fuse the first convolution result and the second convolution result to obtain a comprehensive convolution result;

[0022] Perform normalization processing and activation processing on the comprehensive convolution result to obtain the feature map output by the lightweight convolutional layer.

[0023] According to a data encryption and transmission method provided by the present invention, an intermediate conversion module is further included between the lightweight convolutional layer and the multi-head self-attention layer in the non-first-and-last feature extraction module;

[0024] The intermediate conversion module is used to perform the following operations on the feature map output by the lightweight convolutional layer:

[0025] Perform a point convolution operation on the feature map output by the lightweight convolutional layer to obtain a point convolution conversion result;

[0026] Scale the point convolution conversion result based on the preset scale factor to obtain a scaled conversion result;

[0027] Perform a depth convolution operation on the scaled conversion result to obtain a depth convolution conversion result;

[0028] Based on the point convolution conversion result and the scaled conversion result, determine a difference conversion result;

[0029] Fuse the depth convolution conversion result and the difference conversion result to obtain the feature map output by the intermediate conversion module.

[0030] A data encryption and transmission method provided by the present invention, wherein the feature extraction of any image block based on multiple feature extraction modules to obtain the image feature representation of the any image block includes:

[0031] Determine the feature map scales corresponding to the last three feature extraction modules as the first feature map scale, the second feature map scale, and the third feature map scale;

[0032] Convert the feature maps output by the last three feature extraction modules to the first feature map scale and then fuse them to obtain a first fused feature map;

[0033] Convert the feature maps output by the last three feature extraction modules to the second feature map scale and then fuse them to obtain a second fused feature map;

[0034] Convert the feature maps output by the last three feature extraction modules to the third feature map scale and then fuse them to obtain a third fused feature map;

[0035] Fuse the first fused feature map, the second fused feature map, and the third fused feature map to obtain the image feature representation of the any image block.

[0036] A data encryption and transmission method provided by the present invention, wherein the encryption of the encrypted bit planes of each encrypted image block includes:

[0037] Based on the importance scores of each encrypted image block, determine the encryption algorithm for each encrypted image block; wherein, the higher the importance score of any encrypted image block, the higher the security level of the encryption algorithm for the any encrypted image block.

[0038] The present invention also provides a data encryption and transmission device, including:

[0039] An image division unit for determining encrypted image data and dividing the encrypted image data into multiple image blocks; the encrypted image data is a grayscale image;

[0040] An importance evaluation unit for determining the importance scores of each image block and determining encrypted image blocks based on the importance scores of each image block;

[0041] A bit plane determination unit for, for any encrypted image block, obtaining the pixel value of each pixel point in the any encrypted image block, converting the pixel value of each pixel point into a binary sequence, and converting the any encrypted image block into multiple bit plane data based on the binary sequences corresponding to the pixel values of each pixel point; wherein, any bit plane data is composed of the binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point;

[0042] An encryption - to - be - determined bit unit, configured to determine the bit - plane to be encrypted of any to - be - encrypted image block based on the information ratio of each bit - plane data of the to - be - encrypted image block;

[0043] A data encryption unit, configured to encrypt the bit - plane to be encrypted of each to - be - encrypted image block, obtain the encrypted image block corresponding to each to - be - encrypted image block, and construct the encrypted image data corresponding to the to - be - encrypted image data based on the encrypted image blocks corresponding to each to - be - encrypted image block and the remaining image blocks in the to - be - encrypted image data.

[0044] The present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the data encryption and transmission method described in any one of the above is implemented.

[0045] The present invention further provides a non - transitory computer - readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data encryption and transmission method described in any one of the above is implemented.

[0046] The present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the data encryption and transmission method described in any one of the above is implemented.

[0047] The data encryption and transmission method and device provided by the present invention divide the to - be - encrypted image data into multiple image blocks, determine the importance scores of each image block, and determine the to - be - encrypted image blocks based on the importance scores of each image block; then for any to - be - encrypted image block, obtain the pixel value of each pixel point in the to - be - encrypted image block, convert the pixel value of each pixel point into a binary sequence, and convert the to - be - encrypted image block into multiple bit - plane data based on the binary sequence corresponding to the pixel value of each pixel point, so as to determine the bit - plane to be encrypted of the to - be - encrypted image block based on the information ratio of each bit - plane data of the to - be - encrypted image block; furthermore, encrypt the bit - plane to be encrypted of each to - be - encrypted image block, obtain the encrypted image block corresponding to each to - be - encrypted image block, and construct the encrypted image data corresponding to the to - be - encrypted image data based on the encrypted image blocks corresponding to each to - be - encrypted image block and the remaining image blocks in the to - be - encrypted image data, which can improve the encryption efficiency while ensuring data security. Description of the Drawings

[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 is a schematic flowchart of the data encryption transmission method provided by the present invention;

[0050] Figure 2 is a schematic flowchart of the importance score evaluation method provided by the present invention;

[0051] Figure 3 is a schematic structural diagram of the data encryption transmission device provided by the present invention;

[0052] Figure 4 is a schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners

[0053] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0054] Figure 1 is a schematic flowchart of the data encryption transmission method provided by the present invention. As Figure 1 shown, the method includes:

[0055] Step 110, determining the image data to be encrypted and dividing the image data to be encrypted into a plurality of image blocks; the image data to be encrypted is a grayscale image;

[0056] Step 120, determining the importance score of each image block and determining the image blocks to be encrypted based on the importance scores of the respective image blocks;

[0057] Step 130, for any image block to be encrypted, obtaining the pixel value of each pixel point in the any image block to be encrypted, converting the pixel value of each pixel point into a binary sequence, and converting the any image block to be encrypted into a plurality of bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point; wherein, any bit-plane data is composed of binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point;

[0058] Step 140, determining the bit plane to be encrypted of the any image block to be encrypted based on the information ratio of each bit-plane data of the any image block to be encrypted;

[0059] Step 150: Encrypt the bit planes to be encrypted of each image block to be encrypted, obtain the encrypted image blocks corresponding to each image block to be encrypted, and construct the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0060] Here, if the image data that needs to be encrypted and transmitted is a non - grayscale image, it is converted into a grayscale image to obtain the image data to be encrypted, and the image data to be encrypted is divided into multiple image blocks based on a preset image size. The size of each image block is the same as the above - mentioned preset image size. To improve the efficiency of the encryption link in the data encryption and transmission process, the importance scores of each image block can be determined, and the image blocks to be encrypted are determined as the subsequent encryption objects based on the importance scores of each image block, while the other image blocks other than the image blocks to be encrypted can be not encrypted. Here, the more important the image semantic information contained in any image block, the higher the importance score of the image block, and the higher the necessity of encrypting it.

[0061] In some embodiments, as Figure 2 shown, the importance scores of each image block can be determined based on the following method:

[0062] Step 210: Extract features of any image block based on multiple feature extraction modules to obtain the image feature representation of the any image block;

[0063] Step 220: Classify the image feature representation of the any image block based on a classification module to obtain the probability that the any image block contains a preset target, and determine the importance score of the any image block based on the probability that the any image block contains a preset target;

[0064] Among them, the first feature extraction module and the last feature extraction module are constructed based on lightweight convolutional layers, and the non - first - and - last feature extraction modules are constructed based on the lightweight convolutional layers, the multi - head self - attention layer and the feed - forward neural network in the Transformer model.

[0065] Here, the importance score of any image block is evaluated by a classification model designed for the current scenario. Among them, under the overall goal of improving the efficiency of the encryption link, the classification model needs to balance the image classification accuracy (i.e., the accuracy of determining whether a preset target is contained in an image block) and the model inference efficiency. The former is to avoid information leakage caused by incorrect classification resulting in unencrypted image blocks that should be encrypted, while the latter is to improve the efficiency of the entire encryption link. To meet the requirements of both image classification accuracy and model inference efficiency simultaneously, the design of its feature extraction module is the core when constructing the classification model.

[0066] Specifically, the classification model includes a plurality of sequentially connected feature extraction modules and a classification module. The feature extraction modules are used to extract the image semantic features of the input image patches to obtain the image feature representations of the image patches, and the classification module is used to calculate the probability that the image patches contain a preset target based on the image feature representations of the image patches, so as to quantify the importance score of the image patches based on the probability that the image patches contain the preset target (for example, the probability that the image patches contain the preset target can be multiplied by a preset coefficient to obtain its importance score). Among them, in the plurality of sequentially connected feature extraction modules, the first feature extraction module and the last feature extraction module are constructed based on lightweight convolutional layers, and the non-first and last feature extraction modules are constructed based on lightweight convolutional layers, the multi-head self-attention layer and the feed-forward neural network in the Transformer model. Here, the goal of the lightweight convolutional layer is to extract features from the input feature map through fewer and parallelizable convolutional operations to reduce the computational complexity of the convolutional layer. By introducing the multi-head self-attention layer and the feed-forward neural network in the Transformer model into the intermediate feature extraction module and combining the core network layer of the Transformer model with the lightweight convolutional layer, the inductive bias advantage of the convolutional layer and the long-term dependence modeling ability of the Transformer can be combined, enabling the classification model to not only focus on the image details in the image patches but also understand the overall structure of the entire image patch, thereby improving the feature extraction ability of the classification model.

[0067] In some embodiments, the lightweight convolutional layer is used to perform the following operations on the input feature map: scale the input feature map based on a preset scale coefficient to obtain a scaled feature map, and determine a difference feature map based on the input feature map and the scaled feature map; on the one hand, a depth convolution operation can be performed on the scaled feature map to obtain a first convolution result, and on the other hand, a point convolution operation is performed on the difference feature map to obtain a second convolution result, and then the above first convolution result and the above second convolution result are fused to obtain a comprehensive convolution result; finally, the comprehensive convolution result is normalized and activated to obtain the feature map output by the lightweight convolutional layer.

[0068] In some other embodiments, the lightweight convolutional layer can perform the operations shown in the following formula:

[0069] ;

[0070] where LightCNN(x) is the feature map output by the lightweight convolutional layer, x is the input feature map, Swish is the activation function, BN is the normalization operation, γ is the preset scale coefficient, DW is the depth convolution operation, and PW is the point convolution operation.

[0071] In some other embodiments, to better integrate the core network layer of the Transformer model with the lightweight convolutional layer, an intermediate conversion module is inserted between the lightweight convolutional layer and the multi-head self-attention layer in the Transformer model to completely introduce the features extracted by the lightweight convolutional layer into the Transformer model by reconstructing the depthwise separable convolution. Specifically, the intermediate conversion module is used to perform the following operations on the feature map output by the lightweight convolutional layer: perform a point convolution operation on the feature map output by the lightweight convolutional layer within the same feature extraction module to obtain a point convolution conversion result; scale the point convolution conversion result based on the above preset scale coefficient to obtain a scaled conversion result; then, on the one hand, perform a depth convolution operation on the above scaled conversion result to obtain a depth convolution conversion result, and on the other hand, determine a difference conversion result based on the point convolution conversion result and the scaled conversion result; finally, fuse the depth convolution conversion result and the difference conversion result to obtain the feature map output by the intermediate conversion module, and this feature map will be input into the multi-head self-attention layer and the feed-forward neural network of the Transformer model in the same feature extraction module.

[0072] In some other embodiments, the intermediate conversion module can perform the operations shown in the following formula:

[0073] ;

[0074] where y is the feature map output by the lightweight convolutional layer, and Translation(y) is the feature map output by the intermediate conversion module.

[0075] Since the classification model contains multiple sequentially connected feature extraction modules, and each feature extraction module can output a feature map containing image semantics with different levels of abstraction, in order to provide richer image semantics to the classification module, the feature maps output by multiple feature extraction modules can be fused. Specifically, the scales of the feature maps corresponding to the last three feature extraction modules can be determined and used as the first feature map scale, the second feature map scale, and the third feature map scale respectively (where the first feature map scale > the second feature map scale > the third feature map scale). Subsequently, the feature maps output by the last three feature extraction modules are all converted to the first feature map scale and then fused to obtain the first fused feature map, the feature maps output by the last three feature extraction modules are all converted to the second feature map scale and then fused to obtain the second fused feature map, and at the same time, the feature maps output by the last three feature extraction modules are all converted to the third feature map scale and then fused to obtain the third fused feature map. Then, the first fused feature map, the second fused feature map, and the third fused feature map are fused to obtain the image feature representation of the input image patch.

[0076] After obtaining the importance scores of each image block, image blocks with importance scores higher than a preset threshold can be screened out from the importance scores of each image block as the second-level image blocks to be encrypted. To further improve the encryption efficiency in the encryption process, for any image block to be encrypted, the pixel value (0-255) of each pixel point in the image block to be encrypted can be obtained, and the pixel value of each pixel point is respectively converted into a binary sequence (8-bit binary sequence), and the image block to be encrypted is converted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point. Among them, any bit-plane data is composed of the binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point. For example, for the first bit, the binary numbers at the first bit in the binary sequences corresponding to the pixel values of each pixel point can be obtained and combined into the bit-plane data corresponding to the first bit. Subsequently, the information ratio of each bit-plane data of any image block to be encrypted is determined, and based on the information ratio of each bit-plane data of the image block to be encrypted, the bit-plane to be encrypted of the image block to be encrypted is determined, so as to encrypt only the bit-planes to be encrypted of each image block to be encrypted, and the encryption efficiency is accelerated by reducing the amount of data to be encrypted. Here, the bit-plane data with an information ratio higher than a preset threshold can be screened out as the bit-plane to be encrypted.

[0077] In some embodiments, the information ratio of the bit-plane data of any image block to be encrypted can be determined based on the number of bit-plane data of the image block to be encrypted and the position of the data in the bit-plane data in the binary sequence corresponding to the pixel value of each pixel point in the image block to be encrypted. Taking the bit-plane data corresponding to the i-th bit (i.e., the bit-plane data composed of the binary numbers at the i-th bit in the binary sequences corresponding to the pixel values of each pixel point) as an example, its information ratio can be calculated based on the following formula:

[0078] ;

[0079] Among them, InfRatio(i) is the information ratio of the bit-plane data corresponding to the i-th bit.

[0080] By encrypting the to-be-encrypted bit planes of each to-be-encrypted image block, the encrypted image blocks corresponding to each to-be-encrypted image block can be obtained. In some embodiments, considering that the computational complexities of encryption algorithms with different security levels are different, and the higher the security level, the higher its computational complexity. Therefore, in order to improve the encryption efficiency, the encryption algorithm for each to-be-encrypted image block can be determined based on the importance score of each to-be-encrypted image block; wherein, the higher the importance score of any to-be-encrypted image block, the higher the security level of the encryption algorithm for this to-be-encrypted image block. Subsequently, the encrypted image data corresponding to the to-be-encrypted image data is constructed based on the encrypted image blocks corresponding to each to-be-encrypted image block and the remaining image blocks in the to-be-encrypted image data, and the encrypted image data is transmitted to implement the encrypted transmission of the image data.

[0081] In summary, the method provided by the embodiments of the present invention divides the to-be-encrypted image data into multiple image blocks, determines the importance score of each image block, and determines the to-be-encrypted image blocks based on the importance scores of each image block; then for any to-be-encrypted image block, obtains the pixel value of each pixel point in this to-be-encrypted image block, converts the pixel value of each pixel point into a binary sequence, and converts this to-be-encrypted image block into multiple bit plane data based on the binary sequence corresponding to the pixel value of each pixel point, so as to determine the to-be-encrypted bit plane of this to-be-encrypted image block based on the information ratio of each bit plane data of any to-be-encrypted image block; furthermore, encrypts the to-be-encrypted bit planes of each to-be-encrypted image block to obtain the encrypted image blocks corresponding to each to-be-encrypted image block, and constructs the encrypted image data corresponding to the to-be-encrypted image data based on the encrypted image blocks corresponding to each to-be-encrypted image block and the remaining image blocks in the to-be-encrypted image data, which can improve the encryption efficiency while ensuring data security.

[0082] Next, the data encryption transmission device provided by the present invention will be described. The data encryption transmission device described below can be correspondingly referred to the data encryption transmission method described above.

[0083] Based on any of the above embodiments, Figure 3 is a schematic structural diagram of the data encryption transmission device provided by the present invention, as Figure 3 shown, the device includes:

[0084] An image division unit 310, configured to determine the to-be-encrypted image data and divide the to-be-encrypted image data into multiple image blocks; the to-be-encrypted image data is a grayscale image;

[0085] An importance evaluation unit 320, configured to determine the importance score of each image block and determine the to-be-encrypted image blocks based on the importance scores of each image block;

[0086] A bit plane determination unit 330, configured to, for any image block to be encrypted, obtain the pixel value of each pixel point in the any image block to be encrypted, convert the pixel value of each pixel point into a binary sequence, and convert the any image block to be encrypted into a plurality of bit plane data based on the binary sequences corresponding to the pixel values of each pixel point; wherein, any bit plane data is composed of binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point;

[0087] An encrypted bit determination unit 340, configured to determine the encrypted bit plane of the any image block to be encrypted based on the information ratio of each bit plane data of the any image block to be encrypted;

[0088] A data encryption unit 350, configured to encrypt the encrypted bit planes of each image block to be encrypted to obtain an encrypted image block corresponding to each image block to be encrypted, and construct an encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0089] The device provided by the embodiment of the present invention divides the image data to be encrypted into a plurality of image blocks, determines the importance scores of each image block, and determines the image blocks to be encrypted based on the importance scores of each image block; then, for any image block to be encrypted, obtains the pixel value of each pixel point in the image block to be encrypted, converts the pixel value of each pixel point into a binary sequence, and converts the image block to be encrypted into a plurality of bit plane data based on the binary sequences corresponding to the pixel values of each pixel point, so as to determine the encrypted bit plane of the image block to be encrypted based on the information ratio of each bit plane data of the any image block to be encrypted; furthermore, encrypts the encrypted bit planes of each image block to be encrypted to obtain an encrypted image block corresponding to each image block to be encrypted, and constructs an encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted, which can improve the encryption efficiency while ensuring data security.

[0090] Based on any of the above embodiments, the information ratio of any bit plane data of any image block to be encrypted is determined based on the number of bit plane data of the any image block to be encrypted and the position of the data in the any bit plane data in the binary sequences corresponding to the pixel values of each pixel point in the any image block to be encrypted.

[0091] Based on any of the above embodiments, the determining the importance scores of each image block includes:

[0092] Performing feature extraction on any image block by a plurality of feature extraction modules to obtain an image feature representation of the any image block;

[0093] Classify the image feature representation of any one of the image patches based on the classification module to obtain the probability that the preset target is included in any one of the image patches, and determine the importance score of any one of the image patches based on the probability that the preset target is included in any one of the image patches;

[0094] Among them, the first feature extraction module and the last feature extraction module are constructed based on lightweight convolutional layers, and the non-first-and-last feature extraction modules are constructed based on the lightweight convolutional layers, the multi-head self-attention layer and the feed-forward neural network in the Transformer model.

[0095] Based on any of the above embodiments, the lightweight convolutional layer is used to perform the following operations on the input feature map:

[0096] Scale the input feature map based on a preset scale factor to obtain a scaled feature map;

[0097] Determine a difference feature map based on the input feature map and the scaled feature map;

[0098] Perform a depth convolution operation on the scaled feature map to obtain a first convolution result, and perform a point convolution operation on the difference feature map to obtain a second convolution result;

[0099] Fuse the first convolution result and the second convolution result to obtain a comprehensive convolution result;

[0100] Perform normalization processing and activation processing on the comprehensive convolution result to obtain the feature map output by the lightweight convolutional layer.

[0101] Based on any of the above embodiments, the lightweight convolutional layer is used to perform the following operations on the input feature map:

[0102] Scale the input feature map based on a preset scale factor to obtain a scaled feature map;

[0103] Determine a difference feature map based on the input feature map and the scaled feature map;

[0104] Perform a depth convolution operation on the scaled feature map to obtain a first convolution result, and perform a point convolution operation on the difference feature map to obtain a second convolution result;

[0105] Fuse the first convolution result and the second convolution result to obtain a comprehensive convolution result;

[0106] Perform normalization processing and activation processing on the comprehensive convolution result to obtain the feature map output by the lightweight convolutional layer.

[0107] Based on any of the above embodiments, the feature extraction of any image block by the multiple feature extraction modules to obtain the image feature representation of the any image block includes:

[0108] Determine the feature map scales corresponding to the last three feature extraction modules as the first feature map scale, the second feature map scale, and the third feature map scale;

[0109] Convert the feature maps output by the last three feature extraction modules to the first feature map scale and then fuse them to obtain a first fused feature map;

[0110] Convert the feature maps output by the last three feature extraction modules to the second feature map scale and then fuse them to obtain a second fused feature map;

[0111] Convert the feature maps output by the last three feature extraction modules to the third feature map scale and then fuse them to obtain a third fused feature map;

[0112] Fuse the first fused feature map, the second fused feature map, and the third fused feature map to obtain the image feature representation of the any image block.

[0113] Based on any of the above embodiments, the encryption of the to-be-encrypted bit planes of each to-be-encrypted image block includes:

[0114] Determine the encryption algorithm for each to-be-encrypted image block based on the importance scores of the respective to-be-encrypted image blocks; wherein, the higher the importance score of any to-be-encrypted image block, the higher the security level of the encryption algorithm for the any to-be-encrypted image block.

[0115] Figure 4 is a schematic structural diagram of the electronic device provided by the present invention, as Figure 4As shown in the figure, the electronic device may include: a processor 410, a memory 420, a communications interface 430, and a communication bus 440. Among them, the processor 410, the memory 420, and the communication interface 430 complete communication with each other through the communication bus 440. The processor 410 may call logic instructions in the memory 420 to execute a data encryption and transmission method, which includes: determining image data to be encrypted and dividing the image data to be encrypted into multiple image blocks; the image data to be encrypted is a grayscale image; determining the importance score of each image block and determining the image blocks to be encrypted based on the importance scores of the respective image blocks; for any image block to be encrypted, obtaining the pixel value of each pixel point in the any image block to be encrypted, converting the pixel value of each pixel point into a binary sequence, and converting the any image block to be encrypted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point; wherein, any bit-plane data is composed of binary numbers at the same position in the binary sequence corresponding to the pixel value of each pixel point; determining the bit-plane to be encrypted of the any image block to be encrypted based on the information ratio of each bit-plane data of the any image block to be encrypted; encrypting the bit-planes to be encrypted of each image block to be encrypted to obtain encrypted image blocks corresponding to each image block to be encrypted, and constructing encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0116] In addition, when the logic instructions in the above-mentioned memory 420 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0117] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the data encryption and transmission method provided by each of the above methods. The method includes: determining the image data to be encrypted and dividing the image data to be encrypted into multiple image blocks; the image data to be encrypted is a grayscale image; determining the importance scores of each image block and determining the image blocks to be encrypted based on the importance scores of each image block; for any image block to be encrypted, obtaining the pixel value of each pixel point in the any image block to be encrypted, converting the pixel value of each pixel point into a binary sequence, and converting the any image block to be encrypted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point; wherein, any bit-plane data is composed of binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point; determining the bit plane to be encrypted of the any image block to be encrypted based on the information ratio of each bit-plane data of the any image block to be encrypted; encrypting the bit planes to be encrypted of each image block to be encrypted to obtain the encrypted image blocks corresponding to each image block to be encrypted, and constructing the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0118] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the data encryption and transmission method provided by each of the above. The method includes: determining the image data to be encrypted and dividing the image data to be encrypted into multiple image blocks; the image data to be encrypted is a grayscale image; determining the importance scores of each image block and determining the image blocks to be encrypted based on the importance scores of each image block; for any image block to be encrypted, obtaining the pixel value of each pixel point in the any image block to be encrypted, converting the pixel value of each pixel point into a binary sequence, and converting the any image block to be encrypted into multiple bit-plane data based on the binary sequence corresponding to the pixel value of each pixel point; wherein, any bit-plane data is composed of binary numbers at the same position in the binary sequences corresponding to the pixel values of each pixel point; determining the bit plane to be encrypted of the any image block to be encrypted based on the information ratio of each bit-plane data of the any image block to be encrypted; encrypting the bit planes to be encrypted of each image block to be encrypted to obtain the encrypted image blocks corresponding to each image block to be encrypted, and constructing the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0119] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0120] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data encryption transmission method, characterized in that: include: Determine image data to be encrypted, and divide the image data to be encrypted into a plurality of image blocks; the image data to be encrypted is a grayscale image; Determining the importance score of each image block, and determining the image block to be encrypted based on the importance score of each image block; For any image block to be encrypted, obtain the pixel value of each pixel in the image block to be encrypted, convert the pixel value of each pixel into a binary sequence, and convert the image block to be encrypted into a plurality of bit plane data based on the binary sequence corresponding to the pixel value of each pixel; wherein any bit plane data is composed of the binary number at the same position in the binary sequence corresponding to the pixel value of each pixel; Based on the information ratio of each bit plane data of any image block to be encrypted, determining the bit plane to be encrypted of any image block to be encrypted; wherein the bit plane data with an information ratio higher than a preset threshold is selected as the bit plane to be encrypted; The encrypted bit planes of each image block to be encrypted are encrypted to obtain encrypted image blocks corresponding to each image block to be encrypted, and encrypted image data corresponding to the image data to be encrypted are constructed based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

2. The data encryption transmission method according to claim 1, characterized in that: The information ratio of any bit plane data of any image block to be encrypted is determined based on the number of bit plane data of any image block to be encrypted and the position of the data in any bit plane data in the binary sequence corresponding to the pixel value of each pixel point in any image block to be encrypted.

3. The data encryption transmission method according to claim 1 or 2, characterized in that: Determining the importance score of each image block includes: Extracting features from any image block based on multiple feature extraction modules to obtain image feature representation of any image block; Classifying the image feature representation of any image block based on the classification module to obtain a probability that any image block contains a preset target, and determining an importance score of any image block based on the probability that any image block contains the preset target; Among them, the first feature extraction module and the last feature extraction module are constructed based on the lightweight convolutional layer, and the non-first and last feature extraction modules are constructed based on the lightweight convolutional layer and the multi-head self-attention layer and feedforward neural network in the Transformer model.

4. The data encryption transmission method according to claim 3, characterized in that: The light convolutional layer is used to perform the following operations on the input feature map: Scaling the input feature map based on a preset scale factor to obtain a scaled feature map; Determining a difference feature map based on the input feature map and the scaled feature map; Performing a depth convolution operation on the scaled feature map to obtain a first convolution result, and performing a point convolution operation on the difference feature map to obtain a second convolution result; Fusing the first convolution result and the second convolution result to obtain a comprehensive convolution result; The comprehensive convolution result is normalized and activated to obtain a feature map output by the lightweight convolution layer.

5. The data encryption transmission method according to claim 4, characterized in that: An intermediate conversion module is also included between the lightweight convolution layer in the non-head-tail feature extraction module and the multi-head self-attention layer in the Transformer model; The intermediate conversion module is used to perform the following operations on the feature map output by the lightweight convolutional layer: Performing a point convolution operation on the feature map output by the lightweight convolution layer to obtain a point convolution conversion result; Scaling the point convolution conversion result based on the preset scale coefficient to obtain a scaled conversion result; Performing a depth convolution operation on the scaling conversion result to obtain a depth convolution conversion result; Determining a difference conversion result based on the point convolution conversion result and the scaling conversion result; The deep convolution conversion result and the difference conversion result are fused to obtain a feature map output by the intermediate conversion module.

6. The data encryption transmission method according to claim 3, characterized in that: The step of extracting features from any image block based on multiple feature extraction modules to obtain image feature representation of any image block includes: Determine the feature map scales corresponding to the last three feature extraction modules as the first feature map scale, the second feature map scale, and the third feature map scale; The feature maps output by the last three feature extraction modules are converted to the first feature map scale and then fused to obtain a first fused feature map; The feature maps output by the last three feature extraction modules are converted into the second feature map scale and then fused to obtain a second fused feature map; The feature maps output by the last three feature extraction modules are converted to the third feature map scale and then fused to obtain a third fused feature map; The first fused feature map, the second fused feature map and the third fused feature map are fused to obtain an image feature representation of any image block.

7. The data encryption transmission method according to claim 1 or 2, characterized in that: The step of encrypting the to-be-encrypted bit planes of each to-be-encrypted image block comprises: Based on the importance score of each image block to be encrypted, an encryption algorithm for each image block to be encrypted is determined; wherein, the higher the importance score of any image block to be encrypted, the higher the security level of the encryption algorithm for the image block to be encrypted.

8. A data encryption transmission device, characterized in that: include: An image division unit, used for determining image data to be encrypted, and dividing the image data to be encrypted into a plurality of image blocks; The image data to be encrypted is a grayscale image; An importance evaluation unit, used to determine the importance score of each image block, and determine the image block to be encrypted based on the importance score of each image block; A bit plane determination unit is used to obtain, for any image block to be encrypted, a pixel value of each pixel in the image block to be encrypted, convert the pixel value of each pixel into a binary sequence, and convert the image block to be encrypted into a plurality of bit plane data based on the binary sequence corresponding to the pixel value of each pixel; wherein any bit plane data is composed of a binary number at the same position in the binary sequence corresponding to the pixel value of each pixel; A unit for determining a bit to be encrypted, used to determine a bit plane to be encrypted of any image block to be encrypted based on the information ratio of each bit plane data of any image block to be encrypted; wherein the bit plane data with an information ratio higher than a preset threshold is selected as the bit plane to be encrypted; A data encryption unit is used to encrypt the encrypted bit planes of each image block to be encrypted to obtain the encrypted image blocks corresponding to each image block to be encrypted, and to construct the encrypted image data corresponding to the image data to be encrypted based on the encrypted image blocks corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the data encryption transmission method as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data encryption transmission method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image antitheft chain method and device and electronic equipment

    CN107302706A

  • Image encryption method and system based on bit plane and readable storage medium

    CN115643001A

  • Face data encryption transmission method for terminal identity authentication

    CN115776410A