WO2023142440A1 - 一种图像加密、图像处理方法、装置、设备及介质 - Google Patents

一种图像加密、图像处理方法、装置、设备及介质 Download PDF

Info

Publication number
WO2023142440A1
WO2023142440A1 PCT/CN2022/112618 CN2022112618W WO2023142440A1 WO 2023142440 A1 WO2023142440 A1 WO 2023142440A1 CN 2022112618 W CN2022112618 W CN 2022112618W WO 2023142440 A1 WO2023142440 A1 WO 2023142440A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
image
pixel
sub
original image
Prior art date
Application number
PCT/CN2022/112618
Other languages
English (en)
French (fr)
Inventor
王琪
周雍恺
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2023142440A1 publication Critical patent/WO2023142440A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0407Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Definitions

  • the present application relates to the technical field of data transmission, and in particular to an image encryption and image processing method, device, equipment and medium.
  • the biometric technology for identification based on images containing users has been widely used in many scenarios such as finance, security, e-commerce, etc. Bind the face information with the bank card information.
  • the image acquisition device first collects an image containing the user, and sends the image containing the user and the generated password information to the target device, where the target device can be a card issuing device.
  • the card-issuing bank system performs face verification based on the image containing the user and the password information. If the verification is passed, the face information in the image containing the user is bound to the corresponding bank card, or it is determined that the user has Permissions can handle corresponding tasks based on the corresponding bank card, as shown in Figure 1.
  • HTTPS Hypertext Transfer Protocol Secure
  • TCP Transmission Control Protocol
  • TLS Transport Layer Security
  • the present application provides an image encryption, image processing method, device, equipment and medium, which are used to solve the problem in the prior art that the privacy protection of images including users is not high and affects user experience.
  • the application provides an image encryption method, the method comprising:
  • the pixel values corresponding to the pixel points in the original image containing the user are processed to obtain a plurality of processed first target images, wherein the multiple first target images can obtain the original image;
  • Each encrypted first target image is sent to each corresponding target device.
  • the pixel values corresponding to the pixels in the original image including the user are processed, and the processed first target images include:
  • the processed pixel value of the corresponding pixel in each processed first target image is determined.
  • splitting the pixel value into the number of sub-pixel values according to the number of target devices to receive the image includes:
  • the determining the processed pixel value of the corresponding pixel in each first target image after processing according to the number of sub-pixel values corresponding to each pixel includes:
  • the pixel values corresponding to the pixels in the original image including the user are processed, and the processed first target images include:
  • For each sub-image set the pixel values of other pixels in the original image other than the pixels included in the sub-original image as preset pixel values to obtain a processed first target image corresponding to the sub-image.
  • dividing the original image into the number of sub-images includes:
  • the step of setting pixel values of pixels other than the pixels included in the sub-original image in the original image as preset pixel values to obtain the processed first target image corresponding to the sub-image includes:
  • the method further includes:
  • the quantity of the target device dividing the target key into the number of target subkeys, wherein the number of target subkeys can be spliced into the target key;
  • Said sending the encrypted first target image to each target device includes:
  • the encrypted first target image and the encrypted target subkey are respectively sent to each corresponding target device.
  • the present application provides an image processing method applied to a target device, the method comprising:
  • the pixel values corresponding to the pixel points in each target image are processed to obtain the original image.
  • the method also includes:
  • the original image is input into the pre-trained feature extraction model, and the corresponding feature vector of the original image is obtained and saved.
  • the inputting the original image into the pre-trained feature extraction model, and obtaining the feature vector corresponding to the original image includes:
  • the method also includes:
  • the model performs feature extraction on the received third target image to obtain a feature vector corresponding to the third target image.
  • the method further includes:
  • the feature vector is divided into the number of sub-feature vectors, any sub-feature vector of the number of sub-feature vectors is saved, and other sub-feature vectors are sent to the other targets respectively. equipment, and
  • the sub-feature vectors sent by the other target devices are received and stored.
  • the method further includes:
  • the target verification information is generated by the other target device according to the identification information and attribute information of the other target device itself;
  • said obtaining the target key includes:
  • the method before receiving the decrypted target sub-private key sent by the other target device, the method further includes:
  • the other target devices For each of the other target devices, generate a target public-private key pair, and send the target public key in the target public-private key pair to the other target devices, so that the other target devices are encrypted based on the private key pair After the target sub-private key is decrypted, the decrypted target sub-private key is encrypted based on the target public key;
  • the method After receiving the decrypted target sub-private key sent by the other target device, before splicing each received decrypted target sub-private key, the method further includes:
  • processing the pixel values corresponding to the pixel points in each target image to obtain the original image includes:
  • the sum of the pixel values of the pixel in each target image is determined as the corresponding pixel value of the pixel in the original image.
  • said determining the pixel value and value of the pixel in each target image as the pixel value corresponding to the pixel in the original image includes:
  • the sum value of the pixel value corresponding to the pixel point of each target image in the pixel matrix corresponding to the channel determined as the pixel value corresponding to the pixel in the channel of the original image.
  • processing the pixel values corresponding to the pixel points in each target image to obtain the original image includes:
  • the target pixel whose pixel value in the target image is not a preset pixel value determines the target pixel whose pixel value in the target image is not a preset pixel value; set the pixel value of the target pixel in the original image as the corresponding target pixel in the target image The pixel value of the point gets the original image.
  • the determination of target pixels whose pixel values in the target image are not preset pixel values includes:
  • each pixel in each target image on each preset channel determine whether the pixel value of the pixel in the target image on the channel is a non-preset pixel value, and if so, determine the pixel is the target pixel on the channel;
  • Said setting the pixel value of the target pixel in the original image as the pixel value of the corresponding target pixel in the target image to obtain the original image includes:
  • the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • the present application also provides an image encryption device, which includes:
  • the first acquisition module is used to process the pixel values corresponding to the pixels in the original image containing the user according to the number of target devices to receive the image, and obtain a plurality of processed first target images, wherein the plurality of first The target image can obtain the original image;
  • An encryption module configured to encrypt each of the first target images with a target key
  • the first sending module is configured to send each encrypted first target image to each corresponding target device.
  • the first acquisition module is specifically configured to split the pixel value of each pixel in the original image into the number of sub-pixels according to the number of target devices to receive the image value, wherein the sum of the number of sub-pixel values is the pixel value; according to the number of sub-pixel values corresponding to each pixel, determine the processed pixel value of the corresponding pixel in each first target image after processing .
  • the first acquisition module is specifically configured to determine the pixel matrix corresponding to each preset channel of the original image, wherein each element in the pixel matrix is each pixel point on the corresponding channel Corresponding pixel value; for each pixel value in the pixel matrix corresponding to each channel, according to the number of target devices to receive the image, split the pixel value in the pixel matrix corresponding to the channel into the number of sub-pixels value, wherein the sum of the number of sub-pixel values is the pixel value in the pixel matrix corresponding to the channel; according to the number of sub-pixel values corresponding to each pixel in the pixel matrix corresponding to each channel, determine the processed Each channel corresponds to the processed pixel value of the corresponding pixel in each first target image.
  • the first acquisition module is specifically configured to divide the original image into the number of sub-images according to the number of target devices to receive the image; for each sub-image, divide the sub-image in the original image
  • the pixel values of other pixel points other than the pixel points included in the original image are set to preset pixel values to obtain a processed first target image corresponding to the sub-image.
  • the first acquisition module is specifically configured to determine the second target image corresponding to the original image on each preset channel; for the second target image corresponding to each channel, according to the image to be received The number of target devices, divide the corresponding second target image on the channel into the number of sub-images; for each sub-image corresponding to the second target image on each channel, divide the corresponding second target image on the channel The pixel values of other pixel points other than the pixel points included in the sub-image in the image are set to preset pixel values, and the processed first target image corresponding to the sub-image of the second target image on the channel is obtained.
  • the device also includes:
  • a splitting module configured to split the target key into the number of target subkeys according to the number of target devices, wherein the number of target subkeys can be spliced into the target key ;
  • the encryption module is further configured to respectively encrypt the number of target subkeys according to the received public key sent by each target device;
  • the first sending module is specifically configured to send the encrypted first target image and the encrypted target subkey to each corresponding target device.
  • the present application also provides an image processing device, which includes:
  • a receiving module configured to receive the encrypted first target image sent by the electronic device
  • a processing module configured to send an image acquisition instruction to other target devices; receive other encrypted first target images sent by the other target devices;
  • the second acquisition module is used to obtain a target key, and based on the target key, decrypt the received first target image and every other first target image to obtain each target image; for each target The pixel values corresponding to the pixel points in the image are processed to obtain the original image.
  • the second acquisition module is also used to input the original image into the pre-trained feature extraction model, obtain and save the feature vector corresponding to the original image.
  • the second obtaining module is specifically configured to process pixel values corresponding to pixel points in the original image to obtain multiple third target images, wherein the multiple third target images can obtain the original image Determining any third target image in the plurality of third target images as the fourth target image; performing feature vector extraction on the fourth target image based on the pre-trained feature extraction model to obtain the The feature vector corresponding to the fourth target image.
  • the device also includes:
  • the second sending module is further configured to divide the feature vector into the number of sub-feature vectors according to the number of the target devices, and save any one of the number of sub-feature vectors, and sending other sub-feature vectors to the other target devices respectively, and receiving and storing the sub-feature vectors sent by the other target devices.
  • the device also includes:
  • the verification module is configured to receive the target verification information sent by the other target devices, and determine that the other target devices are credible if there is standard verification information consistent with the target verification information in the standard verification information of each device saved in advance by itself. ; Wherein, the target verification information is generated by the other target device according to the identification information and attribute information of the other target device itself; if the other target devices are all credible, trigger the processing module.
  • the second acquisition module is configured to receive the encrypted target subkey sent by the electronic device, decrypt the encrypted target subkey based on the private key, and receive the encrypted target subkey from the other target device. Sending the decrypted target sub-private key; splicing each received decrypted target sub-private key to generate a target key.
  • the second sending module is further configured to generate a target public-private key pair for each of the other target devices, and send the target public key in the target public-private key pair to the other target devices, so that After the other target device decrypts the encrypted target sub-private key based on the private key, encrypts the decrypted target sub-private key based on the target public key;
  • the device also includes:
  • a decryption module configured to decrypt the received encrypted target sub-private key based on the target private key in the target public-private key pair.
  • the second acquiring module is specifically configured to determine the pixel value and value of the pixel in each target image as the pixel value of the pixel in each target image as the pixel value of the pixel in the original image The pixel value corresponding to the pixel point.
  • the second acquisition module is specifically configured to, for the pixel value corresponding to each pixel point of each target image in the preset pixel matrix corresponding to each channel, convert each target image to the pixel value corresponding to the channel The sum of the pixel values corresponding to the pixel point in the pixel matrix is determined as the pixel value corresponding to the pixel point in the channel of the original image.
  • the second acquisition module is specifically configured to, for any target image, determine target pixels whose pixel values in the target image are not preset pixel values; The pixel value of the point is set to the pixel value of the corresponding target pixel point in the target image to obtain the original image.
  • the second acquisition module is specifically configured to determine whether the pixel value of the pixel in the target image on the channel is an unpreset value according to each pixel in each target image on each preset channel. Set the pixel value, if so, then determine this pixel point as the target pixel point on the channel; the pixel value of the target pixel point in the channel of the original image is set as the sub-image corresponding to the target image on the channel. The pixel value of the target pixel in each channel; the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • the present application also provides an electronic device, the electronic device includes a processor, and the processor is configured to implement the steps of any one of the image encryption methods described above when executing the computer program stored in the memory.
  • the present application also provides a computer-readable storage medium, which stores a computer program that can be executed by a terminal, and when the program is run on the terminal, the terminal executes any of the image encryption methods described above. step.
  • the present application also provides an electronic device, the electronic device includes a processor, and the processor is configured to implement the steps of any one of the above image processing methods when executing the computer program stored in the memory.
  • the present application also provides a computer-readable storage medium, which stores a computer program executable by a terminal, and when the program runs on the terminal, the terminal executes any one of the image processing methods described above. step.
  • the pixel values corresponding to the pixels in the original image containing the user are processed to obtain a plurality of processed first target images, wherein the plurality of first The original image can be obtained from the target image, each first target image is encrypted by using the target key, and each encrypted first target image is sent to each corresponding target device.
  • each of the multiple first target images is obtained after processing the pixels corresponding to the pixels in the original image, the pixels contained in each first target image The corresponding pixel value is not exactly the same as the pixel value corresponding to the corresponding pixel point in the original image, and since the multiple first target images are respectively sent to the corresponding target device after obtaining multiple first target images, therefore, Regardless of whether the attack is carried out during the process of sending the first target image, or the target device storing the first target image is attacked, it is impossible to obtain the original image based on a single first target image, which ensures the integrity of image transmission and storage. Security protects user privacy and improves user experience.
  • Figure 1 is a schematic diagram of the process of binding a bank card based on face recognition and handling business in the prior art
  • FIG. 2 is a schematic diagram of an image encryption process provided by an embodiment of the present application.
  • Fig. 3a is a schematic diagram of an original image provided by some embodiments of the present application.
  • Fig. 3b is a schematic diagram of a pixel matrix corresponding to each preset channel of an original image provided by some embodiments of the present application;
  • Fig. 4a is a schematic diagram of an original image provided by some embodiments of the present application.
  • Fig. 4b is a schematic diagram of a first target image determined based on the original image provided by some embodiments of the present application.
  • FIG. 5 is a schematic diagram of an image processing process provided by some embodiments of the present application.
  • Fig. 6a is a schematic diagram of an original image provided by some embodiments of the present application.
  • Figure 6b is a schematic diagram of a third target image obtained after processing the pixel values corresponding to the pixel points in the original image provided by some embodiments of the present application;
  • Fig. 6c is another schematic diagram of a third target image obtained after processing the pixel values corresponding to the pixel points in the original image provided by some embodiments of the present application;
  • Fig. 7a is a schematic diagram before segmentation of a feature vector provided by some embodiments of the present application.
  • Fig. 7b is a schematic diagram after segmentation of a feature vector provided by some embodiments of the present application.
  • Fig. 7c is a schematic diagram after segmentation of another feature vector provided by some embodiments of the present application.
  • Fig. 8a is a schematic diagram of the process of image recognition based on MPC in the related art including the feature vector corresponding to the user's original image;
  • Fig. 8b is a schematic diagram of a process of identifying a feature vector corresponding to an original image including a user provided by some embodiments of the present application;
  • FIG. 9 is a schematic structural diagram of an image encryption device provided by some embodiments of the present application.
  • FIG. 10 is a schematic structural diagram of an image processing device provided by some embodiments of the present application.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by some embodiments of the present application.
  • Fig. 12 is a schematic structural diagram of an electronic device provided by some embodiments of the present application.
  • the pixel values corresponding to the pixels in the original image containing the user are processed to obtain a plurality of processed first target images, among which the plurality of first
  • the original image can be obtained from the target image
  • each first target image is encrypted by using the target key
  • each encrypted first target image is sent to each corresponding target device.
  • the embodiments of this application provide an image encryption and image processing method, device, equipment and medium.
  • FIG. 2 is a schematic diagram of an image encryption process provided by an embodiment of the present application, and the process includes the following steps:
  • S201 According to the number of target devices to receive images, process the pixel values corresponding to the pixels in the original image containing the user to obtain a plurality of processed first target images, wherein the multiple first target images can be obtained Describe the original image.
  • the image encryption method provided in the embodiment of the present application is applied to an electronic device, and the electronic device may be a device such as a smart terminal, a PC, or a server.
  • the electronic device obtains the original image containing the user, wherein, if the electronic device is pre-installed with an image acquisition device, the original image can be collected by the image acquisition device of the electronic device, and if the electronic device is not installed with an image Acquisition equipment, the original image can also be sent to electronic equipment after being collected by other image acquisition equipment.
  • the user in order to encrypt the image, the user first needs to log in to the electronic device, and only authorized users can obtain the original image and encrypt the original image. Specifically, the user can verify the identity information based on the application program on the electronic device. If the application program receives the verification information carrying the identity information, it uses the pre-saved target user identity information to compare with the received identity information. If the identity information of the target user is consistent with the identity information, it is determined that the verification is passed, and the application program sends an image acquisition instruction to the image acquisition device, so that the image acquisition device collects the original image containing the user and sends it to the application to allow the application to obtain an image containing the user.
  • the user's identity information may include at least one of the user's mobile phone number, name, user name, ID card information, and the like.
  • the electronic device can process the pixel value corresponding to the pixel in the original image containing the user according to the number of target devices to receive the image , to obtain a plurality of first target images.
  • the target device of the image to be received is the target device that has received the first target image, and the more the target device is, the pixel value corresponding to the pixel in the original image is processed, and the first target image obtained
  • the number is also more.
  • several target devices only need to acquire several first target images.
  • each first target image processes the pixel values of some pixels in the original image, so combining the first target images obtained by each target device will obtain the original image.
  • S202 Encrypt each of the first target images by using a target key.
  • each first target image is encrypted with a target key, wherein the target key can be generated by the electronic device itself, and for the convenience of subsequent target devices, the The encrypted first target image is decrypted to obtain the decrypted first target image, and the target key may also be sent to the electronic device by the target device.
  • the target key used for encrypting each first target image may be the same or different.
  • the electronic device If the target key is generated by the electronic device itself, in order to ensure that the target device can subsequently decrypt the encrypted first target image, the electronic device also needs to send the target key to the target device, and in order to reduce the workload of the electronic device , if the target key is generated by the electronic device itself, the electronic device may only generate one target key, and encrypt each first target image based on the generated one target key.
  • S203 Send each encrypted first target image to each corresponding target device.
  • each encrypted first target image is sent to each corresponding target device.
  • the device encrypts the first target image with the target key sent by the target device, and sends the first target image encrypted based on the target key sent by the target device to the target device.
  • the target key for encrypting multiple first target images is generated by an electronic device, therefore, the target key for encrypting each first target image is the same, then the To send each encrypted first target image to each corresponding target device, it only needs to ensure that at least one encrypted first target image is sent to one target device.
  • each of the multiple first target images is obtained after processing the pixels corresponding to the pixels in the original image, the pixels contained in each first target image The corresponding pixel value is not exactly the same as the pixel value corresponding to the corresponding pixel point in the original image, and since the multiple first target images are respectively sent to the corresponding target device after obtaining multiple first target images, therefore, Regardless of whether the attack is carried out during the process of sending the first target image, or the target device storing the first target image is attacked, it is impossible to obtain the original image based on a single first target image, which ensures the integrity of image transmission and storage. Security protects user privacy and improves user experience.
  • a plurality of first target images obtained after processing include:
  • the processed pixel value of the corresponding pixel in each processed first target image is determined.
  • the pixel value of each pixel in the original image may be calculated according to the number of target devices to receive the image. split into the number of sub-pixel values, wherein the sum of the number of sub-pixel values is the pixel value. For example, if the number of target devices to receive the image is 4, for the pixel value of each pixel in the original image, the pixel value is split into 4 sub-pixel values.
  • each sub-pixel value in the number of sub-pixel values is not limited, and can be any value in [0, 255], but the sum of the number of sub-pixel values should be equal to the pixel value, and the pixel value is generally divided at will. Points can ensure the security of the image.
  • any sub-pixel value is used as the pixel value of a corresponding pixel point on any first target image,
  • each processed first target image is obtained.
  • the pixel value of the pixel can be split into the number of sub-pixel values, therefore, for each pixel in each first target image, the first target image
  • the pixel value of this pixel can be any one of multiple sub-pixel values corresponding to this pixel, but the sub-pixel values corresponding to this pixel in different first target images are different, as long as the number of sub-pixels of a pixel is guaranteed
  • Each sub-pixel value is the processed pixel value of the corresponding pixel in each first target image, that is, the sum of the processed pixel values of the corresponding pixel in each first target image is the corresponding pixel in the original image The pixel value of the point.
  • the two pixels are pixel A and pixel B respectively, the pixel value corresponding to pixel A is 255, and the pixel value corresponding to pixel B is 60.
  • the number of target devices receiving the image is 3, then the pixel value 255 corresponding to the pixel point A is split into 3 sub-pixel values, and the sum of the 3 sub-pixel values of the pixel point A is 255, for example, it can be respectively 20, 30, and 205, or 50, 55, and 150, and so on.
  • the pixel value corresponding to pixel A is 255
  • the three sub-pixel values after splitting are 20, 30, and 205 respectively
  • the pixel value corresponding to pixel point B is 60
  • the three sub-pixel values after splitting are 10, 24, and 26 respectively.
  • the three first target images are respectively referred to as the first target image 1, the first target image 2 and the first target image 3, then the pixels corresponding to the pixel point A and the pixel point B in the first target image 1
  • the values can be 20 and 10, the pixel values corresponding to pixel A and pixel B in the second target image 2 can be 30 and 24, and the pixel values corresponding to pixel A and pixel B in the second target image 3 can be are 205 and 26; or, the pixel values corresponding to pixel A and pixel B in the first target image 1 can also be 20 and 24, and the pixel values corresponding to pixel A and pixel B in the second target image 2 It can also be 30 and 10, and the pixel values corresponding to pixel A and pixel B in the second target image 3 can also be 205 and 26; or, the pixel values corresponding to pixel A and pixel B in the first target image 1
  • the pixel values can also be 30 and 26, the pixel values corresponding to pixel A and pixel B in the second target image 2 can be
  • the pixel value of each pixel in the original image is based on the To the number of devices the image is targeted for, splitting that pixel value into that number of sub-pixel values includes:
  • the determining the processed pixel value of the corresponding pixel in each first target image after processing according to the number of sub-pixel values corresponding to each pixel includes:
  • segmentation can be performed directly based on the pixel values corresponding to each pixel in the original image. Since each pixel in the original image corresponds to a pixel value in each preset channel, therefore, If for each pixel value corresponding to each preset channel of each pixel in the original image, the pixel value corresponding to each preset channel of the pixel is split, more security can be ensured .
  • the original image is generally an RGB image, so the preset channels are generally R channel, G channel and B channel.
  • the original image has a pixel matrix corresponding to each preset channel, where one channel corresponds to a pixel matrix, and each element in the pixel matrix is each corresponding pixel point in the corresponding channel pixel value on .
  • the channel After determining the pixel matrix corresponding to each channel, in order to obtain multiple first target images, for each pixel value in the pixel matrix corresponding to each channel, according to the number of target devices to receive images, the channel The pixel value in the corresponding pixel matrix is split into the number of sub-pixel values, wherein the sum of the number of sub-pixel values is the pixel value in the pixel matrix corresponding to the channel, wherein each sub-pixel value in the number of sub-pixel values There is no limit to the size of , which can be any value in [0,255], but the sum of the sub-pixel values of this number should be equal to the pixel value in the pixel matrix corresponding to this channel.
  • each first target image corresponding to each channel after processing is determined.
  • each pixel value in the pixel matrix corresponding to each channel can be split into multiple sub-pixel values, therefore, for each pixel in each first target image corresponding to each channel,
  • the pixel in the first target image corresponding to the channel may be any one of multiple sub-pixel values, but the sub-pixel values corresponding to the pixel in different first target images corresponding to the channel are different.
  • Fig. 3a is a schematic diagram of an original image provided by some embodiments of the present application
  • Fig. 3b is a schematic diagram of a pixel matrix corresponding to each preset channel of an original image provided by some embodiments of the present application, now for Fig. 3a and Figure 3b for illustration.
  • the original image is an RGB image, as shown in Figure 3a, the original image corresponds to a N*M*3 pixel matrix, where N is the number of pixels contained in the length direction of the original image, and M is the width of the original image
  • N is the number of pixels contained in the length direction of the original image
  • M is the width of the original image
  • the number of pixels included in the direction, 3 is the number of channels, which are R channel, G channel and B channel.
  • Each channel corresponds to a pixel matrix, and for the pixel matrix corresponding to each channel, the pixel matrix corresponding to the channel is an N*M pixel matrix, as shown in Figure 3b, the pixel matrix corresponding to the R channel is The pixel matrix corresponding to the G channel is The pixel matrix corresponding to the B channel is
  • the pixel corresponding to the pixel in the original image containing the user The value is processed, and the obtained multiple first target images after processing include:
  • For each sub-image set the pixel values of other pixels in the original image other than the pixels included in the sub-original image as preset pixel values to obtain a processed first target image corresponding to the sub-image.
  • the original image in order to obtain a plurality of first target images capable of obtaining the original image, the original image may be divided into the number of sub-images according to the number of target devices to receive the image, wherein each sub-image is located at The positions in the original image are all different, and the number of sub-images can be spliced into the original image.
  • the pixel values of other pixels in the original image other than the pixels contained in the sub-original image can be set as preset pixel values , to obtain the processed first target image corresponding to the sub-image.
  • the preset pixel value can be 0, or 255, or other pixel values, etc.
  • the preset pixel value can be set according to requirements.
  • the upper half of the original image may be determined as a sub-image, and the lower half of the original image may be determined as a sub-image.
  • the upper half of the image is referred to as a first sub-image, and the lower half of the image is referred to as a second sub-image.
  • the original image can also be divided according to preset rules, and the original image can be divided into multiple areas. Since the number of target devices is known, multiple areas can be grouped according to the number and divided into the number of areas. The regions contained in each group are not repeated, and each region is divided into different groups, and the regions contained in each group constitute a sub-image.
  • Fig. 4a is a schematic diagram of an original image provided by some embodiments of the present application
  • Fig. 4b is a schematic diagram of a first target image determined based on the original image provided by some embodiments of the present application. Now, we will describe Fig. 4a and Fig. 4b .
  • the obtained original image is shown in Figure 4a.
  • P11, P12, P13, P14, P21....P41 are all areas in the original image, and P11, P13, P22 , P23, P31, P32, P34, and P43 constitute a sub-image, and P12, P14, P21, P24, P33, P41, P42, and P44 constitute another sub-image.
  • the pixel values of other pixel points other than the pixel point are set to preset pixel values, and the processed first target image corresponding to the sub-image is obtained.
  • the pixels corresponding to the pixels contained in P12, P14, P21, P24, P33, P41, P42, and P44 in the original image The value is set to a preset pixel value, and the processed first target image corresponding to the sub-image is obtained, as shown in the left image in FIG. 4b.
  • the pixel values corresponding to the pixels contained in P24, P33, P41, P42, and P44 have been set to the preset pixel values.
  • the pixel values corresponding to the pixels contained in P11, P13, P22, P23, P31, P32, P34, and P43 in the original image are set as The preset pixel value is used to obtain the processed first target image corresponding to the sub-image, as shown in the right image in FIG. 4b.
  • the original image is divided into the number of sub-images
  • Images include:
  • the step of setting pixel values of pixels other than the pixels included in the sub-original image in the original image as preset pixel values to obtain the processed first target image corresponding to the sub-image includes:
  • the original image can be directly divided into multiple sub-images, since the original image has pixel values corresponding to each preset channel, because the pixels in the original image are divided into each preset
  • the image formed by the pixel values corresponding to the channel is used as the second target image. Therefore, for the second target image corresponding to each preset channel of the original image, the second target image is divided into sub-images to obtain the first target image corresponding to each channel, which can better ensure security .
  • the original image is generally an RGB image
  • the preset channels are generally R channel, G channel and B channel.
  • the second target image corresponding to each preset channel of the original image may be determined first, wherein one channel corresponds to one second target image. For the corresponding second target image on each channel, according to the number of target devices to receive the image, divide the corresponding second target image on the channel into the number of sub-images.
  • the number of target devices to receive images is 3, divide the second target image corresponding to the R channel into 3 sub-images, divide the second target image corresponding to the G channel into 3 sub-images, and divide the second target image corresponding to the B channel into 3 sub-images.
  • the second target image is divided into 3 sub-images.
  • the channel In the second target image the pixel values of the pixels other than the pixels contained in the sub-image are set to the preset pixel values, and the processed first target corresponding to the sub-image of the second target image on the channel is obtained. image.
  • the corresponding second target images on the R channel, G channel, and B channel of the original image are respectively called the second target image A, the second target image B, and the second target image C, so as to determine the second target image on the R channel.
  • the processed first target image corresponding to each sub-image of the second target image A will be described as an example.
  • the upper half of the second target image A may be determined as a sub-image, and the lower half of the second target image A may be determined as a sub-image.
  • the upper half of the second target image A is called the first sub-image A
  • the lower half of the second target image A is called the second sub-image A.
  • the method further includes:
  • the quantity of the target device dividing the target key into the number of target subkeys, wherein the number of target subkeys can be spliced into the target key;
  • Said sending the encrypted first target image to each target device includes:
  • the encrypted first target image and the encrypted target subkey are respectively sent to each corresponding target device.
  • the target key for encrypting multiple first target images may be generated by the electronic device, and may also be generated for the target device and sent to the electronic device.
  • the electronic device In order for the subsequent target device to be able to decrypt the encrypted first target image based on the target key, the electronic device needs to also send the target key to the target device.
  • the electronic device can also divide the target key into multiple target sub-keys. Specifically, according to the number of target devices to receive images, the target key is divided into the A quantity of target subkeys, wherein the quantity of target subkeys can be spliced into a target key. Wherein, each target sub-private key is a part of the target key.
  • the target key is AZ2y789t0 and the number of target devices is 2, then the target key is divided into two target sub-private keys, and the two target sub-private keys may be AZ2y and 789t0 respectively.
  • the number of target sub-private keys can also be encrypted according to the received public key sent by each target device to obtain the encrypted target sub-private key.
  • the number of multiple target sub-private keys obtained by the electronic device is the same as the number of received public keys sent by the target device.
  • the encrypted target sub-private key and the encrypted first target image may be sent to the corresponding target device at the same time.
  • FIG. 5 is a schematic diagram of an image processing process provided by some embodiments of the present application. The process includes the following steps:
  • S501 Receive an encrypted first target image sent by an electronic device.
  • the image processing method provided in the embodiment of the present application is applied to a target device.
  • the target device may be a device such as a smart terminal, a PC, or a server, and the target device is not the same device as the electronic device performing image encryption.
  • the target device in order to obtain the original image, receives the encrypted first target image sent by the electronic device.
  • S502 Send an image acquisition instruction to other target devices; receive encrypted other first target images sent by the other target devices.
  • the target device for image processing may be any target device, and the target device may be pre-configured with the information of other target devices that simultaneously receive the encrypted first target image sent by the electronic device , so as to facilitate the target device to communicate with other target devices, and obtain other encrypted first target images sent by other target devices.
  • the target device performing image processing needs to send images to other target devices An instruction is obtained, and other encrypted first target images sent by other target devices are received.
  • the encrypted other first target image in the other target device may generate a target key for the other target device, and then send the target key to the electronic device Then, the electronic device encrypts the first target image according to the received target key and sends it to the other target device, and the other target device directly sends the received encrypted first target image to the target device.
  • the encrypted other first target image in the other target device may also be a target key generated based on the electronic device, and based on the target key, the The first target image is encrypted and sent to the other target device, and the other target device sends the encrypted first target image received from the electronic device to the target device.
  • S503 Obtain a target key, and decrypt the received first target image and each other first target image based on the target key, to obtain each target image.
  • the target device in order to obtain the original image, decrypts the encrypted first target image received by itself and other encrypted first target images sent by other target devices to obtain each target image.
  • the target image is an unencrypted first target image.
  • the target key for encrypting all first target images is generated by an electronic device
  • the target key for encrypting each first target key is the same, therefore, the target The target key acquired by the device is sent by the electronic device.
  • the same target key is used for decryption to obtain each target image.
  • the target key for encrypting all first target images is generated by the corresponding target device
  • the target key for encrypting each first target image is generated by a different target device. Therefore, the target device obtains the target key generated by itself for encrypting its first target image, and obtains the target keys generated by other target devices and sent to the target device.
  • the target key corresponding to the first target image is used for decryption to obtain the target image corresponding to the first target image.
  • S504 Process the pixel values corresponding to the pixel points in each target image to obtain the original image.
  • the pixel values corresponding to the pixel points in each target image are processed.
  • the electronic device and the target device pre-agreed on the pixel value processing method, that is, the target device knows that the electronic device processes the pixel value of the pixel in the original image
  • the corresponding pixel value processing method is determined according to the processing method, and the pixel value corresponding to the pixel point in each target image is processed correspondingly by using the processing method to obtain the original image.
  • the target device can only obtain the original image after receiving the encrypted first target image sent by the electronic device and other encrypted first target images sent by other target devices, based on the encrypted It is impossible to obtain the original image for the last first target image, even when there are loopholes or attacks, there will be no security risks, which protects user privacy and improves user experience.
  • Embodiment 6 is a diagrammatic representation of Embodiment 6
  • the method further includes:
  • the original image is input into the pre-trained feature extraction model, and the corresponding feature vector of the original image is obtained and saved.
  • the feature extraction model is pre-trained, and the original image is input into the pre-trained feature extraction model to obtain The feature vector corresponding to the original image, and save the obtained feature vector.
  • the original image in order to improve the accuracy of the determined feature vector corresponding to the original image, before inputting the original image into the pre-trained feature extraction model, the original image can be preprocessed first, such as denoising , grayscale, face detection, normalization, etc., and input the processed original image into the pre-trained feature extraction model for target feature extraction.
  • preprocessed first such as denoising , grayscale, face detection, normalization, etc.
  • the inputting the original image into the pre-trained feature extraction model, and obtaining the feature vector corresponding to the original image includes:
  • the target device directly saves the determined feature vector corresponding to the original image in the target device after obtaining the feature vector corresponding to the original image
  • the target device has a loophole or is attacked, since it can directly Obtaining the feature vector corresponding to the original image saved by the target device also has the risk of insecurity.
  • the pixel values corresponding to the pixel points in the original image can be processed to obtain multiple third target images, and then the multiple third target images can be processed on different target devices. Feature extraction, wherein the plurality of third target images can obtain original images.
  • the target device can process the pixel values corresponding to the pixels in the original image based on the pre-trained feature extraction model deployed in the target device to obtain the pre-trained feature extraction model
  • the outputted multiple third target images may also directly process the pixel values corresponding to the pixel points in the original image for the target device to obtain multiple third target images.
  • the target device processes the pixel values corresponding to the pixel points in the original image to obtain multiple third target images and the electronic device processes the pixel values corresponding to the pixel points in the original image to obtain multiple first target images Same, no more details here.
  • Figure 6a is a schematic diagram of the original image provided by some embodiments of the present application
  • Figure 6b is a third target image obtained after processing the pixel values corresponding to the pixels in the original image provided by some embodiments of the present application
  • Schematic diagram
  • FIG. 6c is another schematic diagram of the third target image obtained after processing the pixel values corresponding to the pixel points in the original image provided by some embodiments of the present application.
  • the original image may be divided into two sub-images first, where the white squares in FIG. 6a represent each area of the original image.
  • the pixel values of other pixels in the original image except the pixels contained in the sub-image are set as preset pixel values, and the processed first target image corresponding to the sub-image is obtained, wherein,
  • the black squares in FIG. 6b and FIG. 6c indicate that the pixel value of the pixel corresponding to the region in the original image is set to a preset pixel value.
  • the target device may determine any third target image among the plurality of third target images as the fourth target image, and continue to analyze the fourth target image based on the pre-trained feature extraction model deployed in the target device.
  • the feature vectors of the four target images are extracted, the feature vectors corresponding to the fourth target images are obtained, and the feature vectors corresponding to the fourth target images are saved.
  • the method further includes:
  • the model performs feature extraction on the received third target image to obtain a feature vector corresponding to the third target image.
  • the target device Since the target device has determined a plurality of third target images, after determining the fourth target image for feature extraction in the target device in the plurality of third target images, among the plurality of third target images except the fourth target image
  • the third target images are sent to other target devices respectively, wherein one third target image is sent to one other target device.
  • the other target devices After sending the third target images except the fourth target image among the plurality of third target images to the corresponding other target devices, the other target devices respectively analyze the received fourth target images based on their own pre-trained feature extraction models.
  • the feature extraction is performed on the three target images, the feature vector corresponding to the third target image is obtained, and the obtained feature vector is saved.
  • Embodiment 7 is a diagrammatic representation of Embodiment 7:
  • the method further includes:
  • the feature vector is divided into the number of sub-feature vectors, any sub-feature vector of the number of sub-feature vectors is saved, and other sub-feature vectors are sent to the other targets respectively. equipment, and
  • the sub-feature vectors sent by the other target devices are received and stored.
  • the target device After the target device determines the feature vector corresponding to the fourth target image, it can directly save the feature vector, because if the fourth target image is based on the sub-image divided on the original image, the sub-image contained in the original image If the pixel values corresponding to other pixel points are set as preset pixel values, some features in the original image can still be extracted. Therefore, in order to further improve security, in the embodiment of the present application, further Segmenting the feature vector, saving some of the sub-feature vectors obtained after the segmentation, and sending the rest of the sub-feature vectors to other target devices for storage.
  • the feature vector can be divided into the number of sub-feature vectors according to the number of target devices, where the number of target devices includes the target device itself and other target devices, where the number of sub-feature vectors The sum of is the eigenvector.
  • Fig. 7a is a schematic diagram before segmentation of a feature vector provided by some embodiments of the present application
  • Fig. 7b is a schematic diagram after segmentation of a feature vector provided by some embodiments of the present application
  • Fig. 7c is a schematic diagram of some embodiments of the present application Another schematic diagram of the segmented feature vector provided will now be described with reference to FIG. 7a , FIG. 7b and FIG. 7c .
  • the component can be split into two sub-eigenvectors, where the sum of the two subcomponents is for that amount. It is also possible to keep some components in the feature vector unchanged for some components in each component in the feature vector, set the components other than some components in the feature vector to preset values, and determine a sub-feature vector. Setting the part of the component in the eigenvector to a preset value, keeping the components in the eigenvector other than the part of the component unchanged, and determining another sub-eigenvector.
  • the preset value can be 0, as shown in Figure 7a
  • each component in the feature vector is represented by a square frame, as shown in Figure 7b and Figure 7c
  • the white square frame represents the component that remains unchanged
  • the black Square boxes represent components set to preset values.
  • the specific determined sub-eigenvectors can have many possible forms.
  • Figure 7b and Figure 7c show two forms respectively, one of which is shown in the two images in Figure 7b, and the other form is shown in the two images in Figure 7c image.
  • the feature vector corresponding to the third target image is determined in the other target device, the feature vector is also segmented, and a sub-feature vector obtained after segmentation is retained, and the other The sub-eigenvectors are respectively sent to other target devices except itself, so each target device will receive the sub-eigenvectors sent by other target devices.
  • the process of encrypting an image by an electronic device and the process of processing an image by a target device can be applied in a user identity registration scenario, and can also be used in a user identity identification scenario.
  • the target device directly saves a sub-feature vector corresponding to the obtained fourth target image and received sub-feature vectors sent by other target devices.
  • the other target device also saves a sub-feature vector corresponding to the third target image obtained by itself and a received sub-feature vector sent by other target devices.
  • the target device can directly obtain a sub-feature vector corresponding to the fourth target image and the received sub-feature vectors sent by other target devices, and can directly base on the pre-saved user correspondence
  • the sub-feature vectors determine the Euclidean distance between the pre-saved sub-feature vectors corresponding to each user, and identify the identity of the user according to the Euclidean distance and the preset threshold value.
  • the process of identifying other target devices The process of identifying the target device is the same as that of the target device, and will not be repeated here.
  • the identification result of each target device determine the identity of the user.
  • the target device includes all other target devices and the target device. Specifically, it can be determined whether the identification results recognized by each target device are consistent. If they are consistent, the The identification result recognized by any target device may be determined as the final identification result.
  • each target device after each target device determines the identity recognition result, it can also output the respective determined identity recognition result, specifically, it can be output in the form of text or voice, for example, displaying " Recognize the text that the user is user A", or send out the voice of "recognize the user is user A”.
  • Embodiment 8 is a diagrammatic representation of Embodiment 8
  • the method after receiving the encrypted first target image sent by the electronic device, and before sending acquisition instructions to other target devices, the method further includes:
  • the target device in order for the target device to obtain the original image, and because the encrypted first target image is stored in different target devices, the target device needs to communicate with each other target device to obtain each other The encrypted first target image stored in the target device.
  • the target device In order to determine whether other target devices are trustworthy, the target device first receives the target verification message generated by other target devices based on the identification information and attribute information of the other target devices, wherein the identification information and attribute information of the other target devices are pre-stored in other In the target device, the attribute information may be version information, device information, etc. of the target device.
  • the target verification information may be a verification signature or a verification report.
  • the target device receives the target verification information sent by the other target device, and determines whether the standard verification information of each device saved in advance by itself is related to the target verification information. If consistent standard verification information exists, it is determined that the other target device is credible, and if it does not exist, it is determined that the other target device is not credible.
  • the target device can generate a random message before receiving the target verification message sent by other target devices. number, and send the random number to other target devices, after other target devices generate the target verification message, they can send the random number and the target verification message to the target device at the same time.
  • the random number is randomly generated, and the random number is only used to distinguish which user identification or user registration process is aimed at.
  • the standard verification information of each device can be stored in the target device in advance, and can also be stored in the verification service system. If it is saved in the verification service system, the target device will obtain the target After verifying the information, send a verification information acquisition request to the verification service system, obtain and save the standard verification information of each device sent by the verification service system, and then verify based on the standard verification information of each device and the target verification information sent by other target identification. Whether this other target device is trusted. Specifically, which device the standard verification information of each device is stored in is not limited.
  • the operation of sending an acquisition command to other target devices is performed. If any other target device is untrustworthy, in order to ensure safety, no command is sent to other target devices. Get the action for the instruction.
  • the electronic device after receiving the encrypted first target image sent by the electronic device, before sending acquisition instructions to other target devices, it is verified whether other target devices are credible, and the encrypted first target image is guaranteed to be While the communication of the image is secure, the security of the data processing process of the encrypted first target image can also be ensured.
  • Embodiment 9 is a diagrammatic representation of Embodiment 9:
  • the obtaining the target key includes:
  • Each decrypted target subkey is spliced to generate a target key.
  • each target subkey is encrypted and sent to the corresponding target device, wherein the public key for encrypting each target subkey is generated and sent to the corresponding target device. Therefore, the target device will receive an encrypted target subkey sent by the electronic device, and decrypt the encrypted target subkey based on the private key generated by itself, wherein the private key is the same as that sent to the electronic device , and the public key used by the electronic device to encrypt the target subkey is a public-private key pair, where the public-private key pair can be an asymmetric public-private key pair or a symmetric public-private key pair.
  • the public-private key pair is an asymmetric public-private key pair
  • the asymmetric public-private key pair may be a public key infrastructure (Public Key Infrastructure, PKI) asymmetric public-private key pair.
  • the target device in order to obtain the target key, the target device needs to obtain the target subkey sent by the electronic device to each other target device, because the target subkey sent by the electronic device to each other target device is based on the corresponding Therefore, the target subkey received by the target device from other target devices is the decrypted target subkey.
  • the received decrypted target subkey is the target subkey obtained by decrypting the encrypted target subkey based on the private key generated by the other target device.
  • the target device concatenates each decrypted target subkey to generate a target key. Specifically, in order to splice accurately, the target device needs to determine the splicing order of each target subkey.
  • the electronic device can divide the target key into target The position of the obtained target sub-private key in the target key, and set the identification information for each target sub-key. For example, if the target key is divided into two target sub-keys, the position in the target key will be The identification information of the earlier target subkey is set to 1, and the identification information of the later target subkey in the target key is set to 2.
  • the electronic device sends the target subkey to other corresponding target devices, it also sends the corresponding identification information to other target devices.
  • target device when other target devices send the decrypted target subkey to the target device, they also need to send the identification information of the target subkey to the target device. After receiving each decrypted target subkey and the identification information of each target subkey, the target device splices each decrypted target subkey according to the identification information of each target subkey to generate target key.
  • the method before receiving the decrypted target subkey sent by the other target device, the method further include:
  • each of the other target devices For each of the other target devices, generate a target public-private key pair, and send the target public key in the target public-private key pair to the other target device, so that the other target device encrypts the target device based on the private key pair. After the subkey is decrypted, encrypt the decrypted target subkey based on the target public key;
  • the method After receiving the decrypted target sub-private key sent by the other target device, before splicing each received decrypted target sub-private key, the method further includes:
  • the target device since the target device receives the decrypted target subkey sent by other target devices to determine the target key, and then decrypts the encrypted first target image, if the target device receives the decrypted Data leakage or tampering in the process of the final target subkey will seriously affect the security or cause the subsequent inability to decrypt the encrypted first target image, and eventually the original image cannot be restored.
  • a target public-private key pair before receiving the decrypted target subkeys sent by other target devices, a target public-private key pair can be generated for each other target device, and the target public key in the target public-private key pair can be sent to to other target devices, so that other target devices decrypt the encrypted target subkey based on their own private key, and then encrypt the decrypted target subkey based on the received target public key sent by the target device, and Send the encrypted target sub-private key to the target device.
  • the target device can generate a target public-private key pair corresponding to the other target device, that is, different target public-private key pairs can be generated for different target devices, in order to reduce the target device Burden, it is also possible to generate the same target public-private key pair for all other target devices.
  • the target device After receiving the encrypted target sub-private key, the target device decrypts the received encrypted target sub-key based on the target private key in the generated target public-private key pair to obtain the target sub-key.
  • the processing of the pixel values corresponding to the pixels in each target image to obtain the original image includes:
  • the sum of the pixel values of the pixel in each target image is determined as the corresponding pixel value of the pixel in the original image.
  • the electronic device divides the pixel value of each pixel in the original image into multiple sub-pixel values, and determines the value of each pixel according to the multiple sub-pixel values corresponding to each pixel
  • the target device obtains the original image according to each target image, according to each corresponding pixel in each target image , determine the pixel value and value of the pixel point in each target image as the pixel value corresponding to the pixel point in the original image, and then obtain the original image.
  • the determination of the pixel value and value of the pixel in each target image as the pixel value corresponding to the pixel in the original image includes:
  • the sum value of the pixel value corresponding to the pixel point of each target image in the pixel matrix corresponding to the channel determined as the pixel value corresponding to the pixel in the channel of the original image.
  • the electronic device splits the pixel value in the pixel matrix corresponding to each channel into multiple sub-pixel values for each pixel value in the pixel matrix corresponding to each channel, and according to the corresponding The number of sub-pixel values corresponding to each pixel in the pixel matrix of the pixel matrix, determine the processed pixel value of the corresponding pixel in each first target image corresponding to each channel, then the target device in order to restore the original image, for each For each pixel of the target image in the preset pixel matrix corresponding to each channel, the sum of the pixel values corresponding to the pixel in the pixel matrix corresponding to the channel of each target image is determined as the original image in the pixel matrix The pixel value corresponding to this pixel point in the channel.
  • the processing of the pixel values corresponding to the pixels in each target image to obtain the original image includes:
  • the target pixel whose pixel value in the target image is not a preset pixel value determines the target pixel whose pixel value in the target image is not a preset pixel value; set the pixel value of the target pixel in the original image as the corresponding target pixel in the target image The pixel value of the point gets the original image.
  • the electronic device divides the original image into multiple sub-images, and for each sub-image, set the pixel values of the pixels in the original image other than the pixels included in the sub-original image to The preset pixel value is used to obtain the processed first target image corresponding to the sub-image. Then, in order to obtain the original image, the target device can, for any target image, determine that the pixel value of the pixel in the target image is not the preset pixel. value, and set the pixel value of the target pixel in the original image to the pixel value of the corresponding target pixel in the target image to obtain the original image.
  • the determination of the target pixels whose pixel values in the target image are not preset pixel values includes:
  • each pixel in each target image on each preset channel determine whether the pixel value of the pixel in the target image on the channel is a non-preset pixel value, and if so, determine the pixel is the target pixel on the channel;
  • Said setting the pixel value of the target pixel in the original image as the pixel value of the corresponding target pixel in the target image to obtain the original image includes:
  • the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • the electronic device divides the corresponding second target image on the channel into multiple sub-images according to the second target image corresponding to the original image on each preset channel, for each channel corresponding to For each sub-image corresponding to the second target image of the corresponding channel, the pixel values of other pixels other than the pixels contained in the sub-image in the corresponding second target image on the channel are set to preset pixel values, and the channel is obtained.
  • the target device can determine the Whether the pixel value of the pixel point in the target image is a non-preset pixel value, if so, determine the pixel point as the target pixel point on the channel, and set the pixel value of the target pixel point in the original image in the channel is the pixel value of the target pixel in the sub-image corresponding to the target image on the channel, and the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • Figure 8a is a schematic diagram of the process of image recognition based on MPC in the related art, including the feature vector corresponding to the original image of the user
  • Figure 8b is a schematic diagram of the process of identifying the feature vector corresponding to the original image of the user provided by some embodiments of the present application , will now be described with reference to Fig. 8a and Fig. 8b.
  • the electronic device first obtains the original image containing the user, and then performs feature extraction on the original image, determines that the corresponding feature vector is split into the first feature vector and the second feature vector, and respectively based on the obtained target key pair
  • the first eigenvector and the second eigenvector are encrypted, and the encrypted first eigenvector and the encrypted second eigenvector are respectively sent to the corresponding first target device and the corresponding second target device, the first target device Obtain the target key, and decrypt the encrypted first eigenvector based on the target key, obtain the decrypted first eigenvector and store it in the database of the first target device;
  • the second target device obtains the target key , and decrypt the encrypted second feature vector based on the target key to obtain the decrypted second feature vector and store it in the database of the second target device.
  • the first target device compares the first feature vector (after decryption) with the feature vectors of each user pre-stored in the first target device
  • the second target device compares the second feature vector (after decryption) with the feature vectors of each user pre-stored in the second target device, and determines the identity of the user according to the two comparison results.
  • the electronic device first obtains the original image containing the user, and processes the pixel values corresponding to the pixel points in the original image to obtain a plurality of processed first target images.
  • the first target image is encrypted, and the target key is divided into multiple target subkeys, and each target subkey is encrypted respectively according to the received public key sent by each target device, and each encrypted The first target image and each encrypted target subkey are sent to each corresponding target device.
  • Each target device is located in the face service system corresponding to each institution.
  • the face service system corresponding to the institution includes both the target device and the verification service system.
  • the institution The face service system corresponding to 1 includes both the first target device and the first verification service system
  • the face service system corresponding to organization 2 includes both the second target device and the second verification service system.
  • the first target device receives the encrypted first target image 1 and the encrypted target subkey 1, and the second target device receives the encrypted first target image 2 and the encrypted target subkey 2, so as to The first target device restores the original image for illustration.
  • the first target device generates a random number and sends the random number to the second target device.
  • the second target device generates target verification information based on its own identification information and attribute information and sends it to The first target device, the first target device receives the target verification information sent by the second target device, sends a verification information acquisition instruction to the first verification service system, and obtains the standard verification information of each device, if the standard verification information of each device exists Standard verification information consistent with the target verification information determines that the second target device is authentic.
  • the first target device decrypts the received encrypted target subkey 1 sent by the electronic device based on the private key generated by itself, and obtains the decrypted target subkey 1 . And generate the target public-private key pair, send the target public key in the target public-private key pair to the second target device, and send the image acquisition instruction to the second target device, after the second target device receives the image acquisition instruction and the target public key , the second target device decrypts the received encrypted target subkey 2 sent by the electronic device based on the private key generated by itself, and encrypts the obtained decrypted target subkey 2 based on the target public key, and The encrypted target sub-key 2 and the encrypted first target image 2 are sent to the first target device, and after receiving the encrypted target sub-key 2, the first target device, based on the generated target public-private key pair The target private key decrypts the encrypted target subkey 2, and the first target device obtains the decrypted target subkey 2.
  • the second target device After receiving the other third target image, the second target device obtains the feature vector of the other third target image based on the pre-trained feature extraction model in the second target device.
  • the first target device After determining the feature vector corresponding to the fourth target image, the first target device divides the feature vector into feature vector 1 and feature vector 2. After determining the feature vector corresponding to another third target image, the second target device divides the feature vector into The feature vector is divided into feature vector 3 and feature vector 4, then the first target device can send feature vector 2 to the second target device, and receive feature vector 4 sent by the second target device, the second target device can send Feature vector 4 is sent to the second target device, and feature vector 1 sent by the second target device is received, that is, feature vector 1 and feature vector 4 are stored in the first target device, and feature vector 2 is stored in the second target device and eigenvector3.
  • Fig. 9 is a schematic structural diagram of an image encryption device provided by some embodiments of the present application, the device includes:
  • the first acquisition module 901 is configured to process the pixel values corresponding to the pixels in the original image containing the user according to the number of target devices to receive the image, to obtain a plurality of processed first target images, in which a plurality of the first target images A target image can obtain the original image;
  • An encryption module 902 configured to encrypt each of the first target images with a target key
  • the first sending module 903 is configured to send each encrypted first target image to each corresponding target device.
  • the first obtaining module 901 is specifically configured to, for the pixel value of each pixel in the original image, decompose the pixel value according to the number of target devices to receive the image Divided into the number of sub-pixel values, wherein the sum of the number of sub-pixel values is the pixel value; according to the number of sub-pixel values corresponding to each pixel, determine the corresponding pixel in each first target image after processing The processed pixel value of the point.
  • the first acquisition module 901 is specifically configured to determine a pixel matrix corresponding to each preset channel of the original image, where each element in the pixel matrix is The pixel value corresponding to a pixel point on the corresponding channel; for each pixel value in the pixel matrix corresponding to each channel, according to the number of target devices to receive the image, the pixel value in the pixel matrix corresponding to the channel is decomposed Divided into the number of sub-pixel values, wherein the sum of the number of sub-pixel values is the pixel value in the pixel matrix corresponding to the channel; according to the number of sub-pixel values corresponding to each pixel in the pixel matrix corresponding to each channel The pixel value is to determine the processed pixel value of the corresponding pixel in each first target image corresponding to each channel after processing.
  • the first obtaining module 901 is specifically configured to divide the original image into the number of sub-images according to the number of target devices to receive the image; for each sub-image, divide the In the original image, the pixel values of other pixel points other than the pixel points included in the sub-original image are set as preset pixel values, so as to obtain a processed first target image corresponding to the sub-image.
  • the first acquisition module 901 is specifically configured to determine the second target image corresponding to each preset channel of the original image; for the second target image corresponding to each channel image, according to the number of target devices to receive the image, divide the corresponding second target image on the channel into the number of sub-images; for each sub-image corresponding to the second target image on each channel, divide the Set the pixel values of other pixels other than the pixels included in the sub-image in the corresponding second target image on the channel to preset pixel values, and obtain the processed sub-image corresponding to the second target image on the channel. first target image.
  • the device also includes:
  • a splitting module 904 configured to split the target key into the number of target subkeys according to the number of target devices, wherein the number of target subkeys can be spliced into the target key key;
  • the encryption module 902 is further configured to respectively encrypt the number of target subkeys according to the received public key sent by each target device;
  • the first sending module 903 is specifically configured to send the encrypted first target image and the encrypted target subkey to each corresponding target device.
  • Fig. 10 is a schematic structural diagram of an image processing device provided by some embodiments of the present application, the device includes:
  • a processing module 1002 configured to send an image acquisition instruction to other target devices; receive encrypted other first target images sent by the other target devices;
  • the second obtaining module 1003 is configured to obtain a target key, and decrypt the received first target image and each other first target image based on the target key to obtain each target image; for each The pixel values corresponding to the pixel points in the target image are processed to obtain the original image.
  • the second acquisition module 1003 is further configured to input the original image into a pre-trained feature extraction model, obtain and save a feature vector corresponding to the original image.
  • the second obtaining module 1003 is specifically configured to process pixel values corresponding to pixel points in the original image to obtain multiple third target images, wherein the multiple third target images
  • the image can obtain the original image; any one of the third target images in the plurality of third target images is determined as the fourth target image; based on the pre-trained feature extraction model, the fourth target image is
  • the feature vector extraction is to obtain the feature vector corresponding to the fourth target image.
  • the device also includes:
  • the second sending module 1004 is configured to send the third target images except the fourth target image among the plurality of third target images to the corresponding other target devices, so that the other target devices Feature extraction is performed on the received third target image based on the pre-trained feature extraction model respectively, to obtain a feature vector corresponding to the third target image.
  • the second sending module 1004 is further configured to divide the feature vector into the number of sub-feature vectors according to the number of the target devices, and save the number of sub-feature vectors any one of the sub-feature vectors, and send the other sub-feature vectors to the other target devices respectively, and receive and store the sub-feature vectors sent by the other target devices.
  • the device also includes:
  • the verification module 1005 is configured to receive the target verification information sent by the other target devices, and determine that the other target devices can wherein, the target verification information is generated by the other target device according to the identification information and attribute information of the other target device; if the other target devices are all credible, the processing module is triggered.
  • the second obtaining module 1003 is configured to receive the encrypted target subkey sent by the electronic device, and decrypt the encrypted target subkey based on the private key, And receiving the decrypted target sub-private keys sent by the other target devices; splicing each of the received decrypted target sub-private keys to generate a target key.
  • the second sending module 1004 is further configured to generate a target public-private key pair for each of the other target devices, and send the target public key in the target public-private key pair to the The other target device, so that the other target device decrypts the encrypted target sub-private key based on the private key, and then encrypts the decrypted target sub-private key based on the target public key;
  • the device also includes:
  • Decryption module 1006 configured to decrypt the received encrypted target sub-private key based on the target private key in the target public-private key pair.
  • the second acquisition module 1003 is specifically configured to, according to the pixel value of each pixel in each of the target images, combine the pixel value of the pixel in each target image with the value , determined as the pixel value corresponding to the pixel in the original image.
  • the second obtaining module 1003 is specifically configured to, for each pixel value corresponding to each pixel point in the preset pixel matrix corresponding to each channel of each target image, set each The sum of the pixel values corresponding to the pixel point in the pixel matrix corresponding to the channel of the target image is determined as the pixel value corresponding to the pixel point of the original image in the channel.
  • the second acquisition module 1003 is specifically configured to, for any target image, determine target pixels whose pixel values in the target image are not preset pixel values; The pixel value of the target pixel in the original image is set to the pixel value corresponding to the target pixel in the target image to obtain the original image.
  • the second acquiring module 1003 is specifically configured to determine the pixel in the target image on the channel according to each preset pixel in the target image on the channel Whether the pixel value of the original image is a non-preset pixel value, if so, determine the pixel point as the target pixel point on the channel; set the pixel value of the target pixel point in the original image in the channel as the target pixel point in the channel The pixel value of the target pixel in the sub-image corresponding to the target image; the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • some embodiments of the present application also provide an electronic device, as shown in FIG. , the communication interface 1102 and the memory 1103 communicate with each other through the communication bus 1104 .
  • a computer program is stored in the memory 1103, and when the program is executed by the processor 1101, the processor 1101 is made to perform the following steps:
  • the pixel values corresponding to the pixel points in the original image containing the user are processed to obtain a plurality of processed first target images, wherein the multiple first target images can obtain the original image;
  • Each encrypted first target image is sent to each corresponding target device.
  • the processor 1101 is further configured to split the pixel value of each pixel in the original image into the number of sub-pixel values according to the number of target devices to receive the image , wherein the sum of the number of sub-pixel values is the pixel value; according to the number of sub-pixel values corresponding to each pixel, determine the processed pixel value of the corresponding pixel in each processed first target image.
  • the processor 1101 is also configured to determine a pixel matrix corresponding to each preset channel of the original image, wherein each element in the pixel matrix corresponds to each pixel point on the corresponding channel For each pixel value in the pixel matrix corresponding to each channel, according to the number of target devices to receive the image, split the pixel value in the pixel matrix corresponding to the channel into the number of sub-pixel values , wherein, the sum of the number of sub-pixel values is the pixel value in the pixel matrix corresponding to the channel; according to the number of sub-pixel values corresponding to each pixel in the pixel matrix corresponding to each channel, determine each processed The processed pixel values of corresponding pixels in each first target image corresponding to channels.
  • the processor 1101 is further configured to divide the original image into the number of sub-images according to the number of target devices to receive the image; for each sub-image, divide the sub-original image in the original image
  • the pixel values of other pixel points other than the pixel points included in the image are set to preset pixel values to obtain a processed first target image corresponding to the sub-image.
  • the processor 1101 is also configured to determine the second target image corresponding to the original image on each preset channel; for the second target image corresponding to each channel, according to the image to be received The number of target devices, divide the corresponding second target image on the channel into the number of sub-images; for each sub-image corresponding to the second target image on each channel, divide the corresponding second target image on the channel Set the pixel values of other pixel points other than the pixel points included in the sub-image to preset pixel values, and obtain the processed first target image corresponding to the sub-image of the second target image on the channel.
  • the processor 1101 is further configured to divide the target key into the number of target subkeys according to the number of the target devices, wherein the number of target subkeys can be concatenated into the target key; according to the received public key sent by each target device, respectively encrypt the number of target subkeys; respectively encrypt the encrypted first target image and the encrypted target subkey sent to each corresponding target device.
  • the communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 1102 is used for communication between the electronic device and other devices.
  • the memory may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • RAM Random Access Memory
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • processor can be general-purpose processor, comprises central processing unit, network processor (Network Processor, NP) etc.; Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • network processor Network Processor, NP
  • NP Network Processor
  • Other programmable logic devices discrete gate or transistor logic devices, discrete hardware components, etc.
  • some embodiments of the present application also provide an electronic device, as shown in FIG. , the communication interface 1202 and the memory 1203 communicate with each other through the communication bus 1204 .
  • a computer program is stored in the memory 1203, and when the program is executed by the processor 1201, the processor 1201 is made to perform the following steps:
  • the pixel values corresponding to the pixel points in each target image are processed to obtain the original image.
  • the processor 1201 is also configured to input the original image into the pre-trained feature extraction model, obtain and save the feature vector corresponding to the original image.
  • the processor 1201 is further configured to process the pixel values corresponding to the pixel points in the original image to obtain multiple third target images, wherein the multiple third target images can obtain the original image; Determining any third target image in the plurality of third target images as a fourth target image; performing feature vector extraction on the fourth target image based on the pre-trained feature extraction model to obtain the fourth target image The feature vectors corresponding to the four target images.
  • the processor 1201 is further configured to respectively send third target images except the fourth target image among the multiple third target images to corresponding other target devices, so that all The other target devices respectively perform feature extraction on the received third target image based on the pre-trained feature extraction model, and obtain a feature vector corresponding to the third target image.
  • the processor 1201 is further configured to divide the feature vector into the number of sub-feature vectors according to the number of the target devices, save any one of the number of sub-feature vectors, and Sending other sub-feature vectors to the other target devices, and receiving and storing the sub-feature vectors sent by the other target devices.
  • the processor 1201 is further configured to receive the target verification information sent by the other target devices, and if there is standard verification information consistent with the target verification information in the standard verification information of each device saved in advance by the processor 1201, determine The other target devices are credible; wherein, the target verification information is generated by the other target devices according to the identification information and attribute information of the other target devices; if the other target devices are all credible, then proceed to The other target device sends an operation of obtaining an instruction.
  • the processor 1201 is further configured to receive the encrypted target subkey sent by the electronic device, decrypt the encrypted target subkey based on the private key, and receive the encrypted target subkey from the other target device Sending the decrypted target sub-private key; splicing each received decrypted target sub-private key to generate a target key.
  • the processor 1201 is further configured to generate a target public-private key pair for each of the other target devices, and send the target public key in the target public-private key pair to the other target devices, so that all After the other target device decrypts the encrypted target sub-private key based on the private key, the decrypted target sub-private key is encrypted based on the target public key; based on the target in the target public-private key pair The private key decrypts the received encrypted target sub-private key.
  • the processor 1201 is further configured to, according to the pixel value of each pixel in each of the target images, determine the pixel value and value of the pixel in each target image as the pixel in the original image The pixel value corresponding to the point.
  • the processor 1201 is also configured to set the pixel value corresponding to each pixel point of each target image in the preset pixel matrix corresponding to each channel, and set the pixel value of each target image corresponding to the channel The sum of the pixel values corresponding to the pixel in the matrix is determined as the pixel value corresponding to the pixel in the channel of the original image.
  • the processor 1201 is further configured to, for any target image, determine target pixels whose pixel values in the target image are not preset pixel values; The pixel value of is set to the pixel value of the corresponding target pixel point in the target image to obtain the original image.
  • the processor 1201 is further configured to determine whether the pixel value of the pixel in the target image on the channel is non-preset according to each pixel in each target image on each preset channel If so, then determine this pixel as the target pixel on the channel; set the pixel value of the target pixel in the channel of the original image as the sub-image corresponding to the target image on the channel The pixel value of the target pixel point; the original image is obtained according to the pixel value of the target pixel point in each channel of the original image.
  • the communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 1202 is used for communication between the electronic device and other devices.
  • the memory may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one magnetic disk memory.
  • RAM Random Access Memory
  • NVM Non-Volatile Memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • processor can be general-purpose processor, comprises central processing unit, network processor (Network Processor, NP) etc.; Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • network processor Network Processor, NP
  • NP Network Processor
  • Other programmable logic devices discrete gate or transistor logic devices, discrete hardware components, etc.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program executable by the electronic device, when the program is stored in the electronic When running on the device, the electronic device implements the following steps when executing:
  • the pixel values corresponding to the pixel points in the original image containing the user are processed to obtain a plurality of processed first target images, wherein the multiple first target images can obtain the original image;
  • Each encrypted first target image is sent to each corresponding target device.
  • the pixel values corresponding to the pixels in the original image including the user are processed, and the processed first target images include:
  • the processed pixel value of the corresponding pixel in each processed first target image is determined.
  • splitting the pixel value into the number of sub-pixel values according to the number of target devices to receive the image includes:
  • the determining the processed pixel value of the corresponding pixel in each first target image after processing according to the number of sub-pixel values corresponding to each pixel includes:
  • the pixel values corresponding to the pixels in the original image including the user are processed, and the processed first target images include:
  • For each sub-image set the pixel values of other pixels in the original image other than the pixels included in the sub-original image as preset pixel values to obtain a processed first target image corresponding to the sub-image.
  • dividing the original image into the number of sub-images includes:
  • the step of setting pixel values of pixels other than the pixels included in the sub-original image in the original image as preset pixel values to obtain the processed first target image corresponding to the sub-image includes:
  • the method further includes:
  • the quantity of the target device dividing the target key into the number of target subkeys, wherein the number of target subkeys can be spliced into the target key;
  • Said sending the encrypted first target image to each target device includes:
  • the encrypted first target image and the encrypted target subkey are respectively sent to each corresponding target device.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program executable by the electronic device, when the program is stored in the electronic When running on the device, the electronic device implements the following steps when executing:
  • the pixel values corresponding to the pixel points in each target image are processed to obtain the original image.
  • the method also includes:
  • the original image is input into the pre-trained feature extraction model, and the corresponding feature vector of the original image is obtained and saved.
  • the inputting the original image into the pre-trained feature extraction model, and obtaining the feature vector corresponding to the original image includes:
  • the method also includes:
  • the model performs feature extraction on the received third target image to obtain a feature vector corresponding to the third target image.
  • the method further includes:
  • the feature vector is divided into the number of sub-feature vectors, any sub-feature vector of the number of sub-feature vectors is saved, and other sub-feature vectors are sent to the other targets respectively. equipment, and
  • the sub-feature vectors sent by the other target devices are received and stored.
  • the method further includes:
  • the target verification information is generated by the other target device according to the identification information and attribute information of the other target device itself;
  • said obtaining the target key includes:
  • the method before receiving the decrypted target sub-private key sent by the other target device, the method further includes:
  • the other target devices For each of the other target devices, generate a target public-private key pair, and send the target public key in the target public-private key pair to the other target devices, so that the other target devices are encrypted based on the private key pair After the target sub-private key is decrypted, the decrypted target sub-private key is encrypted based on the target public key;
  • the method After receiving the decrypted target sub-private key sent by the other target device, before splicing each received decrypted target sub-private key, the method further includes:
  • processing the pixel values corresponding to the pixel points in each target image to obtain the original image includes:
  • the sum of the pixel values of the pixel in each target image is determined as the corresponding pixel value of the pixel in the original image.
  • said determining the pixel value and value of the pixel in each target image as the pixel value corresponding to the pixel in the original image includes:
  • the sum value of the pixel value corresponding to the pixel point of each target image in the pixel matrix corresponding to the channel determined as the pixel value corresponding to the pixel in the channel of the original image.
  • processing the pixel values corresponding to the pixel points in each target image to obtain the original image includes:
  • the target pixel whose pixel value in the target image is not a preset pixel value determines the target pixel whose pixel value in the target image is not a preset pixel value; set the pixel value of the target pixel in the original image as the corresponding target pixel in the target image The pixel value of the point gets the original image.
  • the determination of target pixels whose pixel values in the target image are not preset pixel values includes:
  • each pixel in each target image on each preset channel determine whether the pixel value of the pixel in the target image on the channel is a non-preset pixel value, and if so, determine the pixel is the target pixel on the channel;
  • Said setting the pixel value of the target pixel in the original image as the pixel value of the corresponding target pixel in the target image to obtain the original image includes:
  • the original image is obtained according to the pixel value of the target pixel in each channel of the original image.
  • each of the multiple first target images is obtained after processing the pixels corresponding to the pixels in the original image, the pixels contained in each first target image The corresponding pixel value is not exactly the same as the pixel value corresponding to the corresponding pixel point in the original image, and since the multiple first target images are respectively sent to the corresponding target device after obtaining multiple first target images, therefore, Regardless of whether the attack is carried out during the process of sending the first target image, or the target device storing the first target image is attacked, it is impossible to obtain the original image based on a single first target image, which ensures the integrity of image transmission and storage. Security protects user privacy and improves user experience.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable image processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable image processing device, so that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the image processing performed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Facsimile Transmission Control (AREA)
  • Image Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本申请公开了一种图像加密、图像处理方法、装置、设备及介质,由于在本申请实施例中,多个第一目标图像中每个第一目标图像都是对原图像中像素点对应的像素点进行处理后得到的,每个第一目标图像中包含的像素点对应的像素值与原图像中的对应的像素点对应的像素值不完全相同,且由于在获得多个第一目标图像后,将多个第一目标图像分别发送给对应的目标设备,因此,不管是在第一目标图像发送的过程中进行攻击,还是对存储了第一目标图像的目标设备进行攻击,都不可能基于单独的一个第一目标图像获得原图像,保证了图像传输和存储的安全性,保护了用户的隐私,提高了用户的体验。

Description

一种图像加密、图像处理方法、装置、设备及介质
相关申请的交叉引用
本申请要求在2022年01月28日提交中国专利局、申请号为202210105850.2、申请名称为“一种图像加密、图像处理方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据传输技术领域,尤其涉及一种图像加密、图像处理方法、装置、设备及介质。
背景技术
基于包含用户的图像进行身份识别的生物识别技术,在金融、安防、电子商务等诸多场景实现了广泛应用,比如,基于人脸识别来实现用户银行卡注册,或者进行业务办理的过程中,需要将人脸信息与银行卡信息进行绑定,具体的,图像采集设备先采集包含用户的图像,并将该包含用户的图像以及生成的口令信息发送给目标设备,其中,该目标设备可以为发卡银行系统,发卡银行系统基于该包含用户的图像以及口令信息进行人脸验证,若验证通过,则将该包含用户的图像中的人脸信息与对应的银行卡进行绑定,或者确定该用户具有权限,可以基于对应的银行卡办理相应的任务,如图1所示。
伴随着生物识别技术的快速发展,人们也越来越注重身份识别过程的安全性,若直接将包含用户的图像进行传输以及存储,以便后续用于进行身份识别,不仅面临着信息泄露的风险,还要面临法律合规方面的风险。
为了提高安全性,传统超文本传输安全协议(Hypertext Transfer Protocol Secure,HTTPS)一般通过安全传输层协议(Transport Layer Security,TLS)建立发送端与接收端的传输控制协议(Transmission Control Protocol,TCP)连接,并基于证书链和密钥确保包含用户的图像的安全。但是该过程就算在 图像传输以及存储过程中对该包含用户的图像进行了加密,若传输的过程存在漏洞或者存储该图像的设备被攻击,那么所有的加密也变得毫无意义,隐私保护性不高,影响用户的体验。
发明内容
本申请提供了一种图像加密、图像处理方法、装置、设备及介质,用以解决现有技术中对包含用户的图像隐私保护性不高,影响用户体验的问题。
本申请提供了一种图像加密方法,所述方法包括:
根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
采用目标密钥对每个所述第一目标图像进行加密;
将加密后的每个第一目标图像发送给对应的每个目标设备。
进一步地,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;
根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值包括:
确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;
针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;
所述根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值包括:
根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;
针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
进一步地,所述根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像包括:
确定所述原图像在预设的每个通道上对应的第二目标图像;
针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;
所述将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像包括:
针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
进一步地,所述采用目标密钥对每个所述第一目标图像进行加密之后,所述将加密后的第一目标图像发送给每个目标设备之前,所述方法还包括:
根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;
根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;
所述将加密后的第一目标图像发送给每个目标设备包括:
将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
本申请提供了一种图像处理方法,应用于目标设备,所述方法包括:
接收电子设备发送的加密后的第一目标图像;
向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;
对每个目标图像中像素点对应的像素值进行处理,获得原图像。
进一步地,所述方法还包括:
将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
进一步地,所述将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量包括:
对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;
将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;
基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
进一步地,所述方法还包括:
将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述 第三目标图像对应的特征向量。
进一步地,获得目标图像对应的特征向量之后,所述方法还包括:
根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及
接收所述其他目标设备发送的子特征向量并保存。
进一步地,所述接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获取指令之前,所述方法还包括:
接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;
若所述其他目标设备均可信,则进行向所述其他目标设备发送获取指令的操作。
进一步地,所述获得目标密钥包括:
接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;
将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
进一步地,所述接收所述其他目标设备发送的解密后的目标子私钥之前,所述方法还包括:
针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基于所述目标公钥对解密后的所述目标子私钥进行加密;
所述接收所述其他目标设备发送的解密后的目标子私钥之后,将接收到的每个解密后的所述目标子私钥进行拼接之前,所述方法还包括:
基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
进一步地,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
进一步地,所述将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值包括:
针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
进一步地,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
进一步地,所述确定该目标图像中像素点的像素值非预设的像素值的目标像素点包括:
根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;
所述将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像包括:
将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;
根据原图像在每个通道中所述目标像素点的像素值得到原图像。
本申请还提供了一种图像加密装置,该装置包括:
第一获取模块,用于根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
加密模块,用于采用目标密钥对每个所述第一目标图像进行加密;
第一发送模块,用于将加密后的每个第一目标图像发送给对应的每个目标设备。
进一步地,所述第一获取模块,具体用于针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述第一获取模块,具体用于确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述第一获取模块,具体用于根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
进一步地,所述第一获取模块,具体用于确定所述原图像在预设的每个通道上对应的第二目标图像;针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;针对每个通道上对应的第二目标图像对应的每个子图像,将 该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
进一步地,所述装置还包括:
切分模块,用于根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;
所述加密模块,还用于根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;
所述第一发送模块,具体用于将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
本申请还提供了一种图像处理装置,该装置包括:
接收模块,用于接收电子设备发送的加密后的第一目标图像;
处理模块,用于向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
第二获取模块,用于获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;对每个目标图像中像素点对应的像素值进行处理,获得原图像。
进一步地,所述第二获取模块,还用于将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
进一步地,所述第二获取模块,具体用于对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
进一步地,所述装置还包括:
第二发送模块,用于将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目 标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述第三目标图像对应的特征向量。
进一步地,所述第二发送模块,还用于根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及接收所述其他目标设备发送的子特征向量并保存。
进一步地,所述装置还包括:
验证模块,用于接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;若所述其他目标设备均可信,则触发所述处理模块。
进一步地,所述第二获取模块,用于接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
进一步地,所述第二发送模块,还用于针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基于所述目标公钥对解密后的所述目标子私钥进行加密;
所述装置还包括:
解密模块,用于基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
进一步地,所述第二获取模块,具体用于根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
进一步地,所述第二获取模块,具体用于针对每个目标图像在预设的每 个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
进一步地,所述第二获取模块,具体用于针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
进一步地,所述第二获取模块,具体用于根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;根据原图像在每个通道中所述目标像素点的像素值得到原图像。
本申请还提供了一种电子设备,所述电子设备包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如上述任一所述图像加密方法的步骤。
本申请还提供了一种计算机可读存储介质,其存储有可由终端执行的计算机程序,当所述程序在所述终端上运行时,使得所述终端执行上述任一项所述图像加密方法的步骤。
本申请还提供了一种电子设备,所述电子设备包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如上述任一所述图像处理方法的步骤。
本申请还提供了一种计算机可读存储介质,其存储有可由终端执行的计算机程序,当所述程序在所述终端上运行时,使得所述终端执行上述任一项所述图像处理方法的步骤。
在本申请实施例中,根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像, 其中多个第一目标图像能够得到原图像,采用目标密钥对每个第一目标图像进行加密,将加密后的每个第一目标图像发送给对应的每个目标设备。由于在本申请实施例中,多个第一目标图像中每个第一目标图像都是对原图像中像素点对应的像素点进行处理后得到的,每个第一目标图像中包含的像素点对应的像素值与原图像中的对应的像素点对应的像素值不完全相同,且由于在获得多个第一目标图像后,将多个第一目标图像分别发送给对应的目标设备,因此,不管是在第一目标图像发送的过程中进行攻击,还是对存储了第一目标图像的目标设备进行攻击,都不可能基于单独的一个第一目标图像获得原图像,保证了图像传输和存储的安全性,保护了用户的隐私,提高了用户的体验。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中基于人脸识别绑定银行卡以及办理业务的过程示意图;
图2为本申请实施例提供的一种图像加密的过程示意图;
图3a为本申请一些实施例提供的一种原图像的示意图;
图3b为本申请一些实施例提供的一种原图像在预设的每个通道上对应的像素矩阵的示意图;
图4a为本申请一些实施例提供的一种原图像的示意图;
图4b为本申请一些实施例提供的一种基于原图像确定的第一目标图像的示意图;
图5为本申请一些实施例提供的一种图像处理的过程示意图;
图6a为本申请一些实施例提供的一种对原图像的示意图;
图6b为本申请一些实施例提供的一种对原图像中像素点对应的像素值进 行处理后获得的第三目标图像的示意图;
图6c为本申请一些实施例提供的另一种对原图像中像素点对应的像素值进行处理后获得的第三目标图像的示意图;
图7a为本申请一些实施例提供的一种特征向量的切分前的示意图;
图7b为本申请一些实施例提供的一种特征向量的切分后的示意图;
图7c为本申请一些实施例提供的另外一种特征向量的切分后的示意图;
图8a为相关技术中基于MPC进行图像识别的包含用户的原图像对应的特征向量的过程示意图;
图8b为本申请一些实施例提供的一种识别包含用户的原图像对应的特征向量的过程示意图;
图9为本申请一些实施例提供的一种图像加密装置结构示意图;
图10为本申请一些实施例提供的一种图像处理装置结构示意图;
图11为本申请一些实施例提供的一种电子设备的结构示意图;
图12为本申请一些实施例提供的一种电子设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
在本申请实施例中,根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到原图像,采用目标密钥对每个第一目标图像进行加密,将加密后的每个第一目标图像发送给对应的每个目标设备。
实施例1:
为了保证图像传输和存储的安全性,保护用户的隐私,本申请实施例提 供了一种图像加密、图像处理方法、装置、设备及介质。
图2为本申请实施例提供的一种图像加密的过程示意图,该过程包括以下步骤:
S201:根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像。
本申请实施例提供的图像加密方法应用于电子设备,该电子设备可以是智能终端、PC或者服务器等设备。
在本申请实施例中,电子设备获得包含用户的原图像,其中,若电子设备预先安装了图像采集设备,则该原图像可以为电子设备的图像采集设备采集的,若该电子设备未安装图像采集设备,该原图像还可以为其他图像采集设备采集后发送给电子设备的。
在本申请实施例中,为了对图像进行加密,首先需要用户登录电子设备,只有具有权限的用户才能获取到原图像并对原图像进行加密。具体的,用户可以基于电子设备上的应用程序进行身份信息验证,若应用程序接收到携带身份信息的验证信息,则采用预先保存的目标用户身份信息与接收到的该身份信息进行比较,若存在与该身份信息一致的目标用户身份信息,则确定验证通过,应用程序向图像采集设备发送图像获取指令,以使图像采集设备在接收到该图像获取指令后,采集包含用户的原图像并发送给应用程序,以使应用程序获得到包含用户的图像。其中,该用户的身份信息可以包括用户的手机号、姓名、用户名以及身份证信息等等中的至少一个。
为了保证在传输或者存储的过程中图像的安全性,在本申请实施例中,电子设备可以根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,获得多个第一目标图像。其中,待接收到的图像的目标设备为接收到第一目标图像的目标设备,且该目标设备的数量越多,则对原图像中像素点对应的像素值进行处理,获得的第一目标图像的数量也越多。一般有几个目标设备获取几个第一目标图像即可。
为了保证将处理后的多个第一目标图像发送给对应的目标设备后,对应的目标设备能够将原图像进行复原,在对原图像中像素点对应的像素值进行处理时,需要保证可以基于处理后的多个第一目标图像得到该原图像。比如每个第一目标图像是对原图像中部分像素点的像素值进行了处理,这样将每个目标设备获取到的第一目标图像结合将会获取到原图像。
S202:采用目标密钥对每个所述第一目标图像进行加密。
为了保证安全,在获得多个第一目标图像后,采用目标密钥对每个第一目标图像分别进行加密,其中,该目标密钥可以为电子设备本身生成的,为了便于后续目标设备可以对加密的第一目标图像进行解密,以获得解密后的第一目标图像,该目标密钥也可以为目标设备发送给电子设备的。其中,对每个第一目标图像进行加密采用的目标密钥可以相同,也可以不相同。
其中,生成目标密钥的过程为现有技术,在此不做赘述。
若该目标密钥为电子设备本身生成的,为了保证目标设备后续可以对加密的第一目标图像进行解密,电子设备还需要将该目标密钥发送给目标设备,且为了减少电子设备的工作负担,若该目标密钥为电子设备本身生成的,则电子设备可以只生成一个目标密钥,并基于该生成的一个目标密钥分别对每个第一目标图像进行加密。
S203:将加密后的每个第一目标图像发送给对应的每个目标设备。
在本申请实施例中,在获得加密后的每个第一目标图像后,将加密后的每个第一目标图像分别发送给对应的每个目标设备。
在一种可能的实施方式中,若对每个第一目标图像加密的目标密钥为各个目标设备发送的,为了便于后续目标设备可以对接收到的加密后的第一目标图像进行解密,电子设备针对每个目标设备,采用该目标设备发送的目标密钥对第一目标图像进行加密,并将该基于该目标设备发送的目标密钥加密后的第一目标图像发送给该目标设备。
在另外一种可能的实施方式中,若对多个第一目标图像加密的目标密钥为电子设备产生的,因此,对每个第一目标图像进行加密的目标密钥均相同, 则可以随机将各个加密后的第一目标图像发送给对应的每个目标设备,只需要保证至少一个加密后的第一目标图像发送给一个目标设备即可。
由于在本申请实施例中,多个第一目标图像中每个第一目标图像都是对原图像中像素点对应的像素点进行处理后得到的,每个第一目标图像中包含的像素点对应的像素值与原图像中的对应的像素点对应的像素值不完全相同,且由于在获得多个第一目标图像后,将多个第一目标图像分别发送给对应的目标设备,因此,不管是在第一目标图像发送的过程中进行攻击,还是对存储了第一目标图像的目标设备进行攻击,都不可能基于单独的一个第一目标图像获得原图像,保证了图像传输和存储的安全性,保护了用户的隐私,提高了用户的体验。
实施例2:
为了获得多个第一目标图像,在上述实施例的基础上,在本申请实施例中,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;
根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
在本申请实施例中,为了获得能够得到原图像的多个第一目标图像,可以针对原图像中的每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为该数量个子像素值,其中,该数量个子像素值的和值为该像素值。比如,若待接收到图像的目标设备的数量为4个,则针对原图像中的每个像素点的像素值,将该像素值拆分为4个子像素值。其中,该数量个子像素值中每个子像素值的大小不做限制,可以为[0,255]中的任意数值,但是该数量个子像素值的和值应该等于该像素值,一般对像素值进行随意拆分更能保证图像的安全性。
为了确定多个第一目标图像,在本申请实施例中,针对每个像素点对应的该数量个子像素值,将任意一个子像素值作为任意一个第一目标图像上对应像素点的像素值,从而得到处理后的每个第一目标图像。由于针对原图像中的每个像素点,都可以将该像素点的像素值拆分为该数量个子像素值,因此,针对每个第一目标图像中的每个像素点,该第一目标图像中该像素点的像素值可以为该像素点对应的多个子像素值中的任意一个,但是不同的第一目标图像中该像素点对应的子像素值不相同,只要保证一个像素点的该数量个子像素值分别为每个第一目标图像中对应像素点的处理后的像素值即可,也就是每个第一目标图像中对应像素点的处理后的像素值的和为原图像中对应像素点的像素值。
针对该原图像中的两个像素点进行描述,该两个像素点分别为像素点A和像素点B,像素点A对应的像素值为255,像素点B对应的像素值为60,该待接收到图像的目标设备的数量为3个,则将该像素点A对应的像素值255拆分为3个子像素值,且该像素点A的3个子像素值的和值为255,例如可以分别为20、30以及205,或者50、55以及150等等。将该像素点B对应的像素值60拆分为3个子像素值,且该像素点B的3个子像素值的和值为60,例如可以分别为10、24以及26,或者5、15以及40等等。
若像素点A对应的像素值255,拆分后的3个子像素值分别为20、30以及205,像素点B对应的像素值60,拆分后的3个子像素值分别为10、24以及26。为了便于描述,将3个第一目标图像分别称为第一目标图像1、第一目标图像2以及第一目标图像3,则该第一目标图像1中像素点A以及像素点B对应的像素值可以为20和10,该第二目标图像2中像素点A以及像素点B对应的像素值可以为30和24,该第二目标图像3中像素点A以及像素点B对应的像素值可以为205和26;或者,该第一目标图像1中像素点A以及像素点B对应的像素值还可以为20和24,该第二目标图像2中像素点A以及像素点B对应的像素值还可以为30和10,该第二目标图像3中像素点A以及像素点B对应的像素值还可以为205和26;或者,该第一目标图像1中 像素点A以及像素点B对应的像素值还可以为30和26,该第二目标图像2中像素点A以及像素点B对应的像素值还可以为205和10,该第二目标图像3中像素点A以及像素点B对应的像素值还可以为20和24等等。
为了对原图像中各个像素点的像素值进行拆分,在上述各实施例的基础上,在本申请实施例中,所述针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值包括:
确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;
针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;
所述根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值包括:
根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
在本申请实施例中,可以直接基于原图像中各个像素点对应的像素值进行切分,由于该原图像中的每个像素点分别在预设的每个通道都对应一个像素值,因此,若针对该原图像中每个像素点在预设的每个通道对应的每个像素值,对该像素点在该预设的每个通道对应的像素值进行拆分,则更能保证安全性。其中该原图像一般为RGB图像,因此该预设的通道一般为R通道、G通道以及B通道。
为了进一步的保证安全性,该原图像在预设的每个通道上都对应有像素矩阵,其中,一个通道对应一个像素矩阵,且该像素矩阵中每个元素为每个对应像素点在对应通道上的像素值。
在确定每个通道对应的像素矩阵后,为了获得多个第一目标图像,可以 针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为该数量个子像素值,其中,该数量个子像素值的和为该通道对应的像素矩阵中该像素值,其中,该数量个子像素值中每个子像素值的大小不做限制,可以为[0,255]中的任意数值,但是该数量个子像素值的和值应该等于该通道对应的像素矩阵中该像素值。
为了确定多个第一目标图像,在本申请实施例中,根据每个通道对应的像素矩阵中每个像素点对应的该数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
由于针对每个通道对应的像素矩阵中每个像素值,都可以将该像素值拆分为多个子像素值,因此,针对每个通道对应的每个第一目标图像中的每个像素点,该通道对应的该第一目标图像中该像素点可以为多个子像素值中的任意一个,但是该通道对应的不同的第一目标图像中该像素点对应的子像素值不相同。
图3a为本申请一些实施例提供的一种原图像的示意图,图3b为本申请一些实施例提供的一种原图像在预设的每个通道上对应的像素矩阵的示意图,现针对图3a和图3b进行说明。
该原图像为一个RGB图像,如图3a,该原图像对应一个N*M*3的像素矩阵,其中,N为该原图像的长度方向包含的像素点的数量、M为该原图像的宽度方向包含的像素点的数量,3为通道数,分别是R通道、G通道以及B通道。
每个通道都对应一个像素矩阵,且针对每个通道对应的像素矩阵,该通道对应的像素矩阵为一个N*M的像素矩阵,如图3b所示,该R通道对应的像素矩阵为
Figure PCTCN2022112618-appb-000001
在G通道对应的像素矩阵为
Figure PCTCN2022112618-appb-000002
在B通道对应的像素矩阵为
Figure PCTCN2022112618-appb-000003
实施例3:
为了获得多个第一目标图像,在上述各实施例的基础上,在本申请实施例中,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;
针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
在本申请实施例中,为了获得能够得到原图像的多个第一目标图像,可以根据待接收到图像的目标设备的数量,将该原图像划分为该数量个子图像,其中,每个子图像位于该原图像中的位置均不相同,且该数量个子图像可以拼接为原图像。
在本申请实施例中,为了获得多个第一目标图像,可以针对每个子图像,将该原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。其中,该预设的像素值可以为0、或255、或其他的像素值等,具体的,该预设的像素值可以根据需求进行设置。
若该待接收到图像的目标设备的数量为两个,则可以将该原图像中的上半部分图像确定为一个子图像,将该原图像的下半部分图像确定为一个子图像。为了便于描述,将该上半部分图像称为第一子图像,将下半部分图像称为第二子图像。将该原图像中该第一子图像包含的像素点以外的其他像素点设置为预设的像素值,也就是说,保持该第一子图像中的像素点的像素值不 变,将下半部分图像中的所有像素点的像素值设置为预设的像素值,获得该第一子图像对应的处理后的第一目标图像;将该原图像中该第二子图像包含的像素点以外的其他像素点设置为预设的像素值,也就是说,保持该第二子图像中的像素点的像素值不变,将上半部分图像中的所有像素点的像素值设置为预设的像素值,获得该第二子图像对应的处理后的第一目标图像。
或者,还可以按照预设的规则对原图像进行划分,将原图像划分为多个区域,因为目标设备的数量是已知的,可以根据该数量对多个区域进行分组,划分为该数量个组,每个组中包含的区域不重复,并且每个区域被划分到不同的组中,每个组包含的区域构成一个子图像。
图4a为本申请一些实施例提供的一种原图像的示意图,图4b为本申请一些实施例提供的一种基于原图像确定的第一目标图像的示意图,现针对图4a和图4b进行说明。
以目标设备的数量为2进行说明,获得的原图像如图4a所示,图4a中P11、P12、P13、P14、P21…….P41均为该原图像中各个区域,P11、P13、P22、P23、P31、P32、P34、P43构成一个子图像,P12、P14、P21、P24、P33、P41、P42、P44构成另外一个子图像,针对每个子图像,将该原图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。具体的,针对P11、P13、P22、P23、P31、P32、P34、P43构成的子图像,将原图像中P12、P14、P21、P24、P33、P41、P42、P44包含的像素点对应的像素值设置为预设的像素值,获得该子图像对应的处理后的第一目标图像,如图4b中左侧图像所示。其中,[P12] 1、[P14] 1、[P21] 1、[P24] 1、[P33] 1、[P41] 1、[P42] 1、[P44] 1,表征该P12、P14、P21、P24、P33、P41、P42、P44包含的像素点对应的像素值已经设置为预设的像素值。
针对P12、P14、P21、P24、P33、P41、P42、P44构成的子图像,将原图像中P11、P13、P22、P23、P31、P32、P34、P43包含的像素点对应的像素值设置为预设的像素值,获得该子图像对应的处理后的第一目标图像,如 图4b中右侧图像所示。其中,[P11] 1、[P13] 1、[P22] 1、[P23] 1、[P33] 1、[P31] 1、[P32] 1、[P34] 1、[P43] 1,表征该P11、P13、P22、P23、P31、P32、P34、P43包含的像素点对应的像素值已经设置为预设的像素值。
为了将原图像划分为多个子图像,在上述各实施例的基础上,在本申请实施例中,所述根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像包括:
确定所述原图像在预设的每个通道上对应的第二目标图像;
针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;
所述将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像包括:
针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
在本申请实施例中,可以直接将原图像划分为多个子图像,由于该原图像分别在预设的每个通道都对应有像素值,因为将原图像中像素点分别在预设的每个通道对应的像素值构成的图像作为第二目标图像。因此,针对该原图像分别在预设的每个通道对应的第二目标图像,将该第二目标图像进行子图像的划分,获得每个通道对应的第一目标图像,则更能保证安全性。其中,该原图像一般为RGB图像,因此该预设的通道一般为R通道、G通道以及B通道。
为了进一步的保证安全性,可以先确定该原图像在预设的每个通道上对应的第二目标图像,其中,一个通道对应一个第二目标图像。针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为该数量个子图像。
若待接收到图像的目标设备的数量为3个,将R通道对应的第二目标图 像划分为3个子图像,将G通道对应的第二目标图像划分为3个子图像,将B通道对应的第二目标图像划分为3个子图像。
为了确定每个通道上的第二目标图像的每个子图像对应的处理后的第一目标图像,在本申请实施例中,针对每个通道的第二目标图像对应的每个子图像,将该通道的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
为了便于描述,将原图像的R通道、G通道以及B通道上对应的第二目标图像分别称为第二目标图像A、第二目标图像B以及第二目标图像C,以确定R通道上第二目标图像A的每个子图像对应的处理后的第一目标图像为例进行说明。
若目标设备的数量为两个,则可以将第二目标图像A中的上半部分图像确定为一个子图像,将该第二目标图像A的下半部分图像确定为一个子图像。为了便于描述,将该第二目标图像A中上半部分图像称为第一子图像A,将该第二目标图像A下半部分图像称为第二子图像A。将该第二目标图像A中该第一子图像A包含的像素点以外的其他像素点设置为预设的像素值,也就是说,保持原图像中该第一子图像A中包含的像素点的像素值不变,将下半部分图像中包含的所有像素点的像素值设置为预设的像素值,获得该第二目标图像A的第一子图像A对应的处理后的第一目标图像;将该第二目标图像A中该第二子图像A包含的像素点以外的其他像素点设置为预设的像素值,也就是说,保持原图像中该第二子图像A中包含的像素点的像素值不变,将上半部分图像中包含的所有像素点的像素值设置为预设的像素值,获得该第二目标图像A的第二子图像A对应的处理后的第一目标图像。
实施例4:
为了便于目标设备基于目标密钥对第一目标图像进行解密,在上述各实施例的基础上,在本申请实施例中,所述采用目标密钥对每个所述第一目标图像进行加密之后,所述将加密后的第一目标图像发送给每个目标设备之前, 所述方法还包括:
根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;
根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;
所述将加密后的第一目标图像发送给每个目标设备包括:
将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
对多个第一目标图像进行加密的目标密钥可以为电子设备产生的,还可以为目标设备产生发送给电子设备的,在本申请实施例中,若该目标密钥为电子设备产生的,为了便于后续目标设备能够基于目标密钥对该加密后的第一目标图像进行解密,电子设备需要将该目标密钥也发送给目标设备。
为了提高安全性,电子设备还可以将目标密钥进行切分,切分为多个目标子密钥,具体的,根据待接收到图像的目标设备的数量,将该目标密钥切分为该数量个目标子密钥,其中,数量个目标子密钥能够拼接成目标密钥。其中,每个目标子私钥均是目标密钥的一部分。
比如,该目标密钥为AZ2y789t0,目标设备的数量为2,则将该目标密钥切分为两个目标子私钥,该两个目标子私钥可以分别为AZ2y以及789t0。
为了提高安全性,在获得多个目标子私钥后,还可以根据接收到的每个目标设备发送的公钥,对该数量个目标子私钥进行加密,获得加密后的目标子私钥,具体的,电子设备获得的多个目标子私钥的数量与接收到的目标设备发送的公钥的数量相同,具体基于哪个公钥对哪个目标子私钥进行加密不做限制,只需要保证每个目标设备发送的公钥对不同的目标子私钥进行加密即可。其中,不同的目标设备发送的公钥不相同。
为了减少电子设备以及目标设备的工作负担,可以将该加密后的目标子私钥以及加密后的第一目标图像同时发送给对应的目标设备。
实施例5:
图5为本申请一些实施例提供的一种图像处理的过程示意图,该过程包括以下步骤:
S501:接收电子设备发送的加密后的第一目标图像。
本申请实施例提供的图像处理方法应用于目标设备,该目标设备可以是智能终端、PC或者服务器等设备,且该目标设备与进行图像加密的电子设备不为同一个设备。
在本申请实施例中,为了获得原图像,目标设备接收电子设备发送的加密后第一目标图像。
S502:向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像。
在本申请实施例中,进行图像处理的目标设备可以是任意一个目标设备,并且可以在该目标设备中预先配置与其同时接收到电子设备发送的加密后的第一目标图像的其他目标设备的信息,从而方便该目标设备与其他目标设备进行通信,获取其他目标设备发送的加密后的其他第一目标图像。
由于电子设备得到的处理后的多个第一目标图像分别发送给了对应的目标设备,因此,在本申请实施例中,为了获得原图像,进行图像处理的目标设备需要向其他目标设备发送图像获取指令,并接收其他目标设备发送的加密后的其他第一目标图像。
在一种可能的实施方式中,针对每个其他目标设备,该其他目标设备中加密后的其他第一目标图像可以为该其他目标设备生成目标密钥后,将该目标密钥发送给电子设备后,使得电子设备根据接收到的目标密钥对第一目标图像进行加密后发送给该其他目标设备,该其他目标设备直接将该接收到的加密后的其他第一目标图像发送给目标设备。
在另一种可能的实施方式中,针对每个其他目标设备,该其他目标设备中加密后的其他第一目标图像还可以为基于电子设备产生的目标密钥,并基于该目标密钥将该第一目标图像进行加密后发送给该其他目标设备,该其他目标设备将接收到的电子设备发送的加密后的第一目标图像发送给目标设备。
S503:获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像。
在本申请实施例中,为了获得原图像,目标设备对自身接收到的加密后的第一目标图像以及其他目标设备发送的加密后的其他第一目标图像进行解密,获得每个目标图像。其中,目标图像为未加密的第一目标图像。
在一种可能的实施方式中,若对所有第一目标图像进行加密的目标密钥为电子设备生成的,则对每个第一目标密钥进行加密的目标密钥均相同,因此,该目标设备获取到的目标密钥为电子设备发送的,在对接收到的第一目标图像及每个其他第一目标图像进行解密时,采用相同的目标密钥进行解密,获得每个目标图像。
在另一种可能的实施方式中,若对所有第一目标图像进行加密的目标密钥为对应的目标设备生成的,则对每个第一目标图像进行加密的目标密钥均由不同的目标设备生成,且均不相同,因此,该目标设备获取自身生成的对自身第一目标图像进行加密的目标密钥,获取其他目标设备生成并发送给该目标设备的目标密钥。在对接收到的第一目标图像及每个其他第一目标图像进行解密时,采用该第一目标图像对应的目标密钥进行解密,获得该第一目标图像对应的目标图像。
S504:对每个目标图像中像素点对应的像素值进行处理,获得原图像。
在本申请实施例中,在获得每个目标图像之后,为了获得原图像,将每个目标图像中像素点对应的像素值进行处理。
具体的,为了保证基于每个目标图像准确的获得原图像,电子设备以及目标设备预先约定了像素值处理方式,也就是说,目标设备已知电子设备对原图像中像素点进行像素值进行处理的方法,根据该处理方法确定对应的像素值处理方法,采用该处理方法对每个目标图像中像素点对应的像素值进行对应的处理,获得原图像。
本申请实施例中,由于目标设备在接收到电子设备发送的加密后的第一目标图像以及其他目标设备发送的加密后的其他第一目标图像之后,才能获 得原图像,基于自身接收到的加密后的第一目标图像不可能获得原图像,即使在存在漏洞或者攻击时,也不会存在安全隐患,保护了用户隐私,提高了用户体验。
实施例6:
为了确定原图像对应的特征向量,便于后续基于特征向量进行身份识别,在上述各实施例的基础上,所述方法还包括:
将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
为了对原图像准确的进行特征提取,获得该原图像对应的特征向量,在本申请实施例中,预先训练完成了特征提取模型,将该原图像输入到预先训练完成的特征提取模型中,获得该原图像对应的特征向量,并将该获得的特征向量进行保存。
在本申请实施例中,为了提高确定的原图像对应的特征向量的准确性,在将原图像输入到预先训练完成的特征提取模型之前,可以先对该原图像进行预处理,比如,去噪、灰度化、人脸检测、归一化等处理,并将处理后的原图像输入到预先训练完成的特征提取模型中,进行目标特征提取。
其中,对原图像进行预处理的过程为现有技术,在此不做赘述。
为了提高安全性,在上述各实施例的基础上,所述将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量包括:
对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;
将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;
基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
在本申请实施例中,若目标设备在获得原图像对应的特征向量后,直接将确定的该原图像对应的特征向量保存在目标设备中,若目标设备存在漏洞 或者被攻击时,由于可以直接获得目标设备保存该原图像对应的特征向量,还会存在不安全的风险。为了提高安全性,在本申请实施例中,可以对该原图像中像素点对应的像素值进行处理,获得多个第三目标图像,然后使得该多个第三目标图像在不同的目标设备进行特征提取,其中,该多个第三目标图像能够获得原图像。具体的,在本申请实施例中,目标设备可以基于该目标设备中部署的预先训练完成的特征提取模型,对原图像中像素点对应的像素值进行处理,获得该预先训练完成的特征提取模型输出的多个第三目标图像,还可以为目标设备直接对该原图像中像素点对应的像素值进行处理,获得多个第三目标图像。
目标设备对原图像中像素点对应的像素值进行处理,获得多个第三目标图像的过程与和电子设备对原图像中像素点对应的像素值进行处理,获取多个第一目标图像的过程相同,在此不再赘述。
图6a为本申请一些实施例提供的一种对原图像的示意图,图6b为本申请一些实施例提供的一种对原图像中像素点对应的像素值进行处理后获得的第三目标图像的示意图,图6c为本申请一些实施例提供的另一种对原图像中像素点对应的像素值进行处理后获得的第三目标图像的示意图,现针对图6a、图6b以及图6c进行说明。
以目标设备的数量为2进行说明,可以先将原图像分割为两个子图像,其中,图6a中的白色的正方块表征该原图像的各个区域。
然后针对每个子图像,将原图像中除该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,获得该子图像对应的处理后的第一目标图像,其中,该图6b和图6c中黑色正方块表征该原图像中该区域对应的像素点的像素值设置为了预设的像素值。可见,针对原图像分割的两个子图像中每个子图像对应的处理后的第一目标图像针对同一个像素点对应的像素值不相同,具体的确定的第一目标原图像的可以存在多种可能形式,图6b和图6c中显示了两种形式,其中一种形式参见图6b中的两张图像,另外一种形式参见图6c中的两张图像。
在本申请实施例中,目标设备可以将该多个第三目标图像中的任意一个第三目标图像确定为第四目标图像,并基于目标设备中部署的预先训练完成的特征提取模型继续对第四目标图像进行特征向量提取,获得该第四目标图像对应的特征向量,并将该第四目标图像对应的特征向量进行保存。
为了使得其他目标设备对第三目标图像进行特征提取,在上述各实施例的基础上,所述方法还包括:
将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述第三目标图像对应的特征向量。
由于目标设备确定了多个第三目标图像,在确定该多个第三目标图像中在目标设备进行特征提取的第四目标图像后,将该多个第三目标图像中除第四目标图像以外的第三目标图像,分别发送给其他目标设备,其中,一个第三目标图像发送给一个其他目标设备。
在将该多个第三目标图像中除第四目标图像以外的第三目标图像,分别发送给对应的其他目标设备后,其他目标设备分别基于自身预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得第三目标图像对应的特征向量,并将获得的特征向量进行保存。
实施例7:
为了进一步提高安全性,在上述各实施例的基础上,获得目标图像对应的特征向量之后,所述方法还包括:
根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及
接收所述其他目标设备发送的子特征向量并保存。
目标设备在确定第四目标图像对应的特征向量后,可以直接将该特征向量进行保存,由于若该第四目标图像是基于原图像上划分的子图像,将原图 像中该子图像中包含的像素点以外的其他像素点对应的像素值设置为预设像素值而获得的,则还是可以提取到原图像中的部分特征,因此为了进一步提高安全性,在本申请实施例中,还可以进一步对该特征向量进行切分,将切分后获得的多个子特征向量中的部分子特征向量进行保存,将其余的子特征向量发送给其他目标设备进行保存。
在本申请实施例中,可以根据目标设备的数量,将该特征向量切分为该数量个子特征向量,其中,该目标设备的数量包括目标设备自身以及其他目标设备,其中,该数量个子特征向量的和值为该特征向量。
若该目标设备的数量为2个,该特征向量为(a,b),则将该特征向量切分为2个子特征向量,分别为(a1,b1)以及(a2,b2),其中,a=a1+a2,b=b1+b2。
图7a为本申请一些实施例提供的一种特征向量的切分前的示意图,图7b为本申请一些实施例提供的一种特征向量的切分后的示意图,图7c为本申请一些实施例提供的另外一种特征向量的切分后的示意图,现针对图7a、图7b以及图7c进行说明。
特征向量的切分方式存在多种,若目标设备的数量为两个,则可以针对特征向量中的每个分量,将该分量拆分为两个子特征向量,其中,该两个子分量的和值为该分量。还可以针对该特征向量中的每个分量中的部分分量,将该特征向量中的部分分量保持不变,将该特征向量中除部分分量以外的分量设置为预设的数值,确定一个子特征向量。将该特征向量中的该部分分量设置为预设的数值,将该特征向量中除部分分量以外的分量保持不变,确定另外一个子特征向量。其中,该预设的数值可以为0,如图7a所示,用正方形框表征特征向量中的各个分量,如图7b和图7c所示,白色的正方形框表征保持不变的分量,黑色的正方形框表征设置为预设的数值的分量。具体的确定的子特征向量可以存在多种可能形式,图7b和图7c分别显示了两种形式,其中一种形式参见图7b中的两张图像,另外一种形式参见图7c中的两张图像。
在根据目标设备的数量,将该特征向量切分为该数量个子特征向量后, 保存该数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给其他目标设备,其中,一个子特征向量发送给一个其他目标设备。
同理,针对每个其他目标设备,该其他目标设备中在确定第三目标图像对应的特征向量后,也将该特征向量进行切分,并保留一个切分后获得的子特征向量,将其他子特征向量分别发送给除自身以外的其他目标设备,因此每个目标设备都会接收到其他目标设备发送的子特征向量。
在本申请实施例中,电子设备对图像进行加密的过程以及目标设备进行图像处理的过程可以应用在用户身份注册场景,还可以用于用户身份识别场景。具体的,若应用在用户身份注册场景,则目标设备直接将获得的第四目标图像对应的一个子特征向量以及接收到的其他目标设备发送的子特征向量进行保存。同理,针对每个其他目标设备,该其他目标设备也将自身获得的第三目标图像对应的一个子特征向量以及接收到的其他目标设备发送的子特征向量进行保存。若应用在用户身份识别场景,则目标设备直接将获得的第四目标图像对应的一个子特征向量以及接收到的其他目标设备发送的子特征向量后,可以直接基于该自身预先保存的各个用户对应的子特征向量,确定与预先保存的各个用户对应的子特征向量之间的欧式距离,根据该欧式距离以及预设的阈值,识别该用户的身份,同理,其他目标设备进行身份识别的过程与目标设备进行身份识别的过程相同,在此不做赘述。根据每个目标设备的身份识别结果,确定用户的身份,目标设备包括所有其他目标设备以及该目标设备,具体的,可以确定每个目标设备识别出的身份识别结果是否一致,若一致,则将任意一个目标设备识别出的身份识别结果确定为最终的身份识别结果即可。
其中,确定两个子特征向量之间的欧式距离的过程为现有技术,在此不做赘述。
在本申请实施例中,在各个目标设备在确定身份识别结果后,还可以将各自确定的身份识别结果输出,具体的,可以通过文字或者语音的方式进行输出,比如,在显示页面上显示“识别出该用户为用户A”的文字,或者发出“识 别出该用户为用户A”的语音。
实施例8:
为了提高安全性,在上述各实施例的基础上,所述接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获取指令之前,所述方法还包括:
接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;
若所述其他目标设备均可信,则进行向所述其他目标设备发送获取指令的操作。
在本申请实施例中,目标设备为了获得原图像,且由于加密后的第一目标图像分别保存在不同的目标设备中,因此,目标设备需要与每个其他目标设备进行通信,获得每个其他目标设备中保存的加密后的第一目标图像。
在本申请实施例中,为了提高安全性,可以在接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获得指令之前,先确定该其他目标设备是否可信。
为了确定其他目标设备是否可信,目标设备先接收其他目标设备基于该其他目标设备自身的标识信息、属性信息生成目标验证消息,其中,该其他目标设备自身的标识信息以及属性信息预先保存在其他目标设备中,属性信息可以为该目标设备的版本信息,设备信息等等。其中,该目标验证信息可以为验证签名或者验证报告。
其中,生成验证签名以及验证报告的过程为现有技术,在此不做赘述。
为了验证该其他目标设备是否可信,在本申请实施例中,目标设备接收该其他目标设备发送的目标验证信息,并确定自身预先保存的各个设备的标准验证信息中是否存在与该目标验证信息一致的标准验证信息,若存在,则确定该其他目标设备可信,若不存在,则确定该其他目标设备不可信。
在本申请实施例中,由于在存在不同的用户识别或者用户注册过程,且每次用户识别或者用户注册时,都需要在向其他目标设备发送获得指令,在向其他目标设备发送获得指令之前,先对其他目标设备是否可信进行验证,因此为了准确的区分是针对哪次进行用户识别或者哪次用户注册进行验证,目标设备可以在接收其他目标设备发送的目标验证消息之前,先产生一个随机数,并将该随机数发送给其他目标设备,其他目标设备在生成目标验证消息后,可以将该随机数与该目标验证消息同时发送给目标设备。其中,该随机数是随机产生的,且该随机数只用于区分针对哪个用户识别或用户注册过程。
在本申请实施例中,该各个设备的标准验证信息可以预先保存在目标设备中,还可以保存在验证服务系统中,若保存在验证服务系统中,则目标设备在获得其他目标设备发送的目标验证信息后,向该验证服务系统发送验证信息获取请求,获得验证服务系统发送的各个设备的标准验证信息并保存,然后基于该各个设备的标准验证信息以及其他目标识别发送的目标验证信息,验证该其他目标设备是否可信。具体的,各个设备的标准验证信息保存在哪个设备中,不再限定。
在本申请实施例中,若确定所有其他目标设备均可信,则进行向其他目标设备发送获取指令的操作,若存在任意一个其他目标设备不可信,为了保证安全,不进行向其他目标设备发送获取指令的操作。
在本申请实施例中,由于在接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获取指令之前,先验证了其他目标设备是否可信,在保证加密后的第一目标图像的通信安全的同时,还可以保证对加密后的第一目标图像的数据处理过程的安全性。
实施例9:
为了获取目标密钥,在上述各实施例的基础上,在本申请实施例中,所述获得目标密钥包括:
接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后 的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子密钥;
将每个解密后的所述目标子密钥进行拼接,生成目标密钥。
在本申请实施例中,若目标密钥为电子设备产生的,且电子设备将目标密钥进行切分,切分为多个目标子密钥后,对每个目标子密钥进行加密后发送给对应的目标设备,其中,对每个目标子密钥进行加密的公钥为对应的目标设备产生并发送的。因此,目标设备会接收到电子设备发送的一个加密后的目标子密钥,并基于该自身产生的私钥对该加密后的目标子密钥进行解密,其中,该私钥与发送给电子设备,且电子设备用于对目标子密钥进行加密的公钥为一个公私钥对,其中,该公私钥对可以为非对称公私钥对,也可以为对称公私钥对,在本申请实施例中,该公私钥对为非对称公私钥对,且该非对称公私钥对可以为公钥基础设施(Public Key Infrastructure,PKI)非对称公私钥对。
其中,生成公私钥对的过程为现有技术,在此不做赘述。
在本申请实施例中,目标设备为了获得目标密钥,需要获得电子设备发送给每个其他目标设备的目标子密钥,由于电子设备发送给每个其他目标设备的目标子密钥为基于对应的其他目标设备发送的公钥进行加密后的目标子密钥,因此,目标设备接收到其他目标设备发送的目标子密钥为解密后的目标子密钥。具体的,该接收到的解密后的目标子密钥为其他目标设备基于自身产生的私钥对加密后的目标子密钥进行解密后的目标子密钥。
在本申请实施例中,目标设备将每个解密后的目标子密钥进行拼接,生成目标密钥。具体的,为了准确的进行拼接,目标设备需要确定每个目标子密钥的拼接顺序,在本申请实施例中,电子设备可以预先将目标密钥切分为目标子密钥之后,根据切分后获得的目标子私钥在目标密钥中的位置,为各个目标子密钥设置标识信息,比如,若将目标密钥切分为两个目标子密钥,则将在目标密钥中位置靠前的目标子密钥的标识信息设置为1,将在目标密钥中位置靠后的目标子密钥的标识信息设置为2。电子设备在将目标子密钥发送 给对应的其他目标设备时,将对应的标识信息也发送给其他目标设备。且其他目标设备在将解密后的目标子密钥发送给目标设备时,还需要将目标子密钥的标识信息也发送给目标设备。目标设备在接收每个解密后的目标子密钥以及每个目标子密钥的标识信息后,根据每个目标子密钥的标识信息,对每个解密后的目标子密钥进行拼接,生成目标密钥。
为了保证接收其他目标设备发送的目标子密钥过程中的安全性,在上述各实施例的基础上,所述接收所述其他目标设备发送的解密后的目标子密钥之前,所述方法还包括:
针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给该其他目标设备,以使该其他目标设备基于所述私钥对加密后的目标子密钥进行解密后,基于所述目标公钥对解密后的所述目标子密钥进行加密;
所述接收所述其他目标设备发送的解密后的目标子私钥之后,将接收到的每个解密后的所述目标子私钥进行拼接之前,所述方法还包括:
基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子密钥进行解密。
在本申请实施例中,由于目标设备接收其他目标设备发送的解密后的目标子密钥是用于确定目标密钥,进而对加密的第一目标图像进行解密,因此,若目标设备在接收解密后的目标子密钥的过程中出现数据泄露或者被篡改,则会严重影响安全性或者导致后续不能对加密的第一目标图像进行解密,最终无法恢复原图像。因此,在本申请实施例中,可以在接收其他目标设备发送的解密后的目标子密钥之前,针对每个其他目标设备,生成目标公私钥对,将目标公私钥对中的目标公钥发送给其他目标设备,以使其他目标设备基于自身的私钥对加密后的目标子密钥进行解密后,基于接收到的目标设备发送的目标公钥对解密后的目标子密钥进行加密,并将加密后的目标子私钥发送给目标设备。其中,可以针对每个其他目标设备,目标设备生成该其他目标设备对应的一个目标公私钥对,也就是说,可以针对不用的其他目标设备, 生成不同的目标公私钥对,为了减少目标设备工作负担,还可以针对所有其他目标设备,生成一个相同的目标公私钥对。
目标设备在接收到加密后的目标子私钥后,基于生成的目标公私钥对中的目标私钥对接收到的加密后的目标子密钥进行解密,获得目标子密钥。
实施例10:
为了获得原图像,在上述各实施例的基础上,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
在本申请实施例中,若电子设备针对原图像中的每个像素点的像素值,将该像素值拆分为多个子像素值,并根据每个像素点对应的多个子像素值,确定每个第一目标图像中对应像素点的处理后的像素值,进而确定第一目标图像,则目标设备在根据每个目标图像,获得原图像时,根据每个目标图像中的每个对应像素点,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值,进而获得原图像。
为了获得原图像,在上述各实施例的基础上,所述将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值包括:
针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
在本申请实施例中,若电子设备针对每个通道对应的像素矩阵中的每个像素值,将该通道对应的像素矩阵中该像素值拆分为多个子像素值,并根据每个通道对应的像素矩阵中每个像素点对应的该数量个子像素值,确定每个通道对应的每个第一目标图像中对应像素点的处理后的像素值,则目标设备为了恢复原图像,针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
实施例11:
为了获得原图像,在上述各实施例的基础上,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
在本申请实施例中,若电子设备将所述原图像划分为多个子图像,并针对每个子图像,将该原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像,则目标设备为了获得原图像,可以针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点,并将该原图像中该目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
为了获得原图像,在上述各实施例的基础上,所述确定该目标图像中像素点的像素值非预设的像素值的目标像素点包括:
根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;
所述将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像包括:
将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;
根据原图像在每个通道中所述目标像素点的像素值得到原图像。
在本申请实施例中,若电子设备根据原图像在预设的每个通道上对应的第二目标图像,将该通道上对应的第二目标图像划分为多个子图像,针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图 像,则目标设备为了确定原图像,可以根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点,将原图像在该通道中目标像素点的像素值设置为该通道上该目标图像对应的该子图像中目标像素点的像素值,根据原图像在每个通道中目标像素点的像素值得到原图像。
图8a为相关技术中基于MPC进行图像识别的包含用户的原图像对应的特征向量的过程示意图,图8b为本申请一些实施例提供的一种识别包含用户的原图像对应的特征向量的过程示意图,现针对图8a和图8b进行说明。
以待接收到图像的目标设备的数量为2个进行说明。
相关技术中,电子设备先获得包含用户的原图像,然后对该原图像进行特征提取,确定对应的特征向量拆分为第一特征向量以及第二特征向量,并分别基于获得的目标密钥对该第一特征向量以及第二特征向量进行加密,将加密后的第一特征向量以及加密后的第二特征向量分别发送给对应的第一目标设备以及对应的第二目标设备,第一目标设备获得目标密钥,并基于该目标密钥对该加密后的第一特征向量进行解密,获得解密后的第一特征向量并存储在第一目标设备的数据库中;第二目标设备获得目标密钥,并基于该目标密钥对该加密后的第二特征向量进行解密,获得解密后的第二特征向量并存储在第二目标设备的数据库中。由于第一目标设备以及第二目标设备中分别预先保存了各个用户的特征向量,第一目标设备将该第一特征向量(解密后的)与第一目标设备中预先保存的各个用户的特征向量进行比较,第二目标设备将该第二特征向量(解密后的)与第二目标设备中预先保存的各个用户的特征向量进行比较,根据两个比较结果,确定用户的身份。
在本申请实施例中,电子设备先获得包含用户的原图像,将该原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,基于目标密钥对该多个第一目标图像进行加密,并将目标密钥切分为多个目标子密钥,根据接收到的每个目标设备发送的公钥,分别对各个目标子密钥进行加密, 将加密后的每个第一目标图像以及加密后的每个目标子密钥发送给对应的每个目标设备。
每个目标设备位于各个机构对应的人脸服务系统中,针对每个机构对应的人脸服务系统,该机构对应的人脸服务系统中既包含目标设备,还可以包含验证服务系统,比如,机构1对应的人脸服务系统中既包含第一目标设备,还可以包含第一验证服务系统,机构2对应的人脸服务系统中既包含第二目标设备,还可以包含第二验证服务系统。
第一目标设备接收到加密后的第一目标图像1以及加密后的目标子密钥1,第二目标设备接收到加密后的第一目标图像2以及加密后的目标子密钥2,以在第一目标设备中恢复原图像进行说明,第一目标设备产生随机数,并将该随机数发送给第二目标设备,第二目标设备根据自身的标识信息、属性信息生成目标验证信息并发送给第一目标设备,第一目标设备接收该第二目标设备发送的目标验证信息,向第一验证服务系统发送验证信息获取指令,获得各个设备的标准验证信息,若各个设备的标准验证信息中存在与该目标验证信息一致的标准验证信息,确定该第二目标设备可信。
第一目标设备基于自身生成的私钥对接收到的电子设备发送的加密后的目标子密钥1进行解密,获得解密后的目标子密钥1。并生成目标公私钥对,将该目标公私钥对中的目标公钥发送给第二目标设备,并向第二目标设备发送图像获取指令,第二目标设备接收到图像获取指令以及目标公钥后,第二目标设备基于自身产生的私钥对接收到的电子设备发送的加密后的目标子密钥2进行解密,并将获得的解密后的目标子密钥2基于目标公钥进行加密,将加密后的目标子密钥2以及加密后的第一目标图像2发送给第一目标设备,第一目标设备在接收到加密后的目标子密钥2后,基于生成的目标公私钥对中的目标私钥,对该加密后的目标子密钥2进行解密,第一目标设备获得解密后的目标子密钥2。
将解密后的目标子密钥1和解密后的目标子密钥2进行拼接,确定目标密钥,并基于目标密钥对每个加密后的第一目标图像1和加密后的第一目标 图像2进行解密,获得每个目标图像,对每个目标图像中像素点对应的像素值进行处理,获得原图像。
将该原图像输入到第一目标设备中预先训练完成的特征提取模型中,基于预先训练完成的特征提取模型,对该原图像中像素点对应的像素值进行处理,获得预先训练完成的特征提取模型输出的两个第三目标图像,将两个第三目标图像中的任意一个第三目标图像确定为第四目标图像,并基于该第一目标设备中的预先训练完成的特征提取模型,提取该第四目标图像对应的特征向量,将两个第三目标图像中除该第四目标图像以外的另一个第三目标图像发送给第二目标设备。
第二目标设备接收到该另一个第三目标图像后,基于该第二目标设备中的预先训练完成的特征提取模型,获得该另外一个第三目标图像的特征向量。
第一目标设备在确定第四目标图像对应的特征向量后,将该特征向量切分为特征向量1和特征向量2,第二目标设备在确定另外一个第三目标图像对应的特征向量后,将该特征向量切分为特征向量3和特征向量4,则第一目标设备可以将特征向量2发送给第二目标设备,并接收到第二目标设备发送的特征向量4,第二目标设备可以将特征向量4发送给第二目标设备,并接收到第二目标设备发送的特征向量1,也就是说,第一目标设备中存储特征向量1和特征向量4,第二目标设备中存储特征向量2和特征向量3。
实施例12:
图9为本申请一些实施例提供的一种图像加密装置结构示意图,该装置包括:
第一获取模块901,用于根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
加密模块902,用于采用目标密钥对每个所述第一目标图像进行加密;
第一发送模块903,用于将加密后的每个第一目标图像发送给对应的每个目标设备。
在一种可能的实施方式中,所述第一获取模块901,具体用于针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
在一种可能的实施方式中,所述第一获取模块901,具体用于确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
在一种可能的实施方式中,所述第一获取模块901,具体用于根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
在一种可能的实施方式中,所述第一获取模块901,具体用于确定所述原图像在预设的每个通道上对应的第二目标图像;针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
在一种可能的实施方式中,所述装置还包括:
切分模块904,用于根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密 钥;
所述加密模块902,还用于根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;
所述第一发送模块903,具体用于将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
实施例13:
图10为本申请一些实施例提供的一种图像处理装置结构示意图,该装置包括:
接收模块1001,用于接收电子设备发送的加密后的第一目标图像;
处理模块1002,用于向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
第二获取模块1003,用于获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;对每个目标图像中像素点对应的像素值进行处理,获得原图像。
在一种可能的实施方式中,所述第二获取模块1003,还用于将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
在一种可能的实施方式中,所述第二获取模块1003,具体用于对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
在一种可能的实施方式中,所述装置还包括:
第二发送模块1004,用于将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像 进行特征提取,获得所述第三目标图像对应的特征向量。
在一种可能的实施方式中,所述第二发送模块1004,还用于根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及接收所述其他目标设备发送的子特征向量并保存。
在一种可能的实施方式中,所述装置还包括:
验证模块1005,用于接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;若所述其他目标设备均可信,则触发所述处理模块。
在一种可能的实施方式中,所述第二获取模块1003,用于接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
在一种可能的实施方式中,所述第二发送模块1004,还用于针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基于所述目标公钥对解密后的所述目标子私钥进行加密;
所述装置还包括:
解密模块1006,用于基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
在一种可能的实施方式中,所述第二获取模块1003,具体用于根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
在一种可能的实施方式中,所述第二获取模块1003,具体用于针对每个 目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
在一种可能的实施方式中,所述第二获取模块1003,具体用于针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
在一种可能的实施方式中,所述第二获取模块1003,具体用于根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;根据原图像在每个通道中所述目标像素点的像素值得到原图像。
实施例14:
在上述各实施例的基础上,本申请一些实施例还提供了一种电子设备,如图11所示,包括:处理器1101、通信接口1102、存储器1103和通信总线1104,其中,处理器1101,通信接口1102,存储器1103通过通信总线1104完成相互间的通信。
所述存储器1103中存储有计算机程序,当所述程序被所述处理器1101执行时,使得所述处理器1101执行如下步骤:
根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
采用目标密钥对每个所述第一目标图像进行加密;
将加密后的每个第一目标图像发送给对应的每个目标设备。
进一步地,所述处理器1101,还用于针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个 子像素值,其中所述数量个子像素值的和为该像素值;根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述处理器1101,还用于确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述处理器1101,还用于根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
进一步地,所述处理器1101,还用于确定所述原图像在预设的每个通道上对应的第二目标图像;针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
进一步地,所述处理器1101,还用于根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
上述服务器提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口1102用于上述电子设备与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选地,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述处理器可以是通用处理器,包括中央处理器、网络处理器(Network Processor,NP)等;还可以是数字指令处理器(Digital Signal Processing,DSP)、专用集成电路、现场可编程门陈列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。
实施例15:
在上述各实施例的基础上,本申请一些实施例还提供了一种电子设备,如图12所示,包括:处理器1201、通信接口1202、存储器1203和通信总线1204,其中,处理器1201,通信接口1202,存储器1203通过通信总线1204完成相互间的通信。
所述存储器1203中存储有计算机程序,当所述程序被所述处理器1201执行时,使得所述处理器1201执行如下步骤:
接收电子设备发送的加密后的第一目标图像;
向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;
对每个目标图像中像素点对应的像素值进行处理,获得原图像。
进一步地,所述处理器1201,还用于将所述原图像输入到预先训练完成 的特征提取模型中,获得所述原图像对应的特征向量并保存。
进一步地,所述处理器1201,还用于对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
进一步地,所述处理器1201,还用于将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述第三目标图像对应的特征向量。
进一步地,所述处理器1201,还用于根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及接收所述其他目标设备发送的子特征向量并保存。
进一步地,所述处理器1201,还用于接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;若所述其他目标设备均可信,则进行向所述其他目标设备发送获取指令的操作。
进一步地,所述处理器1201,还用于接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
进一步地,所述处理器1201,还用于针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基 于所述目标公钥对解密后的所述目标子私钥进行加密;基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
进一步地,所述处理器1201,还用于根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
进一步地,所述处理器1201,还用于针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
进一步地,所述处理器1201,还用于针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
进一步地,所述处理器1201,还用于根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;根据原图像在每个通道中所述目标像素点的像素值得到原图像。
上述服务器提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口1202用于上述电子设备与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存 储器。可选地,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述处理器可以是通用处理器,包括中央处理器、网络处理器(Network Processor,NP)等;还可以是数字指令处理器(Digital Signal Processing,DSP)、专用集成电路、现场可编程门陈列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。
实施例16:
在上述各实施例的基础上,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有可由电子设备执行的计算机程序,当所述程序在所述电子设备上运行时,使得所述电子设备执行时实现如下步骤:
根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
采用目标密钥对每个所述第一目标图像进行加密;
将加密后的每个第一目标图像发送给对应的每个目标设备。
进一步地,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;
根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值包括:
确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;
针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目 标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;
所述根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值包括:
根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值,确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
进一步地,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;
针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
进一步地,所述根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像包括:
确定所述原图像在预设的每个通道上对应的第二目标图像;
针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;
所述将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像包括:
针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
进一步地,所述采用目标密钥对每个所述第一目标图像进行加密之后,所述将加密后的第一目标图像发送给每个目标设备之前,所述方法还包括:
根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;
根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥进行加密;
所述将加密后的第一目标图像发送给每个目标设备包括:
将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
实施例17:
在上述各实施例的基础上,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有可由电子设备执行的计算机程序,当所述程序在所述电子设备上运行时,使得所述电子设备执行时实现如下步骤:
接收电子设备发送的加密后的第一目标图像;
向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;
对每个目标图像中像素点对应的像素值进行处理,获得原图像。
进一步地,所述方法还包括:
将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
进一步地,所述将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量包括:
对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;
将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;
基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
进一步地,所述方法还包括:
将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述第三目标图像对应的特征向量。
进一步地,获得目标图像对应的特征向量之后,所述方法还包括:
根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及
接收所述其他目标设备发送的子特征向量并保存。
进一步地,所述接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获取指令之前,所述方法还包括:
接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;
若所述其他目标设备均可信,则进行向所述其他目标设备发送获取指令的操作。
进一步地,所述获得目标密钥包括:
接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;
将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
进一步地,所述接收所述其他目标设备发送的解密后的目标子私钥之前,所述方法还包括:
针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基于所述目标公钥对解密后的所述目标子私钥进行加密;
所述接收所述其他目标设备发送的解密后的目标子私钥之后,将接收到的每个解密后的所述目标子私钥进行拼接之前,所述方法还包括:
基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
进一步地,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
进一步地,所述将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值包括:
针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
进一步地,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
进一步地,所述确定该目标图像中像素点的像素值非预设的像素值的目标像素点包括:
根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;
所述将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像包括:
将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;
根据原图像在每个通道中所述目标像素点的像素值得到原图像。
由于在本申请实施例中,多个第一目标图像中每个第一目标图像都是对原图像中像素点对应的像素点进行处理后得到的,每个第一目标图像中包含的像素点对应的像素值与原图像中的对应的像素点对应的像素值不完全相同,且由于在获得多个第一目标图像后,将多个第一目标图像分别发送给对应的目标设备,因此,不管是在第一目标图像发送的过程中进行攻击,还是对存储了第一目标图像的目标设备进行攻击,都不可能基于单独的一个第一目标图像获得原图像,保证了图像传输和存储的安全性,保护了用户的隐私,提高了用户的体验。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程图像处理设备的处理器以产生一个机器,使得通过计算机或其他可编程图像处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程图像处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器 中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程图像处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (22)

  1. 一种图像加密方法,应用于电子设备,所述方法包括:
    根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
    采用目标密钥对每个所述第一目标图像进行加密;
    将加密后的每个第一目标图像发送给对应的每个目标设备。
  2. 根据权利要求1所述的方法,其中,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
    针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值,其中所述数量个子像素值的和为该像素值;
    根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值。
  3. 根据权利要求2所述的方法,其中,所述针对所述原图像中每个像素点的像素值,根据待接收到图像的目标设备的数量,将该像素值拆分为所述数量个子像素值包括:
    确定所述原图像在预设的每个通道上对应的像素矩阵,其中,所述像素矩阵中每个元素为每个像素点在对应通道上对应的像素值;
    针对每个通道对应的像素矩阵中的每个像素值,根据待接收到图像的目标设备的数量,将该通道对应的像素矩阵中该像素值拆分为所述数量个子像素值,其中,所述数量个子像素值的和为该通道对应的像素矩阵中该像素值;
    所述根据每个像素点对应的所述数量个子像素值,确定处理后的每个第一目标图像中对应像素点的处理后的像素值包括:
    根据每个通道对应的像素矩阵中每个像素点对应的所述数量个子像素值, 确定处理后的每个通道对应的每个第一目标图像中对应像素点的处理后的像素值。
  4. 根据权利要求1所述的方法,其中,所述根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像包括:
    根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像;
    针对每个子图像,将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像。
  5. 根据权利要求4所述的方法,其中,所述根据待接收到图像的目标设备的数量,将所述原图像划分为所述数量个子图像包括:
    确定所述原图像在预设的每个通道上对应的第二目标图像;
    针对每个通道上对应的第二目标图像,根据待接收到图像的目标设备的数量,将该通道上对应的第二目标图像划分为所述数量个子图像;
    所述将所述原图像中该子原图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该子图像对应的处理后的第一目标图像包括:
    针对每个通道上对应的第二目标图像对应的每个子图像,将该通道上对应的第二目标图像中该子图像包含的像素点以外的其他像素点的像素值设置为预设的像素值,得到该通道上该第二目标图像的该子图像对应的处理后的第一目标图像。
  6. 根据权利要求1所述的方法,其中,所述采用目标密钥对每个所述第一目标图像进行加密之后,所述将加密后的第一目标图像发送给每个目标设备之前,所述方法还包括:
    根据所述目标设备的数量,将所述目标密钥切分为所述数量个目标子密钥,其中,所述数量个目标子密钥能够拼接成所述目标密钥;
    根据接收到的每个目标设备发送的公钥,分别对所述数量个目标子密钥 进行加密;
    所述将加密后的第一目标图像发送给每个目标设备包括:
    将加密后的第一目标图像以及加密后的目标子密钥分别发送给对应的每个目标设备。
  7. 一种图像处理方法,应用于目标设备,所述方法包括:
    接收电子设备发送的加密后的第一目标图像;
    向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
    获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;
    对每个目标图像中像素点对应的像素值进行处理,获得原图像。
  8. 根据权利要求7所述的方法,其中,所述方法还包括:
    将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量并保存。
  9. 根据权利要求8所述的方法,其中,所述将所述原图像输入到预先训练完成的特征提取模型中,获得所述原图像对应的特征向量包括:
    对所述原图像中像素点对应的像素值进行处理,获得多个第三目标图像,其中,多个第三目标图像能够获得所述原图像;
    将所述多个第三目标图像中的任意一个第三目标图像确定为第四目标图像;
    基于所述预先训练完成的特征提取模型对所述第四目标图像进行特征向量提取,获得所述第四目标图像对应的特征向量。
  10. 根据权利要求9所述的方法,其中,所述方法还包括:
    将所述多个第三目标图像中除所述第四目标图像以外的第三目标图像,分别发送给对应的所述其他目标设备,以使所述其他目标设备分别基于预先训练完成的特征提取模型对接收到的第三目标图像进行特征提取,获得所述第三目标图像对应的特征向量。
  11. 根据权利要求8或9所述的方法,其中,获得目标图像对应的特征向量之后,所述方法还包括:
    根据所述目标设备的数量,将所述特征向量切分为所述数量个子特征向量,保存所述数量个子特征向量中任意一个子特征向量,并将其他子特征向量分别发送给所述其他目标设备,以及
    接收所述其他目标设备发送的子特征向量并保存。
  12. 根据权利要求7所述的方法,其中,所述接收电子设备发送的加密后的第一目标图像之后,向其他目标设备发送获取指令之前,所述方法还包括:
    接收所述其他目标设备发送的目标验证信息,若自身预先保存的各个设备的标准验证信息中存在与所述目标验证信息一致的标准验证信息,确定所述其他目标设备可信;其中,所述目标验证信息为所述其他目标设备根据所述其他目标设备自身的标识信息及属性信息生成的;
    若所述其他目标设备均可信,则进行向所述其他目标设备发送获取指令的操作。
  13. 根据权利要求7所述的方法,其中,所述获得目标密钥包括:
    接收所述电子设备发送的加密后的目标子密钥,基于私钥对所述加密后的目标子密钥进行解密,并接收所述其他目标设备发送的解密后的目标子私钥;
    将接收到的每个解密后的所述目标子私钥进行拼接,生成目标密钥。
  14. 根据权利要求13所述的方法,其中,所述接收所述其他目标设备发送的解密后的目标子私钥之前,所述方法还包括:
    针对每个所述其他目标设备,生成目标公私钥对,将所述目标公私钥对中的目标公钥发送给所述其他目标设备,以使所述其他目标设备基于所述私钥对加密后的目标子私钥进行解密后,基于所述目标公钥对解密后的所述目标子私钥进行加密;
    所述接收所述其他目标设备发送的解密后的目标子私钥之后,将接收到 的每个解密后的所述目标子私钥进行拼接之前,所述方法还包括:
    基于所述目标公私钥对中的目标私钥对接收到的加密后的目标子私钥进行解密。
  15. 根据权利要求7所述的方法,其中,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
    根据每个所述目标图像中每个像素点的像素值,将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值。
  16. 根据权利要求15所述的方法,其中,所述将每个目标图像中该像素点的像素值和值,确定为原图像中该像素点对应的像素值包括:
    针对每个目标图像在预设的每个通道对应的像素矩阵中的每个像素点对应的像素值,将每个目标图像在该通道对应的像素矩阵中该像素点对应的像素值的和值,确定为原图像在该通道中该像素点对应的像素值。
  17. 根据权利要求7所述的方法,其中,所述对每个目标图像中像素点对应的像素值进行处理,获得原图像包括:
    针对任意一个目标图像,确定该目标图像中像素点的像素值非预设的像素值的目标像素点;将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像。
  18. 根据权利要求17所述的方法,其中,所述确定该目标图像中像素点的像素值非预设的像素值的目标像素点包括:
    根据预设的每个通道上的每个目标图像中每个像素点,确定该通道上该目标图像中该像素点的像素值是否为非预设的像素值,若是,则将该像素点确定为该通道上的目标像素点;
    所述将所述原图像中所述目标像素点的像素值设置为该目标图像中对应目标像素点的像素值得到原图像包括:
    将原图像在该通道中所述目标像素点的像素值设置为该通道上该目标图像对应的该子图像中所述目标像素点的像素值;
    根据原图像在每个通道中所述目标像素点的像素值得到原图像。
  19. 一种图像加密装置,应用于电子设备,所述装置包括:
    第一获取模块,用于根据待接收到图像的目标设备的数量,对包含用户的原图像中像素点对应的像素值进行处理,得到处理后的多个第一目标图像,其中多个第一目标图像能够得到所述原图像;
    加密模块,用于采用目标密钥对每个所述第一目标图像进行加密;
    发送模块,用于将加密后的每个第一目标图像发送给对应的每个目标设备。
  20. 一种图像处理装置,应用于目标设备,所述装置包括:
    接收模块,用于接收电子设备发送的加密后的第一目标图像;
    处理模块,用于向其他目标设备发送图像获取指令;接收所述其他目标设备发送的加密后的其他第一目标图像;
    第二获取模块,用于获得目标密钥,并基于所述目标密钥对接收到的所述第一目标图像及每个其他第一目标图像进行解密,获得每个目标图像;对每个目标图像中像素点对应的像素值进行处理,获得原图像。
  21. 一种电子设备,所述电子设备包括处理器和存储器,所述存储器用于存储程序指令,所述处理器用于执行存储器中存储的计算机程序时实现上述权利要求1-6任一所述图像加密方法的步骤或7-18任一所述图像处理方法的步骤。
  22. 一种计算机可读存储介质,其存储有计算机程序,所述计算机程序被处理器执行时实现上述权利要求1-6任一所述图像加密方法的步骤或7-18任一所述图像处理方法的步骤。
PCT/CN2022/112618 2022-01-28 2022-08-15 一种图像加密、图像处理方法、装置、设备及介质 WO2023142440A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210105850.2 2022-01-28
CN202210105850.2A CN114553499B (zh) 2022-01-28 2022-01-28 一种图像加密、图像处理方法、装置、设备及介质

Publications (1)

Publication Number Publication Date
WO2023142440A1 true WO2023142440A1 (zh) 2023-08-03

Family

ID=81673878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/112618 WO2023142440A1 (zh) 2022-01-28 2022-08-15 一种图像加密、图像处理方法、装置、设备及介质

Country Status (3)

Country Link
CN (1) CN114553499B (zh)
TW (1) TW202332230A (zh)
WO (1) WO2023142440A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553499B (zh) * 2022-01-28 2024-02-13 中国银联股份有限公司 一种图像加密、图像处理方法、装置、设备及介质
CN114676396B (zh) * 2022-05-30 2022-08-30 山东极视角科技有限公司 深度神经网络模型的保护方法、装置、电子设备和介质
CN116418566A (zh) * 2023-03-15 2023-07-11 北京拙河科技有限公司 一种基于sm加密算法的图像数据保存方法及装置

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108306876A (zh) * 2018-01-30 2018-07-20 平安普惠企业管理有限公司 客户身份验证方法、装置、计算机设备和存储介质
US20190028722A1 (en) * 2017-07-21 2019-01-24 Samsung Electronics Co., Ltd. Electronic device and method for encoding image data therein
US20200218903A1 (en) * 2018-11-21 2020-07-09 Jeju National University Industry-Academic Cooperation Foundation CCTV video smart surveillance system and method thereof
CN111651775A (zh) * 2020-04-29 2020-09-11 北京奇艺世纪科技有限公司 图像加密、解密方法、装置、电子设备及存储介质
JP2021005259A (ja) * 2019-06-27 2021-01-14 コニカミノルタ株式会社 情報処理システム及びプログラム
CN112422907A (zh) * 2020-11-09 2021-02-26 西安万像电子科技有限公司 图像处理方法、装置及系统
CN112530551A (zh) * 2020-12-10 2021-03-19 武汉联影医疗科技有限公司 图像的处理系统及方法
CN113766085A (zh) * 2021-05-17 2021-12-07 腾讯科技(深圳)有限公司 图像处理方法及相关装置
CN114553499A (zh) * 2022-01-28 2022-05-27 中国银联股份有限公司 一种图像加密、图像处理方法、装置、设备及介质

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW526643B (en) * 1999-05-20 2003-04-01 Ind Tech Res Inst Data access control system and method
JP3671188B2 (ja) * 2003-10-21 2005-07-13 傳田アソシエイツ株式会社 認証システムおよび認証方法
CN104040934B (zh) * 2011-12-15 2018-04-24 英特尔公司 当被云服务操控时保护图像隐私
CN105100115A (zh) * 2015-08-27 2015-11-25 中国科学院信息工程研究所 一种基于加密口令及数据拆分的隐私保护的数据存储方法
US10225265B1 (en) * 2016-04-15 2019-03-05 Snap Inc. End to end encryption
CN107767352A (zh) * 2017-11-16 2018-03-06 北京经纬恒润科技有限公司 一种adas图像色彩重建方法及装置
CN108243197B (zh) * 2018-01-31 2019-03-08 北京深思数盾科技股份有限公司 一种数据分发、转发方法及装置
CN108810555B (zh) * 2018-06-15 2020-09-22 南开大学 基于图像压缩与弹性分辨率的缩略图图像隐私保护方法
EP3654578B1 (en) * 2018-11-16 2022-04-06 SafeTech BV Methods and systems for cryptographic private key management for secure multiparty storage and transfer of information
CN110032877A (zh) * 2019-03-01 2019-07-19 阿里巴巴集团控股有限公司 图像存取方法及其系统
CN110557361B (zh) * 2019-03-14 2022-04-26 深圳市丰浩达工程项目管理有限公司 一种全过程造价动态管理方法及系统
US10922422B2 (en) * 2019-05-13 2021-02-16 Advanced New Technologies Co., Ltd. Blockchain-based image processing method and apparatus
CN110211082B (zh) * 2019-05-31 2021-09-21 浙江大华技术股份有限公司 一种图像融合方法、装置、电子设备及存储介质
WO2021232865A1 (zh) * 2020-05-18 2021-11-25 华为技术有限公司 一种对象识别方法、装置、设备及介质
CN112084525B (zh) * 2020-10-23 2024-06-14 北京东方通科技股份有限公司 一种分布式密钥加密方法、装置、电子设备和存储介质
CN112307454A (zh) * 2020-11-09 2021-02-02 深圳市欢太科技有限公司 一种数据加密方法、装置、存储介质及电子设备
CN112653539B (zh) * 2020-12-29 2023-06-20 杭州趣链科技有限公司 一种待存储数据的存储方法、装置以及设备
CN112802138B (zh) * 2021-02-04 2024-03-12 联仁健康医疗大数据科技股份有限公司 一种图像处理方法、装置、存储介质及电子设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190028722A1 (en) * 2017-07-21 2019-01-24 Samsung Electronics Co., Ltd. Electronic device and method for encoding image data therein
CN108306876A (zh) * 2018-01-30 2018-07-20 平安普惠企业管理有限公司 客户身份验证方法、装置、计算机设备和存储介质
US20200218903A1 (en) * 2018-11-21 2020-07-09 Jeju National University Industry-Academic Cooperation Foundation CCTV video smart surveillance system and method thereof
JP2021005259A (ja) * 2019-06-27 2021-01-14 コニカミノルタ株式会社 情報処理システム及びプログラム
CN111651775A (zh) * 2020-04-29 2020-09-11 北京奇艺世纪科技有限公司 图像加密、解密方法、装置、电子设备及存储介质
CN112422907A (zh) * 2020-11-09 2021-02-26 西安万像电子科技有限公司 图像处理方法、装置及系统
CN112530551A (zh) * 2020-12-10 2021-03-19 武汉联影医疗科技有限公司 图像的处理系统及方法
CN113766085A (zh) * 2021-05-17 2021-12-07 腾讯科技(深圳)有限公司 图像处理方法及相关装置
CN114553499A (zh) * 2022-01-28 2022-05-27 中国银联股份有限公司 一种图像加密、图像处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN114553499A (zh) 2022-05-27
CN114553499B (zh) 2024-02-13
TW202332230A (zh) 2023-08-01

Similar Documents

Publication Publication Date Title
US10839070B1 (en) Securely executing smart contract operations in a trusted execution environment
US10798087B2 (en) Apparatus and method for implementing composite authenticators
US10498542B2 (en) Electronic identification verification methods and systems with storage of certification records to a side chain
US10903976B2 (en) End-to-end secure operations using a query matrix
WO2023142440A1 (zh) 一种图像加密、图像处理方法、装置、设备及介质
WO2020177392A1 (zh) 基于联邦学习的模型参数训练方法、装置、设备及介质
CN111181720A (zh) 基于可信执行环境的业务处理方法及装置
CN111654367B (zh) 密码运算、创建工作密钥的方法、密码服务平台及设备
WO2019218919A1 (zh) 区块链场景下的私钥管理方法、装置及系统
WO2018145127A1 (en) Electronic identification verification methods and systems with storage of certification records to a side chain
CN107317677B (zh) 密钥存储及设备身份认证方法、装置
US12015711B2 (en) Data security processing terminal and system
CN114024710A (zh) 一种数据传输方法、装置、系统及设备
CN111027632A (zh) 一种模型训练方法、装置及设备
CN109660534B (zh) 基于多商户的安全认证方法、装置、电子设备及存储介质
CN112232814A (zh) 支付密钥的加密和解密方法、支付认证方法及终端设备
CN110942382A (zh) 电子合同的生成方法、装置、计算机设备及存储介质
WO2021190197A1 (zh) 生物支付设备的认证方法、装置、计算机设备和存储介质
CN109274644A (zh) 一种数据处理方法、终端和水印服务器
CN110798433B (zh) 一种验证码校验方法及装置
CN108900595B (zh) 访问云存储服务器数据的方法、装置、设备及计算介质
CN113434882A (zh) 应用程序的通讯保护方法、装置、计算机设备及存储介质
CN107689867B (zh) 一种在开放环境下的密钥保护方法和系统
US20220345292A1 (en) Method and device for encryption of video stream, communication equipment, and storage medium
CN114553557A (zh) 密钥调用方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22923244

Country of ref document: EP

Kind code of ref document: A1