Using blockchain technology in IoT manufacture environment for intelligence prediction

Blockchain technology has become more important in recent years in Internet of Things (IoT) manufacturing. Many IoT manufacturing factories have successively invested in the blockchain architecture in the system to manage the data of the IoT manufacturing system for intelligence prediction. The blockchain-based system architecture can ensure the process of data transmission and preservation. However, any node must hold complete blockchain information. When there are thousands of nodes, the cost of hard disk space for storing these data will increase drastically as the number of nodes increases. In order to solve the above problems, this paper proposed a blockchain structure to reduce the space and network transmission costs. This architecture divides the traditional blockchain into two parts, which are divided into private blockchain and public blockchain according to the edge and the cloud. Each workshop will manage its own private blockchain, and the cloud will manage itself public blockchain. Under the proposed structure, each working node only needs to maintain the blockchain at its edge node and does not need to communicate with other edge node. The experimental results can effectively intelligence predict the space cost of node expansion, and it can also avoid the unnecessary network communication overhead caused by the traditional architecture. It can improve the space used of blockchain and reduce the network transfer time, and the cost of expanding nodes can be greatly reduced.


Introduction
Industry technology is a brand-new concept in recent years. Its core concept is to connect existing industrial chains through integration, such as factory production lines, distributors, raw material supply, and physical channels. Construct a highly adaptable architecture that can flexibly allocate resources in response to various needs. Blockchain is an emerging platform for developing decentralized applications and data storage. Public blockchain platforms allow us to guarantee these properties with overwhelming probabilities even when untrusted users are participants of distributed applications. Even though blockchain technology has become popularly known because of its use in the implementation of Cryptocurrencies such as Bitcoin. In this architecture, artificial intelligence can realize self-assessment and demand analysis. Upstream and downstream industries can communicate closely with each other and can adjust the production line of the factory according to different customized orders at any time, as well as automated order distribution and raw materials (Lavanya et al. 2018).
With the increasing awareness of data security, blockchain technology (Singhal et al. 2018;Zhang et al. 2018) has attracted a lot of public attention in recent years. From financial services, media and telecommunications, healthcare to transportation, blockchain has been added. One of the most well-known blockchain applications is Bitcoin. Since Bitcoin became popular globally in 2017, many people have begun to notice the potential and advantages of blockchain technology. Many countries compete with Communicated by Mu-Yen Chen.
& Yuqiang Chen chenyuqiang@126.com enterprises to invest technology and funds into the development of blockchain. Of course, there is a reason for the rise of the blockchain. Take Bitcoin as an example. In the traditional gold flow, it is inevitable for any transaction to pass through financial institutions such as banks. Bitcoin through the cryptography-based blockchain architecture and consensus mechanism (Vujicie et al. 2018) realizes the decentration of the account data transaction and storage technology, so that the transaction does not need to pass the authentication of any center . It can be established successfully by breaking the centralized structure of traditional cash flow transactions and creating a new safe transaction method. Through its core decentralization mechanism and anti-tampering technology of data, blockchain has gradually been applied to various applications in recent years. In addition to the innovation of blockchain in the cash flow industry, the relationship between blockchain and the Internet of Things (IoT) has also become closer year by year. Many properties of blockchain are quite compatible with IoT applications (Teslya et al. 2018;Wu et al. 2018;Banerjee et al. 2018), for example, the distributed architecture of the blockchain requires IoT devices and IoT devices to communicate directly with each other, without the need for coordination or service through a central incoming device. Therefore, each device can directly communicate with each other and establish synchronization records by itself, while maintaining data consistency and tampering prevention. Blockchain is equivalent to stimulating the potential of IoT itself and increasing the industrial environment scalability. The architecture of edge computing is already a mature technology today. It is already used in many industrial IoT systems to manage the production line in the factory by establishing a cluster of small edge servers located in the factory. In the factory, the current status of the production line equipment and the information of the produced products will be sent to the edge of the factory via the IoT sensors on the production line, and the edge will perform the management and abnormality judgment of the factory (Fernandez et al. 2019). At the same time, the edge is also responsible for sending historical information to the cloud, so that the cloud can also have the information on the edge, and the cloud can also manage and maintain the edge.
However, with the increasing trend of the introduction of such smart factories in the manufacturing industry, the subsequent issue is the security of information in the factory (Fernandez et al. 2019). To compute the decisionmaker estimations in a more flexile and affluent way, as well as improve the reliability of the decisions that depends on star ratings or grades for the purpose of the modelization of decision-making problems in medical field Adeel et al. 2020Adeel et al. , 2019. In recent years, there have been frequent incidents of industrial espionage intrusions in factories. Once the servers are invaded, the information of the products in the factory is likely to be easily stolen or tampered with. This will endanger the intellectual property rights of the company and cause serious damage to the company money loss. Therefore, there is an existing design architecture that combines the blockchain architecture with the industrial Internet of Things. In the blockchain, information is packaged into blocks and connected in series, and verified by the blockchain itself. The mechanism can ensure that the block is absolutely not forged or modified, and all information and blocks on the chain will be maintained and verified by all nodes to be maliciously modified or sent by mistake. In addition, the blockchain architecture can also reduce the failure and loss caused by the invasion of important cluster servers through a decentralized distributed architecture (Chen et al. 2021c(Chen et al. , 2020. Although the blockchain architecture itself can effectively reduce the losses caused by data theft or node failures, due to the decentralized architecture of the blockchain itself, all nodes must hold a block of the complete blockchain in order to perform the district. According to the rules of traditional blockchain, a block must be verified as legal and must be verified by more than 50% of the nodes before it can be legally added to the blockchain. For the propagation between nodes, when the number of nodes is extremely large, the propagation speed of the block will therefore decrease, and the processing speed of the block will be slowed down, and a large amount of bandwidth will be used for the propagation of the block. Taking into account the data flow in the industrial IoT environment, the generation of blocks will be more frequent than when the blockchain is used for gold flow transactions. On the contrary, the edge computing architecture will cause enterprises to bear more hardware costs and performance issues when expanding more factory node (Barenji et al. 2020).
Since the use of traditional blockchain in the industrial Internet of Things may cause some intangible cost and efficiency issues, this research attempts to propose a hierarchical blockchain architecture. Under this architecture, it is no longer the nodes in all edge servers to jointly maintain the entire blockchain, but instead each edge server has its own private blockchain independently. There will be no interference from the other party's private blockchain. Each edge server will only be responsible for its own private blockchain. In the cloud, there will be a public blockchain. All edge servers will regularly push the blocks to the cloud, and this blockchain will store all the blocks from different edge servers. Through this design, this research attempts to reduce the communication cost between nodes in different edge servers, so as to reduce the transmission time and the purpose. At the same time, under the hierarchical blockchain, each private blockchain only has edge server is used for storage, so only a small number of edge nodes are needed to store the blockchain information, which improves the design method that consumes a lot of storage space in the original distributed architecture. Through the above methods, industrial IoT manufacturers can adopt the blockchain architecture while avoiding the costs caused by the expansion of edge servers or node expansion. This paper has five sections. Sect. 1 is the introduction, which will explain the research background, research motivation and research purpose, and also summarize the improvement of the traditional methods. Sect. 2 is the analysis of related technologies and literature discussion. Sect. 3 will explain the system architecture and compare the differences with the traditional architecture, as well as improvements and features. Sect. 4 will conduct experimental tests. It will compare the results of the traditional architecture and the architecture under the simulation of the industrial IoT environment data flow. Section 5 will summarize this paper. It will explain the contributions, future work and limitation.
2 Literature review

Blockchain
Blockchain is a decentralized information storage technology that protects and stores data based on the credibility of cryptography. Among them, the most famous application of the blockchain is Bitcoin. Bitcoin may be used as an example for theoretical and explanation. In the blockchain architecture, there is only one blockchain, which is formed by connecting countless blocks. In each block, there is a part called transaction, which represents the data contained in this block. Taking Bitcoin as an example, transaction records represent the records of Bitcoin transferred from user A to user B. Transaction records can have different data storage content with different applications (Chen et al. 2021a(Chen et al. , 2021b. The method of concatenation between blocks is to concatenate blocks one by one by enclosing the hash value of the previous block in each block. In other words, a blockchain is a data chain composed of multiple blocks, as shown in Fig. 1.

Block data structure
A block can be divided into two parts: a block header and a block body containing transaction data. The block body is usually a list of all transaction records, which is responsible for saving in the blockchain. In the data field, the number of transaction records in a block is not fixed. In terms of Bitcoin, in fact, there will be an average of 3-500 transactions in a block, which records all actual money transaction information. There are three types of metadata in the block header. When verifying the block, you only need to check the block header to complete the verification. The three original materials are shown in Fig. 1: (1) The data of its own hash value and the hash of previous block header.
(2) Timestamp, the random number of the proof of work algorithm and the difficulty target of the proof of work algorithm. (3) The transaction records in the current block will use the Merkle tree to calculate the hash value of each transaction data, and the block header will store the hash value of the Merkle tree root.
When each new block is generated, the current last block of the blockchain will be used as the parent block of the newly generated block, and its hash value will be recorded in the newly generated block, and its own block header All the fields in will also be connected and hashed to calculate the hash value of its own block header and add it to the end of the blockchain. By analogy, when the next new block is generated, it is also necessary to record the hash value of the current end block before it can be added to the blockchain. The reason why the blockchain is known for its high reliability is that it uses the basis of cryptography to protect data. As mentioned above, the block will save the hash data of the previous block. The hash is a way to calculate the data. The fingerprint method, which means that different data will get different hash values, so each block will have its own unique hash value . Blockchain uses this feature to protect data, which means that if the transaction information of one of the blocks is falsified, the hash value of the block will change together, because each block is above hash data of each block is concatenated (Liu et al. 2020a. If the hash data of one of the blocks does not match or has been maliciously modified, it can be easily verified. In addition to recording the time stamp when the block is generated, the block header requires a consensus mechanism in Bitcoin to determine who will process the block through proof of work or mining competition. Therefore, random storage is required. Finally, the block header will store the hash data of all transactions. This hash value is the root of the hash tree calculated by the hash tree algorithm (Angrish et al. 2018).
At present, the common hash algorithm used in blockchain is SHA-256 (secured hash algorithm 256). SHA-256 is a single function, given an input value and a result will be obtained. The blockchain uses decentralized information storage technology to store information. The entire blockchain is jointly maintained by many nodes. The method of verification is that 50% of the nodes have verified to be a legal zone. Blocks, only blocks that have passed legal verification, can be added to the blockchain. Since the blockchain needs to be maintained by all nodes, each node needs to maintain the information of the entire blockchain. Take Bitcoin as an example. When you use Bitcoin for the first time, you must download the entire Bitcoin blockchain to your computer before you can participate in the maintenance and use of the blockchain network. Each node maintains blockchain information, which also ensures that the data will not disappear due to partial node failures (AI-Jaroodj et al. 2019).

Types of blockchain
In the current environment, blockchains can be roughly divided into three types based on their functions and permissions, namely public blockchain, consortium blockchain, and private blockchain. The public chain is the most traditional blockchain. In the initial application of blockchain, Bitcoin is a public chain. Its nature is public as its name implies, which means that all information in its blockchain is public. Similarly, any information in the block is also jointly maintained by everyone. Under this structure, no node has higher power than other nodes. All behaviors on the blockchain are determined through a consensus mechanism. This decentralized mechanism is also one of the reasons for the flourishing of the blockchain . Of course, in some environments, it is not hoped that the information of the blockchain can be accessed by anyone at will. At this time, the alliance chain and the private chain are produced. In the alliance chain, only people or groups specially selected in advance can participate in the consensus mechanism. A private chain is a chain with more restricted permissions, in which only the specified nodes can participate in the consensus decision, which makes the blockchain better controlled (Yin et al. 2018).
A Merkle tree is a tree data structure. It only stores the hash value of the data at the leaf nodes. In the case of the blockchain, it will calculate the hash of all transaction content separately after the value, it is stored in the leaf node; the hash value of the non-leaf node is obtained by concatenating the hash values of other child nodes and calculating the hash. The blockchain will first calculate the hash value of all transactions and store it in the leaf node. Since the blockchain is usually a binary hash tree, the hash value of the leaf node will be connected in pairs, and calculate the hash value. The result obtained is the hash value of the parent node. The parent node remaining after repeating the above actions is the Merkle tree root, because this root node passes all the leaf nodes are obtained layer by layer, so as long as the data of any leaf node is modified or does not match the actual data, it will be easily identified.
In the theory, even if you do not use a tree structure and just concatenate all the transaction records together to hash the hash value, you can still distinguish the transaction Fig. 1 The detailed data structure of blockchain records, but you need to pay more for verification. The advantage of using the hash tree structure is that when verifying the legitimacy of the leaf nodes, it only needs to verify a few of them to complete the verification.

Blockchain fork
The consensus proof algorithm; one is to reduce the risk of block tampering or forgery, the other is to reduce the probability of blocks being generated at the same time and added to the end of the blockchain. Due to the characteristics of consensus proof, even if there are many nodes, the probability of calculating a legal random number at the same time is very low. However, sometimes it happens that two blocks are generated at the same time, and the last block is regarded as the parent block at the same time. In this case, it will fork, since when a node generates a block, the transaction information contained in it is broadcasted by neighboring nodes. So, the transaction information contained in the block generated by different nodes will also be different, which means when two blocks are generated at the same time, these two blocks will have the same transaction data at the same time and are legal blocks at the same time, resulting in repeated additions of transactions. According to the basic principles and security of the blockchain, it is not allowed to have sidechains under normal operation conditions. At this time, the blockchain will usually adopt the longest chain principle to deal with (Kurpjuweit et al. 2019).

The longest chain principle
Since the network has a delay in communication in the actual environment, different nodes receive these two blocks in a sequential order, and when a node generates a new block, it tends to receive the first one blocks are connected. So after a period of time, there will always be one branch chain that is longer than the other. At this time, the shorter chain will be discarded according to the longest chain principle, as shown in Fig. 2, and the longest chain as the main chain continues to extend. At this time, the discarded branch chain transactions must be recalculated by each node and packaged into blocks before they can be recorded in the blockchain again. Take Bitcoin as an example, Bitcoin takes a long time to verify transactions. One of the reasons is to wait for the block where the transaction itself is located on the longest chain in the blockchain. Usually, it will wait for about six blocks to be connected. Make sure that your block is not in the short chain, then the transaction can be considered as successful.

Review of research
The method of applying blockchain technology to the edge computing environment is introduced. This paper focuses on the blockchain application of mobile devices and edge computing devices. At the same time, it provides a relatively basic architecture model. Deep learning is used to improve the resource allocation and communication between mobile devices and edge computing, and to improve communication efficiency. It points out that communication traffic is a major cost in the edge computing environment. This shortcoming of blockchain temporarily stores blocks instead of directly syncing to the cloud was proposed. It solves the problem of traffic overload that blockchain may face in the industrial IoT environment and uses edge terminals. The network temporarily stores the generated information and transfers the block to the cloud for storage until the traffic permits. This architecture provides the idea of a hierarchical blockchain Xiong et al. 2021). Compared with the former, our paper will focus on space utilization and node cost.

Architecture definition
Since the proposed paper is a system designed specifically for the edge computing IoT environment of the blockchain architecture, we define the architecture diagram of traditional edge computing first and then define the architecture that blockchain computing is applied to. First, the architecture diagram of the traditional edge computing system, which is divided into the cloud and the edge. Here, it is assumed that each factory is an edge computing unit. Each edge end contains all the machines in the factory and multiple working nodes that can perform calculation processing. The machine will periodically generate product information and the status data of the machine itself during product production. These data will device of the Internet of Things are passed to the working nodes in the factory, and these nodes can store and process the data. The cloud can communicate with each edge node and obtain information about a specific machine. If necessary, the cloud can also implement operations on a specific machine. Blockchain is essentially a decentralized storage technology. It stores data in blocks by means of blocks and connects each block in a concatenated manner. In Fig. 3, we define the traditional area blockchain technology uses the architecture diagram of the edge computing system. Each edge server represents a factory. In the blockchain architecture, every working node in the factory will be added to the maintenance of the blockchain, and every work in the cloud nodes will also join the maintenance of the blockchain, which means that all nodes can see and maintain the information on the blockchain, and all nodes will save the complete information of the blockchain. If any node tries to tamper with or lose the block Information can be corrected by other nodes immediately. And the machines in each factory will also generate data, which will be processed by the nodes in the factory and then packaged into newly generated blocks and synchronized to the blockchain. Since the information of the blockchain is shared and maintained by everyone at the same time, no matter whether the node is located in the cloud or on the edge after the block is updated, the latest block can be held.
In Fig. 3, it demos the architecture of the current blockchain technology applied to the edge computing environment. Under the architecture, all nodes maintain the blockchain. According to the nature of the blockchain, this architecture can indeed provide good protection and tampering protection function. However, due to the nature of the blockchain itself, in order for any node to participate in the maintenance of the blockchain, the node must download the complete information of the blockchain, which will not cause any problems in the short term, but as time evolves, it uses space will increase rapidly, which leads to any node must have enough hardware space, otherwise it will not be able to maintain the blockchain and add new blocks. At the same time, when the manufacturer decides to expand a new edge computing terminal, since new nodes must also join the maintenance of the blockchain and have complete blockchain information, as the length of the blockchain increases, and the new cost of adding new edge computing units will also be increased. In addition to some shortcomings in hardware cost, it is mentioned that after a block is successfully packaged and added to the blockchain, it must be authenticated by more than 45% of the nodes before it can be recognized as a legal block. Since all nodes maintain the blockchain at the same time, this means that at least half of the working nodes must pass authentication before a block is successfully added to the blockchain. This will happen when there are many factory nodes. This leads to serious efficiency problems. At the same time, broadcasting this block to other nodes will also cause a lot of network resource consumption, which is a relatively serious problem for the factory environment. The architecture of traditional blockchains applied to edge computing environments and pointed out some of the shortcomings that may occur. Therefore, this paper proposed a system architecture that can optimize the efficiency of blockchain technology in edge computing environments and space usage. It will first explain the architecture of the system and the environment configuration of the built system, and explain the details of the different modules one by one, and finally explain the operation process of the overall system as Fig. 4. Figure 4 is the system architecture proposed in this paper. It is an improvement of the system in Fig. 3. This architecture uses hierarchical blockchain technology. The purpose is to reduce some space and time efficiency problems.

Hierarchical architecture description
The hierarchical blockchain architecture is that all nodes jointly maintain the only blockchain. All management and block additions are shared by all nodes. The proposed hierarchical blockchain architecture that each edge computing unit independently has its own blockchain. Here, we refer to each edge unit's own private blockchain as a private chain, and the cloud itself holds a public chain. Taking Fig. 4 as an example, there are three edge private chains and one cloud public chain. The private chain means that its blocks can only be maintained and controlled by specific nodes. Under this architecture, each edge unit can only access the private chain of its own edge unit and cannot access the private chain of other edge units. It means that the edge units are completely independent, while the cloud holds a public chain. Although it is called a public chain, it does not mean that nodes on other edge units need to participate in the maintenance of the blockchain. Only the cloud is involved in the maintenance of this chain. The reason why it is called a public chain, because the blockchain holds all the blocks at the edge. In this method, all blocks on the edge private chain will eventually be synchronized to the public chain in the cloud. It will describe the module functions of each working node and the process of synchronizing blocks in detail below, as shown in Fig. 5.

System module
The difference between the responsibilities of the edge work node and the cloud work node is shown in Fig. 5 . The following will start with the introduction of the module of the edge-end working node, and at the end explain the difference in behavior between the cloud-end working node and the edge-end working node.
• Raw Data Generator: In order to simulate the process of actual factory data generation, a raw data generation module is set in each edge working node. This module will periodically generate raw data. The content includes various status messages of production line machines, product process information, time stamps, and other information. This module will send the generated raw data to the raw data receiving module. • Raw Data Receiver: Raw Data Sender: These two modules belong to the Raw Data Interface. The raw data receiving module will receive the raw data generated. The original data of the module and the received data are transferred to the original data conversion module for conversion. In this system, all data should be saved in the form of blocks, so all the original data will be parsed in the original data conversion module and converted into the form of transactions, and packaged into a block, and these blocks will be sent to the block receiving module . • Block Receiver, Block Synchronizer: These two modules are collectively called block interface, where the block receiving module will receive the original data conversion module packaged. The block is completed, and it is verified and hashed. The transaction in each block will be checked to ensure that it has not undergone any tampering. After confirming that the block is correct and is a legal block, the block will be synchronized to other nodes through the block synchronization module. The synchronization will prioritize the synchronization to the working node of the same edge. Try to keep all nodes on the edge side holding the same block information. At the same time, the block synchronization module will synchronize the older block to the cloud block interface and send. The block receiving module accepts the received old blocks. The cloud block synchronization module and the block receiving module have roughly the same functions as those on the edge, but the synchronization range of the synchronization module is limited to the cloud. The other working nodes do not include the edge nodes. After being accepted by the block receiving module, the private blockchain and public blockchain will be stored in the hard disk of the working node in the form of blocks at the same edge in the end, all the working nodes will hold the private blockchain information at the edge end at the same time. This enables this architecture to prevent data tampering, and also achieve the effect of redundant backup, ensuring that information will not be lost. Dividing blocks into edge private chains and cloud public chains is the main feature.

Block synchronization mechanism
The private chain block synchronization method of a single edge is shown in Fig. 6. Figure 6 depicts that the original data are first generated from the factory machine and then passed through the component named data interface. Right after the original data are preprocessed, it is packaged into a new block and broadcast to each working node . The worker responsible for packaging is determined through a consensus mechanism. Because of the industrial environment, consensus mechanisms such as workload proof are not suitable for this. Therefore, the method of holding proof is used to determine who is responsible for this packaging. Each worker node holds and maintains private blockchain, and it can only be accessed by the worker nodes on the edge. After that, monitor the private chain through the Block Synchronizer and synchronize the old block generated earlier to the public chain in the cloud. This action will occur at every edge, so the cloud, the order of blocks received by the public chain is not fixed. In the end, the public chain in the cloud will hold all the blocks at the edge, and the edge will only save the blocks it generates.

Architecture characteristics
The advantages and disadvantages of the architecture compared to the traditional architecture as Table 1. The difference between the traditional method and the proposed method is compared in Table 1. In this architecture, one of the biggest differences between the traditional method and the proposed method is the number of blockchains. This architecture divides the blockchain into different independent blockchains by taking the edge and the cloud as the unit. The most obvious improvement under this architecture is the use of storage space. Under the traditional blockchain, all nodes must maintain a single blockchain, and this blockchain must store all received data. In this case, the data generated by each edge will be stored in the same blockchain, and each node must bear its storage cost. After the blockchain is divided by this architecture, each edge only saves itself edge.
The generated blocks do not interfere with each other at the edges, which improves the aforementioned space usage problem. Since the only cloud holding all blockchain information, storage costs will become controllable and will not increase due to the number of edge nodes. Moreover, because the edge terminals do not interfere with each other, the coupling degree of the system is also improved, and there is no need to communicate with other edge terminals, the bandwidth cost and processing delay are also reduced. The proposed architecture is not only the  Using blockchain technology in IoT manufacture environment for intelligence… 1723 improvement in space, but also can reduce the cost of node expansion. Under the traditional architecture, whenever a new node is expanded, the new node must synchronize the existing block information and maintain it together. This leads to the number of nodes increases, the space cost will also increase significantly, which seriously affects the cost of manufacturers to expand new edge terminals. With this system architecture, the new node does not need to store the old blockchain information, because each edge terminal is independent, so the newly created edge terminal does not need to synchronize the old block, but only needs to maintain itself. The information generated is sufficient, so the cost of expanding nodes can be greatly reduced. Compared with the above advantages, these efficiency and cost advantages are achieved through the reduction of security. Since the traditional blockchain is maintained by all nodes, it is very difficult to tamper with the information of any node. It is difficult, but after changing the layered architecture proposed, since the number of nodes maintained by each blockchain is reduced, the risk of tampering will also be relatively higher.

System configuration
The tools used to develop this architecture system and the method of setting up the environment . Refer to the diagram for the process. First of all, because this framework needs to simulate the situation in the edge computing environment, it is inevitable to use virtual machines as an alternative when there are insufficient physical machines. The hardware virtualization software uses VMware workstation. It allows users can create and execute multiple virtual machines at the same time, and each virtual machine can execute its installed operating system. The virtual machines set the resources to be allocated to each virtual machine and then install the OS system in sequence. After the installation is completed, because the communication between virtual machines in the experimental environment is necessary, the network interface card of each virtual machine must be set before use. After setting the bridge interface card for each machine, each machine can have an independent IP under the local network and can communicate with each other, simply use the built-in Linux command to test.

Experimental test
In order to really analyze and test the performance comparison between the proposed architecture and traditional methods, we will build a simulated edge environment and the hardware devices. The following experiments are performed by a total of ten virtual machines and are divided into three edge ends according to the different physical machines: Edge1, Edge2, and Edge3. All nodes except the virtual machine cloud work as working nodes and only maintain their own private blockchain. The virtual machine cloud is responsible for the processing of the cloud and is responsible for receiving blocks from each edge. Among them, the virtual machine Edge11, the virtual machine Edge21, and the virtual machine Edge31 not only serve as the work node, but are also responsible for simulating the behavior of the factory machine, responsible for the generation of raw data and outputting the data to the work node on the edge of its own.

Test items
The performance comparison between traditional blockchain architecture and hierarchical blockchain architecture is given as follows: • The original data are generated by the virtual machine Edge11, the virtual machine Edge21, and the virtual machine Edge31, and other virtual machines serve as working nodes. These data will be converted into blocks by each working node and saved in the form of blockchain, and finally stored on the hard disk. This experiment will analyze the comparison of the hard disk space consumed by the traditional method and the proposed method as the total amount of processed data increases. • The original data are generated by the virtual machine Edge11, the virtual machine Edge21, and the virtual machine Edge31, and other virtual machines serve as working nodes. After receiving sufficient data, these data will be packaged into blocks by each working node and broadcast to other working nodes. Since the nodes are fully connected in the traditional method, the proposed method is to take each edge terminal as private. Therefore, this experiment will analyze the number of attempts to broadcast to other nodes. • The original data are generated by the virtual machine Edge11, the virtual machine Edge21, and the virtual machine Edge31, and other virtual machines serve as working nodes. This experiment sets the variable as the number of transactions that can be recorded in each block and analyzes the speed difference between the traditional method and the proposed method under different transaction numbers.

Comparison of hard disk space consumption
The explains why the traditional blockchain consumes a large amount of hard disk resources in a multi-node environment, which all nodes in the traditional blockchain must hold block information, resulting in a large number of hard disks occupied . The hierarchical structure proposed is shown in Fig. 7. Since each edge end only needs to maintain its own blockchain, compared to the traditional architecture, only the cloud must hold all blockchain information, so it can significantly reduce the space occupation of the block. The comparison of space occupancy under quantitative data. First, the quantitative data will be generated by the data generation nodes: virtual machine Edge11, virtual machine Edge21, and virtual machine Edge31. The transaction list size of the block tested in this experiment is 1024, which means that a block can store 1024 pieces of data. After that, the total amount of data generated by each data generating node is 200, 300, 400, 500 and 600 blocks of data. These data will be received by each working node and converted into blocks. In addition, the data generating node will only send data to the working nodes at the same edge, that is, the virtual machine Edge11 will only send data to the virtual machine Edge11, virtual machine Edge12, and virtual machine Edge13. After completing the data generation and synchronization of all blocks, compare the space usage in the two methods. In order to analyze the resource usage under different architectures, this experiment uses functions in the Java language to obtain the target blockchain and the space used by the block. Since there is no method to obtain the actual size of the object in the native methods of the Java language, this article uses the external library java-sizeof to obtain the size of the blockchain object. Fig. 8 shows the comparison of space under different amounts of data . It can be found that the proposed architecture is superior to the traditional architecture for spatial optimization, the data at each edge are isolated by using a hierarchical blockchain architecture. It can reduce the space problem of rapid expansion due to the increase of nodes in the traditional method.
When there are more edge ends, it can save more space consumption. The reason is that the hierarchical structure will cut the original data more finely due to the increase of edge ends, and share it evenly among each edge end. And each edge end only needs to maintain its own data, so it can be more efficient than traditional methods that have to maintain all data. The experiment total data volume range is constant, all are 100 blocks range, and all edge ends are three working nodes. Because of the limited number of machines, only 2, 4, 6 edge-end conditions were initially tested. First of all, the situation where there is only one edge is the same as the traditional method. After gradually increasing the edge, a significant reduction in space consumption. Therefore, this method can effectively reduce the space cost that enterprises need to a large-scale industrial IoT environment.

Comparison of data volume and transmission time
The different architectures to complete block synchronization and transmission under quantitative data as Fig. 7. First, the virtual machine Edge11, the virtual machine Edge21, and the virtual machine Edge31 are also used to generate the original data. Under the two architectures, the original data will be packaged into blocks by each node and broadcast to the other nodes. In the next experiment, this article will Fig. 7 Hierarchical blockchain improves space occupation Using blockchain technology in IoT manufacture environment for intelligence… 1725 distinguish the system architecture strategy used by the nodes by code names. The nodes using traditional methods are NodeA1 to NodeA9 in cloud A, and the nodes using the hierarchical architecture are NodeB1 to NodeB9 in cloud B.
Corresponding time cost must be spent in the process. The count of the time spent and the transmission time of each node, each edge end and the cloud as Fig. 9.
In the traditional architecture, it can be observed that as the amount of data increases, the amount of transmission spent will increase by the same amount, and the hierarchical architecture can reduce the transmission time by a certain amount compared with the traditional architecture. The reason is that the nature of the blockchain itself. When the blockchain is broadcasting, the block must be synchronized to all nearby nodes. At the same time, the block needs to be broadcast to half of the nodes to receive and verify that it is correct before it can be added to the blockchain. This means that if the area is maintained more nodes in the blockchain, the longer the verification time will be spent. In this experiment, since the private chains are segmented, and each private chain is maintained by only three nodes, this means that each time a block is synchronized, it only needs to broadcast the block to the other two nodes. On the contrary, in the traditional architecture, all nodes need to know each other, so in the experiment, any node will need to broadcast the block to the other eight nodes and the cloud when broadcasting, which is a more transmission than the hierarchical blockchain. The hierarchical blockchain avoids some communication costs through the hierarchical structure and reduces the time cost of verification.
In order to compare the difference in transmission time more clearly, this architecture method is better than the traditional method. The transmission difference between each edge end, basically the reason for the result is the same as described above. Figure 9 shows the time it takes for the cloud node to receive the last block. In the experiment, the cloud is only the recipient of the final block, and there is no further calculation optimization.
In addition to analyzing the impact of the number of blocks in time, we also experimented with the impact of different block transaction list sizes on time under the constant number of blocks. In the experiment, the time spent under different block transaction list lengths is tested by fixing the number of blocks range to 100 blocks. The difference is that the time saving effect is slightly reduced. The reason is that the optimization and improvement of the processing time of this architecture lies in the number of blocks. When changing, therefore, the number of blocks does not significantly affect the time gap as Fig. 10.

Comparison of communication times
In IoT environment, bandwidth is also a very tightly resource. Most of the bandwidth in many factories is used for equipment communication and data transmission. Therefore, a system architecture has a good bandwidth usage architecture is worth considering. To monitor the nodes of different architectures and observe their behavior during regional synchronization, and analyze whether the architecture is a bandwidth-friendly system is important.
The system architecture is to analyze the number of times that the work node communicates with other work nodes in different areas. The results of the experiment are shown in Fig. 11. It shows that the architecture can basically retain a relatively small number of communications. The reason is the hierarchical architecture system has private chain, each time the node that communicate is only itself. But the traditional architecture must synchronize blocks with the other eight nodes and the cloud. This is not a bandwidthfriendly behavior. In fact, the block synchronization performed in the experiment may not need to add a new block, because when its node receives the broadcast already holds the block, and the newly received block will be discarded immediately. It can be seen that when there are more nodes, more blocks will actually be broadcast, but they are actually nodes that do not need to be synchronized, resulting in bandwidth waste. By dividing and privatizing the blockchain, bandwidth waste can be effectively reduced.

Conclusion
Through the reliability of cryptography, blockchain technology provides a more reliable choice for today's data storage solutions. At the same time, due to the characteristics of using P2P network communication, it can also be used as a secure distributed storage of data lib. This paper proposed a hierarchical blockchain technology architecture based on the viewpoint of industrial security and reduce cost. The experimental results can effectively intelligence predict the space cost of node expansion, and it can also avoid the unnecessary network communication overhead caused by the traditional architecture. It can improve the space used of blockchain and reduce the network transfer time, and the cost of expanding nodes can be greatly reduced. The contribution of this paper is as follows: 1. It optimized the existing blockchain system to make it more suitable for practical industrial IoT applications. 2. The hierarchical architecture uses private chains to separate different industrial IoT environments, which not only improves the overall system manageability and reliability of the blockchain, but also improves the shortcomings of the traditional blockchain, such as the massive consumption of space, the slowdown in processing speed caused by multiple nodes . 3. The hierarchical structure can increase the operating efficiency of the overall system and reduces the transmission cost. 4. In the proposed hierarchical architecture, the new node does not need to store the old blockchain information, because each edge terminal is independent, so the newly created edge terminal does not need to synchronize the old block, so the cost of expanding nodes can be greatly reduced .
For future work, blockchain as an emerging technology may still have many immaturities. In the face of actual industrial and business networking applications, it still needs to be discussed regarding the completeness of the system architecture. The limitation lacks a set of consensus mechanism algorithms suitable for industrial and business networking, it is also limited to a certain degree in transaction processing speed.