Transmission method for image carrying sensitive information and related equipment

By identifying and encrypting the areas of sensitive information in the image, the problems of resource waste and information leakage during image transmission in the prior art are solved, and efficient resource utilization and information security guarantee are achieved.

CN119544880AActive Publication Date: 2025-02-28AGRICULTURAL BANK OF CHINA
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411722186.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-28
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively protect sensitive information during image transmission, resulting in waste of resources and information leakage.

Method used

By processing the image using a preset recognition model, the area containing sensitive information in the image is identified and encrypted, and an encrypted image and corresponding encrypted information are generated for transmission.

Benefits of technology

Reduces the resources required to encrypt the image in full image, reduces resource consumption during transmission, avoids the leakage of sensitive information, and improves the security of image transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544880A_ABST
    Figure CN119544880A_ABST
Patent Text Reader

Abstract

The invention provides a transmission method for an image carrying sensitive information and related equipment, which are applied to the technical field of image transmission, and comprise the following steps: acquiring an image to be transmitted; a preset recognition model is used for processing the image, all text recognition information of the image is obtained, and the text recognition information comprises a text image area recognized in the image and text content in the text image area; based on a preset sensitive word library, determining the text recognition information with the sensitive words as sensitive information; encrypting a text image region corresponding to each piece of sensitive information in the image to obtain an encrypted image corresponding to the image; and generating encrypted information corresponding to the encrypted image, and transmitting the encrypted image and the encrypted information of the encrypted image to an image receiver. According to the scheme, the partial region in the image is encrypted, and the image does not need to be subjected to full-image encryption by using a large number of resources, so that the amount of data needing to be transmitted is small, the resources applied during transmission are reduced, and resource waste is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image transmission, and in particular to a transmission method and related equipment for images carrying sensitive information. Background Art

[0002] With the rapid development of the Internet, images have become one of the main tools for information interaction due to their intuitive and easy-to-understand characteristics. In the process of communication in offices and other fields, screenshots or photos of files are often taken to convey information. Screenshots or photos of files may be widely circulated, leading to the leakage of sensitive information and causing significant losses.

[0003] The inventors have found that in order to prevent the leakage of sensitive information during the transmission of images, the images are usually fully encrypted before transmission. Full-image encryption requires a lot of processing resources, and transmitting fully encrypted images also consumes additional resources, resulting in a waste of resources. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a transmission method and related equipment for images carrying sensitive information. By applying the solution provided by the present application, the area containing sensitive information in the image can be encrypted. The encrypted image thus obtained is a locally encrypted image. The encryption process uses fewer resources, and the encrypted image also occupies fewer resources during transmission, thereby avoiding waste of resources, avoiding leakage of sensitive information in the image, and improving the security of image transmission.

[0005] To achieve the above objectives, the present application provides the following technical solutions:

[0006] A method for transmitting an image carrying sensitive information, comprising:

[0007] Acquire the image to be transmitted;

[0008] Processing the image using a preset recognition model to obtain each text recognition information of the image, wherein the text recognition information includes a text image area recognized in the image and text content in the text image area;

[0009] Based on the preset sensitive word library, the text recognition information containing sensitive words is determined as sensitive information;

[0010] Encrypting the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image;

[0011] Generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

[0012] In the above method, optionally, the step of determining text identification information containing sensitive words as sensitive information based on a preset sensitive word library includes:

[0013] For each piece of text identification information, based on the sensitive word library, it is determined whether there is a sensitive word in the text identification information. When a sensitive word exists in the text identification information, the text identification information is determined to be sensitive information.

[0014] In the above method, optionally, encrypting the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image includes:

[0015] Get a digital key with an even number of digits;

[0016] For each sensitive information, determining a text image region in the image corresponding to the sensitive information as a target image region, and using the digital key to scramble the pixel order of the target image region to encrypt the target image region;

[0017] When each text image area corresponding to the sensitive information in the image is encrypted, an encrypted image corresponding to the image is obtained.

[0018] Optionally, the method described above uses the digital key to scramble the pixel order of the target image area to encrypt the target image area, including:

[0019] Determining a pixel processing strategy corresponding to each digit in the digital key;

[0020] Determine the number of pixels in the target image area, and determine the ranking number of each pixel in the target image area;

[0021] Determine the first number in the digital key as the target number;

[0022] Determine the first pixel point in the target image area as the target pixel point;

[0023] Processing the pixel value in the target pixel point based on the sorting number of the target pixel point and the pixel processing strategy of the target number;

[0024] Determine whether the target pixel is the last pixel in the target image area;

[0025] If the target pixel is not the last pixel in the target image area, a pixel in the target image area that is next to the target pixel is determined as a new target pixel, and then the process returns to the step of processing the pixel value in the target pixel by executing the pixel processing strategy based on the sorting number of the target pixel and the target number;

[0026] If the target pixel is the last pixel in the target image area, determining whether the target number is the last number in the digital key;

[0027] If the target number is not the last number in the digital key, a number in the digital key following the target number is determined as a new target number, and the step of returning to determine the first pixel point in the target image area as the target pixel point is executed;

[0028] If the target number is the last number in the digital key, the encryption of the target image area is completed.

[0029] In the above method, optionally, the pixel processing strategy based on the sorting number of the target pixel point and the target number, processing the pixel value in the target pixel point, includes:

[0030] Determine whether the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number;

[0031] When the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy, determining whether the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number based on the target number, the number of pixels and the sorting number of the target pixel point;

[0032] When the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number, based on the target number and the sorting number of the target pixel point, a first pixel point is determined in the target image area, and a pixel value in the target pixel point is exchanged with a pixel value of the first pixel point;

[0033] When the target pixel does not satisfy the exchange condition in the pixel processing strategy of the target number, or the digital type of the sorting number of the target pixel does not match the digital type in the pixel processing strategy of the target number, the processing of the pixel value of the target pixel is terminated.

[0034] The above method may optionally further include:

[0035] After receiving the encrypted image and the encrypted information, the image receiver decrypts the encrypted information and the encrypted image to obtain the image.

[0036] A transmission device carrying an image of sensitive information, comprising:

[0037] A first acquisition unit, used to acquire an image to be transmitted;

[0038] A second acquisition unit is used to process the image using a preset recognition model to acquire each text recognition information of the image, wherein the text recognition information includes a text image region recognized in the image and text content in the text image region;

[0039] A determination unit, configured to determine text recognition information containing sensitive words as sensitive information based on a preset sensitive word library;

[0040] An encryption unit, used for encrypting a text image region corresponding to each of the sensitive information in the image to obtain an encrypted image corresponding to the image;

[0041] A generating unit is used to generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

[0042] In the above device, optionally, the determination unit performs a process of determining text recognition information containing sensitive words as sensitive information based on a preset sensitive word library, including:

[0043] For each piece of text identification information, based on the sensitive word library, it is determined whether there is a sensitive word in the text identification information. When a sensitive word exists in the text identification information, the text identification information is determined to be sensitive information.

[0044] In the above device, optionally, the encryption unit executes a process of encrypting a text image region corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image, comprising:

[0045] Get a digital key with an even number of digits;

[0046] For each sensitive information, determining a text image region in the image corresponding to the sensitive information as a target image region, and using the digital key to scramble the pixel order of the target image region to encrypt the target image region;

[0047] When each text image area corresponding to the sensitive information in the image is encrypted, an encrypted image corresponding to the image is obtained.

[0048] In the above device, optionally, the encryption unit performs a process of using the digital key to disrupt the pixel order of the target image area to encrypt the target image area, including:

[0049] Determining a pixel processing strategy corresponding to each number in the digital key;

[0050] Determine the number of pixels in the target image area, and determine the sorting number of each pixel in the target image area;

[0051] Determine the first number in the digital key as the target number;

[0052] Determine the first pixel point in the target image area as the target pixel point;

[0053] Processing the pixel value in the target pixel point based on the sorting number of the target pixel point and the pixel processing strategy of the target number;

[0054] Determine whether the target pixel is the last pixel in the target image area;

[0055] If the target pixel is not the last pixel in the target image area, a pixel in the target image area that is next to the target pixel is determined as a new target pixel, and then the process returns to the step of processing the pixel value in the target pixel by executing the pixel processing strategy based on the sorting number of the target pixel and the target number;

[0056] If the target pixel is the last pixel in the target image area, determining whether the target number is the last number in the digital key;

[0057] If the target number is not the last number in the digital key, a number in the digital key following the target number is determined as a new target number, and the step of returning to determine the first pixel point in the target image area as the target pixel point is executed;

[0058] If the target number is the last number in the digital key, the encryption of the target image area is completed.

[0059] In the above device, optionally, the encryption unit executes a pixel processing strategy based on the sorting number of the target pixel point and the target number to process the pixel value in the target pixel point, comprising:

[0060] Determine whether the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number;

[0061] When the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy, determining whether the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number based on the target number, the number of pixels and the sorting number of the target pixel point;

[0062] When the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number, based on the target number and the sorting number of the target pixel point, a first pixel point is determined in the target image area, and a pixel value in the target pixel point is exchanged with a pixel value of the first pixel point;

[0063] When the target pixel does not satisfy the exchange condition in the pixel processing strategy of the target number, or the digital type of the sorting number of the target pixel does not match the digital type in the pixel processing strategy of the target number, the processing of the pixel value of the target pixel is terminated.

[0064] The above device may optionally further include:

[0065] A decryption unit is used to decrypt the encrypted information and the encrypted image to obtain the image after the image receiver receives the encrypted image and the encrypted information.

[0066] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned method for transmitting images carrying sensitive information.

[0067] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the above-mentioned method for transmitting images carrying sensitive information.

[0068] Compared with the prior art, this application has the following advantages:

[0069] The present application provides a transmission method and related equipment for an image carrying sensitive information, including: obtaining an image to be transmitted; processing the image using a preset recognition model to obtain various text recognition information of the image, wherein the text recognition information includes the text image area recognized in the image and the text content in the text image area; based on a preset sensitive word library, determining the text recognition information containing sensitive words as sensitive information; encrypting the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image; generating encryption information corresponding to the encrypted image, and transmitting the encrypted image and the encryption information of the encrypted image to the image receiver. This solution encrypts a part of the area in the image, and does not need to use a large amount of resources to encrypt the entire image, thereby reducing the amount of data required for transmission, thereby reducing the resources used during transmission and avoiding resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0071] Figure 1 A flow chart of a method for transmitting an image carrying sensitive information provided by an embodiment of the present application;

[0072] Figure 2 A flowchart of using a digital key to scramble the pixel order of a target image area to encrypt the target image area provided in an embodiment of the present application;

[0073] Figure 3 A flowchart of processing the pixel value in the target pixel point based on the pixel processing strategy of the sorting number and the target number of the target pixel point provided in the embodiment of the present application;

[0074] Figure 4 An image processing flow chart provided in an embodiment of the present application;

[0075] Figure 5 A schematic diagram of the structure of a transmission device for an image carrying sensitive information provided in an embodiment of the present application;

[0076] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0078] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0079] Terminology explanation:

[0080] Sensitive information: information related to national security, corporate privacy, personal privacy, etc.

[0081] Key: A string used to encrypt and decrypt images.

[0082] Natural scene text detection and recognition model: This type of model can detect the location of text in an image and recognize the content of the text. The two tasks of detection and recognition can be completed by one model, such as SwinTextSpotter; or they can be completed by multiple models in cooperation, such as PaddleOCR's text detection and text recognition.

[0083] With the rapid development of the Internet, images have become one of the main tools for information interaction due to their intuitive and easy-to-understand characteristics. In the process of communication in offices and other fields, screenshots or photos of files are often taken to convey information. Screenshots or photos of files may be widely circulated, leading to the leakage of sensitive information and causing significant losses.

[0084] Current chat software does not have the function of identifying and protecting sensitive information in images. Existing image encryption and decryption algorithms generally encrypt and decrypt the entire image, and cannot automatically identify sensitive information in the scene for local encryption and decryption, resulting in the consumption of additional resources during the transmission process.

[0085] In order to solve the above problems and the problems in the background technology, the present application provides a transmission scheme for images carrying sensitive information. In the scheme, a recognition model is used to identify and process the image, obtain each text recognition information in the image, and determine the sensitive information in each text recognition information; encrypt the text image area corresponding to each sensitive information in the image to obtain an encrypted image; generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encrypted information of the encrypted image to the image receiver. Therefore, by applying the scheme provided by the present application, partial areas in the image are encrypted, and there is no need to use a large amount of resources to encrypt the entire image, and the resources used during transmission are reduced, thereby avoiding resource waste.

[0086] The present application can be used in many general or special computing device environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc. The method provided in the present application can be applied to a processor or a server.

[0087] Reference Figure 1 , is a flow chart of a method for transmitting an image carrying sensitive information provided by an embodiment of the present application, and is specifically described as follows:

[0088] S101: Acquire an image to be transmitted.

[0089] The image to be transmitted here is an image carrying sensitive information.

[0090] The image may be an image uploaded by a user.

[0091] S102: Process the image using a preset recognition model to obtain text recognition information of the image. The text recognition information includes a text image region recognized in the image and text content in the text image region.

[0092] The recognition model provided in this application is an AI model. Preferably, the AI ​​model can be a natural scene text detection and recognition model such as SwinTextSpotter or PaddleOCR. The recognition model used in this application can recognize the text content in the image and can also recognize the area of ​​the text.

[0093] Preferably, there may be multiple locations of text in the image, and therefore, multiple text recognition information can be identified, the text recognition information including the text content identified in the image and the text image region of the text content in the image, where the text content is located.

[0094] Preferably, the text content in the text recognition information can be represented by Text, and the text image area can be represented by Area.

[0095] S103: Based on a preset sensitive word library, text recognition information containing sensitive words is determined as sensitive information.

[0096] The sensitive word library is a pre-set database, which contains multiple sensitive words.

[0097] For each text identification information, based on the sensitive word library, it is determined whether there are sensitive words in the text identification information. When there are sensitive words in the text identification information, the text identification information is determined to be sensitive information. When there are no sensitive words in the text identification information, the text identification information is not sensitive information.

[0098] Exemplarily, for each text identification information, the text content in the text identification information is segmented to obtain each segmentation of the text identification information. When there is a sensitive word identical to any segmentation in the sensitive word library, it is determined that there is a sensitive word in the text identification information, and then the text identification information is determined to be sensitive information; otherwise, it is determined that there is no sensitive word in the text identification information.

[0099] S104: Encrypt the text image region corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image.

[0100] Preferably, the text image area corresponding to each sensitive information in the image is encrypted in sequence from front to back.

[0101] The process of obtaining an encrypted image corresponding to an image is as follows: obtaining a digital key with an even number of digits; for each sensitive information, determining the text image area corresponding to the sensitive information in the image as the target image area, and using the digital key to scramble the pixel order of the target image area to encrypt the target image area; when each text image area corresponding to the sensitive information in the image is encrypted, an encrypted image corresponding to the image is obtained.

[0102] Exemplarily, the digital key includes multiple numbers, and the total number of numbers is an even number, for example, the total number of numbers may be 4, 6, 8, etc.

[0103] The pixel order of the text image area corresponding to each sensitive information in the image is disrupted, so as to encrypt the text image area corresponding to each sensitive information in the image, and then obtain an encrypted image corresponding to the image.

[0104] S105: Generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

[0105] The digital key and the information of each encrypted region in the image are encrypted using a preset encryption algorithm, thereby generating encrypted information corresponding to the encrypted image, that is, the encrypted information includes the digital key and the information of each encrypted region in the image. Exemplarily, the encryption algorithm may be an SM4 algorithm.

[0106] The encrypted image and the encrypted information are transmitted to the image receiver. Preferably, when the image receiver sets a decryption algorithm corresponding to the above-mentioned encryption algorithm, after receiving the encrypted image and the encrypted information, the image receiver decrypts the encrypted information and the encrypted image to obtain the image; preferably, the encrypted information is decrypted using the decryption algorithm to obtain the digital key and various sensitive information, and the pixel points of the text image area corresponding to each sensitive information in the encrypted image are sorted and restored to obtain the image carrying the sensitive information.

[0107] Preferably, when there is no sensitive information in the image, the image can be directly sent to the image recipient.

[0108] In the method provided in the embodiment of the present application, an image to be transmitted is obtained; the image is processed using a preset recognition model to obtain various text recognition information of the image, wherein the text recognition information includes the text image area recognized in the image and the text content in the text image area; based on a preset sensitive word library, the text recognition information containing sensitive words is determined as sensitive information; the text image area corresponding to each sensitive information in the image is encrypted to obtain an encrypted image corresponding to the image; encryption information corresponding to the encrypted image is generated, and the encrypted image and the encryption information of the encrypted image are transmitted to the image receiver. This solution encrypts partial areas in the image, and there is no need to use a large amount of resources to encrypt the entire image, thereby reducing the amount of data required for transmission, thereby reducing the resources used during transmission and avoiding resource waste.

[0109] Reference Figure 2 , which is a flowchart of using a digital key to scramble the pixel order of a target image area to encrypt the target image area according to an embodiment of the present application, and is specifically described as follows:

[0110] S201, determining a pixel processing strategy corresponding to each number in the digital key.

[0111] For a digital key, the digital key is divided into two key segments of equal number, wherein the numbers in one key segment correspond to the pixel processing strategy of odd-numbered digits of the digital type, and the numbers in the other key segment correspond to the pixel processing strategy of even-numbered digits of the digital type. For another example: the digital key is divided into two key segments of equal number, wherein the numbers in one key segment correspond to the pixel processing strategy of odd-numbered digits of the digital type, and the numbers in the other key segment correspond to the pixel processing strategy of even-numbered digits of the digital type.

[0112] Exemplarily, the digital key is 2345, and the digital key is divided into two key segments, 23 and 45; the 23 key segment corresponds to a pixel processing strategy with an odd-numbered digital type, and the 45 key segment corresponds to a pixel processing strategy with an even-numbered digital type; or, the 23 key segment corresponds to a pixel processing strategy with an even-numbered digital type, and the 45 key segment corresponds to a pixel processing strategy with an odd-numbered digital type.

[0113] S202: Determine the number of pixels in the target image area, and determine the ranking number of each pixel in the target image area.

[0114] The number of pixels in the target image area here may be the total number of pixels in the target pixel area.

[0115] Preferably, each pixel point in the target image area can be output in the form of coordinates, so that a one-dimensional array containing each pixel point in the target image area can be obtained: [p1(x1,y1),p2(x1,y2),p3(x1,y3),...,p n (x i ,y j )], where p n (x i ,y j ) represents the nth pixel in the target image area. Furthermore, n can also be regarded as the sorting number of the pixel in the target image area, and n is a positive integer.

[0116] Preferably, the sorting number of the pixel points can be regarded as the position number of the pixel points in the target image area. Further, according to the position number of each pixel point, each pixel point can be divided into a pixel point located at an odd position and a pixel point located at an even position.

[0117] S203, determining the first number in the digital key as the target number.

[0118] S204: Determine the first pixel point in the target image area as the target pixel point.

[0119] S205 , based on the sorting number of the target pixel point and the pixel processing strategy of the target number, process the pixel value in the target pixel point.

[0120] Reference Figure 3 , the pixel processing strategy based on the sorting number and target number of the target pixel point provided in the embodiment of the present application is a flowchart for processing the pixel value in the target pixel point, and the relevant description is as follows:

[0121] S301, determine whether the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number; when the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy, execute S302; when the digital type of the sorting number of the target pixel point does not match the digital type in the pixel processing strategy, execute S304.

[0122] It should be noted that the digital type in the pixel processing strategy of the target number is the parity of the target number. For example, when the target number is 2, the digital type of the pixel processing strategy of the target number is an even number; when the target number is 3, the digital type of the pixel processing strategy of the target number is an odd number.

[0123] The digital type here is one of an odd number or an even number. Further, when the digital type of the sorting number of the target pixel point is the same as the digital type in the pixel processing strategy of the target number, the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number, otherwise, the digital type of the sorting number of the target pixel point does not match the digital type in the pixel processing strategy of the target number.

[0124] For example, assuming that the target number is f and the sorting number of the target pixel point is 1, the digital type in the pixel processing strategy of the target number f is an even number, and the digital type of the sorting number of the target pixel point is an odd number, and the target pixel point is an odd-numbered pixel point. At this time, the digital type of the sorting number of the target pixel point does not match the digital type in the pixel processing strategy of the target number.

[0125] For example, assuming that the target number is f and the sorting number of the target pixel point is 2, the digital type in the pixel processing strategy of the target number f is an even number, the digital type of the sorting number of the target pixel point is an even number, and the target pixel point is an even-numbered pixel point. At this time, the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number.

[0126] S302. Based on the target number, the number of pixels and the sorting number of the target pixels, determine whether the target pixel meets the exchange condition in the pixel processing strategy of the target number; when the target pixel meets the exchange condition in the pixel processing strategy of the target number, execute S303; when the target pixel does not meet the exchange condition in the pixel processing strategy of the target number, execute S304.

[0127] Based on the target number, the number of pixels in the target image area and the sorting number of the target pixel points, determine whether the target pixel points meet the exchange conditions in the pixel processing strategy of the target number, such as: determine whether the sum of the target number and the sorting number of the target pixel points is greater than the number of pixels in the target image area; if so, determine that the target pixel points do not meet the exchange conditions in the pixel processing strategy of the target number; if not, determine that the target pixel points meet the exchange conditions in the pixel processing strategy of the target number.

[0128] For example: assuming the target number is a, the number of pixels in the target image area is n, and the sorting number of the target pixel is b, if (a+b)>n, the target pixel does not satisfy the exchange condition in the pixel processing strategy of the target number; if (a+b)≤n, the target pixel satisfies the exchange condition in the pixel processing strategy of the target number.

[0129] S303: Based on the target number and the sorting number of the target pixel point, determine the first pixel point in the target image area, and exchange the pixel value in the target pixel point with the pixel value of the first pixel point.

[0130] When determining the first pixel point, the target number is added to the sorting number of the target pixel point to obtain a numerical value, and the first pixel point is determined in the target image area according to the numerical value. Specifically, the pixel point in the target image area with the same sorting number as the numerical value is determined as the first pixel point. For example, when the target number and the sorting number of the target pixel point add up to 9, the pixel point with the sorting number of 9 in the target pixel points is determined as the first pixel point.

[0131] After the first pixel point is determined, the pixel value of the target pixel point is exchanged with the pixel value of the first pixel point. At this time, the pixel value of the target pixel point is changed.

[0132] By changing the pixel values ​​of the pixels in the target image area, the order of the pixels in the target image area is disrupted.

[0133] S304: End the processing of the pixel value of the target pixel.

[0134] It should be noted that when the target pixel does not meet the exchange condition in the pixel processing strategy of the target number, or the digital type of the sorting number of the target pixel does not match the digital type in the pixel processing strategy of the target number, the processing of the pixel value of the target pixel is terminated. At this time, the pixel value of the target pixel has not changed.

[0135] In the present application, the pixel order of the pixels in the target image area is disrupted by changing the pixel values ​​of the pixels. By changing the pixel values ​​of the pixels, the original order of the pixels in the target image area is disrupted, thereby encrypting the target image area.

[0136] S206, determine whether the target pixel is the last pixel in the target image area; if the target pixel is not the last pixel in the target image area, execute S207; if the target pixel is the last pixel in the target image area, execute S208.

[0137] S207: Determine a pixel point after the target pixel point in the target image area as a new target pixel point, and then return to step S205.

[0138] S208, determine whether the target number is the last number in the digital key; if the target number is not the last number in the digital key, execute S209; if the target number is the last number in the digital key, execute S210.

[0139] S209, determine the next digit after the target digit in the digital key as the new target digit, and return to execute step S204.

[0140] S210: Complete encryption of the target image area.

[0141] This application disrupts the order of pixels in the text image area of ​​each sensitive information according to the digital password, thereby encrypting the text image area of ​​each sensitive information, and then obtaining an encrypted image corresponding to the image, thereby realizing encryption of a local area of ​​the image without encrypting the entire image, saving image processing resources, and using fewer transmission resources when transmitting the encrypted image, avoiding resource waste. It also avoids leakage of sensitive information in the image during transmission, improving the security of image transmission.

[0142] Furthermore, after receiving the encrypted image and the encrypted information of the encrypted image, the image receiver first uses the corresponding decryption algorithm to decrypt the encrypted information to obtain the digital key and each encrypted text image area; for each encrypted text image area, the digital key is used to restore the pixels in the encrypted text image area, that is, the digital key is used to perform the same operation as the pixel in the encrypted text image area. Figure 2 The inverse process corresponding to the shown process is performed to restore the order of the pixels in the encrypted text image area, thereby obtaining the decrypted text image area; when all the encrypted text image areas are decrypted, the image can be obtained.

[0143] This application provides an example to illustrate the process of transmitting an image carrying sensitive information, which is described as follows:

[0144] Step 1: The user prepares the image to be transmitted and inputs it into a processor or server equipped with the solution provided by this application.

[0145] Step 2: The server uses an AI model to detect the text area and text information in the image. The AI ​​model can be a variety of natural scene text detection and recognition models such as SwinTextSpotter or PaddleOCR.

[0146] The area where text exists can be called a text image area. The pixels in this area can be output in the form of coordinates. Each text image area containing text in the image can be expressed as:

[0147] Area={P1,P2,...,P a}, where P a Represents the ath text image region in the image;

[0148] P a ={p a1 (x1,y1),p a2 (x1,y2),...,p an (x i ,y j )}, where p an (x i ,y j ) represents the nth pixel in the ath text image area in the image, and x and y represent the horizontal and vertical coordinates respectively.

[0149] Furthermore, the text information in each text image region can be expressed as: Text = {str1, str2, ..., str a}, where str n Represents the text information in the ath text image region in the image.

[0150] Step 3: For each text message, match the text message with the sensitive word library. If a sensitive word exists, determine the text image area corresponding to the text message as the text image area that needs to be encrypted, and store the text image area that needs to be encrypted into an array. The array is represented as follows:

[0151] Area secret ={S1,S2,...,S m}, where S m Indicates the mth text image area in the image that needs to be encrypted;

[0152] S m ={p m1 (x1,y1),p m2 (x1,y2),...,p mn (x i ,y j )}, where pmn (x i ,y j ) represents the nth pixel in the mth text image area to be encrypted in the image, and x and y represent the horizontal and vertical coordinates respectively.

[0153] Step 4: Use an encryption algorithm to encrypt the text image area where the sensitive information is located. This application will scramble the arrangement order of the pixels in the text image area to be encrypted according to the digital key, thereby encrypting the text image area to be encrypted, so that the recipient without the key will not be able to read this part of the content normally.

[0154] Preferably, the process of disrupting the order of the pixels of each text image area to be encrypted in the image is as follows:

[0155] (A) Input Area secret , set the digital key to any 4 Arabic numerals: mnqo;

[0156] (B) Traverse Area in sequence secret Each text image area in the text image area determines the number of pixels u in each text image area; when traversing Area secret When traversing the array Area from front to back, secret Each text image area in the traversal; taking the currently traversed text image area as the target image area, and performing steps (C)-(G) on the target image area;

[0157] (C) For m, for the pixel point p located in an odd position in the target image area i , if (i+m)≤u, then pixel p i and p i+m Exchange positions, if (i+m)>u, pixel p i constant;

[0158] (D) For n, for the pixel point p located in an odd position in the target image area i , if (i+n)≤u, then the pixel p i and p i+n Exchange positions; if (i+n)>u, pixel p i constant;

[0159] (E) For q, for the pixel p located in an even position in the target image area i , if (i+q)≤u, then the pixel p i and p i+q Exchange positions; if (i+q)>u, pixel p i constant;

[0160] (F) For o, for the pixel point p located in an even position in the target image area i , if (i+o)≤u, then the pixel p i and p i+o Exchange positions; if (i+o)>u, pixel p i constant;

[0161] (G) If Area secret When the traversal is completed, go to step (H); if Area secret If the traversal is not completed, the next traversed text image area is used as the new target image area, and then return to (C);

[0162] (H) Obtain the encrypted image.

[0163] Encrypt the array Area using the SM4 algorithm secret And the digital key mnqo, get the encrypted information, and send the encrypted image and the encrypted information to the image recipient.

[0164] If the image receiver has a decryption algorithm corresponding to the SM4 algorithm, it can use the decryption algorithm to decrypt the encrypted information and obtain the array Area secret and numeric key mnqo, then use the array Area secret The encrypted image can be decrypted by using the digital key to obtain the decrypted image. If the decryption algorithm corresponds to the SM4 algorithm, the undecrypted image can be directly obtained.

[0165] The decryption process is as follows:

[0166] (A) Decrypted by SM4 key to obtain Area secret and key mnqo;

[0167] (B) Traverse Area in sequence secret Each text image area in the text image area has a pixel number of u; when traversing Area secret When traversing the array Area from back to front, secret Each text image area in the traversal; taking the currently traversed text image area as the target image area, and performing steps (C)-(G) on the target image area;

[0168] (C) For o, for the pixel point p located in an even position in the target image area i , if (i+o)≤u, then the pixel p i and p i+o Exchange positions; if (i+o)>u, pixel p i constant;

[0169] (D) For q, for the pixel point p located in an even position in the target image area i , if (i+q)≤u, then the pixel p i and p i+q Exchange positions; if (i+q)>u, pixel p i constant;

[0170] (E) For n, for the pixel point p located in an odd position in the target image area i , if (i+n)≤u, then the pixel p i and p i+n Exchange positions; if (i+n)>u, pixel p i constant;

[0171] (F) For m, for the pixel point p located in an odd position in the target image area i , if (i+m)≤u, then pixel p i and p i+m Exchange positions, if (i+m)>u, pixel p i constant;

[0172] (G) If Area secret When the traversal is completed, go to step (H); if Area secret If the traversal is not completed, the next traversed text image area is used as the new target image area, and then return to (C);

[0173] (H) Obtain the decrypted image.

[0174] Further, each text image region in the image that needs to be encrypted.

[0175] Reference Figure 4 , is an image processing flow chart provided by an embodiment of the present application. As shown in the figure, an image is acquired; the text content and the area of ​​the text content in the image are detected using an AI model; each identified text content is matched with a sensitive word library to determine whether there is text content with sensitive information in each text content. If there is text content with sensitive information in each text content, the area of ​​the text content with sensitive information in the image is encrypted, and then the encrypted image is sent to the receiver; when the receiver does not have a key, the receiver acquires the encrypted image; when the receiver has a key, the encrypted image is decrypted to obtain an unencrypted image; when there is no text content with sensitive information in each text content, the image is directly sent to the receiver.

[0176] This application uses an AI model as a tool for detecting and identifying text areas in natural scenes in images. It can widely identify distorted, crooked text in various colors and fonts. It has good versatility and is suitable for most scenarios. Secondly, the present invention can automatically encrypt sensitive information image areas with the smallest impact range. On the one hand, it protects information security, and on the other hand, it enables other recipients to easily read public information. The encryption and decryption algorithm can easily protect key image information.

[0177] This application uses deep learning technology to optimize image encryption and decryption. The solution proposed in this application uses an AI model to detect and recognize text, and obtain image areas where sensitive information exists. It can effectively identify text areas in natural scenes, recognize text content, and match text content with sensitive information vocabulary. If sensitive information exists, the area where the text is located will be locally encrypted, and the order of pixel points in the text image area where sensitive information exists will be disrupted, thereby encrypting the text image area where sensitive information exists, and shuffling the pixel points in the text image area where sensitive information exists to make it unreadable. Users without keys cannot recognize the content of this area, and users with keys can decrypt this area and obtain all the information of the image, thereby avoiding the leakage of sensitive information during transmission and improving the security and reliability of transmission.

[0178] Although the present invention depicts operations in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.

[0179] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0180] The embodiment of the present application also provides a transmission device carrying sensitive information images, which is arranged in a processor or a server, and is used to support Figure 1 Specific implementation of the method shown.

[0181] Reference Figure 5 , is a schematic diagram of the structure of a transmission device carrying sensitive information images provided in an embodiment of the present application, and is specifically described as follows:

[0182] A first acquisition unit 401, used to acquire an image to be transmitted;

[0183] A second acquisition unit 402 is used to process the image using a preset recognition model to acquire each text recognition information of the image, wherein the text recognition information includes a text image region recognized in the image and text content in the text image region;

[0184] A determination unit 403 is used to determine text recognition information containing sensitive words as sensitive information based on a preset sensitive word library;

[0185] The encryption unit 404 is used to encrypt the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image;

[0186] The generating unit 405 is configured to generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

[0187] In the device provided by the embodiment of the present application, an image to be transmitted is obtained; the image is processed using a preset recognition model to obtain various text recognition information of the image, wherein the text recognition information includes the text image area recognized in the image and the text content in the text image area; based on a preset sensitive word library, the text recognition information containing sensitive words is determined as sensitive information; the text image area corresponding to each sensitive information in the image is encrypted to obtain an encrypted image corresponding to the image; encryption information corresponding to the encrypted image is generated, and the encrypted image and the encryption information of the encrypted image are transmitted to the image receiver. This solution encrypts partial areas in the image, and there is no need to use a large amount of resources to encrypt the entire image, thereby reducing the amount of data required for transmission, thereby reducing the resources used during transmission and avoiding resource waste.

[0188] In another embodiment provided by the present application, the determination unit of the device performs a process of determining text recognition information containing sensitive words as sensitive information based on a preset sensitive word library, including:

[0189] For each piece of text identification information, based on the sensitive word library, it is determined whether there is a sensitive word in the text identification information. When a sensitive word exists in the text identification information, the text identification information is determined to be sensitive information.

[0190] In another embodiment provided by the present application, the encryption unit of the device performs a process of encrypting a text image region corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image, including:

[0191] Get a digital key with an even number of digits;

[0192] For each sensitive information, determining a text image region in the image corresponding to the sensitive information as a target image region, and using the digital key to scramble the pixel order of the target image region to encrypt the target image region;

[0193] When each text image area corresponding to the sensitive information in the image is encrypted, an encrypted image corresponding to the image is obtained.

[0194] In another embodiment provided by the present application, the encryption unit of the device performs a process of using the digital key to disrupt the pixel order of the target image area to encrypt the target image area, including:

[0195] Determining a pixel processing strategy corresponding to each number in the digital key;

[0196] Determine the number of pixels in the target image area, and determine the sorting number of each pixel in the target image area;

[0197] Determine the first number in the digital key as the target number;

[0198] Determine the first pixel point in the target image area as the target pixel point;

[0199] Processing the pixel value in the target pixel point based on the sorting number of the target pixel point and the pixel processing strategy of the target number;

[0200] Determine whether the target pixel is the last pixel in the target image area;

[0201] If the target pixel is not the last pixel in the target image area, a pixel in the target image area that is next to the target pixel is determined as a new target pixel, and then the process returns to the step of processing the pixel value in the target pixel by executing the pixel processing strategy based on the sorting number of the target pixel and the target number;

[0202] If the target pixel is the last pixel in the target image area, determining whether the target number is the last number in the digital key;

[0203] If the target number is not the last number in the digital key, a number in the digital key following the target number is determined as a new target number, and the step of returning to determine the first pixel point in the target image area as the target pixel point is executed;

[0204] If the target number is the last number in the digital key, the encryption of the target image area is completed.

[0205] In another embodiment provided by the present application, the encryption unit of the device executes a pixel processing strategy based on the sorting number of the target pixel point and the target number to process the pixel value in the target pixel point, including:

[0206] Determine whether the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number;

[0207] When the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy, determining whether the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number based on the target number, the number of pixels and the sorting number of the target pixel point;

[0208] When the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number, based on the target number and the sorting number of the target pixel point, a first pixel point is determined in the target image area, and a pixel value in the target pixel point is exchanged with a pixel value of the first pixel point;

[0209] When the target pixel does not satisfy the exchange condition in the pixel processing strategy of the target number, or the digital type of the sorting number of the target pixel does not match the digital type in the pixel processing strategy of the target number, the processing of the pixel value of the target pixel is terminated.

[0210] In another embodiment provided by the present application, the device further includes:

[0211] A decryption unit is used to decrypt the encrypted information and the encrypted image to obtain the image after the image receiver receives the encrypted image and the encrypted information.

[0212] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned method for transmitting images carrying sensitive information.

[0213] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the following operations:

[0214] Acquire the image to be transmitted;

[0215] Processing the image using a preset recognition model to obtain each text recognition information of the image, wherein the text recognition information includes a text image area recognized in the image and text content in the text image area;

[0216] Based on the preset sensitive word library, the text recognition information containing sensitive words is determined as sensitive information;

[0217] Encrypting the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image;

[0218] Generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

[0219] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards in the relevant regions.

[0220] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.

[0221] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, 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 creative work.

[0222] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0223] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for transmitting an image carrying sensitive information, characterized in that: include: Acquire the image to be transmitted; Processing the image using a preset recognition model to obtain each text recognition information of the image, wherein the text recognition information includes a text image area recognized in the image and text content in the text image area; Based on the preset sensitive word library, the text recognition information containing sensitive words is determined as sensitive information; Encrypting the text image area corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image; Generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

2. The method according to claim 1, characterized in that The step of determining text identification information containing sensitive words as sensitive information based on a preset sensitive word library includes: For each piece of text identification information, based on the sensitive word library, it is determined whether there is a sensitive word in the text identification information. When a sensitive word exists in the text identification information, the text identification information is determined to be sensitive information.

3. The method according to claim 1, characterized in that The step of encrypting the text image region corresponding to each sensitive information in the image to obtain an encrypted image corresponding to the image includes: Get a digital key with an even number of digits; For each sensitive information, determining a text image region in the image corresponding to the sensitive information as a target image region, and using the digital key to scramble the pixel order of the target image region to encrypt the target image region; When each text image area corresponding to the sensitive information in the image is encrypted, an encrypted image corresponding to the image is obtained.

4. The method according to claim 3, characterized in that The step of using the digital key to disrupt the pixel order of the target image area to encrypt the target image area includes: Determining a pixel processing strategy corresponding to each digit in the digital key; Determine the number of pixels in the target image area, and determine the ranking number of each pixel in the target image area; Determine the first number in the digital key as the target number; Determine the first pixel point in the target image area as the target pixel point; Processing the pixel value in the target pixel point based on the sorting number of the target pixel point and the pixel processing strategy of the target number; Determine whether the target pixel is the last pixel in the target image area; If the target pixel is not the last pixel in the target image area, a pixel in the target image area that is next to the target pixel is determined as a new target pixel, and then the process returns to the step of processing the pixel value in the target pixel by executing the pixel processing strategy based on the sorting number of the target pixel and the target number; If the target pixel is the last pixel in the target image area, determining whether the target number is the last number in the digital key; If the target number is not the last number in the digital key, a number in the digital key following the target number is determined as a new target number, and the step of returning to determine the first pixel point in the target image area as the target pixel point is executed; If the target number is the last number in the digital key, the encryption of the target image area is completed.

5. The method according to claim 4, characterized in that The pixel processing strategy based on the sorting number of the target pixel point and the target number, processing the pixel value in the target pixel point, includes: Determine whether the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy of the target number; When the digital type of the sorting number of the target pixel point matches the digital type in the pixel processing strategy, determining whether the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number based on the target number, the number of pixels and the sorting number of the target pixel point; When the target pixel point satisfies the exchange condition in the pixel processing strategy of the target number, based on the target number and the sorting number of the target pixel point, a first pixel point is determined in the target image area, and a pixel value in the target pixel point is exchanged with a pixel value of the first pixel point; When the target pixel does not satisfy the exchange condition in the pixel processing strategy of the target number, or the digital type of the sorting number of the target pixel does not match the digital type in the pixel processing strategy of the target number, the processing of the pixel value of the target pixel is terminated.

6. The method according to claim 1, characterized in that Also includes: After receiving the encrypted image and the encrypted information, the image receiver decrypts the encrypted information and the encrypted image to obtain the image.

7. A transmission device carrying an image of sensitive information, characterized in that: include: A first acquisition unit, used to acquire an image to be transmitted; A second acquisition unit is used to process the image using a preset recognition model to acquire each text recognition information of the image, wherein the text recognition information includes a text image region recognized in the image and text content in the text image region; A determination unit, configured to determine text recognition information containing sensitive words as sensitive information based on a preset sensitive word library; An encryption unit, used for encrypting a text image region corresponding to each of the sensitive information in the image to obtain an encrypted image corresponding to the image; A generating unit is used to generate encryption information corresponding to the encrypted image, and transmit the encrypted image and the encryption information of the encrypted image to an image receiver.

8. The device according to claim 7, characterized in that The determination unit performs a process of determining text recognition information containing sensitive words as sensitive information based on a preset sensitive word library, including: For each piece of text identification information, based on the sensitive word library, it is determined whether there is a sensitive word in the text identification information. When a sensitive word exists in the text identification information, the text identification information is determined to be sensitive information.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the method for transmitting images carrying sensitive information as described in any one of claims 1-6.

10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the method for transmitting images carrying sensitive information as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Image encryption method and device, image decryption method and device, electronic equipment and storage medium

    CN112035847A

  • Privacy protection method based on medical image

    CN113889232A

  • Information processing method and device, computer equipment and storage medium

    CN114329030A

  • Image acquisition synchronization information encryption and use end decryption restoration method

    CN114374773A

  • Image information desensitization method and device, equipment and storage medium

    CN117390681A