Image processing method, storage medium and computer terminal
In the image processing method of e-commerce platforms, the encrypted images are decrypted using the target object identification and cascading style sheets, and the problem of image theft in the prior art is solved, and the effect of improving data security is achieved.
Patent Information
- Application Number
- CN202210487509.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-05-06
AI Technical Summary
In e-commerce shopping scenarios, the product pictures in the seller's store are easily stolen. In the prior art, watermarks cannot effectively prevent theft of pictures, and automation tools can copy pictures in batches, making it difficult to prevent infringement.
By obtaining the target page, including encrypted pictures, target object identification and target string, using the target object identification to decrypt the target string, obtain the target encryption rules, generate target decryption rules based on the target encryption rules and the cascading style sheet, and finally use the target decryption rules to decrypt the encrypted pictures to obtain the original picture.
Decrypting pictures through the cascading style sheet supported by the native browser avoids the existence of image data in memory and is difficult to be crawled by automated scripts, thereby improving data security and preventing image theft.
Smart Images

Figure CN114996663B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an image processing method, a storage medium and a computer terminal. Background Art
[0002] In e-commerce shopping scenarios, there are a large number of detailed pictures of products in the seller's store. In order to reduce the cost of picture production, some sellers directly steal pictures of similar products. For this purpose, there are even some automated tools on the Internet that can batch copy pictures in the seller's store, and even obtain all pictures in the seller's store, which greatly facilitates infringement.
[0003] In the related art, watermarks can be added to pictures to prevent them from being stolen, but watermarks can only be used for tracing the source and do not affect the use of pictures. In addition, too few watermarks can be easily removed, while too many watermarks reduce the user experience.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide an image processing method, a storage medium, and a computer terminal to at least solve the technical problem of poor security in the related art.
[0006] According to one aspect of an embodiment of the present application, a method for image processing is provided, including: obtaining a target page, wherein the target page contains an encrypted image, a target object identifier and a target character string, the encrypted image is obtained by encrypting pixels of an original image using a target encryption rule, and the target character string is obtained by encrypting the target encryption rule using the target object identifier; decrypting the target character string using the target object identifier to obtain a target encryption rule; generating a target decryption rule based on the target encryption rule and a cascading style sheet; and decrypting the encrypted image using the target decryption rule to obtain the original image.
[0007] According to another aspect of an embodiment of the present application, a picture processing method is also provided, including: obtaining an original picture; randomly generating a target encryption rule; encrypting pixels of the original picture using the target encryption rule to obtain an encrypted picture; encrypting the target encryption rule using a target object identifier to obtain a target string; and generating a target page based on the encrypted picture and the target string.
[0008] According to another aspect of an embodiment of the present application, a picture processing method is also provided, including: a client receives a target page sent by a server, wherein the target page contains an encrypted picture, a target object identifier and a target character string, the encrypted picture is obtained by encrypting pixels of the original picture using a target encryption rule, and the target character string is obtained by encrypting the target encryption rule using the target object identifier; the client decrypts the target character string using the target object identifier to obtain the target encryption rule; the client generates a target decryption rule based on the target encryption rule and a cascading style sheet; the client decrypts the encrypted picture using the target decryption rule to obtain the original picture.
[0009] According to another aspect of an embodiment of the present application, a picture processing method is also provided, including: a server receives an original picture sent by a client; the server randomly generates a target encryption rule; the server uses the target encryption rule to encrypt pixels of the original picture to obtain an encrypted picture; the server uses a target object identifier to encrypt the target encryption rule to obtain a target string; the server generates a target page based on the encrypted picture and the target string; the server sends the target page to the client.
[0010] According to another aspect of the embodiments of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the image processing method in any one of the above embodiments.
[0011] According to another aspect of the embodiments of the present application, a computer terminal is also provided, including: a processor and a memory, the processor is used to run a program stored in the memory, wherein the image processing method in any one of the above embodiments is executed when the program is run.
[0012] In the embodiment of the present application, after obtaining the target page, it is necessary to use the target object identifier to decrypt the target string to obtain the target encryption rule; based on the target encryption rule and the cascading style sheet, generate the target decryption rule; use the target decryption rule to decrypt the encrypted image to obtain the original image. It is easy to notice that the original image can be obtained by decrypting the encrypted image in the target web page through the cascading style sheet natively supported by the browser in the client, rather than restoring the original image in the memory through the script, which is difficult to be captured by the automated script, thereby achieving the technical effect of improving data security, and then solving the technical problem of poor security in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for a method for image processing according to an embodiment of the present application;
[0015] Figure 2 is a flowchart of a picture processing method according to Embodiment 1 of the present application;
[0016] Figure 3 is a flowchart of a picture processing method according to Embodiment 2 of the present application;
[0017] Figure 4 is a flowchart of a picture processing method according to Embodiment 3 of the present application;
[0018] Figure 5 is a flowchart of a picture processing method according to Embodiment 4 of the present application;
[0019] Figure 6 is a structural schematic diagram of a picture processing device according to Embodiment 5 of the present application;
[0020] Figure 7 is a structural schematic diagram of a picture processing device according to Embodiment 6 of the present application;
[0021] Figure 8 is a structural schematic diagram of a picture processing device according to Embodiment 7 of the present application;
[0022] Fig. 9 It is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0026] Cascading Style Sheets, CSS for short, is a computer language used to express the style of files such as HTML (an application of standard generalized markup language) or XML (a subset of standard generalized markup language).
[0027] Scalable Vector Graphics, Scalable Vector Graphics, referred to as SVG.
[0028] Example 1
[0029] According to an embodiment of the present application, an embodiment of a picture processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing the image processing method. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0031] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned image processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0033] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0035] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, the above-mentioned server can be a locally deployed server or a cloud server, connected to one or more clients via a data network connection or electronic connection. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections.
[0036] Under the above operating environment, this application provides Figure 2 The image processing method shown. Figure 2 1 is a flowchart of a method for processing an image according to Embodiment 1 of the present application. Figure 2 As shown, the method may include the following steps:
[0037] Step S202, obtaining a target page, wherein the target page includes an encrypted image, a target object identifier and a target string, the encrypted image is obtained by encrypting pixels of the original image using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier.
[0038] The target page may be a page that the user currently wants to visit. For example, in an e-commerce scenario, the target page may be a product details page or a seller's store page that the user browses; in a social scenario, the target page may be a personal homepage that the user browses, other users' personal homepages, or a hot information page. In order to protect the images in the target page and prevent them from being stolen, the server may encrypt the original images in the target page, so that the target page sent by the server to the client contains only the encrypted images but not the original images.
[0039] The above-mentioned target object identifier can be a unique identifier of the owner of the original image, such as a user ID. The owner here can refer to the user who took the original image, the designer of the original image, and other users who own the original image. It should be noted that each web page can contain the user ID of the owner of the web page. However, if the owner of the web page is different from the owner of the original image, the user ID contained in the target page is different from the target object identifier, and the encrypted image cannot be decrypted normally later, resulting in the user still viewing the encrypted image. In the embodiment of the present application, the example of the owner of the target page being the same as the owner of the original image is used to explain in detail the detailed process of the client decrypting the encrypted image. Therefore, the target page in the embodiment of the present application contains the target object identifier.
[0040] The above-mentioned target encryption rule can be a randomly generated conversion rule for pixel-level processing of the original image. Through the conversion rule, the processed image is different from the original image. Therefore, the above-mentioned conversion rule can be considered as a target encryption rule for encrypting the original image. It should be noted that the conversion rule is reversible, and there is a corresponding CSS rule for the inverse operation. Optionally, the target encryption rule may include: an image conversion type and multiple image conversion parameters. The image conversion type may include at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swap and channel inversion. The image conversion parameters here may include: angle parameters in hue rotation processing, order parameters in channel swap processing and channels that have been inverted in channel inversion processing.
[0041] The target character string may be a character string obtained by encrypting the target encryption rule using the target object identifier as a key. For the convenience of transmission, the target character string may be a binary character string.
[0042] It is easy to notice that this solution only converts the pixels in the image instead of encrypting the entire image file, so the encrypted image is still an image, thus retaining the characteristics of the image itself, such as being able to display gradually while downloading (streaming mode), supporting back-end size scaling (commonly used for preview images), and other advantages.
[0043] In an optional embodiment, in order to prevent the original image in the web page from being stolen, when the user generates a web page in the server, the server can use the randomly generated target encryption rule to encrypt the original image uploaded by the user, and use the target user ID of the user to encrypt the target encryption rule to obtain the target string, so that the server can only store the web page containing the encrypted image, the target user ID and the target string as the target page for other users to access. When the user needs to access the target page, the user can send an access request to the server through the client. At this time, the server can directly send the web page containing the encrypted image, the target user ID and the target string to the client, and the client will display it to the user for viewing.
[0044] Step S204, decrypt the target character string using the target object identifier to obtain a target encryption rule.
[0045] The target object identifier may be used as a key to decrypt the target character string to obtain a target encryption rule.
[0046] It should be noted that, in the actual decryption process, the client can read the object identifier from the target page, and use the object identifier to decrypt the target string. If the owner of the target page is different from the owner of the original picture, that is, if the encrypted picture in the target page is stolen, then because the object identifier read from the target page is different from the target object identifier, it is impossible to decrypt and obtain the correct target encryption rule, and then the original picture cannot be obtained. If the owner of the target page is the same as the owner of the original picture, that is, if the encrypted picture in the target page is not stolen, then because the object identifier read from the target page is the same as the target object identifier, it can be decrypted to obtain the correct target encryption rule, and then the original picture can be obtained.
[0047] Step S206: Generate a target decryption rule based on the target encryption rule and the cascading style sheet.
[0048] Among them, in order to facilitate transmission, the target encryption rule can be a randomly generated binary number, and each bit is used to represent a different conversion rule. For example, when the image conversion type includes horizontal mirroring, vertical mirroring, hue rotation, channel swapping and channel inversion, the target encryption rule can be a 5-bit binary number T and three parameters R1, R2 and R3. The first bit indicates whether the original image is horizontally mirrored. If the original image is horizontally mirrored, the value of the first bit is 1, and the corresponding inverse operation corresponds to the CSS transform:scale(-1,1) rule; the second bit indicates whether the original image is vertically mirrored. If the original image is vertically mirrored, the value of the second bit is 1, and the corresponding inverse operation corresponds to the CSS transform:scale(1,-1) rule; the third bit indicates whether the original image is rotated by X degrees of hue. (also called hue rotation), X degrees can be a randomly generated angle parameter R1. If the original image is rotated by X degrees, the value of the third bit is 1, and the value of R1 is X. The corresponding inverse operation corresponds to the filter:hue-rotate(Xdeg) rule in CSS, where Xdeg is the angle parameter. The fourth bit indicates whether the channels of the original image are swapped, and R2 indicates the randomly generated order parameter of the swap. If the channels of the original image are swapped, the value of the fourth bit is 1, and the value of R2 is the order parameter of the swap. The fifth bit indicates whether the channels of the original image are inverted, and R3 indicates the randomly generated inverted channels. If the channels of the original image are inverted, the value of the fifth bit is 1, and the value of R3 is the inverted channels. The corresponding inverse operation corresponds to the filter:invert(1) rule in CSS.
[0049] It should be noted that the target encryption rules and CSS rules must correspond one to one, because if the image is horizontally mirrored during encryption, it should also be horizontally mirrored during decryption, so as to eliminate the changes made to the image during encryption and obtain the original image. Therefore, the target encryption rules in this application are all reversible to facilitate the subsequent corresponding decryption processing.
[0050] In an optional embodiment, the inverse operation parameters may be generated according to the target encryption rule and the CSS rule, thereby obtaining the above-mentioned target decryption rule.
[0051] Step S208, decrypt the encrypted image using the target decryption rule to obtain the original image.
[0052] The target decryption rule is used to perform the inverse operation corresponding to the target encryption rule on the encrypted image to obtain the original image.
[0053] It should be noted that the above-mentioned decryption operation can be performed in the client's browser based on CSS rules, which can achieve loading and display at the same time, and decryption is only performed through the browser when rendering in the page. There is no need to restore the original image in the script and then decrypt it. That is, the original image is not included in the memory, and it is difficult for attackers to obtain the original image. Therefore, the technical effect of improving data security can be achieved.
[0054] In an optional embodiment, before decryption, it is necessary to insert a target decryption rule into the front-end script, and pictures with encryption marks in the URL can be hidden by default, thereby preventing them from being displayed before the decryption rule is generated.
[0055] In the existing common technical solutions, the image file is usually encrypted to generate an encrypted binary file. The original image file is obtained through script encryption and rendered to the corresponding position of the web page. However, since the encrypted image is a binary file rather than an image format, it cannot be played backend, which will cause the thumbnail function to be unusable. When used on the front end, the complete binary file must be downloaded and then decrypted and displayed at one time, which makes it difficult to achieve the effect of downloading and displaying at the same time, and the original streaming mode and loading characteristics of the image are lost. In addition, after decryption in this way, the original image data exists in the memory, so the attacker can directly access the data and obtain the original image file.
[0056] In the e-commerce scenario, seller A updates the store and uploads the original image to the server. The server can randomly generate a binary number T=101, and combined with CSS rules, the first digit of T is "1", indicating that the CSS transform:scale(-1,1) rule is used to perform horizontal mirroring of the image, the second digit of T is "0", indicating that the CSS transform:scale(1,-1) rule is used to perform vertical mirroring of the image, and the third digit of T is "1", indicating that the CSS filter:hue-rotate(Xdeg) rule is used to perform hue rotation of the image. Then, the transformation rule T and the parameters involved in the above CSS rules are encoded to obtain a new binary string B, and the seller A's user ID is used as the key to encrypt the string B to obtain the target string. It should be noted that the target string can be used as the image name or page address of the encrypted image, so that the target page is bound to the seller A's user ID. When seller A visits the target page, the client can decrypt the target string based on its user ID and obtain the decryption rules, so that the browser can decrypt the encrypted image in combination with the CSS rules and display the original image after decryption.
[0057] In the embodiment of the present application, after obtaining the target page, it is necessary to use the target object identifier to decrypt the target string to obtain the target encryption rule; based on the target encryption rule and the cascading style sheet, generate the target decryption rule; use the target decryption rule to decrypt the encrypted image to obtain the original image. It is easy to notice that the original image can be obtained by decrypting the encrypted image in the target web page through the cascading style sheet natively supported by the browser, rather than restoring the original image in the memory through the script. The image data is difficult to be captured by the automated script, thereby achieving the technical effect of improving data security, thereby solving the technical problem of poor security in the related technology.
[0058] In the above embodiment of the present application, a target decryption rule is generated based on the target encryption rule and the cascading style sheet, including: based on the target encryption rule, determining the inverse operation parameters corresponding to the target encryption rule; and converting the inverse operation parameters into the target decryption rule according to the cascading style sheet.
[0059] Among them, the inverse operation parameters can be the parameters involved in the inverse operation based on the CSS rules. For example, when performing encryption processing, the R1 parameter is combined for hue rotation processing. When decrypting, the inverse operation parameters can be obtained by subtracting R1 from 360, and then the CSS rules for the user to perform the inverse operation are generated.
[0060] It should be noted that when some low-level image operations are involved, such as modifying image channels, corresponding SVG filters need to be generated for CSS filters to call.
[0061] In the above-mentioned embodiments of the present application, the target character string is stored in the page address of the target page or the file name of the encrypted image.
[0062] The target string may be used as the page address of the target page, that is, the path parameter when the encrypted image is published, or as the file name of the encrypted image.
[0063] In the above embodiment of the present application, the target image identifier corresponding to the encrypted image is stored in the page address.
[0064] The target image identifier is used to identify the file as an encrypted image, so that in the subsequent front-end decryption process, the encrypted image is defaulted to not be displayed to prevent the image from being displayed during the decryption process.
[0065] In addition, during the decryption process, the front end detects the encryption mark, extracts the target string, and encrypts the target string using the target object identifier read from the target page, restores the corresponding target encryption rule and the parameters involved in the encryption process, and then, based on the target encryption rule and the parameters involved in the encryption process, obtains the corresponding inverse operation parameters and inverse operation rules to decrypt the encrypted image.
[0066] In the above embodiment of the present application, before decrypting the encrypted image using the target decryption rule to obtain the original image, the method also includes: inserting the target decryption rule for the encrypted image in the target page.
[0067] In the above embodiments of the present application, the encrypted image is in a hidden state.
[0068] In an optional embodiment, when decrypting at the front end, a target decryption rule, that is, a CSS rule for decryption, is inserted into the page in advance, so that the image with the target image identifier in the URL is not displayed by default. For example, the following code can be added to the URL to prevent the encrypted image from being displayed:
[0069]
[0070] Among them, encrypt is the target image identifier, the first rule corresponds to the image loaded by the img tag, and the second rule corresponds to the image loaded by the CSS background.
[0071] For example, the target decryption rule could look like this:
[0072]
[0073]
[0074] In the above embodiment of the present application, the method also includes: obtaining the original image; randomly generating a target encryption rule; encrypting the original image using the target encryption rule to obtain an encrypted image; encrypting the target encryption rule using a target object identifier to obtain a target string; and generating a target page based on the encrypted image and the target string.
[0075] Among them, after receiving the original picture uploaded by the user, the backend randomly generates a number, and defines the corresponding conversion rule for each bit in the number, that is, the above-mentioned target encryption rule, and then uses the encryption rule to encrypt the pixels of the original picture to obtain an encrypted picture. Combine the encryption parameters involved in the target encryption rule and the target decryption rule to generate a binary string, and use the target object identifier as the key to encrypt the binary string to obtain the target string, which is used as the file name of the encrypted picture or the path of the encrypted picture to generate the target page.
[0076] In the above embodiment of the present application, the target encryption rule is encrypted using the target object identifier to obtain the target string, including: encoding the target encryption rule to obtain binary data; encrypting the binary data using the target object identifier to obtain encrypted data; encoding the encrypted data to generate the target string.
[0077] The above encoding of the encryption rule may be combined with the encryption parameters involved in the encryption rule. For example, in an optional embodiment, the encryption conversion rule is T, and the encryption parameters involved include R1, R2, and R3, which may be encoded and stored in the 16-bit data arr:
[0078] arr = new Uint16Array(3)
[0079] arr[0]=T
[0080] arr[1]=R1
[0081] arr[2]=R2
[0082] arr[3]=R3
[0083] Then convert the 16-bit binary array into an 8-bit binary array:
[0084] bytes=new Uint8Array(arr.buffer)
[0085] Finally, after obtaining the binary data, the target object identifier is used as the key to encrypt the target encryption rule to obtain the encrypted data, and then the encrypted result is encoded into a string, that is, the above-mentioned target string.
[0086] Example 2
[0087] According to an embodiment of the present application, a method for processing an image is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0088] Figure 3 is a flow chart of a picture processing method according to Embodiment 2 of the present application. Figure 3 As shown, the method may include the following steps:
[0089] Step S301: Get the original image.
[0090] Step S302: randomly generate target encryption rules.
[0091] Step S303, encrypting the pixels of the original image using the target encryption rule to obtain an encrypted image.
[0092] Step S304: encrypt the target encryption rule using the target object identifier to obtain a target character string.
[0093] Step S305: Generate a target page based on the encrypted image and the target character string.
[0094] In the above embodiment of the present application, the target encryption rules include: an image conversion type and multiple image conversion parameters, and the image conversion type includes at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swapping, and channel inversion.
[0095] In the above-mentioned embodiments of the present application, the target character string is stored in the page address of the target page or the file name of the encrypted image.
[0096] In the above embodiment of the present application, the target image identifier corresponding to the encrypted image is stored in the page address.
[0097] In the above embodiments of the present application, the encrypted image is in a hidden state.
[0098] In the above embodiment of the present application, the target encryption rule is encrypted using the target object identifier to obtain the target string, including: encoding the target encryption rule to obtain binary data; encrypting the binary data using the target object identifier to obtain encrypted data; encoding the encrypted data to generate the target string.
[0099] In the above embodiment of the present application, the method also includes: obtaining a target page, wherein the target page includes an encrypted picture, a target object identifier and a target character string, the encrypted picture is obtained by encrypting pixels of the original picture using a target encryption rule, and the target character string is obtained by encrypting the target encryption rule using the target object identifier; decrypting the target character string using the target object identifier to obtain a target encryption rule; generating a target decryption rule based on the target encryption rule and a cascading style sheet; and decrypting the encrypted picture using the target decryption rule to obtain the original picture.
[0100] In the above embodiment of the present application, a target decryption rule is generated based on the target encryption rule and the cascading style sheet, including: determining the inverse operation parameters corresponding to the target encryption rule based on the target encryption rule; and converting the inverse operation parameters into the target decryption rule according to the cascading style sheet.
[0101] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0102] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0103] Example 4
[0104] According to an embodiment of the present application, a method for processing an image is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0105] Figure 4 is a flow chart of a picture processing method according to Embodiment 3 of the present application. Figure 3 As shown, the method may include the following steps:
[0106] Step S402, the client receives a target page sent by the server, wherein the target page includes an encrypted image, a target object identifier and a target string. The encrypted image is obtained by encrypting pixels of the original image using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier.
[0107] Step S404: the client uses the target object identifier to decrypt the target character string to obtain a target encryption rule.
[0108] Step S406: The client generates a target decryption rule based on the target encryption rule and the cascading style sheet.
[0109] Step S408: The client uses the target decryption rule to decrypt the encrypted image to obtain the original image.
[0110] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0111] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0112] Example 4
[0113] According to an embodiment of the present application, a method for processing an image is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0114] Figure 5 4 is a flowchart of a method for image processing according to Embodiment 4 of the present application. Fig. 9 As shown, the method may include the following steps:
[0115] Step S501: The server receives the original image sent by the client.
[0116] Step S502: The server randomly generates a target encryption rule.
[0117] Step S503: the server encrypts the pixels of the original image using the target encryption rule to obtain an encrypted image.
[0118] Step S504: the server encrypts the target encryption rule using the target object identifier to obtain a target character string.
[0119] Step S505: the server generates a target page based on the encrypted image and the target string.
[0120] Step S506: the server sends the target page to the client.
[0121] In the above embodiment of the present application, the target encryption rules include: an image conversion type and multiple image conversion parameters, and the image conversion type includes at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swapping, and channel inversion.
[0122] In the above-mentioned embodiments of the present application, the target character string is stored in the page address of the target page or the file name of the encrypted image.
[0123] In the above embodiment of the present application, the target image identifier corresponding to the encrypted image is stored in the page address.
[0124] In the above embodiments of the present application, the encrypted image is in a hidden state.
[0125] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0126] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0127] Example 5
[0128] According to an embodiment of the present application, a picture processing device for implementing the above picture processing method is also provided, such as Figure 6 As shown, the device comprises:
[0129] The first acquisition module 60 is used to acquire a target page, wherein the target page includes an encrypted image, a target object identifier and a target string. The encrypted image is obtained by encrypting pixels of the original image using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier.
[0130] The first decryption module 62 is used to decrypt the target character string using the target object identifier to obtain a target encryption rule.
[0131] The first generating module 64 is used to generate a target decryption rule based on the target encryption rule and the cascading style sheet.
[0132] The second decryption module 66 is used to decrypt the encrypted image using the target decryption rule to obtain the original image.
[0133] Optionally, the generation module includes a determination unit and a conversion unit, wherein the determination unit is used to determine the inverse operation parameters corresponding to the target encryption rule based on the target encryption rule; and the conversion unit is used to convert the inverse operation parameters into the target decryption rule according to the cascading style sheet.
[0134] Optionally, the target encryption rule includes: an image conversion type and multiple image conversion parameters, and the image conversion type includes at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swapping, and channel inversion.
[0135] Optionally, the target string is stored in a page address of a target page or a file name of an encrypted image.
[0136] Optionally, a target image identifier corresponding to the encrypted image is stored in the page address.
[0137] Optionally, the device further comprises an inserting module, and the inserting module is used to insert a target decryption rule for the encrypted image in the target page.
[0138] Optionally, the encrypted image is in a hidden state.
[0139] Optionally, the device also includes: a second acquisition module, used to acquire the original image; a second generation module, used to randomly generate a target encryption rule; a first encryption module, used to encrypt the original image using the target encryption rule to obtain an encrypted image; a second encryption module, used to encrypt the target encryption rule using a target object identifier to obtain a target string; and a second generation module, used to generate a target page based on the encrypted image and the target string.
[0140] Optionally, the second encryption module includes: a first encoding unit, used to encode the target encryption rule to obtain binary data; an encryption unit, used to encrypt the binary data using the target object identifier to obtain encrypted data; and a second encoding unit, used to encode the encrypted data to generate a target character string.
[0141] Example 6
[0142] According to an embodiment of the present application, a picture processing device for implementing the above picture processing method is also provided, such as Figure 7 As shown, the device comprises:
[0143] The first acquisition module 71 is used to acquire the original image.
[0144] The first generating module 72 is used to randomly generate a target encryption rule.
[0145] The first encryption module 73 is used to encrypt the pixels of the original image using the target encryption rule to obtain an encrypted image.
[0146] The second encryption module 74 is used to encrypt the target encryption rule using the target object identifier to obtain a target character string.
[0147] The second generating module 75 is used to generate a target page based on the encrypted image and the target character string.
[0148] Optionally, the target string is stored in a page address of a target page or a file name of an encrypted image.
[0149] Optionally, a target image identifier corresponding to the encrypted image is stored in the page address.
[0150] Optionally, the encrypted image is in a hidden state.
[0151] Optionally, the device also includes: a second acquisition module, used to acquire a target page, wherein the target page includes an encrypted picture, a target object identifier and a target character string, the encrypted picture is obtained by encrypting pixels of the original picture using a target encryption rule, and the target character string is obtained by encrypting the target encryption rule using the target object identifier; a first decryption module, used to decrypt the target character string using the target object identifier to obtain a target encryption rule; a third generation module, used to generate a target decryption rule based on the target encryption rule and a cascading style sheet; and a second decryption module, used to decrypt the encrypted picture using the target decryption rule to obtain the original picture.
[0152] Optionally, the third generation module includes: a determination unit, used to determine the inverse operation parameters corresponding to the target encryption rule based on the target encryption rule; and a conversion unit, used to convert the inverse operation parameters into the target decryption rule according to the cascading style sheet.
[0153] Example 7
[0154] According to an embodiment of the present application, a picture processing device for implementing the above picture processing method is also provided, such as Figure 8 As shown, the device comprises:
[0155] The receiving module 81 is used for the server to receive the original image sent by the client.
[0156] The first generation module 82 is used for the server to randomly generate target encryption rules.
[0157] The first encryption module 83 is used for the server to encrypt the pixels of the original image using the target encryption rule to obtain an encrypted image.
[0158] The second encryption module 84 is used for the server to encrypt the target encryption rule using the target object identifier to obtain a target character string.
[0159] The second generating module 85 is used for the server to generate a target page based on the encrypted image and the target character string.
[0160] The sending module 86 is used for the server to send the target page to the client.
[0161] In the above embodiment of the present application, the target encryption rules include: an image conversion type and multiple image conversion parameters, and the image conversion type includes at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swapping, and channel inversion.
[0162] In the above-mentioned embodiments of the present application, the target character string is stored in the page address of the target page or the file name of the encrypted image.
[0163] In the above embodiment of the present application, the target image identifier corresponding to the encrypted image is stored in the page address.
[0164] In the above embodiment of the present application, before the server decrypts the encrypted image using the target decryption rule to obtain the original image, the method also includes: the server inserts the target decryption rule for the encrypted image in the target page.
[0165] In the above embodiments of the present application, the encrypted image is in a hidden state.
[0166] Example 8
[0167] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0168] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0169] In this embodiment, the computer terminal can execute the program code of the following steps in the image processing method:
[0170] A target page is obtained, wherein the target page includes an encrypted image, a target object identifier and a target string, the encrypted image is obtained by encrypting pixels of the original image using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier; the target string is decrypted using the target object identifier to obtain the target encryption rule; a target decryption rule is generated based on the target encryption rule and a cascading style sheet; the encrypted image is decrypted using the target decryption rule to obtain the original image.
[0171] Optionally, Fig. 9 A structural block diagram of a computer terminal according to an embodiment of the present application. Fig. 9 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 902 , and a memory 904 .
[0172] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned image processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0173] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: based on the target encryption rule, determine the inverse operation parameters corresponding to the target encryption rule; convert the inverse operation parameters into the target decryption rule according to the cascading style sheet.
[0174] Optionally, the processor may also execute the following program code steps: obtaining the original image; randomly generating a target encryption rule; encrypting the original image using the target encryption rule to obtain an encrypted image; encrypting the target encryption rule using a target object identifier to obtain a target string; and generating a target page based on the encrypted image and the target string.
[0175] Optionally, the processor may also execute program codes of the following steps: encoding the target encryption rule to obtain binary data; encrypting the binary data using the target object identifier to obtain encrypted data; encoding the encrypted data to generate a target character string.
[0176] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig. 9 It does not limit the structure of the above electronic device. For example, the computer terminal A may also include Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations shown.
[0177] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0178] Example 9
[0179] An embodiment of the present application also provides a computer-readable storage medium.
[0180] Optionally, in this embodiment, the computer-readable storage medium may be used to store program codes executed by the image processing method provided in the above embodiment.
[0181] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0182] Optionally, in this embodiment, the computer-readable storage medium may be configured to store program codes for performing the following steps:
[0183] A target page is obtained, wherein the target page includes an encrypted image, a target object identifier and a target string, the encrypted image is obtained by encrypting pixels of the original image using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier; the target string is decrypted using the target object identifier to obtain the target encryption rule; a target decryption rule is generated based on the target encryption rule and a cascading style sheet; the encrypted image is decrypted using the target decryption rule to obtain the original image.
[0184] Optionally, the storage medium is further configured to store program codes for executing the following steps: based on the target encryption rule, determining the inverse operation parameters corresponding to the target encryption rule; converting the inverse operation parameters into the target decryption rule according to the cascading style sheet. Image processing Optionally, the storage medium is further configured to store program codes for executing the following steps: obtaining the original image; randomly generating the target encryption rule; encrypting the original image using the target encryption rule to obtain the encrypted image; encrypting the target encryption rule using the target object identifier to obtain the target string; generating the target page based on the encrypted image and the target string.
[0185] Optionally, the storage medium is also configured to store program codes for executing the following steps: encoding the target encryption rule to obtain binary data; encrypting the binary data using the target object identifier to obtain encrypted data; encoding the encrypted data to generate a target string. Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: the cloud server receives the target image uploaded by the client; the cloud server processes the target image using the image processing model to obtain a classification result corresponding to the target image, wherein the image processing model is obtained by adjusting the pre-trained model through image samples and target samples, the target sample is a preset sample corresponding to the image sample in the preset sample set, and the image processing model is obtained by training the preset sample set; the cloud server feeds back the classification result to the client.
[0186] It should be noted that the collection, storage, use, processing, transmission, provision and disclosure of images involved in the above embodiments of the present application are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0187] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0188] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0189] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0190] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0191] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0192] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0193] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for processing an image, characterized in that: include: Acquire a target page, wherein the target page includes an encrypted picture, a target object identifier, and a target character string, wherein the encrypted picture is obtained by encrypting pixels of the original picture using a target encryption rule, and the target character string is obtained by encrypting the target encryption rule using the target object identifier, and the target object identifier is used to indicate identification information of the owner of the original picture; Decrypting the target character string using the target object identifier to obtain the target encryption rule; Based on the target encryption rule and the cascading style sheet, generating a target decryption rule; The encrypted image is decrypted using the target decryption rule to obtain the original image.
2. The method according to claim 1, characterized in that Based on the target encryption rule and the cascading style sheet, a target decryption rule is generated, including: Based on the target encryption rule, determining an inverse operation parameter corresponding to the target encryption rule; The inverse operation parameters are converted into the target decryption rules according to the cascading style sheet.
3. The method according to claim 1, characterized in that The target encryption rule includes: a picture conversion type and a plurality of picture conversion parameters, wherein the picture conversion type includes at least one of the following: horizontal mirroring, vertical mirroring, hue rotation, channel swapping and channel inversion.
4. The method according to claim 1, characterized in that: The target character string is stored in the page address of the target page or the file name of the encrypted image.
5. The method according to claim 4, characterized in that The page address stores a target image identifier corresponding to the encrypted image.
6. The method according to claim 1, characterized in that Before decrypting the encrypted image using the target decryption rule to obtain the original image, the method further includes: The target decryption rule is inserted into the target page for the encrypted image.
7. The method according to claim 1, characterized in that The encrypted image is in a hidden state.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Obtaining the original picture; Randomly generating the target encryption rule; Encrypting the original image using the target encryption rule to obtain the encrypted image; Encrypting the target encryption rule using the target object identifier to obtain the target character string; The target page is generated based on the encrypted image and the target character string.
9. The method according to claim 8, characterized in that Encrypting the target encryption rule using the target object identifier to obtain the target character string includes: Encoding the target encryption rule to obtain binary data; Encrypting the binary data using the target object identifier to obtain encrypted data; The encrypted data is encoded to generate the target character string.
10. A method for processing an image, characterized in that: include: Get the original image; Randomly generate target encryption rules; Encrypting pixels of the original image using the target encryption rule to obtain the encrypted image; Encrypting the target encryption rule using a target object identifier to obtain the target character string, wherein the target object identifier is used to represent identification information of the owner of the original image; A target page is generated based on the encrypted image, the target object identifier and the target character string, wherein the target page is processed using the method described in any one of claims 1 to 7.
11. A method for processing an image, characterized in that: include: The client receives a target page sent by the server, wherein the target page includes an encrypted picture, a target object identifier, and a target string, wherein the encrypted picture is obtained by encrypting pixels of the original picture using a target encryption rule, and the target string is obtained by encrypting the target encryption rule using the target object identifier, wherein the target object identifier is used to represent identification information of the owner of the original picture; The client uses the target object identifier to decrypt the target character string to obtain the target encryption rule; The client generates a target decryption rule based on the target encryption rule and the cascading style sheet; The client decrypts the encrypted image using the target decryption rule to obtain the original image.
12. A method for processing an image, characterized in that: include: The server receives the original image sent by the client; The server randomly generates a target encryption rule; The server encrypts the pixels of the original image using the target encryption rule to obtain the encrypted image; The server encrypts the target encryption rule using the target object identifier to obtain the target character string, wherein the target object identifier is used to represent the identification information of the owner of the original picture; The server generates a target page based on the encrypted image, the target object identifier and the target character string; The server sends the target page to the client, wherein the target page is processed using the method described in any one of claims 1 to 7.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the image processing method according to any one of claims 1 to 12.
14. A computer terminal, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the image processing method described in any one of claims 1 to 12 when running.
Citation Information
Patent Citations
Image Obfuscation in Web Content
US20140208201A1