Blockchain network configuration method, apparatus, device, medium, and program product
By reading dynamic hash tables and building container nodes in the blockchain network, the problems of insufficient storage capacity and slow deployment speed of existing blockchain systems are solved, enabling rapid deployment and flexible configuration of multi-role nodes, thus expanding application scenarios.
Patent Information
- Application Number
- CN202411020346.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing multi-node blockchain systems cannot handle large-scale storage loads, have slow node program startup and deployment speeds, cannot support one-click deployment of large-scale nodes, and have limited application scenarios.
By reading the dynamic hash table, calling the container image and dynamic hash table configuration script file, container nodes are built and linked to the blockchain synchronization node, forming a blockchain network with multiple roles and large-scale nodes.
It enables rapid startup and deployment of blockchain networks, supports large-scale node configuration with multiple roles, and broadens the application scenarios of blockchain networks.
Smart Images

Figure CN118869465B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of blockchains, and particularly relates to a blockchain network configuration method and device, equipment, a computer storage medium and a computer program product. BACKGROUND
[0002] The blockchain technology is widely applied in various fields due to its unique advantages such as decentralization and information non-tamperability.
[0003] A multi-node type blockchain system is a relatively common node type scheme of a blockchain system. In the multi-node type blockchain system, nodes are divided into consensus nodes, synchronization nodes and light nodes. Since the node types and the cooperation relationship of each node are relatively simple, the existing multi-node type blockchain system cannot undertake a large-load storage function and cannot complete super-large-scale data encryption storage, resulting in a relatively single application scenario. SUMMARY
[0004] The embodiments of the application provide a blockchain network configuration method, device, equipment, computer storage medium and computer program product, which can support one-key deployment of a multi-role and large-scale node blockchain network.
[0005] In a first aspect, the embodiments of the application provide a blockchain network configuration method, comprising:
[0006] reading a dynamic hash table, the dynamic hash table comprising a plurality of target items, each target item comprising a node role hash value and a script file pointer, the node role hash value comprising a role code, and the script file pointer being used to represent a mapping relationship between the node role hash value and a dynamic hash table configuration script file;
[0007] for each target item, calling a container image corresponding to the role code of the target item and a dynamic hash table configuration script file corresponding to the script file pointer;
[0008] constructing a container node using the container image corresponding to the target item and the dynamic hash table configuration script file;
[0009] linking a plurality of container nodes corresponding to a plurality of target items to a blockchain synchronization node to obtain a blockchain network.
[0010] In an optional implementation, before reading the preset dynamic hash table, the method further comprises:
[0011] obtaining a preset dynamic hash table configuration script file, the preset dynamic hash table configuration script file comprising a role field and a configuration field corresponding to the role field;
[0012] determining a target role code corresponding to the preset dynamic hash table configuration script file based on the role field;
[0013] According to the target role code and the preset dynamic hash table configuration script file, a target item corresponding to the preset dynamic hash table configuration script file is generated in the preset dynamic hash table.
[0014] In an optional embodiment, the node role hash value further includes a script hash value corresponding to the dynamic hash table configuration script file.
[0015] According to the target role code and the preset dynamic hash table configuration script file, a target item corresponding to the preset dynamic hash table configuration script file is generated in the preset dynamic hash table.
[0016] The preset dynamic hash table configuration script file is converted into a data set through a block dynamic hash table construction technology.
[0017] The data set is converted through a secure hash algorithm to obtain a target script hash value corresponding to the preset dynamic hash table configuration script file.
[0018] The target role code and the target script hash value are combined to obtain a target node role hash value corresponding to the preset dynamic hash table configuration script file.
[0019] Based on a mapping relationship between the target node role hash value and the preset dynamic hash table configuration script file, a target script file pointer corresponding to the preset dynamic hash table configuration script file is generated.
[0020] The target node role hash value and the target script file pointer are combined to generate a target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table.
[0021] In an optional embodiment, after the plurality of container nodes corresponding to the plurality of target items are linked to the blockchain synchronization node, the method further includes:
[0022] According to the role codes of the plurality of target items, the plurality of container nodes are divided to obtain a plurality of clusters of different roles.
[0023] In an optional embodiment, after the container image and the dynamic hash table configuration script file corresponding to the target item are used to construct the container node, the method further includes:
[0024] The plurality of container nodes corresponding to the plurality of target items are combined to obtain a blockchain network role tree, and the plurality of container nodes corresponding to the plurality of target items include a pre-packaging stage one container node, a pre-packaging stage container node, a sector submission stage one container node, a sector submission stage two container node, a storage container node, an order processing container node, an order packaging container node, a window space-time proof container node, a winning space-time proof container node, a block space-time proof container node, and a blockchain synchronization container node.
[0025] In an optional implementation, after the plurality of container nodes corresponding to the plurality of target items are linked to the blockchain synchronization node to obtain the blockchain network, the method further comprises: reading a newly added target item in the dynamic hash table, the newly added target item including a target item generated after a preset time;
[0026] calling a target container image corresponding to a role code of the newly added target item, and a newly added dynamic hash table configuration script file corresponding to a script file pointer of the newly added target item;
[0027] constructing a container node using the target container image corresponding to the newly added target item and the newly added dynamic hash table configuration script file;
[0028] linking the container node corresponding to the newly added target item to the blockchain synchronization node.
[0029] In a second aspect, an embodiment of the present application provides a blockchain network configuration apparatus, comprising:
[0030] a reading module configured to read a dynamic hash table, the dynamic hash table including a plurality of target items, each target item including a node role hash value and a script file pointer, the node role hash value including a role code, and the script file pointer being used to indicate a mapping relationship between the node role hash value and a dynamic hash table configuration script file;
[0031] a calling module configured to, for each target item, call a container image corresponding to a role code of the target item and a dynamic hash table configuration script file corresponding to a script file pointer of the target item;
[0032] a constructing module configured to construct a container node using a container image corresponding to the target item and a dynamic hash table configuration script file;
[0033] a linking module configured to link a plurality of container nodes corresponding to a plurality of target items to a blockchain synchronization node to obtain a blockchain network.
[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing computer program instructions;
[0035] The processor, when executing the computer program instructions, implements the blockchain network configuration method according to any optional implementation of the first aspect of the present application.
[0036] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing computer program instructions, the computer program instructions, when executed by a processor, implementing the blockchain network configuration method according to any optional implementation of the first aspect of the present application.
[0037] In a fifth aspect, an embodiment of the present application provides a computer program product. Instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the method for configuring a blockchain network according to any optional implementation manner of the first aspect of the present application.
[0038] The method and apparatus for configuring a blockchain network, the device, the computer storage medium, and the computer program product provided in the embodiments of the present application can read a dynamic hash table, the dynamic hash table including a plurality of target items, each target item including a node role hash value and a script file pointer, the node role hash value including a role code, and the script file pointer being used to represent a mapping relationship between the node role hash value and a dynamic hash table configuration script file. Then, for each target item, a container image corresponding to the role code of the target item and a dynamic hash table configuration script file corresponding to the script file pointer are respectively invoked. A container node is constructed using the container image corresponding to the target item and the dynamic hash table configuration script file. In this way, different types of nodes can be configured in the blockchain network according to the plurality of target items, so that the flexibility of the configuration of the blockchain network can be improved. Then, the plurality of container nodes corresponding to the plurality of target items are linked to a blockchain synchronization node, and a blockchain network including nodes of multiple types is obtained. In this way, the nodes in the blockchain network are run based on containers, and the speed of starting and deploying is fast, and one-key deployment of large-scale nodes can be implemented. In this way, one-key deployment of large-scale nodes of multiple roles can be implemented, so that the application scenarios of the blockchain network are widened. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced. Other drawings can also be obtained by those of ordinary skill in the art without creative labor on the basis of these drawings.
[0040] Figure 1 is a flowchart of a method for configuring a blockchain network provided by an embodiment of the present application;
[0041] Figure 2 is a structural diagram of a blockchain network configuration apparatus provided by another embodiment of the present application;
[0042] Figure 3 is a structural diagram of a blockchain network configuration device provided by yet another embodiment of the present application. DETAILED DESCRIPTION
[0043] The features and exemplary embodiments of various aspects of the present application will be described below in detail, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details for those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0044] It should be noted that, in this paper, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0045] In the embodiments of the present application, the container (Docker) is an open source application container engine, which allows developers to package their applications and dependencies into a portable container, and then publish them to machines of any operating system, and also realizes virtualization. Containers can completely use the sandbox mechanism and will not have any interface with each other. Containers can use the client-server (C / S) architecture mode to use remote interfaces to manage and create containers. The relationship between containers and container images is similar to that between objects and classes in object-oriented programming. The container image can contain application code, dependencies and configuration files. When deploying in a cluster, each node needs to install necessary components such as container engine and Kubelet (Kubernetes node agent) so that containers can run in the cluster. The defined containers can be deployed to the cluster using the Kubernetes orchestration tool.
[0046] The multi-node type blockchain system is a common node type scheme of the blockchain system. In the multi-node type blockchain system, nodes are divided into consensus nodes, synchronization nodes and light nodes. The consensus node is a node participating in the consensus voting, transaction execution, block verification and accounting in the blockchain network. The synchronization node is a node participating in the synchronization and verification of blocks and transactions, block verification, transaction execution, and recording of complete ledger data, but not participating in consensus voting. The light node is a node participating in synchronization and checking block header information and verifying the existence of transactions.
[0047] Since the node type is relatively simple, only three main roles of consensus, synchronization and verification, the existing multi-node type blockchain system cannot bear the storage function of large load. In addition, the node program startup and deployment speed of the existing multi-node type blockchain system is slow, cannot support one-key deployment of large-scale nodes, the cooperation relationship of each node is relatively simple, and cannot complete super-large-scale data encryption storage. Therefore, the application scene of the multi-node type blockchain system is relatively single.
[0048] In view of this, the inventors have ingeniously proposed a blockchain network configuration method, device, equipment, computer storage medium and computer program product.
[0049] The blockchain network configuration method provided by the embodiments of the present application will be introduced below in combination with the drawings and specific embodiments and application scenarios. The blockchain network configuration method provided by the embodiments of the present application can be executed by a blockchain network configuration device, or a part of the modules in the blockchain network configuration device for executing the blockchain network configuration method. In the embodiments of the present application, the blockchain network configuration method executed by the blockchain network configuration device is taken as an example to illustrate the blockchain network configuration method provided by the embodiments of the present application in detail.
[0050] For example, the blockchain network configuration method of the embodiments of the present application can be executed based on a blockchain network configuration system. The blockchain network configuration system can include a dynamic hash table configuration script module, a blockchain network role dynamic hash table module, a container node module, a blockchain network role tree module and a distributed storage network computing cluster module. The modules of the blockchain network configuration system will be briefly introduced below.
[0051] The dynamic hash table configuration script module can generate a dynamic hash table configuration script file based on the configuration information set by the user. Based on the dynamic hash table configuration script file, the corresponding dynamic hash table information can be generated. The dynamic hash table is a hash table that can dynamically expand and shrink, and can dynamically adjust the size of the hash table according to the increase and decrease of data, thereby improving the storage efficiency and query efficiency of the hash table. In the embodiments of the present application, the dynamic hash table can be used to store the configuration information of the nodes of the blockchain network. Specifically, the user can set the configuration information in the dynamic hash table configuration script module, thereby supporting the configuration of different role nodes in the blockchain network. In an embodiment, the configuration information can include a role field and a configuration field corresponding to the role field. As an example, the configuration field can include at least one of a point-to-point transmission protocol field, an application interface field, a sub-protocol field, and a wallet information field.
[0052] The blockchain network role dynamic hash table module can generate corresponding dynamic hash table information in the dynamic hash table based on the dynamic hash table configuration script file. Specifically, the dynamic hash table configuration script file can be converted into dynamic hash table information through a dynamic hash table function of a Block Hash dynamic hash table construction technology. It is easy to understand that in the deployment scenario of a multi-role, large-scale node blockchain network, multiple nodes need to be constructed based on multiple dynamic hash table configuration script files. Therefore, the dynamic hash table can store multiple items of dynamic hash table information corresponding to multiple dynamic hash table configuration script files.
[0053] In one embodiment, the dynamic hash table configuration script file can be converted into a data set through the Block Hash dynamic hash table construction technology. Illustratively, the data set can be a TOML format script configuration file (data toml). The TOML format script configuration file is designed to be unambiguously converted into a hash table (Hashtable). Then, a secure hash algorithm (SHA) such as the SHA256 function can be applied to the data toml to obtain a script hash value corresponding to a certain number of bits. For the roles represented by different role fields, the role codes corresponding to the roles can be set in advance, for example, the node role code in the pre-packaging stage one can be P1, the node role code in the packaging stage two can be P2, the node role code in the block submission stage one can be C1, the node role code in the sector submission stage one can be C2, the node role code in the storage role can be MS, the node role code in the order processing can be DM, the node role code in the order packaging can be SM, the node role code in the window space-time proof can be WD, the node role code in the winning space-time proof can be WN, the node role code in the blockchain synchronization can be DA, and so on. According to the role field in the dynamic hash table configuration script file, the corresponding role code can be assigned, and the combination of the role code corresponding to the dynamic hash table configuration script file and the script hash value can obtain a node role hash value. Then, the node role hash value can be associated with the dynamic hash table configuration script file, and based on the mapping relationship between the two, a script file pointer can be generated. Further, the dynamic hash table information corresponding to the dynamic hash table configuration script file can be generated, which can be represented as {node role hash value, script file pointer}.
[0054] The blockchain network role tree module can manage the blockchain network role tree. The blockchain network configuration system can read the content of the dynamic hash table and construct the blockchain network role tree. Each leaf in the blockchain network role tree can correspond to a container image. In each container image, necessary components such as container engine and Kubelet (Kubernetes node agent) can be installed so that containers can run in the cluster. Based on the container image, a container node can be constructed. Specifically, the system can read each item {node role hash value, dynamic hash table configuration script file pointer} in the dynamic hash table, determine the role of the node according to the role code of the node role hash value, call the container image corresponding to the role, and call the corresponding dynamic hash table configuration script file according to the dynamic hash table configuration script pointer. The system constructs a node container according to the image and the dynamic hash table configuration script file corresponding to each item in the dynamic hash table. All containers constitute a blockchain network role tree. The blockchain network role tree can include various roles, such as pre-packaged stage one node role, pre-packaged stage two node role, sector submission stage one node role, sector submission stage two node role, storage node role, order processing node role, order packaging node role, window space-time proof node role, winning space-time proof node role, and blockchain synchronization node role.
[0055] The container node module can manage the deployment and operation of container nodes of different roles. For example, the container node module can call the blockchain cluster network container orchestration tool to manage the deployment and operation of container nodes of different roles, and realize the deployment and operation of the blockchain cluster network. The blockchain cluster network container orchestration tool library can select the corresponding container image from the blockchain network role tree according to the dynamic hash table, and automatically start, stop and expand the container to meet the needs of the blockchain network. In one embodiment, the container node module can include a blockchain storage container node module and a blockchain block container node module. The blockchain storage container node module can construct the corresponding blockchain storage node according to the container node image of the blockchain storage node. The blockchain storage node can be responsible for generating blocks and storing data. The blockchain block container node module can construct the corresponding blockchain block node according to the node image of the blockchain block container node module. The blockchain block node is responsible for synchronizing blockchain data.
[0056] In the embodiments of the present application, the blockchain network can be established on a blockchain service platform, which is a software deployment platform that abstracts hardware and operating system details and can be seamlessly scaled. The blockchain service platform provides an environment for generating, testing, and deploying a blockchain network, and is a complete development and deployment environment on the cloud, whose resources enable organizations to provide everything from simple cloud-based applications to complex cloud-enabled enterprise applications. The blockchain service platform can manage all container nodes, allowing the creation, stopping, and recovery of blockchain container nodes through a client, and access through a secure network connection. Based on the functions of the blockchain service platform, when expansion is needed, the blockchain cluster network container orchestration tool can automatically create new container nodes. The blockchain cluster network container orchestration tool also has the functions of service discovery and load balancing to ensure balanced distribution of traffic to the backend containers, while enabling internal communication between containers and using monitoring tools to monitor the performance of containers and the blockchain network in real time. The blockchain cluster network container orchestration tool can also configure log collection tools to track and analyze the behavior of applications in containers and the blockchain network, quickly troubleshoot problems, and enable the blockchain network to perform functions such as blockchain-based data encryption, encapsulation, verification, storage, retrieval, transaction, synchronization, etc.
[0057] The distributed storage network computing cluster module can include a management sub-cluster, a blockchain sub-cluster, a computing sub-cluster, a storage sub-cluster, and a verification sub-cluster.
[0058] The management sub-cluster includes a jump machine and a management machine monitoring and operation and maintenance tool. The management sub-cluster can be responsible for managing the entire blockchain network, monitoring the Central Processing Unit (CPU), memory, graphics processing unit (GPU), disk space, disk Input / Output (I / O), downtime or network unavailability of each node, and viewing all major data points, including total storage power, on-chain nodes, and a list of current storage nodes, on an open-source analysis and visualization application.
[0059] The computing sub-cluster can include pre-encapsulation stage one computing nodes, pre-encapsulation stage two computing nodes, sector submission stage one computing nodes, and sector submission stage two computing nodes to complete encryption-related work.
[0060] The storage sub-cluster (storage sealed sectors) can include multiple storage nodes to complete storage-related work.
[0061] The verification sub-cluster can include window space-time proof nodes, winning space-time proof nodes, and block space-time proof nodes to perform spot checks and block functions.
[0062] The blockchain network configuration system provided by the embodiments of the present application can construct a dynamic hash table configuration script configuration file in a flexible field combination, effectively preventing various errors caused by manual configuration of nodes. Through the role field, the dynamic hash table configuration script file supports different blockchain network roles, and the dynamic hash table technology is used to store the dynamic hash table configuration script configuration file. The dynamic hash table configuration script file is converted into a dynamic hash table through the Block_Hash dynamic hash table function, and the container image can construct a blockchain network node role tree according to the node role hash value in the dynamic hash table, configure the nodes in the blockchain network, and realize the rapid pulling and issuing of the image. In this way, one-key deployment of multi-role and large-scale nodes can be realized.
[0063] The embodiments of the present application will be described below in conjunction with the accompanying drawings Figure 1 The blockchain network configuration method provided by the embodiments of the present application will be described in detail.
[0064] Figure 1 The flowchart of the blockchain network configuration method provided by the embodiments of the present application is shown. As shown in the figure, Figure 1 The blockchain network configuration method can specifically include the following steps S110-S140.
[0065] S110, read the dynamic hash table, the dynamic hash table includes a plurality of target items, each target item includes a node role hash value and a script file pointer, the node role hash value includes a role code, and the script file pointer is used to indicate the mapping relationship between the node role hash value and the dynamic hash table configuration script file.
[0066] S120, for each target item, a container image corresponding to the role code of the target item and a dynamic hash table configuration script file corresponding to the script file pointer are called respectively.
[0067] S130, a container node is constructed using the container image and the dynamic hash table configuration script file corresponding to the target item.
[0068] S140, a plurality of container nodes corresponding to a plurality of target items are linked to a blockchain synchronization node to obtain a blockchain network.
[0069] The blockchain network configuration method of the embodiments of the present application can read a dynamic hash table, the dynamic hash table including a plurality of target items, each target item including a node role hash value and a script file pointer, the node role hash value including a role code, and the script file pointer being used to represent a mapping relationship between the node role hash value and a dynamic hash table configuration script file. Then, for each target item, a container image corresponding to the role code of the target item and a dynamic hash table configuration script file corresponding to the script file pointer are respectively called. A container node is constructed using the container image corresponding to the target item and the dynamic hash table configuration script file. In this way, different types of nodes can be configured in the blockchain network according to the plurality of target items, thereby improving the flexibility of the blockchain network configuration. Then, the plurality of container nodes corresponding to the plurality of target items are linked to a blockchain synchronization node, and a blockchain network including nodes of multiple types is obtained. In this way, the nodes in the blockchain network are run based on containers, and the starting and deployment speed is fast, and one-key deployment of large-scale nodes can be realized. In this way, one-key deployment of large-scale nodes of multiple roles can be realized, thereby expanding the application scenarios of the blockchain network.
[0070] In one embodiment, before reading the preset dynamic hash table, the method can further include:
[0071] The preset dynamic hash table configuration script file includes a role field and a configuration field corresponding to the role field.
[0072] The target role code corresponding to the preset dynamic hash table configuration script file is determined based on the role field.
[0073] According to the target role code and the preset dynamic hash table configuration script file, a target item corresponding to the preset dynamic hash table configuration script file is generated in the preset dynamic hash table.
[0074] In the above embodiments, the configuration field can include fields required for nodes of the role corresponding to the role field, for example, can include but is not limited to at least one of a point-to-point transmission protocol field, an application interface field, a sub-protocol field, and a wallet information field. The role field and the configuration field can be configured by a user, thereby supporting different blockchain network node roles.
[0075] According to the above embodiments, the dynamic hash table configuration script configuration file can be constructed in a flexible field combination, and the corresponding target item is generated in the dynamic hash table according to the preset dynamic hash table configuration script file. In this way, different target items can be generated in the dynamic hash table according to different role and configuration fields, and different types of nodes can be configured in the blockchain network. In this way, the flexibility of the blockchain network configuration can be improved.
[0076] In an embodiment, the node role hash value can further include a script hash value corresponding to the preset dynamic hash table configuration script file.
[0077] According to the target role code and the preset dynamic hash table configuration script file, a target item corresponding to the preset dynamic hash table configuration script file is generated in the preset dynamic hash table, which can specifically include:
[0078] The preset dynamic hash table configuration script file is converted into a data set through a block dynamic hash table construction technology.
[0079] The data set is converted through a secure hash algorithm to obtain a target script hash value corresponding to the preset dynamic hash table configuration script file.
[0080] The target role code and the target script hash value are combined to obtain a target node role hash value corresponding to the preset dynamic hash table configuration script file.
[0081] Based on the mapping relationship between the target node role hash value and the preset dynamic hash table configuration script file, a target script file pointer corresponding to the preset dynamic hash table configuration script file is generated.
[0082] The target node role hash value and the target script file pointer are combined to generate a target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table.
[0083] The above embodiment obtains a target script hash value corresponding to the preset dynamic hash table configuration script file through a block dynamic hash table construction technology and a secure hash algorithm, and then combines the target role code and the target script hash value to obtain a target node role hash value, and further generates a target item in the dynamic hash table. In this way, the corresponding container image and the preset dynamic hash table configuration script file of the target role can be accurately called through the target item to construct a corresponding container node. In this way, the efficiency of deploying a blockchain network node can be improved.
[0084] In an embodiment, after linking the plurality of container nodes corresponding to the plurality of target items to the blockchain synchronization node, the method can further include:
[0085] According to the role code of the plurality of target items, the plurality of container nodes are divided to obtain a plurality of clusters of different roles.
[0086] The above embodiment can perform cluster division according to the role code. In this way, each node can be divided into different clusters according to different functions, which is beneficial to the management and maintenance of the blockchain network.
[0087] In an embodiment, after constructing the container node from the container image and the dynamic hash table configuration script file corresponding to the target item, the method can further include:
[0088] The container nodes corresponding to the plurality of target items include a pre-packaging stage one container node, a pre-packaging stage container node, a sector submission stage one container node, a sector submission stage two container node, a storage container node, an order processing container node, an order packaging container node, a window space-time proof container node, a winning space-time proof container node, a block space-time proof container node, and a blockchain synchronization container node.
[0089] The above embodiment can complete spot check verification and block generation by configuring different roles for nodes in the blockchain network. In this way, the needs of scenarios such as encrypted data storage can be met. In this way, in the scenario of encrypted data storage, the blockchain network can provide high-concurrency encrypted data reading, and the encryption calculation, synchronization, retrieval, storage, transaction, and management of encrypted data can realize node separation, so that if one node fails, it will not affect other nodes, thereby providing high-quality storage services. In one embodiment, after linking the plurality of container nodes corresponding to the plurality of target items to the blockchain synchronization node to obtain the blockchain network, the method can further include:
[0090] Reading the newly added target item in the dynamic hash table, the newly added target item including a target item generated after a preset time.
[0091] Calling the target container image corresponding to the role code of the newly added target item, and the newly added dynamic hash table configuration script file corresponding to the script file pointer of the newly added target item.
[0092] Building a container node by using the target container image corresponding to the newly added target item and the newly added dynamic hash table configuration script file.
[0093] Linking the container node corresponding to the newly added target item to the blockchain synchronization node.
[0094] In the above embodiment, the preset time can include the time when the blockchain network is obtained. In this way, after the deployment of the blockchain network is completed, new container nodes can be built according to the user's configuration, and new nodes can be generated in the blockchain network. In this way, the scalability of the blockchain network can be improved.
[0095] It should be noted that the node roles of the blockchain network system configured by the method according to the embodiments of the present application can be configured according to user needs, and are not limited to the node roles listed in the above embodiments. The following will be illustrated by taking the scenario of a blockchain encrypted data blockchain as a service (Blockchain as a Service, BaaS) storage system as an example.
[0096] In the blockchain-based encrypted data BaaS storage system scenario, a plurality of peer encrypted storage nodes form a network, accept data encryption storage requests from users, and seal the data of the clients in the sealed sectors of some encrypted storage nodes. The encryption sealing calculation process and the storage information are recorded in the form of a "proof" string in the blockchain. Every certain period of time, the blockchain-based encrypted data BaaS storage system randomly checks the "proof" string on the blockchain to verify whether the sealed sectors storing the encrypted data are still effectively stored.
[0097] The blockchain-based encrypted data BaaS storage system scenario can adopt a browser and server architecture (B / S architecture), and a remote dictionary service (redis) as a cache library to implement multi-level network construction. In the blockchain-based encrypted data BaaS storage system scenario, the storage client node is responsible for storing data, the data encryption storage cluster can be responsible for encrypting and storing data, the index pool cluster can be responsible for providing an index (CID) of the encrypted data, the CID indicates the location of the encrypted data, and the retrieval client node can be responsible for retrieving encrypted data from the encrypted data storage cluster and returning the retrieval result to the client.
[0098] The specific implementation process can include: determining the number of storage nodes in the blockchain network according to the needs of the user, and determining that the number of storage nodes in the data encryption storage cluster can be, for example, N. The blockchain network configuration system assigns container images according to roles, uses Kubernetes as a container orchestration tool to realize rapid pulling and issuing of the images, and configures script files according to the container images and corresponding dynamic hash tables to deploy different container nodes. Specifically, a pre-sealing stage one node, a pre-sealing stage two node, a sector submission stage one node, a sector submission stage two node, a storage node, an order processing node, an order sealing node, a window space-time proof node, a winning space-time proof node, an index node, a storage client node, a retrieval client node, and a blockchain synchronization node can be deployed, wherein the number of storage nodes is N, and the number of other nodes is at least one and at most N / 2. The blockchain network configuration system completes the linkage between the nodes according to the operation manual of the system, and the specific process is: starting the blockchain synchronization node to form a blockchain network, and linking other nodes to the blockchain synchronization node to form a blockchain storage network. The N storage nodes can be used as a data encryption storage cluster. The index node and the storage node can lock data through a publish-subscribe topic. The storage client node can be responsible for storing data. The retrieval client node can be responsible for retrieving data.
[0099] Based on the same inventive concept, the embodiments of the present application also provide a blockchain network configuration device.
[0100] like Figure 2 As shown, the blockchain network configuration device 200 may include a reading module 201, a calling module 202, a building module 203, and a linking module 204.
[0101] The reading module 201 is used to read the dynamic hash table. The dynamic hash table includes multiple target items. Each target item includes a node role hash value and a script file pointer. The node role hash value includes a role code. The script file pointer is used to represent the mapping relationship between the node role hash value and the dynamic hash table configuration script file.
[0102] Module 202 is used to call the container image corresponding to the role code of each target item, and the dynamic hash table configuration script file corresponding to the script file pointer, respectively.
[0103] Module 203 is used to build container nodes using the container image and dynamic hash table configuration script file corresponding to the target item.
[0104] Link module 204 is used to link multiple container nodes corresponding to multiple target items to the blockchain synchronization node to obtain the blockchain network.
[0105] The blockchain network configuration device of this application embodiment can read a dynamic hash table, which includes multiple target items. Each target item includes a node role hash value and a script file pointer. The node role hash value includes a role code, and the script file pointer represents the mapping relationship between the node role hash value and the dynamic hash table configuration script file. Then, for each target item, the container image corresponding to the role code of the target item and the dynamic hash table configuration script file corresponding to the script file pointer are called respectively. Container nodes are constructed using the container image corresponding to the target item and the dynamic hash table configuration script file. In this way, different types of nodes can be configured in the blockchain network according to multiple target items, thereby improving the flexibility of blockchain network configuration. Next, the multiple container nodes corresponding to multiple target items are linked to the blockchain synchronization node to obtain a blockchain network containing multiple types of nodes. In this way, the nodes in the blockchain network run on containers, and the startup and deployment speed is fast, enabling one-click deployment of large-scale nodes. Thus, one-click deployment of multi-role, large-scale nodes can be achieved, thereby broadening the application scenarios of the blockchain network.
[0106] In one embodiment, the apparatus may further include:
[0107] The acquisition module is used to acquire a preset dynamic hash table configuration script file. The preset dynamic hash table configuration script file includes role fields and configuration fields corresponding to the role fields.
[0108] The determining module is configured to determine a target role code corresponding to the preset dynamic hash table configuration script file based on the role field.
[0109] The generating module is configured to generate a target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table according to the target role code and the preset dynamic hash table configuration script file.
[0110] In one embodiment, the node role hash value can further include a script hash value corresponding to the dynamic hash table configuration script file.
[0111] The generating module is configured to generate a target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table according to the target role code and the preset dynamic hash table configuration script file, and can specifically include:
[0112] The converting module is configured to convert the preset dynamic hash table configuration script file into a data set by using a block dynamic hash table construction technology.
[0113] The converting module is further configured to convert the data set by using a secure hash algorithm to obtain a target script hash value corresponding to the preset dynamic hash table configuration script file.
[0114] The combining module is configured to combine the target role code and the target script hash value to obtain a target node role hash value corresponding to the preset dynamic hash table configuration script file.
[0115] The generating module is configured to generate a target script file pointer corresponding to the preset dynamic hash table configuration script file based on a mapping relationship between the target node role hash value and the preset dynamic hash table configuration script file.
[0116] The combining module is further configured to combine the target node role hash value and the target script file pointer to generate a target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table.
[0117] In one embodiment, the apparatus can further include:
[0118] The dividing module is configured to divide a plurality of container nodes according to role codes of a plurality of target items to obtain a plurality of clusters of different roles.
[0119] In one embodiment, the apparatus can further include:
[0120] The combination module is configured to combine container nodes corresponding to a plurality of target items to obtain a blockchain network role tree, and the container nodes corresponding to the plurality of target items include a pre-packaging stage one container node, a pre-packaging stage container node, a sector submission stage one container node, a sector submission stage two container node, a storage container node, an order processing container node, an order packaging container node, a window space-time proof container node, a winning space-time proof container node, a block space-time proof container node, and a blockchain synchronization container node.
[0121] In an embodiment, the apparatus can further include:
[0122] The reading module is configured to read a newly added target item in the dynamic hash table, and the newly added target item includes a target item generated after a preset time.
[0123] The calling module is configured to call a target container image corresponding to a role code of the newly added target item, and a newly added dynamic hash table configuration script file corresponding to a script file pointer of the newly added target item.
[0124] The construction module is configured to construct a container node by using the target container image corresponding to the newly added target item and the newly added dynamic hash table configuration script file.
[0125] The linking module is configured to link the container node corresponding to the newly added target item to a blockchain synchronization node.
[0126] The blockchain network configuration apparatus provided by the embodiments of the present application can implement Figure 1 The method embodiments implement various processes, and to avoid repetition, details are not described here.
[0127] Figure 3 A hardware structure schematic diagram of a blockchain network configuration device provided by an embodiment of the present application is shown.
[0128] The blockchain network configuration device can include a processor 301 and a memory 302 having computer program instructions stored therein.
[0129] Specifically, the processor 401 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement one or more embodiments of the present application.
[0130] The memory 302 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 302 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a solid-state drive (SSD), a USB drive, or a combination of two or more of these. Where appropriate, the memory 302 can include removable or non-removable (or fixed) media, where appropriate. The memory 302 can be internal or external to the integrated gateway disaster recovery appliance. In particular embodiments, the memory 302 is non-volatile, solid-state memory.
[0131] The memory can include read-only memory (ROM), random-access memory (RAM), magnetic disk storage mediums, optical storage mediums, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (by one or more processors), is operable to
[0132] The processor 301 implements the blockchain network configuration method in any of the above embodiments by reading and executing computer program instructions stored in the memory 302.
[0133] As an example, the blockchain network configuration device can further include a communication interface 303 and a bus 310. Wherein, as shown in Figure 3 The processor 301, the memory 302, the communication interface 303 are connected through the bus 310 and complete the communication between each other.
[0134] The communication interface 303 is mainly used to realize the communication between each module, device, unit and / or equipment in the embodiments of the application.
[0135] Bus 310 includes hardware, software, or both, to couple components of the online data traffic metering device to each other and to couple components to other components within the online data traffic metering device. While bus 310 is shown for the sake of clarity as a single bus, bus 310 can include one or more buses operating together, serially, in parallel, etc. Bus 310 can include any suitable bus or interconnect, including a memory bus, a peripheral bus, an external bus, a serial bus, a parallel bus, etc. or a combination of one or more of the above. Bus 310 can include any suitable bus or interconnect, including an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or interconnect. In some embodiments, bus 310 can include one or more buses, although only one is shown. Although this application describes and illustrates a particular bus, this application contemplates any suitable bus or interconnect.
[0136] The blockchain network configuration device can execute the blockchain network configuration method in the embodiments of the application, thereby realizing the blockchain network configuration method and device described in combination with Figure 1 and Figure 2 described in the embodiments of the application.
[0137] In addition, in combination with the data processing method in the above-mentioned embodiments, the embodiments of the application can provide a computer storage medium to realize. The computer storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to realize any one of the blockchain network configuration methods in the above-mentioned embodiments.
[0138] It needs to be clear that the application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above-mentioned embodiments, several specific steps are described and shown as examples. However, the method process of the application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the application.
[0139] The functions noted in the description of the structural block diagrams above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, functional cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.
[0140] It is also important to note that the examples described herein can be implemented in a variety of systems, including and not limited to a digital electronic circuit, an analog electronic circuit, a computer hardware, firmware, software, or in combinations of them. The example described herein can be implemented as one or more computer programs running on a computer or other programmable data processing devices, a computer program, a computer program product, a computer, a mobile phone, a portable computer, a portable computer, a server, or other programmable data processing devices. The computer program is a set of instructions that can be used to program a computer or other programmable data processing devices to perform a certain task, or to implement a certain abstract data type. The program can be written in any form of programming language, including compiled or interpreted languages, and can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0141] The computer program can be deployed in any form, including, but not limited to, a stand-alone program, a subroutine, a software module, a software component, or other units suitable for use in a computing environment. The computer program can be deployed in, but not limited to, a computer program product, a computer readable medium, or a computer readable storage medium, which can be any medium that can store or transport information for a computer or other programmable data processing devices. The computer readable medium or computer readable storage medium can be, but not limited to, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy disk, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like.
[0142] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A method for configuring a blockchain network, characterized in that, The method comprises the following steps: reading a dynamic hash table, the dynamic hash table comprising a plurality of target items, each of the target items comprising a node role hash value and a script file pointer, the node role hash value comprising a role code, and the script file pointer indicating a mapping relationship between the node role hash value and a dynamic hash table configuration script file; for each target item, calling a container image corresponding to the role code of the target item and a dynamic hash table configuration script file corresponding to the script file pointer; constructing a container node using the container image and the dynamic hash table configuration script file corresponding to the target item; linking a plurality of container nodes corresponding to the plurality of target items to a blockchain synchronization node to obtain a blockchain network; Before the step of reading the preset dynamic hash table, the method further comprises the following steps: obtaining a preset dynamic hash table configuration script file, the preset dynamic hash table configuration script file comprising a role field and a configuration field corresponding to the role field; determining a target role code corresponding to the preset dynamic hash table configuration script file based on the role field; generating a target item corresponding to the preset dynamic hash table configuration script file in a preset dynamic hash table according to the target role code and the preset dynamic hash table configuration script file; the node role hash value further comprises a script hash value corresponding to the dynamic hash table configuration script file; the step of generating the target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table according to the target role code and the preset dynamic hash table configuration script file comprises the following steps: converting the preset dynamic hash table configuration script file into a data set by a block dynamic hash table construction technology; obtaining a target script hash value corresponding to the preset dynamic hash table configuration script file by converting the data set by a secure hash algorithm; combining the target role code and the target script hash value to obtain a target node role hash value corresponding to the preset dynamic hash table configuration script file; generating a target script file pointer corresponding to the preset dynamic hash table configuration script file based on the mapping relationship between the target node role hash value and the preset dynamic hash table configuration script file; combining the target node role hash value and the target script file pointer to generate the target item corresponding to the preset dynamic hash table configuration script file in the preset dynamic hash table.
2. The method of claim 1, wherein, After the step of linking the plurality of container nodes corresponding to the plurality of target items to the blockchain synchronization node, the method further comprises the following step: dividing the plurality of container nodes according to the role codes of the plurality of target items to obtain a plurality of clusters of different roles.
3. The method of claim 1, wherein, After the step of constructing the container node using the container image and the dynamic hash table configuration script file corresponding to the target item, the method further comprises the following step: The container nodes corresponding to the plurality of target items are combined to obtain a blockchain network role tree, and the container nodes corresponding to the plurality of target items include a pre-packaging stage one container node, a pre-packaging stage container node, a sector submission stage one container node, a sector submission stage two container node, a storage container node, an order processing container node, an order packaging container node, a window space-time proof container node, a winning space-time proof container node, a block space-time proof container node, and a blockchain synchronization container node.
4. The method of claim 1, wherein, After the plurality of container nodes corresponding to the plurality of target items are linked to the blockchain synchronization node to obtain the blockchain network, the method further includes: reading a new target item in the dynamic hash table, the new target item including a target item generated after a preset time; Calling a target container image corresponding to a role code of the new target item and a new dynamic hash table configuration script file corresponding to a script file pointer of the new target item; Building a container node using the target container image corresponding to the new target item and the new dynamic hash table configuration script file; Linking the container node corresponding to the new target item to the blockchain synchronization node. 5.A blockchain network configuration apparatus characterized by comprising: Comprise: A reading module for reading a dynamic hash table, the dynamic hash table including a plurality of target items, each target item including a node role hash value and a script file pointer, the node role hash value including a role code, and the script file pointer indicating a mapping relationship between the node role hash value and a dynamic hash table configuration script file; A calling module for calling, for each target item, a container image corresponding to a role code of the target item and a dynamic hash table configuration script file corresponding to a script file pointer; A building module for building a container node using a container image corresponding to the target item and a dynamic hash table configuration script file; A linking module for linking a plurality of container nodes corresponding to a plurality of target items to a blockchain synchronization node to obtain a blockchain network; The device further comprises: An obtaining module for obtaining a preset dynamic hash table configuration script file, the preset dynamic hash table configuration script file including a role field and a configuration field corresponding to the role field; A determining module for determining a target role code corresponding to the preset dynamic hash table configuration script file based on the role field; A generating module for generating a target item corresponding to the preset dynamic hash table configuration script file in a preset dynamic hash table according to the target role code and the preset dynamic hash table configuration script file; The node role hash value further includes a script hash value corresponding to a dynamic hash table configuration script file; The generating module is specifically configured to convert the preset dynamic hash table configuration script file into a data set through a block dynamic hash table construction technology; The data set is converted through a secure hash algorithm to obtain a target script hash value corresponding to the preset dynamic hash table configuration script file; The target role code and the target script hash value are combined to obtain a target node role hash value corresponding to the preset dynamic hash table configuration script file; generate a target script file pointer corresponding to the preset dynamic hash table configuration script file based on a mapping relationship between the target node role hash value and the preset dynamic hash table configuration script file; combine the target node role hash value and the target script file pointer to generate a target item corresponding to the preset dynamic hash table configuration script file in a preset dynamic hash table.
6. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the blockchain network configuration method of any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer program instructions are stored on the computer readable storage medium and are executed by the processor to implement the blockchain network configuration method of any one of claims 1-4.
8. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device to cause the electronic device to perform the blockchain network configuration method of any one of claims 1-4.
Citation Information
Patent Citations
Block chain release method and device
CN110149316A
Trusted starting method and device of block chain all-in-one machine
CN113656806A