A data storage method for blockchain framework design based on edge node computing
By building a blockchain sub-chain on edge nodes and inserting it into the cloud main chain, it solves the problem of excessive computing and storage requirements of the existing blockchain framework when deploying edge nodes, and achieves efficient data management and secure storage. , reducing latency and energy consumption, and improving system stability and scalability.
Patent Information
- Application Number
- CN202111213257.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-10-19
AI Technical Summary
When the existing blockchain framework is deployed on edge nodes with limited resources, the computing and storage requirements are too high, resulting in serious delays and energy consumption, making it difficult to implement large-scale applications. In addition, frequent data interactions lead to excessive load on the communication network, making it difficult to implement large-scale applications. Solve the problem of secure storage of distributed node data.
A blockchain framework based on edge node computing is designed. By building a blockchain sub-chain on the edge device, using smart contracts for identity authentication and data encryption, it reduces the amount of direct information communication and calculation, and inserts the sub-chain into the cloud host. In the chain, distributed storage is realized and cloud computing pressure is reduced.
It optimizes IoT data management, reduces the number of end-to-end communications, reduces latency and energy consumption, improves system stability and security, improves system scalability, and relieves wireless communication network traffic pressure.
Smart Images

Figure CN113949575B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain framework design for distributed node computing, aiming to provide a storage method for relevant detection data in the storage and protection of museum cultural relics. Background Art
[0002] Encrypting and protecting various sensor data in a complex Internet of Things is one of the key technologies in edge computing. At present, the protection of sensor data in China is mainly through local encryption and centralized storage. With the increase in the number of cultural relics, this method will lead to excessive local storage pressure, resulting in damage or loss of data. Using blockchain technology to encrypt and decentralize the protection of sensor data can greatly improve data storage efficiency, prevent data loss and tampering, and improve the data management level of museum cultural relics resources. Dorri et al. (Dorri A, Kanhere SS, Jurdak R, Gauravaram P. "Blockchain for IoT security and privacy: the case study of a smart home". 2017 IEEE International Conference on Pervasive Computing and Communications Workshops, Kona, HI, USA, March 13-17, 2017: 618-623.) proposed a method for encrypting and storing sensor data through blockchain, but this method has too high requirements on the computing amount and storage of the deployed equipment, and it is difficult to apply on a large scale. Moinet et al. (Bendiab K, Kolokotronis N, Shiaeles S, Boucherkha S. "WiP: a novel blockchain-based trust model for cloud identity management." 2018IEEE 16th International Conference on Dependable, Autonomic and Secure Computing, Athens, Greece, Aug. 12-15, 2018.) proposed an identity recognition and authentication method based on blockchain technology to ensure that each data operation can be traced, but this technology is not suitable for distributed edge computing networks.Therefore, most of the existing blockchain frameworks have complex structures, large computational and storage requirements, serious latency and energy consumption, and are difficult to deploy on devices with limited resources. The common distributed storage architecture (Bremer J, Lehnhoff S. "Decentralized coalition formation in agent-based combinatorial heuristics". 14th International Conference on Practical Applications of Agents and Multi-Agent Systems, Seville, Spain, Jun. 1-3, 2016) is difficult to solve the existing distributed node data security storage problem. It is necessary to propose a blockchain framework that conforms to the characteristics of sensor networks based on the relevant characteristics of edge node computing. The "Blockchain + Edge Computing Technology White Paper 2020" proposes many practical scenarios for the use of edge nodes and blockchain applications, and realizes the collection of various data by utilizing the convenience of node information collection. Xu Fangmin et al. (Xu Fangmin, Zhao Chenglin, Yang Fan, Li Bin. Industrial data detection blockchain network architecture and detection method based on edge computing [P], 201811283738.8, Chinese patent, 2018.) use edge nodes to collect data and also use the computing power of edge devices to encrypt data, so as to reduce the risk of information leakage when uploading information to the cloud. However, neither of the above two methods fully utilizes the computing power of edge nodes, resulting in frequent data interaction between edge nodes and the cloud main chain, excessive communication and high latency in the entire system. In addition, the existing blockchain model realizes information update authentication through timed information broadcasting. This method will cause the direct communication of each storage node to be too close and the communication network to be overloaded. Summary of the invention
[0003] In order to overcome the shortcomings of the prior art, the present invention provides a blockchain framework design based on edge node computing, realizes the deployment of the blockchain framework model on a commonly used edge computing platform, and deploys the blockchain architecture model in distributed edge devices to reduce the direct information communication and communication load of each edge node and the computing amount of each storage node.
[0004] The technical solution adopted by the present invention to solve the technical problem comprises the following steps:
[0005] Step S1: Collect the measurement data of the same cultural relic from various sensors and transmit the data to various edge devices through the wireless communication module;
[0006] Step S2: Use smart contracts to authenticate the identity of each edge node. If the authentication fails, the data obtained from the node cannot be saved and is considered illegal data, ending the storage process. Otherwise, go to step S3.
[0007] Step S3: Encrypting the relevant sensor data stored in the edge device;
[0008] Step S4: Build a block subchain on the edge device;
[0009] Step S5: Determine whether the smart contract is fully effective. If not, proceed to S1 to read the sensor data for encrypted storage. If it is fully effective, proceed to the next step.
[0010] Step S6: completely insert the subchain into the existing block main chain in the cloud to save the data on the main chain;
[0011] Step S7: After the main chain data is saved, the sub-chain in the edge device is destroyed to release the storage space;
[0012] Step S8: The main chain broadcasts information, synchronizes information of each distributed node, realizes distributed storage of data, and completes the construction and storage process of the entire blockchain.
[0013] The various sensors include but are not limited to temperature sensors, humidity sensors and infrared sensors.
[0014] The encryption operation steps of step S3 are as follows:
[0015] Step S31: The input information length M bits is modulo 512, and the result is m. If m is not equal to 448, a 1 and n 0s are padded after the input information so that the result of the input information length modulo 512 after padding is equal to 448, where: The information length after padding is 512N+448bit;
[0016] Step S32: Add 64 bits after the padded input information to record the length M of the information before padding;
[0017] Step S33: Generate four standard magic numbers;
[0018] Step S34: perform four rounds of calculations to generate a 128-bit hash value as the final encrypted value.
[0019] The four criteria of step S33 adopt a=(01234567) 16 , b = (89ABCDEF) 16 , c = (FEDCBA98) 16 , d = (76543210)16 .
[0020] The loop operation steps of step S34 are as follows:
[0021] Step S341: Group the input information processed in step S32, and subdivide each 512 bits into 16 groups, each group having 32 bits;
[0022] Step S342: Set four linear encryption functions as follows:
[0023] (1)F(X,Y,Z)=(X&Y)|((~X)&Z)
[0024] (2)G(X,Y,Z)=(X&Z)|(Y&(~Z))
[0025] (3)H(X,Y,Z)=X^Y^Z
[0026] (4) I(X,Y,Z)=Y^(X|(~Z))
[0027] Step S343: Use the four linear encryption functions in step S342 to perform operations on each group. The specific encryption operation process is as follows:
[0028] FF(a,b,c,d,Mj,s,ti) means a=b+((a+F(b,c,d)+Mj+ti)<< <s)
[0029] GG(a,b,c,d,Mj,s,ti) means a=b+((a+G(b,c,d)+Mj+ti)<< <s)
[0030] HH(a,b,c,d,Mj,s,ti) means a=b+((a+H(b,c,d)+Mj+ti)<< <s)
[0031] II(a,b,c,d,Mj,s,ti) means a=b+((a+I(b,c,d)+Mj+ti)<< <s)
[0032] Among them, Mj and ti are constants used in the loop calculation process. The constants used in each loop are different. s is the left shift amount, and the s used in each loop is different.
[0033] The above calculation result is transferred to S342 iteration, and a total of four rounds of iterations are performed. In the four rounds of cycles, the above linear encryption function is used alternately;
[0034] Step S344: The result of the iteration of S343 is four 32-bit groups. These four groups are cascaded to generate a 128-bit hash value as the final encrypted value.
[0035] The steps of constructing the block subchain in step S4 are as follows:
[0036] Step S41: The block address of the previous block node in the storage block subchain is stored so that the previous block address points to the new block address, thereby realizing the insertion of new block information;
[0037] Step S42: storing the timestamp of reading and writing;
[0038] Step S43: Generate a random value using the timestamp as a seed;
[0039] Step S44: Use the encrypted value and the results of the above steps S41, S42, and S43 to build a block subchain data block on the edge device.
[0040] The beneficial effects of the present invention are:
[0041] 1) This invention proposes a hybrid blockchain architecture that allows decentralized data management by building a blockchain subchain on edge devices. Therefore, the architecture has computing distribution under the edge computing paradigm, making it possible to optimize the connection between the Internet of Things and the blockchain. This hybrid architecture optimizes the current end-to-end architecture, making data management of the Internet of Things more convenient, with fewer direct interactions with the main chain and lower latency.
[0042] 2) The present invention designs an edge computing layer in front of the blockchain. By using edge nodes with certain computing capabilities, the process of early data extraction, conversion and organization is transferred from the cloud block main chain to the edge computing layer, which greatly reduces the energy consumption of the blockchain main chain when converting data and building modules, and reduces the waste of computing resources in the Internet of Things layer.
[0043] 3) The present invention uses parallel computing of distributed edge devices to push applications, data and computing power away from the blockchain, reduce the communication between WSN nodes (i.e., sensors) and the cloud block main chain, reduce the wireless data communication traffic between edge nodes and blockchain, and alleviate the traffic pressure of the entire wireless communication network. By making full use of the computing power of edge nodes, building sub-chains at nodes, and distributing the computing workload from the cloud main chain to each edge device, the pressure of centralized computing of the entire system in the cloud is eliminated, and the stability and security of the system are improved. The use of a distributed structure greatly improves the scalability of the entire system and does not impose an excessive computing burden on the cloud. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flow chart of the technical solution of the present invention;
[0045] Figure 2 This is a schematic diagram of the sub-chain structure of the blockchain framework of the present invention;
[0046] Figure 3 This is an overall framework diagram of the blockchain framework designed based on edge computing in the present invention. DETAILED DESCRIPTION
[0047] The present invention is further described below in conjunction with the accompanying drawings and embodiments. The present invention includes but is not limited to the following embodiments.
[0048] The present invention proposes a blockchain framework design based on edge node computing to securely store daily detection data of cultural relics obtained by different sensors. The method first reads the data of each sensor through the sensor module and stores it in the edge device. Then, the node identity is verified by the smart contract. After the identity verification is passed, the data is asymmetrically encrypted in the edge device, and the blockchain sub-chain of related data information is continuously created. Finally, when the smart contract on the sub-chain is executed, the entire sub-chain communicates with the existing data storage main chain, so that the entire sub-chain is inserted into the main chain to realize distributed encrypted storage of data.
[0049] like Figure 1 As shown, the technical solution of the blockchain framework design based on edge computing of the present invention includes the following steps:
[0050] Step S1: Collect the measurement data of the same cultural relic from various sensors such as temperature sensors, humidity sensors and infrared sensors, and transmit the data to various edge devices through wireless communication modules.
[0051] Step S2: Use smart contracts to authenticate the identity of each edge node. If the authentication fails, the data obtained from the node will not be saved and will be regarded as illegal data, ending the storage process; otherwise, go to step S3.
[0052] Step S3: Encrypt the relevant sensor data stored in the edge device. The specific encryption operation steps are as follows:
[0053] Step S31: Padding. The input information length M (bits) is modulo 512, and the result is m. If m is not equal to 448, a 1 and n 0s are added after the input information so that the result of the input information length modulo 512 after padding is equal to 448, where n is
[0054]
[0055] Assume that the information length after padding is 512N+448 (bit).
[0056] Step S32: Record the information length. Add 64 bits after the padded input information to record the information length M before the padded information. At this time, the input information length is 512N+448+64=512(N+1) bits.
[0057] Step S33: Generate four standard magic numbers, where the standard magic number (physical order) is a=(01234567) 16 , b = (89ABCDEF) 16 , c = (FEDCBA98) 16 , d = (76543210) 16 , used for mixed use in group iterative calculations. In the actual encryption process, the four magic numbers can be customized according to actual use.
[0058] Step S34: perform four rounds of loop calculations, where the number of loops is the number of groups (N+1). The specific loop calculation steps are as follows:
[0059] Step S341: Group the input information processed in step S32, subdividing each 512 bits into 16 groups, each group having 32 bits (4 bytes).
[0060] Step S342: Set four linear encryption functions as follows:
[0061] (1)F(X,Y,Z)=(X&Y)|((~X)&Z)
[0062] (2)G(X,Y,Z)=(X&Z)|(Y&(~Z))
[0063] (3)H(X,Y,Z)=X^Y^Z
[0064] (4) I(X,Y,Z)=Y^(X|(~Z))
[0065] Among them, & represents the AND operation, | represents the OR operation, ~ represents the NOT operation, and ^ represents the XOR operation.
[0066] Step S343: Use the four linear encryption functions in step S342 to perform operations on each group. The specific encryption operation process is as follows:
[0067] FF(a,b,c,d,Mj,s,ti) means a=b+((a+F(b,c,d)+Mj+ti)<< <s)
[0068] GG(a,b,c,d,Mj,s,ti) means a=b+((a+G(b,c,d)+Mj+ti)<< <s)
[0069] HH(a,b,c,d,Mj,s,ti) means a=b+((a+H(b,c,d)+Mj+ti)<< <s)
[0070] II(a,b,c,d,Mj,s,ti) means a=b+((a+I(b,c,d)+Mj+ti)<< <s)
[0071] Among them, Mj and ti are constants used in the loop calculation process. The constants used in each loop are different. s is the left shift amount, and the s used in each round of the loop is different.
[0072] The above calculation results are transferred to S342 for iteration, and four rounds of iterations are performed in total. In the four rounds of cycles, the above linear encryption functions are used alternately.
[0073] Step S344: The result of the iteration of S343 is four 32-bit groups. These four groups are cascaded to generate a 128-bit hash value as the final encrypted value.
[0074] Step S4: Build a block subchain on the edge device, where the block subchain structure is as follows: Figure 2 shown.
[0075] Step S41: The block address of the previous block node in the storage block subchain is stored so that the previous block address points to the new block address, thereby realizing the insertion of new block information.
[0076] Step S42: Store the timestamp of reading and writing.
[0077] Step S43: Generate a random value using the timestamp as a seed.
[0078] Step S44: Use the results of the above steps S344, S41, S42, and S43 on the edge device to build the block subchain data block.
[0079] Step S5: Determine whether the smart contract is fully effective. If not, proceed to step S1 to read the sensor data for encrypted storage. If it is fully effective, proceed to the next step.
[0080] Step S6: Insert the sub-chain completely into the existing block main chain in the cloud to save the data in the main chain.
[0081] Step S7: After the main chain data is saved, the sub-chain in the edge device is destroyed to release storage space to reduce subsequent storage and computing pressure.
[0082] Step S8: The main chain broadcasts information to synchronize the information of each distributed node and realize distributed storage of data.
[0083] Step S9: Complete the construction and storage process of the entire blockchain.
[0084] Figure 3 This is an example of the application of the blockchain architecture based on edge computing in cultural relics detection provided by the present invention. The method includes the steps of:
[0085] Step S1: Collect various types of detection data during the storage process of cultural relics through sensors, and transmit the data collected by each node to the edge computing device through the wireless communication network, and use the edge computing layer to perform the next step of calculation.
[0086] Specifically, the relevant data collected by the present invention are the temperature information and humidity information of different parts of the cultural relics, but the data that can be collected and applied include but are not limited to these two types of data. The edge computing device can use Raspberry Pi, and also includes but is not limited to the application of such edge computing devices.
[0087] Step S2: Authenticate each edge node through a smart contract. If the authentication fails, the data is considered illegal; otherwise, it means that the collected temperature and humidity information is relevant cultural relic information that needs to be stored.
[0088] Step S3: Encrypt the temperature and humidity data stored in the edge device. The specific encryption operation steps are as follows:
[0089] Step S31: Fill the length of the temperature and humidity information respectively. Taking the filling of the temperature information length as an example, the temperature information length (bit) is modulo 512. If the modulo result is not equal to 448, fill the input information with a 1 and n 0s, so that the result of the input information length modulo 512 after filling is equal to 448. At this time, the temperature information length reaches 512N+448 (bit) required for subsequent calculations.
[0090] Step S32: Use 64 bits to store the length of the information before filling. Add these 64 bits of data to the information filled in step S31. At this time, the data length is 512 (N+1) bits.
[0091] Step S33: Set the standard magic number for loading, where the standard magic number (physical order) is A1=(01234567) 16 , B1=(89ABCDEF) 16 , C1=(FEDCBA98) 16 , D1=(76543210) 16 .
[0092] Step S34: Group the data processed in step S32 into (N+1) groups, and use the four magic numbers in step S33 to perform four rounds of iterative calculations on the grouped data. The specific steps are as follows:
[0093] Step S341: Continue to group (N+1) groups of data, that is, divide each 512 bits into 16 groups, where each group has 4 bytes, so there are a total of 16 (N+1) groups of data. Randomly arrange the 16 groups of data into groups, each group has 4 groups of data, and a total of four groups. Subsequently, these four groups are encrypted separately.
[0094] Step S342: Set four linear encryption functions as follows:
[0095] (1)(X&Y)|((~X)&Z)
[0096] (2)(X&Z)|(Y&(~Z))
[0097] (3)X^Y^Z
[0098] (4)Y^(X|(~Z))
[0099] Among them, & represents the AND operation, | represents the OR operation, ~ represents the NOT operation, and ^ represents the XOR operation.
[0100] Step S343: Perform four rounds of iterative encryption on the four groups obtained in step S341 using four sets of encryption functions.
[0101] Step S344: perform a AND operation on the result obtained by encryption in step S343 and combine it with the result of step S343 to obtain a 128-bit hash value as the ciphertext value of the information encryption.
[0102] Step S4: Build a block subchain on the edge device. The block subchain structure diagram is as follows: Figure 2 shown.
[0103] Step S41: Store the memory block address of the previous node after the block is encrypted and saved, so that the previous block address points to the new block address, thereby realizing the insertion of new block information.
[0104] Step S42: Store the specific timestamp of executing the block construction operation.
[0105] Step S43: Generate a random value using the timestamp as a seed.
[0106] Step S44: construct an encryption tree using the data obtained by encrypting the read temperature and humidity information in step S3.
[0107] Step S5: Determine whether all smart contract operations are completed to detect whether the smart contract is fully effective. If it is not fully effective, it means that the above data has not been stored and encrypted, so continue to read the sensor data for encrypted storage, and then go to step S2 to continue the data reading, encryption, and storage process. If the smart contract is effective, proceed to step S6.
[0108] Step S6: Transfer the constructed subchain to Figure 3 The blockchain layer shown completely inserts the sub-chain into the main chain to realize data storage on the main chain.
[0109] Step S7: After the main chain data is saved, the Raspberry Pi receives the message and destroys the sub-chain containing the sub-chain related detection data to free up storage space and reduce subsequent storage and computing pressure.
[0110] Step S8: The main chain broadcasts information at the blockchain layer to synchronize node information of other blockchain layers and realize distributed encrypted storage.
[0111] Step S9: Complete the encryption of storage of relevant data obtained during the cultural relics detection process.
Claims
1. A data storage method for blockchain framework design based on edge node computing, characterized in that: The following steps are involved: Step S1: Collect the measurement data of the same cultural relic from various sensors and transmit the data to various edge devices through the wireless communication module; Step S2: Use smart contracts to authenticate the identity of each edge device. If the authentication fails, the data obtained from the node cannot be saved and is considered illegal data, ending the storage process. Otherwise, go to step S3. Step S3: Encrypting the relevant sensor data stored in the edge device; The encryption operation steps of step S3 are as follows: Step S31: The input information length M bits is modulo 512, and the result is m. If m is not equal to 448, a 1 and n 0s are padded after the input information so that the result of the input information length modulo 512 after padding is equal to 448, where: The information length after padding is 512N+448bit; Step S32: Add 64 bits after the padded input information to record the length M of the information before padding; Step S33: Generate four standard magic numbers; Step S34: perform four rounds of calculations to generate a 128-bit hash value as the final encrypted value; Step S4: Build a block subchain on the edge device; The steps of constructing the block subchain in step S4 are as follows: Step S41: The block address of the previous edge device in the storage block subchain is stored so that the previous block address points to the new block address, thereby realizing the insertion of new block information; Step S42: storing the timestamp of reading and writing; Step S43: Generate a random value using the timestamp as a seed; Step S44: Using the encrypted value and the results of the above steps S41, S42, and S43 on the edge device to construct a block subchain data block; Step S5: Determine whether the smart contract is fully effective. If not, proceed to step S1 to read the sensor data for encrypted storage. If it is fully effective, proceed to the next step. Step S6: completely insert the subchain into the existing block main chain in the cloud to save the data on the main chain; Step S7: After the main chain data is saved, the sub-chain in the edge device is destroyed to release the storage space; Step S8: The main chain broadcasts information, synchronizes information of each edge device, realizes distributed storage of data, and completes the construction and storage process of the entire blockchain.
2. The data storage method for blockchain framework design based on edge node computing according to claim 1 is characterized in that: The various sensors include but are not limited to temperature sensors, humidity sensors and infrared sensors.
3. The data storage method for blockchain framework design based on edge node computing according to claim 1 is characterized in that: The four standard magic numbers of step S33 are a=(01234567) 16 , b = (89ABCDEF) 16 , c = (FEDCBA98) 16 , d = (76543210) 16 .
4. The data storage method for blockchain framework design based on edge node computing according to claim 3 is characterized in that: The loop operation steps of step S34 are as follows: Step S341: Group the input information processed in step S32, and subdivide each 512 bits into 16 groups, each group having 32 bits; Step S342: Set four linear encryption functions as follows: (1)F(X,Y,Z)=(X&Y)|((~X)&Z) (2)G(X,Y,Z)=(X&Z)|(Y&(~Z)) (3)H(X,Y,Z)=X^Y^Z (4) I(X,Y,Z)=Y^(X|(~Z)) Step S343: Use the four linear encryption functions in step S342 to perform operations on each group. The specific encryption operation process is as follows: FF(a,b,c,d,Mj,s,ti) means a=b+((a+F(b,c,d)+Mj+ti)<< <s) GG(a,b,c,d,Mj,s,ti) means a=b+((a+G(b,c,d)+Mj+ti)<< <s) HH(a,b,c,d,Mj,s,ti) means a=b+((a+H(b,c,d)+Mj+ti)<< <s) II(a,b,c,d,Mj,s,ti) means a=b+((a+I(b,c,d)+Mj+ti)<< <s) Among them, Mj and ti are constants used in the loop calculation process. The constants used in each loop are different. s is the left shift amount, and the s used in each loop is different. The calculation result is transferred to step S342 for iteration, and a total of four rounds of iterations are performed, in which the above linear encryption functions are used alternately; Step S344: The result of the iteration of step S343 is four 32-bit groups. These four groups are cascaded to generate a 128-bit hash value as the final encrypted value.
Citation Information
Patent Citations
Industrial data detection block chain network architecture based on edge computing and detection method
CN109302405A
Edge computing framework based on blockchain and trusted execution environment
CN112380578A
