Information decryption method, apparatus and device
By acquiring and decrypting pixel-level data of the target image, including pixel size, color value array, and compressed data of color block positions, the distortion problem during image decryption is solved, achieving accurate and lossless restoration and resource conservation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YUANLICHUANG TECH CO LTD
- Filing Date
- 2025-12-02
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies often lead to image distortion when decrypting images, making it impossible to accurately restore the original image.
By acquiring pixel-level data of the target image, including pixel size, color value array, and compressed data of color block positions, and decompressing and recompressing this data to generate the target image, the accurate and lossless restoration of pixel-level data is ensured.
It achieves accurate and lossless restoration of the target image, avoids image distortion, and reduces the consumption of storage and computing resources due to the small data volume.
Smart Images

Figure CN121239795B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, particularly to the field of information security protection in the field of semiconductor technology, and in particular to an information decryption method, apparatus and device. Background Technology
[0002] Information security is crucial across all industries, and encryption technology is generally used to enhance it. Images are a type of critical information, and image encryption is involved in many scenarios. For example, in the field of semiconductor testing technology, the description information for troubleshooting methods of power modules includes images, which need to be encrypted.
[0003] Some traditional methods, when used to decrypt encrypted images, result in image distortion, making it impossible to accurately reconstruct the original image. Summary of the Invention
[0004] Therefore, it is necessary to provide an information decryption method, apparatus, computer device, computer-readable storage medium, and computer program product that can avoid image distortion in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides an information decryption method, which includes:
[0006] Obtain the image encryption information corresponding to the target image;
[0007] Decrypt the encrypted information of the image to obtain the pixel-level data corresponding to the target image; the pixel-level data includes the pixel size of the target image, the color value array, and the compressed data of the color block positions; the color value array includes the color value corresponding to each pixel in the target image and the number of color blocks corresponding to each color value; pixels in the same color block correspond to the same color value; the color blocks are obtained by dividing the target image;
[0008] Decompress the compressed data of the color block positions to obtain the first position array; the first position array includes the coordinates and size of each color block corresponding to the color block divided by the target image;
[0009] Generate the target image based on the pixel size, the first position array, and the color value array.
[0010] In one embodiment, the coordinates of each color block in the first position array include the x-coordinate and y-coordinate values of the color block, and the size of the color block includes the length and height of the color block;
[0011] Decompress the compressed data of the color block positions to obtain the first position array, which includes:
[0012] Decompress the compressed data of the color block positions to obtain a concatenated array; the concatenated array includes an x-coordinate array, a y-coordinate array, a length array, and a height array; the x-coordinate array includes the x-coordinate value of each color block, the y-coordinate array includes the y-coordinate value of each color block, the length array includes the length of each color block, and the height array includes the height of each color block;
[0013] Generate the first position array based on the x-coordinate array, y-coordinate array, length array, and height array.
[0014] In one embodiment, generating a target image based on pixel size, a first position array, and a color value array includes:
[0015] Generate an initial two-dimensional array of pixels; the size of the initial two-dimensional array of pixels is the pixel size.
[0016] Based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, update the color values corresponding to the color blocks in the color value array to the initial two-dimensional pixel array to obtain the target two-dimensional pixel array;
[0017] The target image is obtained by performing image conversion processing based on a two-dimensional array of target pixels.
[0018] In one embodiment, the pixel-level data further includes a first color value, which is the color value with the most corresponding color blocks in the target image; the color values in the color value array are second color values in the target image other than the first color value; the first position array includes the color block coordinates and color block size corresponding to each color block with the second color value; and each element in the initial pixel two-dimensional array is the first color value.
[0019] Based on the color block coordinates and size recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, update the color values corresponding to the color blocks in the color value array to the initial two-dimensional pixel array, including:
[0020] Based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each second color value in the color value array, the first color value corresponding to the color block in the initial pixel two-dimensional array is replaced with the second color value corresponding to the color block in the color value array to obtain the target pixel two-dimensional array.
[0021] In one embodiment, each element of the first position array corresponds to a color block, and each element corresponds to the color value of the corresponding color block; each element includes the color block coordinates and the color block size; the elements in the first position array are sorted sequentially according to the order of their corresponding color values in the color value array;
[0022] Based on the color block coordinates and size recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, update the color values corresponding to the color blocks in the color value array to the initial two-dimensional pixel array, including:
[0023] Starting from the first color value in the color value array, select the first current color value in sequence, and determine the number of color blocks N corresponding to the first current color value, where N≥1 and is an integer;
[0024] From the first position array, determine the N elements corresponding to the first current color value in sequence;
[0025] In the initial two-dimensional pixel array, determine the target position indicated by the color block coordinates and color block size in N elements, update the first current color value to the target position, and obtain the target pixel two-dimensional array.
[0026] In one embodiment, the color patch coordinates in the first element corresponding to each color value in the first position array are the original color patch coordinates, and the color patch coordinates of the non-first elements are the coordinate differences; the N elements are determined from the updated first position array;
[0027] The method also includes:
[0028] Starting from the first color value in the color value array, determine the second current color value in sequence. For each second current color value, determine the element in the first position array corresponding to the second current color value in sequence according to the number of color blocks corresponding to the second current color value.
[0029] When there are multiple elements, the second element among the multiple elements is determined as the current element. The original color block coordinates of the color block corresponding to the current element are determined based on the sum of the coordinate difference in the current element and the current color block coordinates in the previous element.
[0030] Replace the coordinate difference in the current element with the determined original color block coordinates, and take the next element as the new current element to continue iterating until the coordinate difference in multiple elements is replaced with the corresponding original color block coordinates, and stop iterating to obtain the updated first position array.
[0031] In one embodiment, the color values in the color value array are the difference color values obtained by differential calculation of the original color values;
[0032] Image transformation is performed based on a two-dimensional array of target pixels to obtain the target image, including:
[0033] Restore each differential color value in the two-dimensional array of target pixels to its corresponding original color value to obtain the updated two-dimensional array of target pixels;
[0034] The updated two-dimensional array of target pixels is processed to obtain the target image.
[0035] In one embodiment, the target image is included in the original information, which also includes first text information;
[0036] The encrypted information of the target image obtained includes:
[0037] Obtain the encrypted text information obtained by encrypting the second text information; the second text information is obtained by replacing the target image in the original information with the image identifier of the target image;
[0038] Decrypt the encrypted text information to obtain the second text information;
[0039] The encrypted image information is retrieved based on the image identifier in the second text information.
[0040] In one embodiment, the original information includes a fault diagnosis method corresponding to the power module; before obtaining the encrypted text information obtained by encrypting the second text information, the method further includes:
[0041] Responding to the query content entered by the user in the fault query interface, determine the fault identifier that matches the query content;
[0042] The corresponding encrypted file is read based on the fault identifier; the encrypted file is a file encrypted using the fault diagnosis method; the encrypted file includes both text encryption information and image encryption information.
[0043] Secondly, this application also provides an information decryption device, which includes:
[0044] The acquisition module is used to obtain the image encryption information corresponding to the target image;
[0045] The decryption module is used to decrypt the encrypted information of the image to obtain the pixel-level data corresponding to the target image. The pixel-level data includes the pixel size of the target image, the color value array, and the compressed data of the color block positions. The color value array includes the color value corresponding to each pixel in the target image and the number of color blocks corresponding to each color value. Pixels in the same color block correspond to the same color value. The color blocks are obtained by dividing the target image.
[0046] The decompression module is used to decompress the color block position compressed data to obtain a first position array; the first position array includes the color block coordinates and color block size corresponding to each color block divided by the target image; the target image is generated based on the pixel size, the first position array, and the color value array.
[0047] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method mentioned in the first aspect above.
[0048] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method mentioned in the first aspect above.
[0049] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method mentioned in the first aspect above.
[0050] The aforementioned information decryption method, apparatus, computer equipment, computer-readable storage medium, and computer program product decrypt the encrypted information corresponding to the target image to obtain pixel-level data corresponding to the target image. The pixel-level data includes the pixel size of the target image, a color value array, and compressed data of color block positions. The color value array includes the color values corresponding to each pixel in the target image and the number of color blocks corresponding to each color value. Pixels within the same color block correspond to the same color value. The color blocks are obtained by dividing the target image. The compressed data of color block positions is decompressed to obtain a first position array. The first position array includes the coordinates and size of each color block corresponding to the color blocks divided by the target image. The target image is generated based on the pixel size, the first position array, and the color value array. Since the pixel size represents the actual size of the target image, the color value array is equivalent to information about the target image in the color dimension, and the first position array is information in the position dimension, the target image can be accurately and losslessly restored based on the pixel size, the first position array, and the color value array, avoiding image distortion. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating an information decryption method in one embodiment;
[0052] Figure 2 This is a schematic diagram illustrating the principle of decompressing compressed data at the position of color blocks in one embodiment;
[0053] Figure 3 This is a schematic diagram illustrating the updating of an initial two-dimensional array of pixels in one embodiment;
[0054] Figure 4 This is a schematic diagram illustrating the selection of an element from a first position array in one embodiment;
[0055] Figure 5 This is a flowchart illustrating a fuzzy search process in one embodiment;
[0056] Figure 6 This is a flowchart illustrating the information decryption method in another embodiment;
[0057] Figure 7 This is a structural block diagram of an information decryption device in one embodiment;
[0058] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] like Figure 1 As shown, an information decryption method is provided, which is applied to a computer device and includes the following steps:
[0061] S11, obtain the image encryption information corresponding to the target image.
[0062] S12, decrypt the encrypted information of the image to obtain the pixel-level data corresponding to the target image; the pixel-level data includes the pixel size of the target image, the color value array, and the compressed data of the color block positions.
[0063] The image encryption information is obtained by dividing the target image into color blocks, compressing the blocks at the pixel level to obtain pixel-level data, and then encrypting this pixel-level data. Therefore, decrypting the image encryption information yields the corresponding pixel-level data of the target image.
[0064] The color blocks in this embodiment are solid color blocks, meaning that pixels within the same color block correspond to the same color value. There can be one or more color blocks corresponding to the same color value. For example, the divided color blocks can be rectangular blocks. The specific method of color block division is not limited; for instance, one can first find pixels with consecutive equal color values by row and then find pixels with consecutive equal color values by column, thus achieving color block division.
[0065] In this context, the color value array in the pixel-level data is equivalent to compressed data in the color value dimension, including the color values corresponding to each pixel in the target image and the number of color patches corresponding to each color value. That is, the color values in the color value array are the color values corresponding to the pixels in the target image. The color values corresponding to each pixel can include the original color value of the pixel or the color value obtained by differentiating the original color value (i.e., the difference color value). The number of color patches corresponding to each color value refers to the number of color patches that have that color value. The color patches corresponding to a color value are the color patches that originally exist in the target image and have not been processed.
[0066] In some embodiments, the color values in the color value array may include all color values corresponding to pixels in the target image (i.e., the color values corresponding to all pixels), or a subset of color values corresponding to pixels in the target image. For example, a subset of color values may be a second color value other than the first color value, where the first color value is the color value corresponding to the largest number of color blocks. It should be understood that if a difference calculation is performed on the original color values when dividing the color blocks, then the first color value may be the difference color value corresponding to the largest number of color blocks. If no difference calculation is performed on the original color values when dividing the color blocks, the first color value is the original color value corresponding to the largest number of color blocks.
[0067] S13, decompress the color block position compressed data to obtain the first position array; the first position array includes the color block coordinates and color block size corresponding to each color block divided by the target image.
[0068] The compressed data of color block positions in pixel-level data is equivalent to data compressed in the position dimension with color blocks as the granularity. Decompressing it can restore the position information of each color block (including color block coordinates and color block size).
[0069] During the compression stage, a first position array is formed based on the coordinates and size of each color block. Compression is then applied to this first position array to obtain compressed color block position data. During the decompression stage, the compressed color block position data is decompressed to obtain the first position array.
[0070] The first position array includes the coordinates and size of the color patch corresponding to each color value in the color value array. If the color value array contains only a subset of color values, then the first position array will only contain the coordinates and size of the color patches corresponding to those subset of color values. Each element in the first position array corresponds to one color patch, and each element includes the coordinates and size of that color patch; each element corresponds to the color value of the corresponding color patch.
[0071] The coordinates of each color block in the first position array can be the original color block coordinates, or the color block coordinates obtained by calculating the difference between the original color block coordinates (i.e., coordinate difference).
[0072] In some embodiments, the color block coordinates of each color block in the first position array include the x-coordinate value and y-coordinate value of the color block, and the color block size includes the color block length and the color block height. Step S13 includes: decompressing the color block position compressed data to obtain a concatenated array (for example, restoring the concatenated array by folding repeated elements with distance-length); the concatenated array includes an x-coordinate array, a y-coordinate array, a length array, and a height array; the x-coordinate array includes the x-coordinate value of each color block, the y-coordinate array includes the y-coordinate value of each color block, the length array includes the color block length of each color block, and the height array includes the color block height of each color block; and generating the first position array based on the x-coordinate array, y-coordinate array, length array, and height array.
[0073] Specifically, such as Figure 2 As shown, the concatenated array contains 20 elements. Elements marked with dashed boxes correspond to the same color value 1, while unmarked elements correspond to a different color value 2. These 20 elements consist of four arrays: a horizontal coordinate array, a vertical coordinate array, a length array, and a height array. The first position array generated from these four arrays is a two-dimensional array with a column width of 4 (i.e., a 5×4 two-dimensional array). The horizontal coordinate array, vertical coordinate array, length array, and height array each serve as a column of data in the first position array. For example, in the first position array, the first column contains the horizontal coordinate value (original horizontal coordinate value or difference) of each color block in the horizontal coordinate array, the second column contains the vertical coordinate value (original vertical coordinate value or difference) of each color block in the vertical coordinate array, the third column contains the length of each color block in the length array, and the fourth column contains the height of each color block in the height array. A single row of data represents data belonging to the same element. A single row of data contains the coordinates (x and y coordinates) and size (length and height) of the same color block.
[0074] S14: Generate the target image based on the pixel size, the first position array, and the color value array.
[0075] Specifically, the computer device can generate an initial two-dimensional array of pixels; the size of the initial two-dimensional array of pixels is the pixel size. Each element in this initial two-dimensional array of pixels corresponds to a pixel, but not every element records the actual color value; for example, it records a default color value (such as the first color value) or a color value that is empty.
[0076] Furthermore, based on the color block coordinates and size (i.e., the position information of each color block) recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array (i.e., color information), the color values corresponding to the color blocks in the color value array are updated to the initial two-dimensional pixel array to obtain the target two-dimensional pixel array. That is, the corresponding color value is updated at each element position in the initial two-dimensional pixel array to obtain the target two-dimensional pixel array, in which each element position is filled with the corresponding color value, which is equivalent to being able to directly or indirectly determine the real color value corresponding to each pixel.
[0077] In this way, image conversion processing can be performed based on a two-dimensional array of target pixels, thus restoring a complete and undistorted target image.
[0078] In some examples, where the color values in the color value array are the original color values, the target pixel two-dimensional array can be directly processed to restore the target image.
[0079] In other examples, where the color values in the color value array are differential color values, each differential color value in the target pixel two-dimensional array can be restored to its corresponding original color value, resulting in an updated target pixel two-dimensional array. Then, image conversion processing is performed on the updated target pixel two-dimensional array to obtain the target image. It should be understood that restoring differential color values to their corresponding original color values is the inverse process of differential processing the original color values during the compression stage.
[0080] In the above method, since the pixel size represents the actual size of the target image, the color value array is equivalent to the color dimension information of the target image, and the first position array is the position dimension information, the target image can be accurately and losslessly restored based on the pixel size, the first position array, and the color value array, thus avoiding image distortion.
[0081] Furthermore, the pixel-level data includes the pixel size, color value array, and compressed data of color block positions of the target image. This compressed data is very small in size after compression at the pixel level. Therefore, the image encryption information obtained based on the compressed pixel-level data is pixel-level encryption, with a small data size, high compression ratio, and low storage resource consumption. For the decryption device, decrypting this image encryption information also reduces the consumption of storage or computing resources to some extent.
[0082] In some embodiments, the pixel-level data further includes a first color value, which is the color value with the most corresponding color blocks in the target image (i.e., the background color); the color values in the color value array are the second color values in the target image other than the first color value; the first position array includes the color block coordinates and color block size corresponding to each color block with the second color value; and each element in the initial pixel two-dimensional array is the first color value.
[0083] That is, the color value (i.e. element value) recorded at each element position in the initial pixel two-dimensional array is the default first color value. Subsequently, based on the first position array and the color value array, the color value corresponding to each color block in the color value array can be updated to the initial pixel two-dimensional array, that is, the color value recorded at the corresponding element position in the initial pixel two-dimensional array can be updated.
[0084] like Figure 3 As shown, assuming the target image has a pixel size of 8×8, the initial two-dimensional pixel array will also be 8×8. Each element's position records the background color FFFF66. Subsequently, based on the first position array and the color value array, the color values corresponding to each color block can be gradually updated to obtain the target pixel two-dimensional array. It should be understood that... Figure 3 The text only briefly illustrates updating a single color value (009900) to the initial two-dimensional pixel array, but it does not limit the update to only one color value.
[0085] Specifically, based on the color block coordinates and size recorded in the first position array for each color block, and the number of color blocks corresponding to each second color value in the color value array, the first color value corresponding to each color block in the initial two-dimensional pixel array is replaced with the second color value corresponding to that color block in the color value array, thus obtaining the target two-dimensional pixel array. That is, the color block coordinates and size recorded in the first position array can be used to locate or indicate the position of each color block in the initial two-dimensional pixel array, and thus, the first color value corresponding to each color block in the initial two-dimensional pixel array can be replaced with the second color value corresponding to that color block in the color value array.
[0086] In the above embodiments, for the first color value (i.e., the background color) with the largest number of color blocks, compression is not performed on the color dimension and color block position dimension for the color blocks with this first color value. Instead, this first color value is simply recorded in the pixel-level data to be encrypted. This effectively reduces the amount of encryption processing during the encryption stage, decreases the size of the encrypted file, and improves the compression ratio. Furthermore, on the decryption side, using this relatively small amount of pixel-level data can reduce storage resource usage to some extent. Moreover, directly generating the initial two-dimensional pixel array based on the background color allows for faster and more convenient reconstruction of the target pixel two-dimensional array. Since a large number of background color blocks do not need to be reconstructed, only the non-background color values are updated and reconstructed. This significantly improves the image decryption and decompression efficiency and saves computational resources.
[0087] In some embodiments, each element of the first position array corresponds to a color block, and each element corresponds to the color value of the corresponding color block; each element includes the color block coordinates and the color block size; the elements in the first position array are sorted sequentially according to the order of the corresponding color values in the color value array.
[0088] Therefore, the computer device can sequentially select the first current color value from the first color value in the color value array, determine the number of color blocks N corresponding to the first current color value, where N ≥ 1 and is an integer; and sequentially determine the N elements corresponding to the first current color value from the first position array. It should be noted that the number of color blocks N corresponding to different color values as the first current color value can be different. Here, N is used to refer to the number of color blocks corresponding to the first current color value in general, and it is not limited to each color value having the same number of color blocks.
[0089] like Figure 4 As shown, the color value array contains two color values (color value 1 and color value 2). The first color value (color value 1) corresponds to 4 color blocks, and the second color value (color value 2) corresponds to 1 color block. Therefore, the first position array has 5 elements (i.e., 5 rows of data corresponding to the 5 color blocks, each row including the color block coordinates and color block size).
[0090] When color value 1 is the first current color value, the first 4 elements are selected from the first position array. When the second color value is the first current color value, starting from the 5th element in the first position array, one element matching the number of color blocks of the second color value is selected (i.e., the 5th element in the first position array is selected).
[0091] It should be understood that since the elements in the first position array are sorted sequentially according to the order of their corresponding color values in the color value array, the color patch coordinates and sizes of the selected N elements are used to indicate the target positions of each color patch with the first current color value in the initial two-dimensional pixel array. Therefore, the target positions indicated by the color patch coordinates and sizes of the N elements in the initial two-dimensional pixel array can be determined, and the first current color value can be updated to the target position to obtain the target pixel two-dimensional array.
[0092] The first color value in the color value array is used as the first current color value to perform the above processing. After updating it to the corresponding target position in the initial two-dimensional pixel array, the next color value can be selected as the new first current color value, and the above processing continues iteratively until all color values in the color value array are updated to the corresponding target positions in the initial two-dimensional pixel array, thus obtaining the target pixel two-dimensional array. In the above embodiment, the target pixel two-dimensional array can be accurately and conveniently reconstructed.
[0093] In some embodiments, the color block coordinates in the first position array are coordinate differences obtained by interpolating the original color block coordinates. Therefore, the coordinate differences in the first position array can be updated and restored to the original color block coordinates first, and then, based on the color block coordinates and size of each color block recorded in the updated first position array, and the number of color blocks corresponding to each color value in the color value array, the color values corresponding to the color blocks in the color value array are updated to the initial two-dimensional pixel array.
[0094] It should be noted that in this embodiment, during the compression stage, before generating the first position array, a corresponding second position array is generated for each color value in the color value array. The second position array for each color value includes the original coordinates and size of each color patch corresponding to that color value. That is, each element in the second position array includes the original coordinates and size of a color patch. Then, the original color patch coordinates in the second position array are subtracted to obtain a third position array for each color value. The color patch coordinates in each element of this third position array are the coordinate differences after the subtraction calculation. Further, the third position arrays for each color value are concatenated to obtain the first position array.
[0095] For example, in the compression stage, the step of determining the third position array corresponding to each color value includes: in the second position array of each color value, each element is sorted according to the size relationship of the original color block coordinates (for example, the original color block coordinates include the original horizontal coordinate value and the original vertical coordinate value, and each element is sorted according to the size relationship of the original horizontal coordinate value, and elements with the same original horizontal coordinate are sorted according to the size relationship of the original vertical coordinate value). When performing the difference calculation of the original color block coordinates, the original color block coordinates of the first element in the second position array are kept unchanged, and each element other than the first element is recorded as the target element. For each target element in the second position array, the original color block coordinates of the target element are subtracted from the original color block coordinates of the previous element (that is, the original horizontal coordinate value of the target element is subtracted from the original horizontal coordinate value of the previous element, and the original vertical coordinate value of the target element is subtracted from the original vertical coordinate value of the previous element) to obtain the coordinate difference, and the original color block coordinates of the target element are replaced with the coordinate difference to obtain the third position array corresponding to the color value.
[0096] It should be understood that, according to the processing in the compression stage described above, the color patch coordinates in the first element of the first position array for each color value in the color value array are the original color patch coordinates, while the color patch coordinates of other elements are coordinate differences (i.e., the coordinate differences calculated after subtracting the original color patch coordinates). Therefore, in the decompression stage, the process of updating and restoring the coordinate differences in the first position array to the original color patch coordinates is as follows:
[0097] In this embodiment, the elements in the first position array are sorted sequentially according to the order of their corresponding color values in the color value array. The computer device can determine the second current color value sequentially starting from the first color value in the color value array. The second current color value and the first current color value are only used to distinguish the color values currently involved in the calculation at different calculation stages, and do not represent different color values.
[0098] For each second current color value, based on the number of color blocks corresponding to the second current color value, the elements in the first position array corresponding to the second current color value are determined sequentially. The specific processing for determining the elements corresponding to the second current color value can be found in the processing for determining the elements corresponding to the first current color value, and will not be elaborated here.
[0099] If there are multiple color blocks corresponding to the second current color value, it means that multiple color blocks have the same second current color value, thus identifying multiple elements. When multiple elements are identified, based on the compression process described above, the color block coordinates in the first element are the original color block coordinates and do not need to be restored. Therefore, the element value (including color block coordinates and size) of the first element among the identified elements can be kept unchanged. The second element is identified as the current element. The original color block coordinates of the current element are obtained by summing the color block coordinates (i.e., coordinate difference) of the current element with the current color block coordinates of the previous element. That is, the horizontal coordinate value of the current element's color block coordinates is added to the horizontal coordinate value of the current color block coordinates of the previous element (i.e., the element value in the same column of the previous element), and the vertical coordinate value of the current element's color block coordinates is added to the vertical coordinate value of the current color block coordinates of the previous element (i.e., the element value in the same column of the previous element).
[0100] Replace the coordinate difference in the current element with the original color block coordinates, and take the next element as the new current element to continue iterating until the coordinate difference in the determined multiple elements is replaced with the corresponding original color block coordinates and the iteration stops. That is, restore the original color block coordinates of the multiple elements corresponding to the second current color value.
[0101] For example, when the second element is the current element, and the previous element is the first element, its current color block coordinates are the original color block coordinates. This is equivalent to adding the coordinate difference in the second element to the original color block coordinates of the first element, thus obtaining the original color block coordinates corresponding to the second element. Therefore, the coordinate difference in the second element can be replaced with the original color block coordinates. Similarly, when the third element is the current element, and its previous element is the second element, the coordinate difference in the third element can be added to the current color block coordinates of the second element (i.e., the updated original color block coordinates), thus obtaining the original color block coordinates corresponding to the third element. This process can be repeated to update the coordinate differences in multiple elements corresponding to the second current color value to the original color block coordinates.
[0102] After updating and restoring the coordinate differences of each element corresponding to a color value in the first position array to the original color block coordinates, the next color value can be used as the new second current color value, and the above process can be continued until the coordinate differences of each element corresponding to each color value in the first position array are updated and restored to the original color block coordinates. This achieves the coordinate restoration of the entire first position array, resulting in the updated first position array.
[0103] The above method can accurately and conveniently update and restore the coordinate differences in the first position array to the original color block coordinates.
[0104] In some embodiments, the target image is included in the original information, which also includes first text information. Step S11, obtaining the image encryption information corresponding to the target image, includes: obtaining the text encryption information; decrypting the text encryption information to obtain second text information; the second text information is obtained by replacing the target image in the original information with the image identifier of the target image; and searching for the image encryption information based on the image identifier in the second text information.
[0105] It should be understood that the original information includes both the target image and the first text information. During the encryption phase, the target image is encrypted separately to form encrypted image information. In the original information, the location of the target image is replaced with its corresponding image identifier (i.e., image number, used to uniquely identify the target image), resulting in the second text information. That is, the second text information includes the first text information and the image identifier. Furthermore, the second text information is encrypted to obtain the encrypted text information.
[0106] Therefore, in the decryption stage, the encrypted text information can be decrypted first to obtain the second text information. Then, the corresponding encrypted image information can be found based on the image identifier in the second text information. Subsequently, the encrypted image information is decrypted and decompressed according to the method in the embodiments of this application to accurately restore the target image.
[0107] In some embodiments, during the text encryption stage, the second text information is first converted into a byte array, then into a one-dimensional boolean array. Next, the one-dimensional boolean array is cyclically shifted to achieve bit-level obfuscation. Then, the cyclically shifted one-dimensional boolean array is iteratively inverted using a bit-inverting function for further encryption. Finally, the boolean array is converted back into a byte array to obtain the encrypted text information.
[0108] Therefore, the steps for decrypting encrypted text information during the decryption phase include:
[0109] (a) Convert the encrypted text information (i.e., the string) into a one-dimensional second-byte array.
[0110] (b) Convert the second byte array into a one-dimensional boolean array.
[0111] Specifically, each byte element in the second byte array can be converted into a two-dimensional boolean array with a column width of 8, and then the two-dimensional boolean array can be converted into a one-dimensional boolean array.
[0112] (c) The input variable of the inverted position generation function is continuously changed according to the preset rules, so that the inverted position generation function continuously generates new inverted positions. For each generated inverted position, the Boolean element corresponding to the inverted position in the current one-dimensional Boolean array is inverted until the generated inverted position is greater than or equal to the length of the one-dimensional Boolean array and then the inversion stops.
[0113] It should be understood that, during the decryption phase, the iterative inversion process of the bit-inverting generator is consistent with the iterative inversion process during the encryption phase. For example, step (c) includes the following sub-steps:
[0114] (c.1) Invert the y-th bit of the current one-dimensional Boolean array, where y = f(x) and x is initially 0.
[0115] It should be understood that f(x) is the inverted position generator function, where x is the input variable and y is the inverted position. For example, if the y-th element in the current one-dimensional Boolean array is True, its inversion will result in False.
[0116] (c.2) Increment the value of x, repeating step c.1) to invert the value until the value of y is greater than or equal to the length of the one-dimensional Boolean array, at which point the inversion stops. It should be understood that incrementing the value of x is the default rule. Each inversion changes the one-dimensional Boolean array, and each inversion applies to the latest version of the one-dimensional Boolean array.
[0117] (d) Move a preset number of elements from the end of the one-dimensional Boolean array after the inversion stops to the beginning of the one-dimensional Boolean array to update the one-dimensional Boolean array.
[0118] For example, the last two elements of the one-dimensional Boolean array can be deleted, and the deleted two elements can be inserted at the beginning of the one-dimensional Boolean array. In this way, bit-level obfuscation during the compression stage can be restored.
[0119] (e) Convert the updated one-dimensional Boolean array into a two-dimensional Boolean array with a column width of 8.
[0120] (f) Convert the 8 Boolean elements of the two-dimensional Boolean array into a U8 integer row by row, thereby converting the two-dimensional Boolean array into a one-dimensional first byte array.
[0121] (g) Convert the first byte array into a string to obtain the second text information.
[0122] The above solution can flexibly encrypt original information that includes both images and text, thereby greatly improving the encryption effect.
[0123] In some embodiments, the original information includes a troubleshooting method corresponding to the power module (i.e., a description of the troubleshooting method). The computer device can display a fault query interface, where the user can input query content. In response to the query content, the computer device determines a fault identifier that matches the query content. Then, it reads the encrypted file corresponding to the fault identifier, which is a file obtained by encrypting the troubleshooting method corresponding to the fault identifier. This encrypted file includes both text encryption information and image encryption information.
[0124] In one embodiment, a fuzzy search method can be used to determine fault identifiers that match the query content. For example... Figure 5 As shown, the steps of this fuzzy search include:
[0125] (1) In the correspondence table of fault names and fault identifiers, find the fault name that is the same as the query content entered by the user.
[0126] (2) Determine if the same fault name is found. If not, proceed to step (3); if yes, proceed to step (9).
[0127] (3) Extract the query content into multiple keywords according to the keyword length set in the configuration file.
[0128] (4) Filter out and block the featured keywords with high matching degree from the extracted keywords.
[0129] (5) In the correspondence table between fault names and fault identifiers, find the fault names that contain the filtered keywords.
[0130] (6) Determine whether a fault name containing the keyword has been found. If yes, proceed to step (7); otherwise, proceed to step (11).
[0131] (7) Use the distance algorithm to calculate the distance between all found fault names and the input query content.
[0132] (8) Sort all the found fault names in ascending order of distance value and filter fault names whose distance is greater than the preset distance threshold.
[0133] (9) Display the fault name in the results list.
[0134] (10) The fault identifier corresponding to the first fault name in the search results list is used as the fault identifier that matches the query content entered by the user.
[0135] (11) Determine that the user's input query content cannot find the corresponding equipment fault information.
[0136] In the above embodiments, the information is stored locally and cannot be previewed directly. Instead, it is conveniently decrypted and decompressed for viewing through a dedicated fault query interface (such as the fault query interface provided by the host computer of the power module testing system). In this way, the convenience of providing technical support information to users is ensured, while information protection is maximized.
[0137] like Figure 6 As shown, in one embodiment, another information decryption method is provided, which includes the following steps:
[0138] S601, responding to the query content entered by the user in the fault query interface, determines the fault identifier that matches the query content; reads the corresponding encrypted file according to the fault identifier; the encrypted file includes text encryption information and image encryption information corresponding to at least one image; decrypts the text encryption information to obtain second text information, and searches for image encryption information corresponding to the image identifier in the encrypted file according to the image identifier in the second text information.
[0139] For details on the specific process of identifying fault identifiers that match the query content, please refer to the description of fuzzy search above.
[0140] S602, decrypt the encrypted information of the image to obtain the pixel-level data corresponding to the target image; the pixel-level data includes the pixel size of the target image, the color value array, the first color value, and the compressed data of the color block position; the color value array includes each second color value and the number of color blocks corresponding to each second color value; the second color value is the color value in the target image other than the first color value; both the first color value and the second color value are differential color values after differential calculation of the original color values.
[0141] S603, decompress the compressed data of color block positions to obtain a concatenated array; the concatenated array includes an array of horizontal coordinates, an array of vertical coordinates, an array of lengths, and an array of heights; based on the arrays of horizontal coordinates, vertical coordinates, lengths, and heights, generate a first position array; each element in the first position array corresponds to a color block with a second color value, and each element includes the coordinates and size of the color block corresponding to the color block with the second color value; the elements in the first position array are sorted sequentially according to the order of the corresponding second color value in the color value array; the coordinates of the color block in the first element corresponding to each second color value in the first position array are the original color block coordinates, and the coordinates of the color blocks in the non-first elements are the coordinate differences.
[0142] The array consists of several elements: the x-coordinate array (containing the x-coordinates of each color block with a second color value), the y-coordinate array (containing the y-coordinates of each color block), the length array (containing the length of each color block), and the height array (containing the height of each color block). The color block coordinates include both the x-coordinate and y-coordinate values, and the color block size includes both the length and height.
[0143] S604, Generate an initial two-dimensional pixel array; the size of the initial two-dimensional pixel array is the pixel size of the target image; each element in the initial two-dimensional pixel array is the first color value.
[0144] S605, starting from the first color value in the color value array, determine the second current color value in sequence. For each second current color value, determine the element in the first position array corresponding to the second current color value in sequence according to the number of color blocks corresponding to the second current color value.
[0145] S606, when there are multiple elements, the second element among the multiple elements is determined as the current element, and the original color block coordinates of the color block corresponding to the current element are determined based on the sum of the coordinate difference in the current element and the current color block coordinates in the previous element.
[0146] S607, replace the coordinate difference in the current element with the determined original color block coordinates, and take the next element as the new current element to continue iterating until the coordinate difference in multiple elements is replaced with the corresponding original color block coordinates and the iteration stops, resulting in the updated first position array.
[0147] It should be understood that the coordinates of each color block in the updated first position array are the original color block coordinates.
[0148] S608: Starting from the first color value in the color value array, select the first current color value in sequence, and determine the number of color blocks N corresponding to the first current color value, where N≥1 and is an integer; determine the N elements corresponding to the first current color value in sequence from the updated first position array.
[0149] S609, determine the target position indicated by the color block coordinates and color block size in N elements of the initial pixel two-dimensional array, replace the first color value at the target position with the first current color value, and obtain the target pixel two-dimensional array.
[0150] S610, restore each differential color value in the target pixel two-dimensional array to its corresponding original color value to obtain an updated target pixel two-dimensional array; perform image conversion processing on the updated target pixel two-dimensional array to obtain a target image; replace the image identifier in the second text information with the target image to obtain the description information of the fault diagnosis method.
[0151] For example, the computer device can be the host computer of a power module testing system. The description information of the troubleshooting method can be output and displayed in the fault query interface of the host computer of the power module testing system. When displaying the fault query interface, the operating system's API interface can be called to set the window of the host computer of the power module testing system to only output to the physical monitor, preventing tools such as screen capture and screen recording from capturing content, thereby further protecting information security. In addition, a preset watermark can be displayed in the display area of the description information of the troubleshooting method.
[0152] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0153] Based on the same inventive concept, this application also provides an information decryption apparatus for implementing the information decryption method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more information decryption apparatus embodiments provided below can be found in the limitations of the information decryption method described above, and will not be repeated here.
[0154] In one embodiment, such as Figure 7 As shown, an information decryption device is provided, comprising:
[0155] The acquisition module 702 is used to acquire the image encryption information corresponding to the target image;
[0156] The decryption module 704 is used to decrypt the encrypted information of the image to obtain the pixel-level data corresponding to the target image. The pixel-level data includes the pixel size of the target image, the color value array, and the compressed data of the color block positions. The color value array includes the color value corresponding to each pixel in the target image and the number of color blocks corresponding to each color value. Pixels in the same color block correspond to the same color value. The color blocks are obtained by dividing the target image.
[0157] The decompression module 706 is used to decompress the color block position compressed data to obtain a first position array; the first position array includes the color block coordinates and color block size corresponding to each color block divided by the target image; and the target image is generated based on the pixel size, the first position array and the color value array.
[0158] Each module in the aforementioned information decryption device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device within the probe station device, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0159] In one embodiment, a computer device is provided. Its internal structure diagram can be as follows: Figure 8 As shown, this computer device may include a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an information decryption method.
[0160] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the embodiments of the present application.
[0162] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the embodiments of this application.
[0163] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the embodiments of this application.
[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0165] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. The processors involved in the various embodiments provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited thereto.
[0166] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application's patent. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An information decryption method, characterized in that, The method includes: Obtain the image encryption information corresponding to the target image; Decrypt the encrypted information of the image to obtain pixel-level data corresponding to the target image; the pixel-level data includes the pixel size of the target image, a color value array, and compressed data of color block positions; the color value array includes all or part of the color values corresponding to the pixels in the target image, and the number of color blocks corresponding to each color value; pixels in the same color block correspond to the same color value; the color blocks are obtained by dividing the target image; The compressed data of the color block positions is decompressed to obtain a first position array; the first position array includes the color block coordinates and color block size corresponding to each color block divided by the target image; The target image is generated based on the pixel size, the first position array, and the color value array.
2. The method according to claim 1, characterized in that, The coordinates of each color block in the first position array include the x-coordinate and y-coordinate values of the color block, and the size of the color block includes the length and height of the color block; The step of decompressing the compressed data of the color block positions to obtain a first position array includes: The compressed data of the color block positions is decompressed to obtain a spliced array; the spliced array includes an array of horizontal coordinates, an array of vertical coordinates, an array of lengths, and an array of heights; the array of horizontal coordinates includes the horizontal coordinate value of each color block, the array of vertical coordinates includes the vertical coordinate value of each color block, the array of lengths includes the length of each color block, and the array of heights includes the height of each color block; The first position array is generated based on the horizontal coordinate array, the vertical coordinate array, the length array, and the height array.
3. The method according to claim 1, characterized in that, The step of generating the target image based on the pixel size, the first position array, and the color value array includes: Generate an initial two-dimensional array of pixels; the size of the initial two-dimensional array of pixels is the size of the pixels. Based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, the color values corresponding to the color blocks in the color value array are updated to the initial pixel two-dimensional array to obtain the target pixel two-dimensional array; The target image is obtained by performing image conversion processing based on the two-dimensional array of target pixels.
4. The method according to claim 3, characterized in that, The pixel-level data also includes a first color value, which is the color value with the largest number of corresponding color blocks in the target image; when the color value array includes some color values corresponding to pixels in the target image, the color values in the color value array are second color values in the target image other than the first color value; the first position array includes the color block coordinates and color block size corresponding to each color block with the second color value; each element in the initial pixel two-dimensional array is the first color value; The step of updating the color value corresponding to the color block in the color value array to the initial pixel two-dimensional array based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, to obtain the target pixel two-dimensional array, includes: Based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each second color value in the color value array, the first color value corresponding to the color block in the initial pixel two-dimensional array is replaced with the second color value corresponding to the color block in the color value array to obtain the target pixel two-dimensional array.
5. The method according to claim 3, characterized in that, Each element in the first position array corresponds to a color block, and each element corresponds to the color value of the corresponding color block; each element includes the color block coordinates and the color block size; the elements in the first position array are sorted sequentially according to the order of their corresponding color values in the color value array; The step of updating the color value corresponding to the color block in the color value array to the initial pixel two-dimensional array based on the color block coordinates and size of each color block recorded in the first position array, and the number of color blocks corresponding to each color value in the color value array, to obtain the target pixel two-dimensional array, includes: Starting from the first color value in the color value array, select the first current color value in sequence, and determine the number of color blocks N corresponding to the first current color value, where N≥1 and is an integer; From the first position array, determine the N elements corresponding to the first current color value in sequence; In the initial two-dimensional pixel array, determine the target position indicated by the color block coordinates and color block size in the N elements, update the first current color value to the target position, and obtain the target pixel two-dimensional array.
6. The method according to claim 5, characterized in that, The color patch coordinates in the first element corresponding to each color value in the first position array are the original color patch coordinates, and the color patch coordinates in other elements are the coordinate differences; the N elements are determined from the updated first position array; the method further includes: Starting from the first color value in the color value array, determine the second current color value in sequence. For each second current color value, determine the element in the first position array corresponding to the second current color value in sequence according to the number of color blocks corresponding to the second current color value. When there are multiple elements, the second element among the multiple elements is determined as the current element. The original color block coordinates of the color block corresponding to the current element are determined based on the sum of the coordinate difference in the current element and the current color block coordinates in the previous element. The coordinate difference in the current element is replaced with the determined original color block coordinates, and the next element is taken as the new current element to continue iterating until the coordinate difference in the determined multiple elements is replaced with the corresponding original color block coordinates and the iteration stops, thus obtaining the updated first position array.
7. The method according to claim 3, characterized in that, The color values in the color value array are the difference color values obtained by differential calculation of the original color values; The image conversion process based on the two-dimensional array of target pixels to obtain the target image includes: Each differential color value in the target pixel two-dimensional array is restored to its corresponding original color value to obtain the updated target pixel two-dimensional array; The updated two-dimensional array of target pixels is subjected to image conversion processing to obtain the target image.
8. The method according to any one of claims 1 to 7, characterized in that, The target image is contained in the original information, and the original information also includes first text information; The method for obtaining the image encryption information corresponding to the target image includes: Obtain encrypted text information obtained by encrypting the second text information; the second text information is obtained by replacing the target image in the original information with the image identifier of the target image; The encrypted text information is decrypted to obtain the second text information; The encrypted information of the image is retrieved based on the image identifier in the second text information.
9. The method according to claim 8, characterized in that, The original information includes a fault diagnosis method corresponding to the power module; before obtaining the encrypted text information obtained by encrypting the second text information, the method further includes: Responding to the query content entered by the user in the fault query interface, determine the fault identifier that matches the query content; The corresponding encrypted file is read according to the fault identifier; the encrypted file is a file encrypted by the fault diagnosis method; the encrypted file includes the text encryption information and the image encryption information.
10. An information decryption device, characterized in that, The device includes: The acquisition module is used to obtain the image encryption information corresponding to the target image; A decryption module is used to decrypt the encrypted information of the image to obtain pixel-level data corresponding to the target image; the pixel-level data includes the pixel size of the target image, a color value array, and compressed data of color block positions; the color value array includes all or part of the color values corresponding to the pixels in the target image, and the number of color blocks corresponding to each color value; pixels in the same color block correspond to the same color value; the color blocks are obtained by dividing the target image; The decompression module is used to decompress the compressed data of the color block positions to obtain a first position array; the first position array includes the color block coordinates and color block size corresponding to each color block divided by the target image; and the target image is generated according to the pixel size, the first position array and the color value array.
Citation Information
Patent Citations
Information encoding method and device and encoded information obtaining method and device
CN110730277A
Image processing method, program, and image processing device
US20110096985A1