Data encryption transmission method and device

By dividing the image data to be encrypted into multiple image blocks and encrypting the data according to the importance score, the problem of inefficient data encryption in the prior art is solved, and the effect of reducing computing resource consumption while efficient encryption is achieved.

CN119728875AActive Publication Date: 2025-03-28SHANGHAI JIZHANG INFORMATION TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

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

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 each image block to be encrypted into multiple bit plane data, and determining the bit plane to be encrypted based on the information ratio of the bit plane data, and then encrypting.

Benefits of technology

While ensuring data security, it significantly improves encryption efficiency and reduces the consumption of computing resources, especially when handling large-scale data or tasks with high real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728875A_ABST
    Figure CN119728875A_ABST
Patent Text Reader

Abstract

The invention provides a data encryption transmission method and device, and the method comprises the steps: dividing to-be-encrypted image data into a plurality of image blocks, determining the importance score of each image block, and determining a to-be-encrypted image block based on the importance score of each image block; secondly, for any to-be-encrypted image block, acquiring a pixel value of each pixel point in the to-be-encrypted image block, converting the pixel value of each pixel point into a binary sequence, and converting the to-be-encrypted image block into a plurality of bit plane data based on the binary sequence corresponding to the pixel value of each pixel point; determining a to-be-encrypted bit plane of the to-be-encrypted image block based on the information proportion of each bit plane data of any to-be-encrypted image block; and the to-be-encrypted bit plane of each to-be-encrypted image block is encrypted, and the encrypted image data corresponding to the to-be-encrypted image data is constructed based on the encrypted image block corresponding to each to-be-encrypted image block and the other image blocks, so that the encryption efficiency can be improved while the data security is ensured.
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 in particular to a data encryption 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 real-time data transmitted by IoT sensors to sensitive transaction information in enterprise systems, to personal privacy files in cloud storage services, the generation and transmission of data has covered all aspects of social life. However, with the increasing mobility of data, potential security threats are increasing. In order to ensure the security of data during transmission, encryption technology is widely used to protect the confidentiality of data and prevent unauthorized access and tampering.

[0003] Existing data encryption technologies can be roughly divided into two categories: symmetric encryption and asymmetric encryption. Symmetric encryption algorithms (such as AES and DES) are widely used in 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 identity authentication and key distribution scenarios due to their superiority in key management. However, both symmetric and asymmetric encryption rely on complex mathematical operations at their core. Although complex operations improve the security of the algorithm, they also inevitably increase the computational burden and resource consumption, which exposes the problem of inefficiency in specific application scenarios.

[0004] First, the computational complexity of modern encryption algorithms is generally high. For example, large number modular exponentiation and elliptic curve calculations commonly used in asymmetric encryption are time-consuming and require high hardware performance; symmetric encryption also requires computing resources due to multiple rounds of encryption and decryption. 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 by 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 system's CPU and memory resources, 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. In the above context, 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 transmission method and device, which are used to solve the defects of low data encryption efficiency and large required computing resources in the prior art.

[0006] The present invention provides a data encryption transmission method, comprising: 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; Determining the 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; 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.

[0007] According to a data encryption 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 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.

[0008] According to a data encryption transmission method provided by the present invention, 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.

[0009] According to a data encryption transmission method provided by the present invention, the lightweight 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.

[0010] According to a data encryption transmission method provided by the present invention, 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.

[0011] According to a data encryption transmission method provided by the present invention, the feature extraction of any image block based on multiple feature extraction modules to obtain the 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.

[0012] According to a data encryption transmission method provided by the present invention, 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.

[0013] The present invention also provides a data encryption transmission device, comprising: 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 to-be-encrypted bit determination unit, configured to determine the to-be-encrypted bit plane of any to-be-encrypted image block based on the information ratio of each bit plane data of any to-be-encrypted image block; 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.

[0014] The present invention also provides 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, any of the data encryption transmission methods described above is implemented.

[0015] 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, the data encryption transmission method described in any one of the above methods is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned data encryption transmission methods.

[0017] The data encryption transmission method and device provided by the present invention divide the image data to be encrypted into multiple image blocks and 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; then, 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 multiple bit plane data based on the binary sequence corresponding to the pixel value of each pixel, 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; then, encrypt the bit plane to be encrypted of each image block to be encrypted to obtain the encrypted image block 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, so as to improve the encryption efficiency while ensuring data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flow chart of the data encryption transmission method provided by the present invention; Figure 2 is a flow chart of the importance score evaluation method provided by the present invention; Figure 3 It is a structural schematic diagram of the data encryption transmission device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] Figure 1 It is a flow chart of the data encryption transmission method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, 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; Step 120, 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; Step 130, 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; Step 140, determining the 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; Step 150, encrypt 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 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.

[0022] Here, if the received 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 the preset image size. Among them, the size of each image block is consistent with the above-mentioned preset image size. In order to improve the efficiency of the encryption link during data encryption and transmission, the importance score of each image block can be determined, and the image block to be encrypted can be determined as the subsequent encryption object based on the importance score of each image block, and other image blocks other than the image block to be encrypted may not be encrypted. Here, the more important image semantic information any image block contains, the higher the importance score of the image block, and the higher the necessity of encrypting it.

[0023] In some embodiments, Figure 2 As shown, the importance score of each image block can be determined based on the following method: Step 210, extracting features from any image block based on multiple feature extraction modules to obtain image feature representation of any image block; Step 220, classifying the image feature representation of any image block based on the classification module to obtain the probability that any image block contains the preset target, and determining the 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.

[0024] Here, the importance score of any image block is evaluated by the 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 take into account both image classification accuracy (i.e., the accuracy of determining whether the image block contains the preset target) and model reasoning efficiency. The former is to avoid classification errors that cause the encrypted image block to not be encrypted, thereby causing information leakage, while the latter is to improve the efficiency of the entire encryption link. In order to meet the requirements of image classification accuracy and model reasoning efficiency at the same time, the design of its feature extraction module is the core when building a classification model.

[0025] Specifically, the classification model includes a plurality of sequentially connected feature extraction modules and a classification module, wherein the feature extraction module is used to extract the image semantic features of the input image block to obtain the image feature representation of the image block, and the classification module is used to calculate the probability that the image block contains a preset target based on the image feature representation of the image block, thereby quantifying the importance score of the image block based on the probability that the image block contains the preset target (for example, the probability that the image block contains the preset target can be multiplied by a preset coefficient to obtain its importance score). Among 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 and the multi-head self-attention layer and feedforward 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 convolution operations that can be processed in parallel to reduce the computational complexity of the convolutional layer. The multi-head self-attention layer and feedforward neural network in the Transformer model are introduced into the middle feature extraction module, and the core network layer of the Transformer model is combined with the lightweight convolutional layer. The inductive bias advantage of the convolutional layer and the long-term dependency modeling ability of the Transformer can be combined, so that the classification model can not only pay attention to the image details in the image block, but also understand the overall structure of the entire image block, thereby improving the feature extraction ability of the classification model.

[0026] In some embodiments, the lightweight convolution 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, perform a depth convolution operation on the scaled feature map to obtain a first convolution result, and on the other hand, perform a point convolution operation on the difference feature map to obtain a second convolution result, and then fuse the first convolution result and the second convolution result to obtain a comprehensive convolution result; finally, perform normalization and activation on the comprehensive convolution result to obtain a feature map output by the lightweight convolution layer.

[0027] In some other embodiments, the light convolution layer may perform operations as shown in the following formula: ; Among them, LightCNN(x) is the feature map output by the lightweight convolution 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.

[0028] In other embodiments, in order to better combine the core network layer and the lightweight convolution layer of the Transformer model, an intermediate conversion module is inserted between the lightweight convolution layer and the multi-head self-attention layer in the Transformer model, so as to completely introduce the features extracted by the lightweight convolution layer into the Transformer model by reconstructing the depth-separable convolution. Specifically, the intermediate conversion module is used to perform the following operations on the feature map output by the lightweight convolution layer: perform a point convolution operation on the feature map output by the lightweight convolution layer in the same feature extraction module to obtain a point convolution conversion result; scale the point convolution conversion result based on the above-mentioned preset scale coefficient to obtain a scaling conversion result; then, on the one hand, perform a depth convolution operation on the above-mentioned scaling 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 scaling conversion result; finally, fuse the depth convolution conversion result and the difference conversion result to obtain a feature map output by the intermediate conversion module, which will be input into the multi-head self-attention layer and feedforward neural network of the Transformer model in the same feature extraction module.

[0029] In some other embodiments, the intermediate conversion module may perform operations as shown in the following formula: ; Among them, y is the feature map output by the lightweight convolutional layer, and Translation(y) is the feature map output by the intermediate conversion module.

[0030] Since the classification model includes multiple feature extraction modules connected in sequence, each feature extraction module can output a feature map containing image semantics of different abstraction levels. Therefore, in order to provide the classification module with richer image semantics, the feature maps output by multiple feature extraction modules can be fused. Specifically, the feature map scales corresponding to the last three feature extraction modules can be determined as the first feature map scale, the second feature map scale, and the third feature map scale (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 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 block.

[0031] After obtaining the importance scores of each image block, the image blocks with importance scores higher than a preset threshold can be selected from the importance scores of each image block as the second image block to be encrypted. In order to further improve the encryption efficiency of the encryption link, for any image block to be encrypted, the pixel value (0 to 255) of each pixel in the image block to be encrypted can be obtained, and the pixel value of each pixel can be converted into a binary sequence (8-bit binary sequence) respectively, and the image block to be encrypted can be converted into multiple bit plane data based on the binary sequence corresponding to the pixel value of each pixel. Among them, 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. For example, for the first bit, the binary array of the first bit in the binary sequence corresponding to the pixel value of each pixel can be obtained to synthesize 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 then the bit plane to be encrypted of the image block to be encrypted is determined based on the information ratio of each bit plane data of the image block to be encrypted, so that only the bit plane to be encrypted of each image block to be encrypted is 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 the preset threshold can be selected as the bit plane to be encrypted.

[0032] 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 any 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 i-th bit binary number in the binary sequence corresponding to the pixel value of each pixel point) as an example, its information ratio can be calculated based on the following formula: ; Wherein, InfRatio(i) is the information ratio of the bit plane data corresponding to the i-th bit.

[0033] By encrypting the encrypted bit planes of each image block to be encrypted, the encrypted image blocks corresponding to each image block to be encrypted can be obtained. In some embodiments, considering that the computational complexity of encryption algorithms of different security levels is different, the higher the security level, the higher the computational complexity. Therefore, in order to speed up the encryption efficiency, the encryption algorithm of each image block to be encrypted can be determined based on the importance score of each image block to be encrypted; wherein, the higher the importance score of any image block to be encrypted, the higher the security level of the encryption algorithm of the image block to be encrypted. Subsequently, the encrypted image data corresponding to the image data to be encrypted is 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, and the encrypted image data is transmitted to realize the encrypted transmission of the image data.

[0034] In summary, the method provided by the embodiment of the present invention divides the image data to be encrypted into multiple image blocks and determines the importance score of each image block, and determines the image block to be encrypted based on the importance score of each image block; then, for any image block to be encrypted, obtains the pixel value of each pixel in the image block to be encrypted, converts the pixel value of each pixel into a binary sequence, and converts the image block to be encrypted into multiple bit plane data based on the binary sequence corresponding to the pixel value of each pixel, 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; and then encrypts the bit plane to be encrypted of each image block to be encrypted to obtain the encrypted image block corresponding to each image block to be encrypted, and constructs 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, so as to improve the encryption efficiency while ensuring data security.

[0035] The data encryption transmission device provided by the present invention is described below. The data encryption transmission device described below and the data encryption transmission method described above can be referenced to each other.

[0036] Based on any of the above embodiments, Figure 3 is a schematic diagram of the structure of the data encryption transmission device provided by the present invention, such as Figure 3 As shown, the device comprises: The image division unit 310 is used to determine the 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; The importance evaluation unit 320 is 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; The bit plane determining unit 330 is used to obtain the pixel value of each pixel in any 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; The to-be-encrypted bit determination unit 340 is configured to determine the to-be-encrypted bit plane of any to-be-encrypted image block based on the information ratio of each bit plane data of any to-be-encrypted image block; The data encryption unit 350 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.

[0037] The device provided by the embodiment of the present invention divides the image data to be encrypted into multiple image blocks and determines the importance score of each image block, and determines the image block to be encrypted based on the importance score of each image block; then, for any image block to be encrypted, obtains the pixel value of each pixel in the image block to be encrypted, converts the pixel value of each pixel into a binary sequence, and converts the image block to be encrypted into multiple bit plane data based on the binary sequence corresponding to the pixel value of each pixel, thereby determining 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; then, encrypts the bit plane to be encrypted of each image block to be encrypted to obtain the encrypted image block corresponding to each image block to be encrypted, and constructs 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, so as to improve the encryption efficiency while ensuring data security.

[0038] 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 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.

[0039] Based on any of the foregoing embodiments, 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.

[0040] Based on any of the above embodiments, the lightweight 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.

[0041] Based on any of the above embodiments, the lightweight 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.

[0042] Based on any of the above embodiments, the step of extracting features from any image block based on multiple feature extraction modules to obtain an 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.

[0043] Based on any of the above embodiments, encrypting the to-be-encrypted bit planes of each to-be-encrypted image block includes: 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.

[0044] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor (processor) 410, a memory (memory) 420, a communication interface (Communications Interface) 430 and a communication bus 440, wherein the processor 410, the memory 420, and the communication interface 430 communicate with each other through the communication bus 440. The processor 410 can call the logic instructions in the memory 420 to execute the data encryption transmission method, which 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 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, obtaining the pixel value of each pixel in the image block to be encrypted, converting the pixel value of each pixel 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; 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; determining the 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; encrypting the bit plane to be encrypted of each image block to obtain the encrypted image block 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 block corresponding to each image block to be encrypted and the remaining image blocks in the image data to be encrypted.

[0045] In addition, the logic instructions in the above-mentioned memory 420 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0046] 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, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the data encryption transmission method provided by the above methods, and the method 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 block to be encrypted based on the importance score of each image block; for any image block to be encrypted, obtaining the pixel value of each pixel in the image block to be encrypted, and dividing the pixel value of each pixel The value is converted into a binary sequence, and based on the binary sequence corresponding to the pixel value of each pixel point, any image block to be encrypted is converted into multiple bit plane data; 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 point; based on the information ratio of each bit plane data of any image block to be encrypted, the bit plane to be encrypted of any image block to be encrypted is determined; the bit plane to be encrypted of each image block to be encrypted is encrypted to obtain the encrypted image block corresponding to each image block to be encrypted, and the encrypted image data corresponding to the image data to be encrypted is 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.

[0047] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned data encryption transmission method, the method comprising: 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; 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, obtaining the pixel value of each pixel in the image block to be encrypted, converting the pixel value of each pixel into a binary sequence, and based on the importance score of each pixel The binary sequence corresponding to the pixel value of each pixel point converts any image block to be encrypted into multiple bit plane data; 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 point; based on the information ratio of each bit plane data of any image block to be encrypted, the bit plane to be encrypted of any image block to be encrypted is determined; the bit plane to be encrypted of each image block to be encrypted is encrypted to obtain the encrypted image blocks corresponding to each image block to be encrypted, and the encrypted image data corresponding to the image data to be encrypted is 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.

[0048] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0049] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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.

[0050] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions 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; Determining the 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; 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 to-be-encrypted bit determination unit, configured to determine the to-be-encrypted bit plane of any to-be-encrypted image block based on the information ratio of each bit plane data of any to-be-encrypted image block; 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

  • Ciphertext reversible information hiding method based on mean value prediction

    CN116743336A

  • Image encryption method, image encryption device and electronic device

    CN117939030A

Cited By

  • Image data secure transmission method, computing device and computer storage medium

    CN121056580A