An image compression method and system for power grid business based on blockchain

By generating and storing the pixel change function of the power grid business image and combining it with an encryption algorithm, the storage burden problem caused by the large amount of power grid business data is solved, and the data volume is reduced and security is improved.

CN115861455BActive Publication Date: 2025-09-05ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID NINGXIA ELECTRIC POWER COMPANY +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211483879.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-11-10
Filing Date
2022-11-23
Publication Date
2025-09-05
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

The amount of power grid business data is huge, and directly uploading it to the blockchain will result in excessive storage burden.

Method used

By generating and storing the R value change function, G value change function and B value change function of each row of pixels in each image, instead of storing the entire image, and combining these functions with encryption algorithms to process them, the amount of data is reduced and security is improved.

Benefits of technology

It effectively reduces the storage burden of the blockchain and improves data security through a high-tech decryption process to prevent data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861455B_ABST
    Figure CN115861455B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of power grid technology, and more particularly to a blockchain-based image compression method and system for power grid services. The method comprises obtaining an R-value variation function, a G-value variation function, and a B-value variation function corresponding to each row of pixels in each image in the power grid service data to be stored, and storing the functions on the blockchain. Since images account for a large proportion of the power grid service data to be stored, the images are compressed to store only the R-value variation function, the G-value variation function, and the B-value variation function corresponding to each row of pixels in each image, without having to store the entire image. This reduces the image data volume, thereby significantly reducing the storage burden of the blockchain, thereby increasing the storage capacity of evidence stored on the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid technology, and in particular to an image compression method and system for power grid business based on blockchain. Background Art

[0002] A blockchain is a chain of blocks. Each block contains a specific piece of information, and they are linked together in the order in which they were generated. This chain is stored across all servers. As long as at least one server in the system is functioning, the entire blockchain is secure.

[0003] At present, the amount of power grid business data is increasing day by day. If the power grid business data is directly uploaded to the blockchain, the amount of data stored on the blockchain will be large, which will bring a large storage burden to the blockchain. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to address the deficiencies of the existing technology and provide an image compression method and system for power grid business based on blockchain.

[0005] The technical solution of the blockchain-based image compression method for power grid services of the present invention is as follows:

[0006] Obtaining and, based on the R value, G value, and B value of each pixel point in any image to be stored, generating an R value change function for characterizing a change in the R value of each row of pixel points in the image, generating a G value change function for characterizing a change in the G value of each row of pixel points in the image, and generating a B value change function for characterizing a change in the B value of each row of pixel points in the image, until obtaining the R value change function, G value change function, and B value change function corresponding to each row of pixel points in each image in the power grid business data to be stored;

[0007] The R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in the power grid business data to be stored are stored on the blockchain.

[0008] The beneficial effects of the blockchain-based image compression method for power grid services of the present invention are as follows:

[0009] Since images account for a large proportion of the power grid business data to be stored, by compressing the images, only the R value change function, G value change function and B value change function corresponding to each row of pixels in each image are saved, without having to save the entire image. This can reduce the amount of image data and greatly reduce the storage burden of the blockchain.

[0010] Based on the above solution, the image compression method for blockchain-based power grid business of the present invention can also be improved as follows.

[0011] Furthermore, the R value change function, G value change function, and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored are stored on the blockchain, including:

[0012] grouping images in the power grid service data to be stored;

[0013] Using different encryption algorithms, the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group are encrypted, and the encrypted data is stored on the blockchain.

[0014] The beneficial effect of adopting the above further solution is: at present, although the blockchain will uniformly encrypt the data on the chain, even if someone cracks the encryption method of the blockchain, the data obtained is also encrypted, and all encryption algorithms need to be cracked to obtain complete power grid business data. This will undoubtedly greatly increase the difficulty of cracking and greatly reduce the risk of data leakage.

[0015] Furthermore, it also includes:

[0016] Also includes:

[0017] Obtaining the encrypted R value change function, the encrypted G value change function, and the encrypted B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain;

[0018] Determine whether all decryption algorithms selected by the user are correct, and obtain a determination result;

[0019] When the judgment result is yes, the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image are decrypted using the selected decryption algorithm, and the complete image of the required image is obtained based on the decrypted data.

[0020] The beneficial effect of adopting the above further solution is: since the technical threshold of the decryption algorithm is high, a selection method is adopted to lower the technical threshold.

[0021] Furthermore, it also includes:

[0022] The complete image of the required image is converted into a vector image and sent to the user's smart terminal.

[0023] The beneficial effect of adopting the above further solution is: the images in the current power grid business data are bitmaps, which are prone to distortion when enlarged. By converting the complete image of the required image into a vector image, no distortion will occur when the user enlarges and views it, making it easier to view the details in the image.

[0024] Further, grouping the images in the power grid service data to be stored includes:

[0025] The images in the power grid service data to be stored are grouped according to power grid service types.

[0026] The technical solution of the blockchain-based image compression system for power grid services of the present invention is as follows:

[0027] Includes function acquisition module and storage module;

[0028] The function acquisition module is used to: acquire and generate an R value change function for characterizing the change in R value of each row of pixel points in the image based on the R value, G value, and B value of each pixel point in any image to be stored, generate a G value change function for characterizing the change in G value of each row of pixel points in the image, and generate a B value change function for characterizing the change in B value of each row of pixel points in the image, until the R value change function, G value change function, and B value change function corresponding to each row of pixel points in each image in the power grid business data to be stored are obtained;

[0029] The storage module is used to store the R value change function, G value change function and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored on the blockchain.

[0030] The beneficial effects of the blockchain-based image compression system for power grid services of the present invention are as follows:

[0031] Since images account for a large proportion of the power grid business data to be stored, by compressing the images, only the R value change function, G value change function and B value change function corresponding to each row of pixels in each image are saved, without having to save the entire image. This can reduce the amount of image data and greatly reduce the storage burden of the blockchain.

[0032] Based on the above solution, the image compression system for power grid services based on blockchain of the present invention can also be improved as follows.

[0033] Furthermore, the storage module is specifically used for:

[0034] grouping images in the power grid service data to be stored;

[0035] Using different encryption algorithms, the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group are encrypted, and the encrypted data is stored on the blockchain.

[0036] The beneficial effect of adopting the above further solution is: at present, although the blockchain will uniformly encrypt the data on the chain, even if someone cracks the encryption method of the blockchain, the data obtained is also encrypted, and all encryption algorithms need to be cracked to obtain complete power grid business data. This will undoubtedly greatly increase the difficulty of cracking and greatly reduce the risk of data leakage.

[0037] Furthermore, a query module is included, wherein the query module is used to:

[0038] Obtaining the encrypted R value change function, the encrypted G value change function, and the encrypted B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain;

[0039] Determine whether all decryption algorithms selected by the user are correct, and obtain a determination result;

[0040] When the judgment result is yes, the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image are decrypted using the selected decryption algorithm, and the complete image of the required image is obtained based on the decrypted data.

[0041] The beneficial effect of adopting the above further solution is: since the technical threshold of the decryption algorithm is high, a selection method is adopted to lower the technical threshold.

[0042] Furthermore, a sending module is included, wherein the sending module is used to:

[0043] The complete image of the required image is converted into a vector image and sent to the user's smart terminal.

[0044] The beneficial effect of adopting the above further solution is: the images in the current power grid business data are bitmaps, which are prone to distortion when enlarged. By converting the complete image of the required image into a vector image, no distortion will occur when the user enlarges and views it, making it easier to view the details in the image.

[0045] Furthermore, the process of the storage module grouping the images in the power grid service data to be stored includes:

[0046] The images in the power grid service data to be stored are grouped according to power grid service types. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is a flowchart of an image compression method for a blockchain-based power grid service according to an embodiment of the present invention;

[0048] Figure 2This is a structural diagram of an image compression system for blockchain-based power grid services according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] To clearly illustrate the solutions of the present invention, preferred embodiments are given below and described in detail with reference to the accompanying drawings.

[0050] like Figure 1 As shown, in order to facilitate the improvement of the storage capacity of evidence solidified on the blockchain as evidence, an image compression method for power grid services based on blockchain in an embodiment of the present invention can improve the capacity of the evidence content solidified on the blockchain, including the following steps:

[0051] S1. Obtain and, based on the R value, G value, and B value of each pixel point in any image to be stored, generate an R value change function for characterizing the change in the R value of each row of pixel points in the image, generate a G value change function for characterizing the change in the G value of each row of pixel points in the image, and generate a B value change function for characterizing the change in the B value of each row of pixel points in the image, until the R value change function, G value change function, and B value change function corresponding to each row of pixel points in each image in the power grid business data to be stored are obtained;

[0052] Take the first picture as an example:

[0053] S10, obtaining the R value, G value, and B value of each pixel in the first image;

[0054] S11. Obtain the R value of each pixel in the first row of the first image, and generate an R value change function for representing the change of the R values ​​of the pixels in the first row by the following two methods:

[0055] 1) The first method: The position of each pixel in the first row, such as the first pixel, the second pixel, etc., is used as the horizontal coordinate value, and the R value of each pixel in the first row is used as the vertical coordinate value corresponding to each pixel. The function formed thereby is used as the R value change function corresponding to the pixels in the first row. Similarly, the R value change function, G value change function, and B value change function corresponding to each row of pixels in the first image are obtained;

[0056] 2) The second method: perform a binary function fitting on the R value of each pixel in the first row, and use the fitted function as the R value change function corresponding to the pixels in the first row. Similarly, obtain the R value change function, G value change function, and B value change function corresponding to each row of pixels in the first image;

[0057] According to the above two methods, the R value change function, G value change function and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored can be obtained. Since the first method does not cause any changes to the R value, G value and B value of the pixel points of the restored image during compression processing, the first method is preferably used.

[0058] S2. Store the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in the power grid business data to be stored on the blockchain.

[0059] Since images account for a large proportion of the power grid business data to be stored, by compressing the images, only the R value change function, G value change function and B value change function corresponding to each row of pixels in each image are saved, without having to save the entire image. This can reduce the amount of image data and greatly reduce the storage burden of the blockchain.

[0060] Optionally, in the above technical solution, in S2, the R value change function, G value change function, and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored are stored on the blockchain, including:

[0061] S20: Grouping images in the power grid service data to be stored. Specifically, grouping the images in the power grid service data to be stored is performed based on power grid service types, or based on actual conditions.

[0062] S21. Use different encryption algorithms to encrypt the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group, and store the encrypted data on the blockchain.

[0063] The encrypted data refers to: the encrypted R value change function, the encrypted G value change function, and the encrypted B value change function corresponding to each row of pixels in each image.

[0064] Among them, different encryption algorithms include SM2 encryption algorithm, SM3 encryption algorithm, SM4 encryption algorithm, SHA256 encryption algorithm, RAS encryption algorithm, etc., which can be called according to actual conditions.

[0065] At present, although the blockchain will uniformly encrypt the data on the chain, even if someone cracks the encryption method of the blockchain, the data obtained is encrypted, and all encryption algorithms need to be cracked to obtain complete power grid business data. This will undoubtedly greatly increase the difficulty of cracking and greatly reduce the risk of data leakage.

[0066] Optionally, in the above technical solution, the following is further included:

[0067] S3. Obtain the encrypted R value change function, G value change function, and B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain;

[0068] S4. Determine whether all decryption algorithms selected by the user are correct and obtain a determination result;

[0069] S5. If the result of the judgment is yes, the encrypted R value variation function, the encrypted G value variation function, and the encrypted B value variation function corresponding to each row of pixels in the desired image are decrypted using the selected decryption algorithm, and the complete desired image is obtained based on the decrypted data. Since the decryption algorithm has a high technical threshold, a selection method is adopted to reduce the technical threshold.

[0070] Among them, each encryption algorithm has a corresponding decryption algorithm, which will not be elaborated here. When the first judgment result is no, the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image will not be decrypted, and an alarm of "someone maliciously decrypts" will be issued.

[0071] The decrypted data refers to: the decrypted R value change function, the decrypted G value change function, and the decrypted B value change function corresponding to each row of pixels of the required image.

[0072] In another embodiment, during the decryption process, decryption is randomly paused, and each time decryption is randomly paused, the user's identity information is obtained and verified. If the verification is successful, decryption continues until decryption is completed and the decrypted data is obtained. Random identity authentication can effectively ensure that data will not be leaked.

[0073] The process of obtaining the complete image of the desired image based on the decrypted data is as follows:

[0074] Since the input of the R value change function corresponding to each row of pixels in the desired image is the position of the pixel points, and the output value is the R value, then by inputting the position of each row of pixels into the R value change function corresponding to each row of pixels, the R value of each pixel in each row can be obtained, until the R value of each pixel point of the desired image is obtained, and so on, the G value and B value of each pixel point of the desired image are obtained, thereby obtaining the complete image of the desired image.

[0075] Optionally, in the above technical solution, the following is further included:

[0076] S6. Convert the complete image of the desired image into a vector image and send it to the user's smart terminal. Currently, images in power grid business data are bitmaps, which are easily distorted when magnified. Converting the complete image of the desired image into a vector image will prevent distortion when the user zooms in and views the image details, making it easier to see the details.

[0077] Optionally, in the above technical solution

[0078] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given in this application. Those skilled in the art can adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the scope of protection of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0079] like Figure 2 As shown, an image compression system 200 for power grid services based on blockchain according to an embodiment of the present invention includes a function acquisition module 210 and a storage module 220;

[0080] The function acquisition module 210 is used to: acquire and generate an R value change function for characterizing the change in the R value of each row of pixels in any image in the power grid business data to be stored, based on the R value, G value, and B value of each pixel point in the image, generate a G value change function for characterizing the change in the G value of each row of pixels in the image, and generate a B value change function for characterizing the change in the B value of each row of pixels in the image, until the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in the power grid business data to be stored are obtained;

[0081] The storage module 220 is used to store the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in the power grid business data to be stored on the blockchain.

[0082] Since images account for a large proportion of the power grid business data to be stored, by compressing the images, only the R value change function, G value change function and B value change function corresponding to each row of pixels in each image are saved, without having to save the entire image. This can reduce the amount of image data and greatly reduce the storage burden of the blockchain.

[0083] Optionally, in the above technical solution, the storage module 220 is specifically used to:

[0084] Grouping images in the power grid business data to be stored;

[0085] Using different encryption algorithms, the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group are encrypted, and the encrypted data is stored on the blockchain.

[0086] At present, although the blockchain will uniformly encrypt the data on the chain, even if someone cracks the encryption method of the blockchain, the data obtained is encrypted, and all encryption algorithms need to be cracked to obtain complete power grid business data. This will undoubtedly greatly increase the difficulty of cracking and greatly reduce the risk of data leakage.

[0087] Optionally, the above technical solution further includes a query module, which is used to:

[0088] Obtain the encrypted R value change function, G value change function, and B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain;

[0089] Determine whether all decryption algorithms selected by the user are correct and obtain the judgment result;

[0090] When the judgment result is yes, the selected decryption algorithm is used to decrypt the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image, and the complete image of the required image is obtained based on the decrypted data.

[0091] Since the technical threshold of the decryption algorithm is high, a selection method is adopted to lower the technical threshold.

[0092] Optionally, the above technical solution further includes a sending module, which is used to:

[0093] The complete image of the required image is converted into a vector image and sent to the user's smart terminal.

[0094] Currently, the images in power grid business data are bitmaps, which are prone to distortion when enlarged. By converting the complete image of the required image into a vector image, there will be no distortion when the user enlarges and views it, making it easier to view the details in the image.

[0095] Optionally, in the above technical solution, the process of grouping images in the power grid service data to be stored by the storage module includes:

[0096] The images in the power grid service data to be stored are grouped according to power grid service types.

[0097] For the above-mentioned parameters and steps for each unit module to implement corresponding functions in the image compression system 200 for a blockchain-based power grid business of the present invention, reference can be made to the parameters and steps in the embodiment of the image compression method for a blockchain-based power grid business above, and no further details will be given here.

[0098] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a program stored in the memory / storage medium and running on the processor. When the processor executes the program, the steps of any one of the above-mentioned implementations of a blockchain-based power grid service image compression method are implemented.

[0099] Among them, the electronic device can be a computer, a mobile phone, etc., and correspondingly, its program is computer software or a mobile phone APP, etc., and the above-mentioned parameters and steps in an electronic device of the present invention can refer to the parameters and steps in the embodiment of an image compression method for a blockchain-based power grid business above, and will not be repeated here.

[0100] Those skilled in the art will appreciate that the present invention may be implemented as a system, method or computer program product.

[0101] Therefore, the present disclosure may be embodied in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present disclosure may be embodied in the form of a computer program product embodied in one or more computer-readable media, wherein the computer-readable media contains computer-readable program code.

[0102] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device.

[0103] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A blockchain-based image compression method for power grid services, characterized in that: include: Obtaining and, based on the R value, G value, and B value of each pixel point in any image to be stored, generating an R value change function for characterizing a change in the R value of each row of pixel points in the image, generating a G value change function for characterizing a change in the G value of each row of pixel points in the image, and generating a B value change function for characterizing a change in the B value of each row of pixel points in the image, until obtaining the R value change function, G value change function, and B value change function corresponding to each row of pixel points in each image in the power grid business data to be stored; The R value change function, G value change function and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored are solidified and stored on the blockchain for use as evidence.

2. The image compression method for power grid business based on blockchain according to claim 1 is characterized in that: The R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in the power grid business data to be stored are stored on the blockchain, including: grouping images in the power grid service data to be stored; Using different encryption algorithms, the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group are encrypted, and the encrypted data is stored on the blockchain.

3. The image compression method for power grid business based on blockchain according to claim 2 is characterized in that: Also includes: Obtaining the encrypted R value change function, the encrypted G value change function, and the encrypted B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain; Determine whether all decryption algorithms selected by the user are correct, and obtain a determination result; When the judgment result is yes, the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image are decrypted using the selected decryption algorithm, and the complete image of the required image is obtained based on the decrypted data.

4. The image compression method for power grid business based on blockchain according to claim 3 is characterized in that: Also includes: The complete image of the required image is converted into a vector image and sent to the user's smart terminal.

5. The image compression method for power grid business based on blockchain according to any one of claims 2 to 4, characterized in that: Grouping images in the power grid service data to be stored includes: The images in the power grid service data to be stored are grouped according to power grid service types.

6. An image compression system for power grid business based on blockchain, characterized in that: Includes function acquisition module and storage module; The function acquisition module is used to: acquire and generate an R value change function for characterizing the change in R value of each row of pixel points in the image based on the R value, G value, and B value of each pixel point in any image to be stored, generate a G value change function for characterizing the change in G value of each row of pixel points in the image, and generate a B value change function for characterizing the change in B value of each row of pixel points in the image, until the R value change function, G value change function, and B value change function corresponding to each row of pixel points in each image in the power grid business data to be stored are obtained; The storage module is used to store the R value change function, G value change function and B value change function corresponding to each row of pixels of each image in the power grid business data to be stored on the blockchain.

7. The image compression system for power grid services based on blockchain according to claim 6, characterized in that: The storage module is specifically used for: grouping images in the power grid service data to be stored; Using different encryption algorithms, the R value change function, G value change function, and B value change function corresponding to each row of pixels in each image in each group are encrypted, and the encrypted data is stored on the blockchain.

8. The image compression system for power grid services based on blockchain according to claim 7, characterized in that: It also includes a query module, which is used to: Obtaining the encrypted R value change function, the encrypted G value change function, and the encrypted B value change function corresponding to each row of pixels of the image required by the user from the data stored in the blockchain; Determine whether all decryption algorithms selected by the user are correct, and obtain a determination result; When the judgment result is yes, the encrypted R value change function, the encrypted G value change function and the encrypted B value change function corresponding to each row of pixels of the required image are decrypted using the selected decryption algorithm, and the complete image of the required image is obtained based on the decrypted data.

9. The image compression system for power grid services based on blockchain according to claim 8, characterized in that: The invention also includes a sending module, wherein the sending module is used to: The complete image of the required image is converted into a vector image and sent to the user's smart terminal.

10. The image compression system for power grid services based on blockchain according to any one of claims 6 to 9, characterized in that: The process of the storage module grouping images in the power grid service data to be stored includes: The images in the power grid service data to be stored are grouped according to power grid service types.

Citation Information

Patent Citations

  • Medical image compression storage method based on block chain and federated learning

    CN113643390A

  • Curve image generation method and device, equipment and storage medium

    CN114241085A