[go: up one dir, main page]

CN115378590A - Energy data safe storage method and system based on block chain - Google Patents

Energy data safe storage method and system based on block chain Download PDF

Info

Publication number
CN115378590A
CN115378590A CN202211323149.4A CN202211323149A CN115378590A CN 115378590 A CN115378590 A CN 115378590A CN 202211323149 A CN202211323149 A CN 202211323149A CN 115378590 A CN115378590 A CN 115378590A
Authority
CN
China
Prior art keywords
data
groups
encrypted
group
pictures
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211323149.4A
Other languages
Chinese (zh)
Other versions
CN115378590B (en
Inventor
鲍卫东
顾春云
陈荣
陈英俊
徐昕
吴佳佳
郑艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinhua Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Yiwu Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
Jinhua Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Yiwu Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinhua Power Supply Co of State Grid Zhejiang Electric Power Co Ltd, Yiwu Power Supply Co of State Grid Zhejiang Electric Power Co Ltd filed Critical Jinhua Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Priority to CN202211323149.4A priority Critical patent/CN115378590B/en
Publication of CN115378590A publication Critical patent/CN115378590A/en
Application granted granted Critical
Publication of CN115378590B publication Critical patent/CN115378590B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/44Secrecy systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)

Abstract

本发明适用于电数字数据处理技术领域,尤其涉及一种基于区块链的能源数据安全存储方法和系统,所述方法包括:获取随机加密数据图像集以及待加密数据;从待加密数据截取头部数据,将截取后的待加密数据等量分为N组待处理数据,进行平均分割,得到N组数据块组;进行字节分割,得到特定长度数据,据此生成N组加密数据源;根据N组加密数据源对N组数据块组进行重新组合,得到重组数据。本发明通过随机获取图片,将图片作为对能源数据进行加密的基础,从而对待加密数据进行多层分割,进而将分割得到的待加密数据按照特定顺序进行重组,由于图片的内容是随机的,因此根据图片作为加密基础得到的重组数据也是随机的,有效保证了数据的加密安全性。

Figure 202211323149

The present invention is applicable to the technical field of electrical digital data processing, and in particular relates to a method and system for securely storing energy data based on blockchain. The method includes: acquiring a random encrypted data image set and data to be encrypted; Partial data, divide the intercepted data to be encrypted into N groups of data to be processed, and divide them on average to obtain N groups of data block groups; perform byte segmentation to obtain data of a specific length, and generate N groups of encrypted data sources accordingly; According to N groups of encrypted data sources, N groups of data block groups are reassembled to obtain reorganized data. The present invention randomly acquires pictures and uses the pictures as the basis for encrypting energy data, thereby performing multi-layer segmentation of the data to be encrypted, and then reorganizing the divided data to be encrypted according to a specific order. Since the content of the pictures is random, therefore The recombined data obtained based on the picture as the encryption basis is also random, which effectively guarantees the encryption security of the data.

Figure 202211323149

Description

一种基于区块链的能源数据安全存储方法和系统A blockchain-based energy data security storage method and system

技术领域technical field

本发明属于电数字数据处理技术领域,尤其涉及一种基于区块链的能源数据安全存储方法和系统。The invention belongs to the technical field of electrical digital data processing, and in particular relates to a block chain-based energy data security storage method and system.

背景技术Background technique

区块链,就是一个又一个区块组成的链条。每一个区块中保存了一定的信息,它们按照各自产生的时间顺序连接成链条。这个链条被保存在所有的服务器中,只要整个系统中有一台服务器可以工作,整条区块链就是安全的。A blockchain is a chain of blocks one after another. Certain information is stored in each block, and they are connected into a chain according to the time sequence of their generation. This chain is saved in all servers, as long as one server in the whole system can work, the whole blockchain is safe.

能源通常指煤炭、石油、天然气、生物质能、电力、热力、其他直接或者通过加工和转换而取得有用能的各种资源;在能源计量的过程中将会产生大量的能源数据,这些能源数据均需要进行存储。Energy usually refers to coal, oil, natural gas, biomass energy, electricity, heat, and other resources that obtain useful energy directly or through processing and conversion; a large amount of energy data will be generated in the process of energy measurement, and these energy data need to be stored.

在当前的能源数据存储过程中,一般是直接存储于数据库当中,由于数据量庞大,难以通过常规加密手段进行加密和存储,因此,亟需一种安全性更高的能源数据安全存储方法。In the current energy data storage process, it is generally stored directly in the database. Due to the huge amount of data, it is difficult to encrypt and store it through conventional encryption methods. Therefore, a secure energy data storage method with higher security is urgently needed.

发明内容Contents of the invention

本发明实施例的目的在于提供一种基于区块链的能源数据安全存储方法,旨在解决由于数据量庞大,难以通过常规加密手段进行加密和存储的问题。The purpose of the embodiments of the present invention is to provide a secure storage method for energy data based on blockchain, which aims to solve the problem that it is difficult to encrypt and store by conventional encryption means due to the huge amount of data.

本发明实施例是这样实现的,一种基于区块链的能源数据安全存储方法,所述方法包括:The embodiment of the present invention is achieved in this way, a method for securely storing energy data based on blockchain, the method comprising:

获取随机加密数据图像集以及待加密数据,所述随机加密数据图像集为随机采集的图片,一组随机加密数据图像集包括N组图片;Obtain a random encrypted data image set and data to be encrypted, the random encrypted data image set is a randomly collected picture, and a group of random encrypted data image sets include N groups of pictures;

从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组,所述数据块组包含M个数据块,同一数据块组内的数据块进行连续编号;Intercept the header data from the data to be encrypted, divide the intercepted data to be encrypted into N groups of data to be processed, divide each group of data to be processed on average, and obtain N groups of data block groups, and the data block groups include M data blocks, and the data blocks in the same data block group are numbered consecutively;

对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源,N组所述加密数据源与N组数据块组一一对应;Perform byte segmentation on the data corresponding to the N groups of pictures to obtain data of a specific length, and generate N groups of encrypted data sources accordingly, and the encrypted data sources of the N groups correspond to the N groups of data block groups one by one;

根据N组加密数据源对N组数据块组进行重新组合,得到重组数据,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器。According to N groups of encrypted data sources, N groups of data block groups are reassembled to obtain reorganized data, and the reorganized data is published on the blockchain, and the header data and random encrypted data image sets are distributed and stored to the local server.

优选的,所述从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组的步骤,具体包括:Preferably, the step of intercepting header data from the data to be encrypted, dividing the intercepted data to be encrypted into N groups of data to be processed, and dividing each group of data to be processed on average to obtain N groups of data block groups, Specifically include:

从待加密数据截取头部数据,所述头部数据截取的比例根据随机加密数据图像集确定;intercepting header data from the data to be encrypted, the intercepted ratio of the header data is determined according to the random encrypted data image set;

将截取头部数据的待加密数据等分为N组,并进行编号,得到N组待处理数据;Divide the data to be encrypted with intercepted header data into N groups and number them to obtain N groups of data to be processed;

对已经编号的N组待处理数据进行平均分割,每组待处理数据的分割数量相同,得到N组数据块组。The numbered N groups of data to be processed are equally divided, and the number of divisions of each group of data to be processed is the same to obtain N groups of data block groups.

优选的,所述对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源的步骤,具体包括:Preferably, the step of segmenting the data corresponding to N groups of pictures into bytes to obtain data of a specific length, and generating N groups of encrypted data sources accordingly, specifically includes:

根据随机加密数据图像集中包含的图片数量确定字节分割长度;Determine the byte segmentation length according to the number of pictures contained in the random encrypted data image set;

对N组图片对应的数据进行字节分割,得到特定长度数据,每一组图片对应一组特定长度数据,每组特定长度数据中包含多个特定字节长度的字节段;Perform byte segmentation on the data corresponding to N groups of pictures to obtain data of a specific length, each group of pictures corresponds to a group of data of a specific length, and each group of data of a specific length contains multiple byte segments of a specific byte length;

根据每一个字节段生成一组序号,该序号构成加密数据源。A set of serial numbers is generated according to each byte segment, and the serial numbers constitute the encrypted data source.

优选的,所述根据N组加密数据源对N组数据块组进行重新组合,得到重组数据的步骤,具体包括:Preferably, the step of recombining N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data specifically includes:

确定每组数据块组中数据块的编号,N组数据块组中的数据块按照顺序一一对应;Determine the numbers of the data blocks in each group of data block groups, and the data blocks in the N groups of data block groups correspond to each other in sequence;

根据N组加密数据源确定重新组合的顺序,生成重组序列;Determine the order of recombination according to N groups of encrypted data sources, and generate a recombination sequence;

根据重组序列对N组数据块组中进行位置交换,得到重组数据。According to the recombination sequence, the positions in the N groups of data block groups are exchanged to obtain the recombination data.

优选的,所述头部数据占据的比例不超过待加密数据的1%。Preferably, the header data occupies no more than 1% of the data to be encrypted.

优选的,头部数据以及随机加密数据图像集存储之前进行加密处理。Preferably, the header data and the random encrypted data image set are encrypted before being stored.

本发明实施例的另一目的在于提供一种基于区块链的能源数据安全存储系统,所述系统包括:Another object of the embodiments of the present invention is to provide a blockchain-based energy data security storage system, the system comprising:

数据获取模块,用于获取随机加密数据图像集以及待加密数据,所述随机加密数据图像集为随机采集的图片,一组随机加密数据图像集包括N组图片;A data acquisition module, configured to acquire a random encrypted data image set and data to be encrypted, wherein the random encrypted data image set is a randomly collected picture, and a set of random encrypted data image sets includes N groups of pictures;

数据切分模块,用于从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组,所述数据块组包含M个数据块,同一数据块组内的数据块进行连续编号;The data segmentation module is used to intercept header data from the data to be encrypted, divide the intercepted data to be encrypted into N groups of data to be processed, and divide each group of data to be processed on average to obtain N groups of data block groups, The data block group includes M data blocks, and the data blocks in the same data block group are serially numbered;

加密源处理模块,用于对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源,N组所述加密数据源与N组数据块组一一对应;An encryption source processing module is used to segment the data corresponding to the N groups of pictures into bytes to obtain data of a specific length, thereby generating N groups of encrypted data sources, and the encrypted data sources of the N groups are in one-to-one correspondence with the N groups of data blocks;

数据重组模块,用于根据N组加密数据源对N组数据块组进行重新组合,得到重组数据,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器。The data reorganization module is used to recombine N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data, publish the reorganized data on the blockchain, and store the header data and random encrypted data image sets in a local server.

优选的,所述数据切分模块包括:Preferably, the data segmentation module includes:

头部数据截取单元,用于从待加密数据截取头部数据,所述头部数据截取的比例根据随机加密数据图像集确定;A header data interception unit, configured to intercept header data from the data to be encrypted, the ratio of the header data interception is determined according to a random encrypted data image set;

数据等分单元,用于将截取头部数据的待加密数据等分为N组,并进行编号,得到N组待处理数据;The data equal division unit is used to divide the data to be encrypted by intercepting the header data into N groups and number them to obtain N groups of data to be processed;

数据块分割单元,用于对已经编号的N组待处理数据进行平均分割,每组待处理数据的分割数量相同,得到N组数据块组。The data block dividing unit is used to divide the numbered N groups of data to be processed on average, and each group of data to be processed has the same number of divisions to obtain N groups of data blocks.

优选的,所述加密源处理模块包括:Preferably, the encrypted source processing module includes:

分割长度确定单元,用于根据随机加密数据图像集中包含的图片数量确定字节分割长度;A segmentation length determination unit is used to determine the byte segmentation length according to the number of pictures contained in the random encrypted data image set;

图片数据分割单元,用于对N组图片对应的数据进行字节分割,得到特定长度数据,每一组图片对应一组特定长度数据,每组特定长度数据中包含多个特定字节长度的字节段;The picture data segmentation unit is used to segment the data corresponding to N groups of pictures into bytes to obtain data of a specific length, each group of pictures corresponds to a set of data of a specific length, and each set of data of a specific length contains a plurality of words of a specific byte length Segments;

序号生成单元,用于根据每一个字节段生成一组序号,该序号构成加密数据源。The serial number generation unit is used to generate a group of serial numbers according to each byte segment, and the serial numbers constitute an encrypted data source.

优选的,所述数据重组模块包括:Preferably, the data reorganization module includes:

编号确认单元,用于确定每组数据块组中数据块的编号,N组数据块组中的数据块按照顺序一一对应;The number confirmation unit is used to determine the number of the data blocks in each group of data block groups, and the data blocks in the N groups of data block groups correspond to each other in sequence;

序列生成单元,用于根据N组加密数据源确定重新组合的顺序,生成重组序列;A sequence generating unit, configured to determine the order of recombination according to N groups of encrypted data sources, and generate a recombination sequence;

数据块重组单元,用于根据重组序列对N组数据块组中进行位置交换,得到重组数据。The data block reorganization unit is configured to exchange positions in the N groups of data block groups according to the reorganization sequence to obtain reorganized data.

本发明实施例提供的一种基于区块链的能源数据安全存储方法,通过随机获取图片,将图片作为对能源数据进行加密的基础,从而对待加密数据进行多层分割,进而将分割得到的待加密数据按照特定顺序进行重组,由于图片的内容是随机的,因此根据图片作为加密基础得到的重组数据也是随机的,有效保证了数据的加密安全性。The embodiment of the present invention provides a secure storage method for energy data based on blockchain. By randomly obtaining pictures, the pictures are used as the basis for encrypting energy data, so that the data to be encrypted is divided into multiple layers, and then the divided data to be encrypted The encrypted data is reorganized in a specific order. Since the content of the picture is random, the reorganized data obtained based on the picture as the basis for encryption is also random, which effectively guarantees the encryption security of the data.

附图说明Description of drawings

图1为本发明实施例提供的一种基于区块链的能源数据安全存储方法的流程图;Fig. 1 is a flow chart of a method for securely storing energy data based on blockchain provided by an embodiment of the present invention;

图2为本发明实施例提供的从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组的步骤的流程图;Fig. 2 is the header data intercepted from the data to be encrypted provided by the embodiment of the present invention, the intercepted data to be encrypted is equally divided into N groups of data to be processed, and each group of data to be processed is equally divided to obtain N groups of data blocks A flowchart of the steps of the group;

图3为本发明实施例提供的对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源的步骤的流程图;Fig. 3 is the flow chart of the steps of generating N groups of encrypted data sources according to the byte segmentation of the data corresponding to N groups of pictures provided by the embodiment of the present invention to obtain data of a specific length;

图4为本发明实施例提供的根据N组加密数据源对N组数据块组进行重新组合,得到重组数据的步骤的流程图;FIG. 4 is a flow chart of the steps of recombining N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data according to an embodiment of the present invention;

图5为本发明实施例提供的一种基于区块链的能源数据安全存储系统的架构图;Fig. 5 is an architecture diagram of a blockchain-based energy data secure storage system provided by an embodiment of the present invention;

图6为本发明实施例提供的一种数据切分模块的架构图;FIG. 6 is an architecture diagram of a data segmentation module provided by an embodiment of the present invention;

图7为本发明实施例提供的一种加密源处理模块的架构图;FIG. 7 is an architecture diagram of an encryption source processing module provided by an embodiment of the present invention;

图8为本发明实施例提供的一种数据重组模块的架构图。FIG. 8 is an architecture diagram of a data reorganization module provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但除非特别说明,这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一xx脚本称为第二xx脚本,且类似地,可将第二xx脚本称为第一xx脚本。It can be understood that the terms "first", "second" and the like used in the present application may be used to describe various elements herein, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first xx script could be termed a second xx script, and, similarly, a second xx script could be termed a first xx script, without departing from the scope of the present application.

能源通常指煤炭、石油、天然气、生物质能、电力、热力、其他直接或者通过加工和转换而取得有用能的各种资源;在能源计量的过程中将会产生大量的能源数据,这些能源数据均需要进行存储。在当前的能源数据存储过程中,一般是直接存储于数据库当中,由于数据量庞大,难以通过常规加密手段进行加密和存储,因此,亟需一种安全性更高的能源数据安全存储方法。Energy usually refers to coal, oil, natural gas, biomass energy, electricity, heat, and other resources that obtain useful energy directly or through processing and conversion; a large amount of energy data will be generated in the process of energy measurement, and these energy data need to be stored. In the current energy data storage process, it is generally stored directly in the database. Due to the huge amount of data, it is difficult to encrypt and store it through conventional encryption methods. Therefore, a secure energy data storage method with higher security is urgently needed.

本发明通过随机获取图片,将图片作为对能源数据进行加密的基础,从而对待加密数据进行多层分割,进而将分割得到的待加密数据按照特定顺序进行重组,由于图片的内容是随机的,因此根据图片作为加密基础得到的重组数据也是随机的,有效保证了数据的加密安全性。The present invention randomly acquires pictures and uses the pictures as the basis for encrypting energy data, thereby performing multi-layer segmentation of the data to be encrypted, and then reorganizing the divided data to be encrypted in a specific order. Since the content of the pictures is random, therefore The recombined data obtained based on the picture as the encryption basis is also random, which effectively guarantees the encryption security of the data.

如图1所示,为本发明实施例提供的一种基于区块链的能源数据安全存储方法的流程图,所述方法包括:As shown in Figure 1, it is a flow chart of a method for securely storing energy data based on blockchain provided by an embodiment of the present invention. The method includes:

S100,获取随机加密数据图像集以及待加密数据,所述随机加密数据图像集为随机采集的图片,一组随机加密数据图像集包括N组图片。S100. Acquire a random encrypted data image set and data to be encrypted. The random encrypted data image set is randomly collected pictures, and a set of random encrypted data image sets includes N groups of pictures.

在本步骤中,获取随机加密数据图像集以及待加密数据,随机加密数据图像集包括N组图片,该图片为随机采集的图片,单独设置摄像头,可以对出现随机变化的画面进行采集,例如通过相机对河流画面进行拍摄,数量可以为8组,即N为8,待加密数据则是需要进行存储的能源数据。In this step, the random encrypted data image set and the data to be encrypted are obtained. The random encrypted data image set includes N groups of pictures. The camera takes pictures of the river, and the number can be 8 groups, that is, N is 8, and the data to be encrypted is the energy data that needs to be stored.

S200,从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组,所述数据块组包含M个数据块,同一数据块组内的数据块进行连续编号。S200, intercepting the header data from the data to be encrypted, dividing the intercepted data to be encrypted into N groups of data to be processed, and dividing each group of data to be processed on average to obtain N groups of data block groups, the data block groups Contains M data blocks, and the data blocks in the same data block group are numbered consecutively.

在本步骤中,从待加密数据截取头部数据,首先截取头部数据,进行截取时,根据随机加密数据图像集来确定截取的比例,那么获得头部数据的比例也是随机的,进而将截取之后待加密数据划分为N组待处理数据,即划分为8组待处理数据,如头部数据截取a%,那么待处理数据的比例则均为(1- a%)/N,然后再对待处理数据进行平均分割,如8组待处理数据分别为a、b、c、d、e、f、g和h,将a待处理数据等分为M个数据块,则每个数据块的编号为a1,a2……,aM;头部数据占据的比例不超过待加密数据的1%。In this step, the header data is intercepted from the data to be encrypted. First, the header data is intercepted. When intercepting, the proportion of the interception is determined according to the random encrypted data image set. Then the proportion of the obtained header data is also random, and then the interception Afterwards, the data to be encrypted is divided into N groups of data to be processed, that is, divided into 8 groups of data to be processed. If the header data is intercepted by a%, then the proportion of data to be processed is (1- a%)/N, and then treated The processed data is evenly divided. For example, the 8 groups of data to be processed are a, b, c, d, e, f, g, and h respectively, and the data to be processed by a is divided into M data blocks, and the number of each data block is are a 1 , a 2 ..., a M ; the proportion of the header data does not exceed 1% of the data to be encrypted.

S300,对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源,N组所述加密数据源与N组数据块组一一对应。S300. Perform byte segmentation on the data corresponding to N groups of pictures to obtain data of a specific length, and generate N groups of encrypted data sources accordingly. The N groups of encrypted data sources correspond to N groups of data block groups one-to-one.

在本步骤中,对N组图片对应的数据进行字节分割,首先将N组图片对应的数据转为二进制,然后通过分割,将其划分为字节长度均相同的特定长度数据,如三位二进制数据,进行分割时,也是按照数据顺序进行分割,为每一个 加密数据源内的特定长度数据进行连续编号。In this step, segment the data corresponding to the N groups of pictures into bytes, first convert the data corresponding to the N groups of pictures into binary, and then divide it into specific length data with the same byte length, such as three When binary data is divided, it is also divided according to the order of the data, and the data of a specific length in each encrypted data source is serially numbered.

S400,根据N组加密数据源对N组数据块组进行重新组合,得到重组数据,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器。S400, recombine N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data, publish the reorganized data on the blockchain, and store header data and random encrypted data image sets in a local server.

在本步骤中,根据N组加密数据源对N组数据块组进行重新组合,根据N组加密数据源内的特定长度数据将其转化为16进制,三位二进制数据则可以表征8个数字,因此每一组加密数据源内的一组特定长度数据可以转化为一个16进制数字,且范围在0-7,那么N组加密数据源内的同一编号对应的特定长度数据,则对应8个16进制数字,如N组加密数据源内的同一编号对应的特定长度数据转化为16进制分别为2、3、5、1、7、6、2和0,而N组所述加密数据源与N组数据块组一一对应,则根据2、3、5、1、7、6、2和0来确定N组数据块组中同一编号对应的数据块排列位置,举例说明,N组加密数据源内的同一编号对应的特定长度数据转化为16进制分别为2、3、5、1、7、6、2和0,N组数据块组中同一编号对应的数据块分别为a1、b1、c1、d1、e1、f1、g1和h1,经过重组之后,N组数据块组中同一编号对应的数据块根据2、3、5、1、7、6、2和0交换位置,即a1第2、b1第3、c1第5、d1第1、e1第7、f1第6和g1第2,h1第0,对于重复的编号,将其对应的数据块排至最后,排列顺序即为h1、d1、a1、b1、c1、f1、e1和g1,此时可见,针对不同的数据块组之间的数据块已经完成了重组,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器,此时重组数据为公开内容,即使下载也无法直接获取其中的内容,需要根据头部数据以及随机加密数据图像集进行反向加密,恢复重组数据,得到待加密数据;头部数据以及随机加密数据图像集存储之前进行加密处理;下表为重组前后的变化表:In this step, N groups of data block groups are reassembled according to N groups of encrypted data sources, and converted into hexadecimal according to the specific length data in N groups of encrypted data sources, and three-digit binary data can represent 8 numbers. Therefore, a set of data of a specific length in each group of encrypted data sources can be converted into a hexadecimal number, and the range is 0-7, then the data of a specific length corresponding to the same number in N groups of encrypted data sources corresponds to 8 hexadecimal numbers For example, the specific length data corresponding to the same number in N groups of encrypted data sources are converted into hexadecimal numbers of 2, 3, 5, 1, 7, 6, 2 and 0, and the encrypted data sources of N groups are related to N One-to-one correspondence between groups of data blocks, then according to 2, 3, 5, 1, 7, 6, 2 and 0 to determine the arrangement position of the data blocks corresponding to the same number in N groups of data block groups, for example, in N groups of encrypted data sources The data of a specific length corresponding to the same number in hexadecimal are 2, 3, 5, 1, 7, 6, 2, and 0 respectively, and the data blocks corresponding to the same number in N groups of data blocks are a1, b1, c1 respectively , d1, e1, f1, g1, and h1, after reorganization, the data blocks corresponding to the same number in N groups of data block groups are exchanged according to 2, 3, 5, 1, 7, 6, 2, and 0, that is, a1 is the second , b1 No. 3, c1 No. 5, d1 No. 1, e1 No. 7, f1 No. 6, g1 No. 2, h1 No. 0, for repeated numbers, arrange the corresponding data blocks to the end, and the order of arrangement is h1, d1, a1, b1, c1, f1, e1, and g1, it can be seen at this time that the data blocks between different data block groups have been reorganized, and the reorganized data will be published on the blockchain, header data and random encrypted data The image set is distributed and stored on the local server. At this time, the reorganized data is public content. Even if it is downloaded, the content cannot be directly obtained. It is necessary to perform reverse encryption based on the header data and the random encrypted data image set, restore the reorganized data, and obtain the data to be encrypted ; Header data and random encrypted data image sets are encrypted before storage; the following table shows the changes before and after reorganization:

Figure DEST_PATH_IMAGE001
Figure DEST_PATH_IMAGE001

如图2所示,作为本发明的一个优选实施例,所述从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组的步骤,具体包括:As shown in Figure 2, as a preferred embodiment of the present invention, the header data is intercepted from the data to be encrypted, the data to be encrypted after the interception is equally divided into N groups of data to be processed, and each group of data to be processed is processed. The step of dividing evenly to obtain N groups of data block groups specifically includes:

S201,从待加密数据截取头部数据,所述头部数据截取的比例根据随机加密数据图像集确定。S201, intercepting header data from the data to be encrypted, the intercepting ratio of the header data is determined according to a random encrypted data image set.

在本步骤中,从待加密数据截取头部数据,头部数据截取的比例根据随机加密数据图像集确定,具体的,统计随机加密数据图像集中图片的总数据量,截取预设长度的尾部数据,如三位二进制数据,例如100,将其转为16进制,即为4,将其乘以0.1%得到0.4%,那么头部数据的截取比例即为0.4%。In this step, the head data is intercepted from the data to be encrypted, and the proportion of the head data interception is determined according to the random encrypted data image set. Specifically, the total data amount of the pictures in the randomly encrypted data image set is counted, and the tail data of a preset length is intercepted , such as three-digit binary data, such as 100, convert it to hexadecimal, which is 4, multiply it by 0.1% to get 0.4%, then the interception ratio of the header data is 0.4%.

S202,将截取头部数据的待加密数据等分为N组,并进行编号,得到N组待处理数据。S202. Divide the data to be encrypted with the header data intercepted into N groups, and number them to obtain N groups of data to be processed.

在本步骤中,将截取头部数据的待加密数据等分为N组,通过头部数据截取可知,由于采集的图片是随机的,因此得到的头部数据截取比例也是随机的,那么剩余部分的待加密数据的大小也是随机的,通过等分分割,得到N组待处理数据。In this step, the data to be encrypted with intercepted header data is equally divided into N groups. It can be seen from the header data interception that since the collected pictures are random, the interception ratio of the obtained header data is also random, then the remaining part The size of the data to be encrypted is also random, and N groups of data to be processed are obtained through equal division.

S203,对已经编号的N组待处理数据进行平均分割,每组待处理数据的分割数量相同,得到N组数据块组。S203, divide the numbered N groups of data to be processed on average, and each group of data to be processed has the same number of divisions to obtain N groups of data block groups.

在本步骤中,对已经编号的N组待处理数据进行平均分割,以N=8为例,N组待处理数据编号即为a、b、c、d、e、f、g和h,而通过进一步平均分割,各组数据块编号即为a1,a2……,aM,b1,b2……,bM,以此类推。In this step, the numbered N groups of data to be processed are equally divided. Taking N=8 as an example, the numbers of N groups of data to be processed are a, b, c, d, e, f, g, and h, and Through further average division, the serial numbers of each group of data blocks are a 1 , a 2 . . . , a M , b 1 , b 2 . . . , b M , and so on.

如图3所示,作为本发明的一个优选实施例,所述对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源的步骤,具体包括:As shown in Figure 3, as a preferred embodiment of the present invention, the data corresponding to the N groups of pictures is segmented into bytes to obtain data of a specific length, and the steps of generating N groups of encrypted data sources accordingly include:

S301,根据随机加密数据图像集中包含的图片数量确定字节分割长度。S301. Determine the byte segmentation length according to the number of pictures included in the random encrypted data image set.

在本步骤中,根据随机加密数据图像集中包含的图片数量确定字节分割长度,如8组图片,将其转化为二进制数据,对应几位二进制数据则字节分割长度为几个二进制字符,如8组,则可以通过三位二进制进行表示,那么字节分割长度即为3。In this step, the byte segmentation length is determined according to the number of pictures contained in the random encrypted data image set, such as 8 groups of pictures, which are converted into binary data, and the byte segmentation length is several binary characters corresponding to several bits of binary data, such as 8 groups, it can be represented by three-bit binary, then the byte segmentation length is 3.

S302,对N组图片对应的数据进行字节分割,得到特定长度数据,每一组图片对应一组特定长度数据,每组特定长度数据中包含多个特定字节长度的字节段。S302. Perform byte segmentation on the data corresponding to the N groups of pictures to obtain data of a specific length, each group of pictures corresponds to a group of data of a specific length, and each group of data of a specific length includes a plurality of byte segments of a specific byte length.

在本步骤中,对N组图片对应的数据进行字节分割,具体的,当确定字节分割长度为3时,则将N组图片对应的数据都划分为三位的二进制数据,如100-101-010……。In this step, byte segmentation is performed on the data corresponding to the N groups of pictures. Specifically, when it is determined that the byte segmentation length is 3, the data corresponding to the N groups of pictures is divided into three-bit binary data, such as 100- 101-010….

S303,根据每一个字节段生成一组序号,该序号构成加密数据源。S303. Generate a group of sequence numbers according to each byte segment, where the sequence numbers constitute an encrypted data source.

在本步骤中,根据每一个字节段生成一组序号,将三位的二进制数据转化为16进制,即得到序号,如4-5-2……,有N组,则得到N组加密数据源。In this step, a set of serial numbers is generated according to each byte segment, and the three-digit binary data is converted into hexadecimal, that is, the serial number is obtained, such as 4-5-2..., if there are N groups, then N groups of encryption are obtained data source.

如图4所示,作为本发明的一个优选实施例,所述根据N组加密数据源对N组数据块组进行重新组合,得到重组数据的步骤,具体包括:As shown in Figure 4, as a preferred embodiment of the present invention, the step of recombining N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data specifically includes:

S401,确定每组数据块组中数据块的编号,N组数据块组中的数据块按照顺序一一对应。S401. Determine the numbers of the data blocks in each data block group, and the data blocks in the N data block groups correspond to each other in sequence.

S402,根据N组加密数据源确定重新组合的顺序,生成重组序列。S402. Determine a recombination sequence according to N groups of encrypted data sources, and generate a recombination sequence.

在本步骤中,确定每组数据块组中数据块的编号,根据N组加密数据源内的特定长度数据将其转化为16进制,三位二进制数据则可以表征8个数字,因此每一组加密数据源内的一组特定长度数据可以转化为一个16进制数字,根据N组加密数据源确定重新组合的顺序,生成重组序列。In this step, determine the number of the data block in each group of data blocks, and convert it into hexadecimal according to the specific length data in the N groups of encrypted data sources, and the three-digit binary data can represent 8 numbers, so each group A set of data with a specific length in the encrypted data source can be converted into a hexadecimal number, and the sequence of recombination is determined according to N sets of encrypted data sources to generate a recombination sequence.

S403,根据重组序列对N组数据块组中进行位置交换,得到重组数据。S403. Perform position exchange in the N groups of data block groups according to the recombination sequence to obtain recombined data.

在本步骤中,根据重组序列对N组数据块组中进行位置交换,a、b、c、d、e、f、g和h等数据块组中均包含多个数据块,如a数据块组中只包含多个以a开头的数据块,在进行重组之后,a数据块组中将包含b、c、d、e、f、g和h中的数据块,起到重组的目的,同样的,b、c、d、e、f、g和h也会存在其他数据块组中的数据块。In this step, according to the recombination sequence, the positions of N groups of data block groups are exchanged, and data block groups such as a, b, c, d, e, f, g, and h all contain multiple data blocks, such as a data block The group only contains multiple data blocks starting with a. After reorganization, the data block group a will contain data blocks in b, c, d, e, f, g, and h for the purpose of reorganization. Yes, b, c, d, e, f, g, and h also exist in data blocks in other data block groups.

如图5所示,为本发明实施例提供的一种基于区块链的能源数据安全存储系统,所述系统包括:As shown in Figure 5, a blockchain-based energy data security storage system provided by an embodiment of the present invention, the system includes:

数据获取模块100,用于获取随机加密数据图像集以及待加密数据,所述随机加密数据图像集为随机采集的图片,一组随机加密数据图像集包括N组图片。The data acquisition module 100 is configured to acquire a random encrypted data image set and data to be encrypted. The random encrypted data image set is randomly collected pictures, and a group of random encrypted data image sets includes N groups of pictures.

在本系统中,数据获取模块100获取随机加密数据图像集以及待加密数据,随机加密数据图像集包括N组图片,该图片为随机采集的图片,单独设置摄像头,可以对画面出现随机变化的画面进行采集,例如通过相机对河流画面进行拍摄,数量可以为8组,即N为8,待加密数据则是需要进行存储的能源数据。In this system, the data acquisition module 100 acquires a random encrypted data image set and data to be encrypted. The random encrypted data image set includes N groups of pictures. Collecting, for example, taking pictures of rivers with a camera, the number can be 8 groups, that is, N is 8, and the data to be encrypted is the energy data that needs to be stored.

数据切分模块200,用于从待加密数据截取头部数据,将截取后的待加密数据等量划分为N组待处理数据,对每组待处理数据进行平均分割,得到N组数据块组,所述数据块组包含M个数据块,同一数据块组内的数据块进行连续编号。The data segmentation module 200 is used to intercept header data from the data to be encrypted, divide the intercepted data to be encrypted into N groups of data to be processed, and divide each group of data to be processed on average to obtain N groups of data block groups , the data block group includes M data blocks, and the data blocks in the same data block group are numbered consecutively.

在本系统中,数据切分模块200从待加密数据截取头部数据,首先截取头部数据,进行截取时,根据随机加密数据图像集来确定截取的比例,那么获得头部数据的比例也是随机的,进而将截取之后待加密数据划分为N组待处理数据,即划分为8组待处理数据,如头部数据截取a%,那么待处理数据的比例则均为(1- a%)/N,然后再对待处理数据进行平均分割,如8组待处理数据分别为a、b、c、d、e、f、g和h,将a待处理数据等分为M个数据块,则每个数据块的编号为a1,a2……,aM;头部数据占据的比例不超过待加密数据的1%。In this system, the data segmentation module 200 intercepts the header data from the data to be encrypted, first intercepts the header data, and when intercepting, determines the ratio of interception according to the random encrypted data image set, then the ratio of obtaining the header data is also random , and then divide the intercepted data to be encrypted into N groups of data to be processed, that is, divided into 8 groups of data to be processed. If the header data is intercepted by a%, then the proportion of data to be processed is (1- a%)/ N, and then divide the data to be processed evenly. For example, the 8 groups of data to be processed are a, b, c, d, e, f, g, and h respectively, and the data to be processed by a is divided into M data blocks equally, then each The number of each data block is a 1 , a 2 ..., a M ; the header data occupies no more than 1% of the data to be encrypted.

加密源处理模块300,用于对N组图片对应的数据进行字节分割,得到特定长度数据,据此生成N组加密数据源,N组所述加密数据源与N组数据块组一一对应。The encrypted source processing module 300 is used to segment the data corresponding to the N groups of pictures into bytes to obtain data of a specific length, thereby generating N groups of encrypted data sources, and the encrypted data sources of the N groups correspond to the N groups of data block groups one-to-one .

在本系统中,加密源处理模块300对N组图片对应的数据进行字节分割,首先将N组图片对应的数据转为二进制,然后通过分割,将其划分为字节长度均相同的特定长度数据,如三位二进制数据,进行分割时,也是按照数据顺序进行分割,为每一个 加密数据源内的特定长度数据进行连续编号。In this system, the encryption source processing module 300 divides the data corresponding to the N groups of pictures into bytes, first converts the data corresponding to the N groups of pictures into binary, and then divides them into specific lengths with the same byte length When data, such as three-bit binary data, is divided, it is also divided according to the order of the data, and the data of a specific length in each encrypted data source is serially numbered.

数据重组模块400,用于根据N组加密数据源对N组数据块组进行重新组合,得到重组数据,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器。The data reorganization module 400 is used to recombine N groups of data block groups according to N groups of encrypted data sources to obtain reorganized data, publish the reorganized data on the blockchain, and store header data and random encrypted data image sets in a local server .

在本系统中,数据重组模块400根据N组加密数据源对N组数据块组进行重新组合,根据N组加密数据源内的特定长度数据将其转化为16进制,三位二进制数据则可以表征8个数字,因此每一组加密数据源内的一组特定长度数据可以转化为一个16进制数字,且范围在0-7,那么N组加密数据源内的同一编号对应的特定长度数据,则对应8个16进制数字,如N组加密数据源内的同一编号对应的特定长度数据转化为16进制分别为2、3、5、1、7、6、2和0,而N组所述加密数据源与N组数据块组一一对应,则根据2、3、5、1、7、6、2和0来确定N组数据块组中同一编号对应的数据块排列位置,举例说明,N组加密数据源内的同一编号对应的特定长度数据转化为16进制分别为2、3、5、1、7、6、2和0,N组数据块组中同一编号对应的数据块分别为a1、b1、c1、d1、e1、f1、g1和h1,经过重组之后,N组数据块组中同一编号对应的数据块根据2、3、5、1、7、6、2和0交换位置,即a1第2、b1第3、c1第5、d1第1、e1第7、f1第6和g1第2,h1第0,对于重复的编号,将其对应的数据块排至最后,排列顺序即为h1、d1、a1、b1、c1、f1、e1和g1,此时可见,针对不同的数据块组之间的数据块已经完成了重组,将重组数据公布于区块链,头部数据以及随机加密数据图像集分散存储至本地服务器,此时重组数据为公开内容,即使下载也无法直接获取其中的内容,需要根据头部数据以及随机加密数据图像集进行反向加密,恢复重组数据,得到待加密数据。In this system, the data reorganization module 400 reassembles N groups of data block groups according to N groups of encrypted data sources, and converts them into hexadecimal system according to the specific length data in N groups of encrypted data sources, and the three-digit binary data can represent 8 numbers, so a set of data of a specific length in each group of encrypted data sources can be converted into a hexadecimal number, and the range is 0-7, then the data of a specific length corresponding to the same number in N groups of encrypted data sources corresponds to 8 hexadecimal numbers, such as the specific length data corresponding to the same number in N groups of encrypted data sources are converted into hexadecimal numbers as 2, 3, 5, 1, 7, 6, 2 and 0, and the N groups of encrypted The data source is in one-to-one correspondence with N groups of data block groups, and the arrangement position of the data blocks corresponding to the same number in the N groups of data block groups is determined according to 2, 3, 5, 1, 7, 6, 2 and 0. For example, N The specific length data corresponding to the same number in the group encrypted data source is converted into hexadecimal as 2, 3, 5, 1, 7, 6, 2 and 0, and the data blocks corresponding to the same number in N groups of data blocks are respectively a1 , b1, c1, d1, e1, f1, g1 and h1, after reorganization, the data blocks corresponding to the same number in the N group of data block groups are exchanged according to 2, 3, 5, 1, 7, 6, 2 and 0, That is, a1 is the 2nd, b1 is the 3rd, c1 is the 5th, d1 is the 1st, e1 is the 7th, f1 is the 6th, g1 is the 2nd, and h1 is the 0th. They are h1, d1, a1, b1, c1, f1, e1, and g1. At this point, it can be seen that the data blocks between different data block groups have been reorganized, and the reorganized data will be published on the blockchain. The header data And the random encrypted data image set is stored in a local server. At this time, the reorganized data is public content, and the content cannot be directly obtained even if it is downloaded. It is necessary to perform reverse encryption based on the header data and the random encrypted data image set to restore the reorganized data. Get the data to be encrypted.

如图6所示,作为本发明一个优选实施例,所述数据切分模块200包括:As shown in Figure 6, as a preferred embodiment of the present invention, the data segmentation module 200 includes:

头部数据截取单元201,用于从待加密数据截取头部数据,所述头部数据截取的比例根据随机加密数据图像集确定。The header data interception unit 201 is configured to intercept header data from the data to be encrypted, and the interception ratio of the header data is determined according to a random encrypted data image set.

在本模块中,头部数据截取单元201从待加密数据截取头部数据,头部数据截取的比例根据随机加密数据图像集确定,具体的,统计随机加密数据图像集中图片的总数据量,截取预设长度的尾部数据,如三位二进制数据,例如100,将其转为16进制,即为4,将其乘以0.1%得到0.4%,那么头部数据的截取比例即为0.4%。In this module, the header data interception unit 201 intercepts the header data from the data to be encrypted, and the ratio of header data interception is determined according to the random encrypted data image set. Specifically, the total data amount of the pictures in the random encrypted data image set is counted, and the intercepted Tail data with a preset length, such as three-digit binary data, such as 100, is converted to hexadecimal, which is 4, and multiplied by 0.1% to get 0.4%, then the interception ratio of the head data is 0.4%.

数据等分单元202,用于将截取头部数据的待加密数据等分为N组,并进行编号,得到N组待处理数据。The data equal division unit 202 is configured to equally divide the data to be encrypted with the header data intercepted into N groups and number them to obtain N groups of data to be processed.

在本模块中,数据等分单元202将截取头部数据的待加密数据等分为N组,通过头部数据截取可知,由于采集的图片是随机的,因此得到的头部数据截取比例也是随机的,那么剩余部分的待加密数据的大小也是随机的,通过等分分割,得到N组待处理数据。In this module, the data equalization unit 202 divides the data to be encrypted by intercepting the header data into N groups. It can be seen from the header data interception that since the collected pictures are random, the obtained header data interception ratio is also random. , then the size of the remaining data to be encrypted is also random, and N groups of data to be processed are obtained through equal division.

数据块分割单元203,用于对已经编号的N组待处理数据进行平均分割,每组待处理数据的分割数量相同,得到N组数据块组。The data block dividing unit 203 is configured to equally divide the numbered N groups of data to be processed, and the number of divisions of each group of data to be processed is the same to obtain N groups of data blocks.

在本模块中,数据块分割单元203对已经编号的N组待处理数据进行平均分割,以N=8为例,N组待处理数据编号即为a、b、c、d、e、f、g和h,而通过进一步平均分割,各组数据块编号即为a1,a2……,aM,b1,b2……,bM,以此类推。In this module, the data block segmentation unit 203 divides the numbered N groups of data to be processed on average. Taking N=8 as an example, the numbers of N groups of data to be processed are a, b, c, d, e, f, g and h, and through further average division, the numbers of each group of data blocks are a 1 , a 2 ..., a M , b 1 , b 2 ..., b M , and so on.

如图7所示,作为本发明一个优选实施例,所述加密源处理模块300包括:As shown in Figure 7, as a preferred embodiment of the present invention, the encryption source processing module 300 includes:

分割长度确定单元301,用于根据随机加密数据图像集中包含的图片数量确定字节分割长度。The segmentation length determination unit 301 is configured to determine the byte segmentation length according to the number of pictures contained in the random encrypted data image set.

在本模块中,分割长度确定单元301根据随机加密数据图像集中包含的图片数量确定字节分割长度,如8组图片,将其转化为二进制数据,对应几位二进制数据则字节分割长度为几个二进制字符,如8组,则可以通过三位二进制进行表示,那么字节分割长度即为3。In this module, the segmentation length determination unit 301 determines the byte segmentation length according to the number of pictures contained in the random encrypted data image set, such as 8 groups of pictures, which are converted into binary data, and the byte segmentation length is how many bits corresponding to the binary data. binary characters, such as 8 groups, can be represented by three-bit binary, then the byte segmentation length is 3.

图片数据分割单元302,用于对N组图片对应的数据进行字节分割,得到特定长度数据,每一组图片对应一组特定长度数据,每组特定长度数据中包含多个特定字节长度的字节段。The picture data segmentation unit 302 is used to segment the data corresponding to N groups of pictures into bytes to obtain data of a specific length, each group of pictures corresponds to a set of data of a specific length, and each set of data of a specific length includes a plurality of data of a specific byte length byte segment.

在本模块中,图片数据分割单元302对N组图片对应的数据进行字节分割,具体的,当确定字节分割长度为3时,则将N组图片对应的数据都划分为三位的二进制数据,如100-101-010……。In this module, the picture data segmentation unit 302 performs byte segmentation on the data corresponding to the N groups of pictures. Specifically, when the byte segmentation length is determined to be 3, the data corresponding to the N groups of pictures are all divided into three-bit binary Data, such as 100-101-010….

序号生成单元303,用于根据每一个字节段生成一组序号,该序号构成加密数据源。The serial number generating unit 303 is configured to generate a group of serial numbers according to each byte segment, and the serial numbers constitute an encrypted data source.

在本模块中,序号生成单元303根据每一个字节段生成一组序号,将三位的二进制数据转化为16进制,即得到序号,如4-5-2……,有N组,则得到N组加密数据源。In this module, the serial number generation unit 303 generates a group of serial numbers according to each byte segment, converts the three-digit binary data into hexadecimal, and obtains the serial number, such as 4-5-2..., there are N groups, then Get N sets of encrypted data sources.

如图8所示,作为本发明一个优选实施例,所述数据重组模块400包括:As shown in Figure 8, as a preferred embodiment of the present invention, the data reorganization module 400 includes:

编号确认单元401,用于确定每组数据块组中数据块的编号,N组数据块组中的数据块按照顺序一一对应。The serial number confirmation unit 401 is configured to determine the serial numbers of the data blocks in each data block group, and the data blocks in the N data block groups correspond to each other in sequence.

序列生成单元402,用于根据N组加密数据源确定重新组合的顺序,生成重组序列。The sequence generation unit 402 is configured to determine the sequence of recombination according to the N groups of encrypted data sources, and generate a recombination sequence.

在本模块中,编号确认单元401确定每组数据块组中数据块的编号,将N组加密数据源内的特定长度数据转化为16进制,三位二进制数据则可以表征8个数字,因此每一组加密数据源内的一组特定长度数据可以转化为一个16进制数字,根据N组加密数据源确定重新组合的顺序,生成重组序列。In this module, the number confirmation unit 401 determines the number of data blocks in each group of data block groups, and converts the specific length data in N groups of encrypted data sources into hexadecimal, and the three-digit binary data can represent 8 numbers, so each A set of data of a specific length in a set of encrypted data sources can be converted into a hexadecimal number, and the order of recombination is determined according to N sets of encrypted data sources to generate a recombination sequence.

数据块重组单元403,用于根据重组序列对N组数据块组中进行位置交换,得到重组数据。The data block reorganization unit 403 is configured to exchange positions in N groups of data block groups according to the reorganization sequence to obtain reassembled data.

在本模块中,数据块重组单元403根据重组序列对N组数据块组中进行位置交换,a、b、c、d、e、f、g和h等数据块组中均包含多个数据块,如a数据块组中只包含多个以a开头的数据块,在进行重组之后,a数据块组中将包含b、c、d、e、f、g和h中的数据块,起到重组的目的,同样的,b、c、d、e、f、g和h也会存在其他数据块组中的数据块。In this module, the data block reorganization unit 403 performs position exchange on the N groups of data block groups according to the reorganization sequence, and data block groups such as a, b, c, d, e, f, g, and h all contain multiple data blocks , if a data block group only contains multiple data blocks beginning with a, after reorganization, a data block group will contain data blocks in b, c, d, e, f, g and h, which plays a role For the purpose of reorganization, similarly, b, c, d, e, f, g and h will also exist in data blocks in other data block groups.

应该理解的是,虽然本发明各实施例的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各实施例中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of the embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in each embodiment may include multiple sub-steps or multiple stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, the sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and the programs can be stored in a non-volatile computer-readable storage medium When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, should be considered as within the scope of this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention should be based on the appended claims.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (10)

1. A safe energy data storage method based on a block chain is characterized by comprising the following steps:
acquiring a random encrypted data image set and data to be encrypted, wherein the random encrypted data image set is randomly acquired pictures, and a group of random encrypted data image sets comprises N groups of pictures;
intercepting head data from data to be encrypted, equally dividing the intercepted data to be encrypted into N groups of data to be processed, and averagely dividing each group of data to be processed to obtain N groups of data block groups, wherein each data block group comprises M data blocks, and the data blocks in the same data block group are continuously numbered;
carrying out byte segmentation on data corresponding to N groups of pictures to obtain data with a specific length, and generating N groups of encrypted data sources according to the data, wherein the N groups of encrypted data sources correspond to the N groups of data block groups one by one;
and recombining the N groups of data block groups according to the N groups of encrypted data sources to obtain recombined data, publishing the recombined data to the block chain, and dispersedly storing the head data and the random encrypted data image set to the local server.
2. The safe energy data storage method based on the block chain according to claim 1, wherein the step of intercepting the header data from the data to be encrypted, equally dividing the intercepted data to be encrypted into N groups of data to be processed, and averagely dividing each group of data to be processed to obtain N groups of data blocks specifically comprises:
intercepting head data from data to be encrypted, wherein the intercepting proportion of the head data is determined according to a random encrypted data image set;
equally dividing the data to be encrypted, in which the head data is intercepted, into N groups, and numbering the N groups to be processed to obtain N groups of data to be processed;
and averagely dividing the numbered N groups of data to be processed, wherein the dividing quantity of each group of data to be processed is the same, and obtaining N groups of data block groups.
3. The safe energy data storage method based on the blockchain according to claim 1, wherein the step of performing byte segmentation on data corresponding to the N groups of pictures to obtain data with a specific length to generate N groups of encrypted data sources includes:
determining byte segmentation length according to the number of pictures contained in the random encrypted data image set;
carrying out byte segmentation on data corresponding to N groups of pictures to obtain data with specific length, wherein each group of pictures corresponds to one group of data with specific length, and each group of data with specific length comprises a plurality of byte sections with specific byte length;
a set of sequence numbers is generated from each of the byte segments, the sequence numbers forming a source of encrypted data.
4. The block chain-based energy data secure storage method according to claim 1, wherein the step of recombining the N groups of data block groups according to the N groups of encrypted data sources to obtain recombined data specifically includes:
determining the serial numbers of the data blocks in each group of data block groups, wherein the data blocks in the N groups of data block groups correspond to one another in sequence;
determining the recombination sequence according to the N groups of encrypted data sources to generate a recombination sequence;
and carrying out position exchange on the N groups of data block groups according to the recombination sequence to obtain recombination data.
5. The block chain-based energy data secure storage method according to claim 1, wherein the header data occupies a proportion of not more than 1% of the data to be encrypted.
6. The blockchain-based energy data secure storage method according to claim 1, wherein the header data and the random encrypted data image set are encrypted before being stored.
7. A block chain-based energy data secure storage system, the system comprising:
the data acquisition module is used for acquiring a random encrypted data image set and data to be encrypted, wherein the random encrypted data image set is randomly acquired pictures, and one group of random encrypted data image set comprises N groups of pictures;
the data segmentation module is used for intercepting head data from the data to be encrypted, equally dividing the intercepted data to be encrypted into N groups of data to be processed, and averagely segmenting each group of data to be processed to obtain N groups of data block groups, wherein each data block group comprises M data blocks, and the data blocks in the same data block group are continuously numbered;
the encrypted source processing module is used for carrying out byte segmentation on data corresponding to the N groups of pictures to obtain data with a specific length, and generating N groups of encrypted data sources according to the data, wherein the N groups of encrypted data sources correspond to the N groups of data block groups one by one;
and the data recombination module is used for recombining the N groups of data block groups according to the N groups of encrypted data sources to obtain recombined data, publishing the recombined data to the block chain, and dispersedly storing the head data and the random encrypted data image set to the local server.
8. The block chain-based energy data secure storage system according to claim 7, wherein the data segmentation module comprises:
the head data interception unit is used for intercepting head data from data to be encrypted, and the interception proportion of the head data is determined according to the random encrypted data image set;
the data equally dividing unit is used for equally dividing the data to be encrypted of the intercepted head data into N groups and numbering the N groups to obtain N groups of data to be processed;
and the data block segmentation unit is used for averagely segmenting the numbered N groups of data to be processed, wherein the segmentation quantity of each group of data to be processed is the same, and N groups of data block groups are obtained.
9. The block chain-based energy data secure storage system according to claim 7, wherein the encrypted source processing module includes:
a division length determination unit for determining a byte division length according to the number of pictures contained in the random encrypted data image set;
the picture data segmentation unit is used for carrying out byte segmentation on data corresponding to N groups of pictures to obtain data with specific length, each group of pictures corresponds to one group of data with specific length, and each group of data with specific length comprises a plurality of byte segments with specific byte length;
and the sequence number generation unit is used for generating a group of sequence numbers according to each byte section, and the sequence numbers form an encrypted data source.
10. The block chain-based energy data secure storage system according to claim 7, wherein the data reorganization module comprises:
the number confirmation unit is used for determining the number of the data blocks in each group of data block groups, and the data blocks in the N groups of data block groups correspond to one another in sequence;
the sequence generating unit is used for determining the recombination sequence according to the N groups of encrypted data sources and generating a recombination sequence;
and the data block recombination unit is used for carrying out position exchange on the N groups of data block groups according to the recombination sequence to obtain recombined data.
CN202211323149.4A 2022-10-27 2022-10-27 A blockchain-based energy data security storage method and system Active CN115378590B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211323149.4A CN115378590B (en) 2022-10-27 2022-10-27 A blockchain-based energy data security storage method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211323149.4A CN115378590B (en) 2022-10-27 2022-10-27 A blockchain-based energy data security storage method and system

Publications (2)

Publication Number Publication Date
CN115378590A true CN115378590A (en) 2022-11-22
CN115378590B CN115378590B (en) 2023-02-07

Family

ID=84074043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211323149.4A Active CN115378590B (en) 2022-10-27 2022-10-27 A blockchain-based energy data security storage method and system

Country Status (1)

Country Link
CN (1) CN115378590B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5351299A (en) * 1992-06-05 1994-09-27 Matsushita Electric Industrial Co., Ltd. Apparatus and method for data encryption with block selection keys and data encryption keys
JP2008060671A (en) * 2006-08-29 2008-03-13 Brother Ind Ltd Communication system and management device
DE102009050493A1 (en) * 2009-10-23 2011-04-28 Röllgen, Bernd Block data encryption methods
US20120060033A1 (en) * 2009-03-03 2012-03-08 Giuliani Kenneth J Split key secure access system
CN103259780A (en) * 2013-03-02 2013-08-21 苏州阔地网络科技有限公司 Method and system for storing enciphered data
US20140258731A1 (en) * 2013-03-07 2014-09-11 National Cheng Kung University Data encryption system and method
CN104168435A (en) * 2014-08-15 2014-11-26 北京彩云动力教育科技有限公司 Method and system for batched mergence and playing of audio files
CN104205117A (en) * 2014-04-10 2014-12-10 华为技术有限公司 Device file encryption and decryption method and device
CN104331448A (en) * 2014-10-29 2015-02-04 上海大学 Encrypted domain image retrieval method based on JPEG (Joint Picture Expert Group) image alternating current coefficient histograms
CN104468842A (en) * 2014-12-31 2015-03-25 国网甘肃省电力公司信息通信公司 Power grid equipment state information cloud storage system and data uploading and downloading methods thereof
CN106330464A (en) * 2016-10-26 2017-01-11 上海众人网络安全技术有限公司 An identity authentication method, device and system
CN110311783A (en) * 2019-05-30 2019-10-08 平安科技(深圳)有限公司 User attaching verification method, device and computer equipment based on group ranking
CN110351091A (en) * 2019-05-30 2019-10-18 平安科技(深圳)有限公司 Resource exchange method, apparatus and computer equipment based on dual signature
CN110545257A (en) * 2019-07-22 2019-12-06 北京航盛新能科技有限公司 Automobile CAN bus encryption method
CN111884993A (en) * 2020-06-10 2020-11-03 广东工业大学 A CAN Bus Encryption Method Using Encryption Algorithm to Encrypt Data
CN113225297A (en) * 2020-01-21 2021-08-06 北京国双科技有限公司 Data hybrid encryption method, device and equipment
CN113742765A (en) * 2021-11-08 2021-12-03 天津嘉萱智财云科技有限公司 Intelligent cloud data security protection system and method based on block chain

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5351299A (en) * 1992-06-05 1994-09-27 Matsushita Electric Industrial Co., Ltd. Apparatus and method for data encryption with block selection keys and data encryption keys
JP2008060671A (en) * 2006-08-29 2008-03-13 Brother Ind Ltd Communication system and management device
US20120060033A1 (en) * 2009-03-03 2012-03-08 Giuliani Kenneth J Split key secure access system
DE102009050493A1 (en) * 2009-10-23 2011-04-28 Röllgen, Bernd Block data encryption methods
CN103259780A (en) * 2013-03-02 2013-08-21 苏州阔地网络科技有限公司 Method and system for storing enciphered data
US20140258731A1 (en) * 2013-03-07 2014-09-11 National Cheng Kung University Data encryption system and method
CN104205117A (en) * 2014-04-10 2014-12-10 华为技术有限公司 Device file encryption and decryption method and device
CN104168435A (en) * 2014-08-15 2014-11-26 北京彩云动力教育科技有限公司 Method and system for batched mergence and playing of audio files
CN104331448A (en) * 2014-10-29 2015-02-04 上海大学 Encrypted domain image retrieval method based on JPEG (Joint Picture Expert Group) image alternating current coefficient histograms
CN104468842A (en) * 2014-12-31 2015-03-25 国网甘肃省电力公司信息通信公司 Power grid equipment state information cloud storage system and data uploading and downloading methods thereof
CN106330464A (en) * 2016-10-26 2017-01-11 上海众人网络安全技术有限公司 An identity authentication method, device and system
CN110311783A (en) * 2019-05-30 2019-10-08 平安科技(深圳)有限公司 User attaching verification method, device and computer equipment based on group ranking
CN110351091A (en) * 2019-05-30 2019-10-18 平安科技(深圳)有限公司 Resource exchange method, apparatus and computer equipment based on dual signature
CN110545257A (en) * 2019-07-22 2019-12-06 北京航盛新能科技有限公司 Automobile CAN bus encryption method
CN113225297A (en) * 2020-01-21 2021-08-06 北京国双科技有限公司 Data hybrid encryption method, device and equipment
CN111884993A (en) * 2020-06-10 2020-11-03 广东工业大学 A CAN Bus Encryption Method Using Encryption Algorithm to Encrypt Data
CN113742765A (en) * 2021-11-08 2021-12-03 天津嘉萱智财云科技有限公司 Intelligent cloud data security protection system and method based on block chain

Also Published As

Publication number Publication date
CN115378590B (en) 2023-02-07

Similar Documents

Publication Publication Date Title
CN102138170B (en) Data conversion device and data conversion method
JP2020502864A5 (en)
US20180254888A1 (en) Combining hashes of data blocks
JPWO2015107952A1 (en) Secret calculation method, secret calculation system, random replacement device, and program
CN105162590B (en) Parallel homomorphism data ciphering method in a kind of cloud computing environment
Yan et al. Chinese remainder theorem-based secret image sharing for (k, n) threshold
WO2019179258A1 (en) Method and system for workload proof computing chip optimization
CN108833733B (en) A kind of decryption method of the resume image based on chaos S box
CN111798236B (en) Transaction data encryption and decryption methods, devices and equipment
CN114398656A (en) File encryption method, file decryption method, file encryption device, file decryption device, computer equipment and storage medium
CN111241568B (en) Encryption method, decryption method, apparatus, computer equipment and storage medium
CN105824602B (en) Input-dependent random number generating apparatus and method thereof
CN115378590B (en) A blockchain-based energy data security storage method and system
Aggarwal Comparison of RC6, modified RC6 & enhancement of RC6
CN115001730A (en) Access control system and method based on role attribute in distributed scenario
CN116484443B (en) Trusted security storage method and device based on hong Monte-go system
US20130282782A1 (en) Distribution apparatus, restoration apparatus, distribution method, restoration method, and distribution and restoration system
TWI553630B (en) Apparatus and method for adding watermark data to audio signals
CN111669269A (en) BLK data encryption method, device and storage medium
CN113328848B (en) Parameterized S box generation method, device, equipment and storage medium
CN116108214A (en) Remote sensing image data processing method and device, computer equipment and storage medium
Ivanov et al. Nonlinear transformations for the construction of the primitives of symmetric cryptoraphy
CN109450618B (en) MD 5-based encryption method and system
CN113535997A (en) Processing method, system, device and storage medium for storing graphic data in blockchain
US8355501B1 (en) Method of collision-free hashing for near-match inputs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant