Consortium chain data heterogeneous storage method based on weighted thiesen polygon
By adopting a heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons, the problem of excessive storage resource consumption in blockchain systems is solved, storage resources are optimized and data acquisition efficiency is improved, ensuring the efficient operation of blockchain systems.
Patent Information
- Application Number
- CN202310403052.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-04-17
AI Technical Summary
Blockchain systems consume excessive storage resources, especially from mobile and IoT devices, which limits their application on these devices and the scalability of the blockchain.
A heterogeneous data storage method based on weighted Thiessen polygons is adopted for consortium blockchains. Storage groups are generated through self-organization, and storage topology is generated using weighted Thiessen polygons, thereby reducing storage resource consumption and improving load balancing and data acquisition efficiency.
It effectively reduces the storage resource requirements of the blockchain system, improves the data acquisition efficiency between nodes, and ensures the efficient operation of the blockchain system and low data transfer overhead during topology changes.
Smart Images

Figure CN116668468B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons, belonging to the field of blockchain application technology. Background Technology
[0002] We are living in a digital age, with human society generating ever-increasing amounts of data. Due to the widespread adoption of technology and the advancement of digitalization, various devices, sensors, and applications are constantly generating data, such as meteorological, traffic, and health data collected by sensors, and massive amounts of document, image, and video data produced by businesses, governments, and individuals. The importance of data in modern society is self-evident. It is not only the foundation of digital transformation but also a driving force for technological innovation and industrial upgrading. Currently, the amount of data generated by human society is growing exponentially. It is predicted that by 2025, the amount of data generated globally every day will reach 180 ZB (1 ZB = 1.1805916207174113 × 10⁻¹¹). 21 (B) This figure is three times that of 2020. This indicates that human society is undergoing a digital revolution, with data becoming a core element of this revolution. Therefore, the ability to store data becomes crucial, not only for its preservation but also for its easy access, sharing, and analysis. When we possess this data, we can better understand the world we live in, make more informed decisions, and create more innovative and commercially valuable opportunities.
[0003] With the generation of ever-increasing amounts of data, data security has become a top priority in the field of information technology. How to protect sensitive data from unauthorized access, prevent data breaches, and defend against potential cyberattacks has become a popular research topic. Blockchain, due to its ability to provide secure and transparent transactions, has become increasingly popular in recent years. Essentially, blockchain is a shared distributed database, and as a distributed data storage technology, its decentralized, immutable, traceable, and transparent characteristics offer a new solution for data security. Existing blockchains are mainly divided into three categories: public chains, consortium chains, and private chains. Different types of blockchains have different requirements for participating nodes. In public chain systems, all nodes can freely participate in consensus and conduct transactions; there are no restrictions on node joining and leaving, making the public chain system completely decentralized. Consortium chain systems sacrifice some decentralization to improve security. Nodes participating in a consortium chain must be certified by the consortium organization, and node joining and leaving require a certain review mechanism. Hyperledger is a well-known example of a consortium chain system. Private chain systems are completely centralized, only using the blockchain's data storage method.
[0004] Blockchain is an append-only data structure. Regardless of the blockchain system, its size is constantly growing, requiring substantial resources to store it, which is a major constraint on the development of blockchain technology. Data shows that the peak size of the Ethereum blockchain currently exceeds 1TB. In a blockchain system, the node that stores all the data is called a full node. The massive and continuously growing block data places high demands on the storage hardware of full nodes. Ordinary user host devices are unlikely to meet the storage requirements of the entire blockchain, meaning they cannot participate in the blockchain's consensus process. Furthermore, mobile and IoT devices such as smartphones, tablets, smart home devices, and appliances are increasingly prevalent in our lives. If these devices with limited storage resources cannot be incorporated into the blockchain system, the scalability of the blockchain will be significantly reduced, severely limiting the development of this emerging technology. Summary of the Invention
[0005] The purpose of this invention is to solve the technical problem of excessive storage resource consumption in blockchain, and to propose an efficient heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons.
[0006] The objective of this invention is achieved through the following technical solutions.
[0007] First, let's explain the relevant concepts:
[0008] Definition 1: Consensus Node
[0009] Consensus nodes are nodes that participate in the blockchain consensus mechanism, and are also responsible for logical storage topology, executing block allocation algorithms, and other operations.
[0010] Definition 2: Consensus Group
[0011] The set of consensus nodes;
[0012] Definition 3: Storage Node
[0013] It is the smallest unit of storage, responsible for storing blocks and responding to block request messages, etc.
[0014] Definition 4: Storage group
[0015] It is the unit of block allocation. During system initialization, all storage nodes are divided into several storage groups. After the consensus group generates a new block, it will directly allocate the block to its storage group.
[0016] Definition 5: Primary storage node
[0017] It is a storage node randomly selected from the storage group, responsible for maintaining the corresponding storage group information, interacting with the consensus group, and broadcasting the block to other storage nodes in the storage group when it receives a block from the consensus group.
[0018] Definition 6: Network Distance
[0019] This refers to the network transmission latency between two nodes;
[0020] The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons proposed in this invention includes the following steps:
[0021] Step 1: Generate storage group
[0022] During system initialization, all storage nodes are divided into several storage groups;
[0023] Step 2: Select the primary storage node
[0024] Each storage group randomly selects a node belonging to this storage group to become the primary storage node;
[0025] Step 3: Generate storage topology
[0026] After the primary storage node is selected, it will communicate with the consensus group. The consensus group will allocate coordinates to the primary storage node based on its relevant information and generate a storage topology based on weighted Thiessen polygons.
[0027] Step 4: Allocate newly generated blocks
[0028] After a consensus group generates a block, the storage group for storing the block is determined according to the block allocation algorithm, and the block is unicast to the corresponding master storage node. At the same time, the block header of the block is broadcast to all storage nodes in the system to ensure that all storage nodes know the current state of the blockchain.
[0029] Step 5: Block broadcast within the storage group
[0030] After receiving the block sent by the consensus group, the primary storage node broadcasts the block to the other storage nodes in the storage group;
[0031] Step 6: Process the addition of storage nodes
[0032] When a new storage node joins, if the number of new nodes is insufficient to form a storage group, the new node will only receive block headers or request blocks from other nodes, but will not receive requests for storage blocks. Only after enough new nodes have joined to form a new storage node group will the newly created primary storage node report to the consensus group. The consensus group then performs a logical storage topology change according to the block allocation algorithm. After this, the newly formed storage group can begin receiving storage block requests.
[0033] Step 7: Process storage node exit
[0034] If a storage node exits, the storage group with the exiting node will report to the consensus group. The consensus group will then perform a logical storage topology change and will no longer allocate blocks to that storage group. At this time, the storage group will only perform operations such as receiving block headers, requesting blocks, or responding to block requests until the number of nodes in the storage group is restored to the specified value.
[0035] Beneficial effects
[0036] The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons generates storage groups to store blocks through self-organization. At the same time, the method of generating Thiessen polygons is introduced into the blockchain storage mechanism, which reduces the blockchain's consumption of storage resources, ensures the load balance of block storage, reduces the data transfer overhead caused by storage topology changes, improves the data acquisition efficiency between blockchain nodes, and can ensure the efficient operation of the blockchain system. Attached Figure Description
[0037] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0038] The specific implementation process of the method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0039] Example
[0040] like Figure 1 As shown, this embodiment specifically elaborates on the workflow of the heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons.
[0041] The implementation of the heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons can be divided into three stages:
[0042] Phase 1: Initialization Phase. During initialization, all storage nodes are divided into several storage groups according to the storage group generation algorithm, and a master storage node is selected. Then, the master storage node communicates with the consensus group. The consensus group assigns coordinates to the master storage nodes based on the network distance between them, mapping them onto a virtual two-dimensional plane. Then, a weighted Thiessen polygon is generated based on the master storage node coordinates to divide the entire virtual two-dimensional plane. This phase corresponds to steps 1, 2, and 3 in the invention description.
[0043] Phase Two: Block Generation and Allocation. After system initialization, the consensus group begins generating blocks and allocating them to the corresponding storage groups. Once a block is generated based on consensus, the consensus group unicasts the block to the primary storage node of the corresponding storage group according to the block allocation algorithm. Upon receiving the new block from the consensus group, the primary storage node broadcasts the block within its storage group. After sending the block to the primary storage node of the corresponding storage group, the consensus group also broadcasts the block header to all storage nodes in the system, ensuring that all nodes are aware of the current state of the blockchain. This phase corresponds to steps 4 and 5 in the invention description.
[0044] Phase Three: System Operation and Maintenance. This phase primarily involves the addition or removal of nodes. When a new storage node joins, if the number of new nodes is insufficient to form a storage group, the newly joined node only receives block headers or requests blocks from other storage nodes, without accepting storage requests for new blocks. This continues until enough new nodes are added to form a new storage group, at which point the newly created primary storage node reports to the consensus group. The consensus group then changes the logical storage topology according to the block allocation algorithm, after which the newly formed storage group can begin receiving storage block requests. When a node leaves, the storage group from which that node leaves reports to the consensus group, and the consensus group performs a logical storage topology change; blocks are no longer allocated to the storage group. At this point, the storage group will only receive block headers, block requests, or respond to block requests until the number of nodes in the storage group returns to the specified value. This phase corresponds to steps 6 and 7 in the invention description.
[0045] The aforementioned heterogeneous data storage method refers to a blockchain system where the consensus group and storage group are separate. The consensus group, as the executor of the consensus algorithm, is only responsible for block generation and allocation. The storage group is the carrier of block storage and is responsible for the storage of the blockchain. In consortium blockchains, different consortia may use different ledger formats, and the described method is applicable to different consortium blockchain ledger structures.
[0046] In Phase One, after the storage group is generated, the consensus group broadcasts the generated logical storage topology information to all storage nodes. All storage nodes can then process block requests based on this storage topology information.
[0047] In Phase 1, coordinates are assigned to primary storage nodes using a multidimensional scaling method, based on the network distance between primary storage nodes.
[0048] Let P be an n*m matrix representing the coordinates of n main storage nodes in an m-dimensional virtual space; let B denote the standard product matrix of P, i.e., B = PP. T Let D = [ND] ij ] represents the network distance matrix of n primary storage nodes, where ND ijThis represents the network distance between primary storage nodes i and j; matrices B and D have the following relationship:
[0049] B = -1 / 2JD (2) J;
[0050] Among them, D (2) =[ND ij 2 ];
[0051] J = I⁻¹ / nA;
[0052] Where I represents an n-order identity matrix, and A represents an n-order matrix consisting of n ones;
[0053] Assume the eigenvalues of matrix B, from largest to smallest, are λ1…λ2. n The corresponding eigenvectors are e1…e n Take λ1…λ m Generate a diagonal matrix D, with corresponding m eigenvectors e1…e m Forming matrix Q, then
[0054] P = QD 1 / 2 ;
[0055] When m=2, the calculated P is the two-dimensional coordinate matrix of the primary storage node.
[0056] In Phase 1, the process of generating weighted Thiessen polygons based on the coordinates of the primary storage node to divide the entire virtual two-dimensional plane, and then generating Thiessen polygons on the generated two-dimensional virtual plane using the Fortune algorithm, involves the following steps:
[0057] Step 1: Sort the primary storage nodes in ascending order of their y-coordinates, and insert each node into the Beachline in turn;
[0058] Step 2: In the Beachline, each generated point corresponds to an arc segment. For ease of calculation, each arc segment can be represented as a quadratic curve between three foci. These three foci include the current generated point and its two adjacent generated points;
[0059] Step 3: In the Beachline, each arc segment represents a portion of a Thiessen polygonal unit, the boundary of which is composed of perpendicular segments between adjacent arc segments;
[0060] Step 4: Calculate the intersection points between adjacent arc segments in Beachline. These intersection points correspond to the vertices in the Thiessen polygon graph.
[0061] Step 5: At each intersection, split the adjacent arc segments and reconnect the Beachline;
[0062] Step 6: Repeat steps 4 and 5 until there are no more arc segments in the Beachline; at this point, all the intersections and arc segments constitute the complete Thiessen polygon.
[0063] In Phase Two, the allocation of the newly generated block involves generating a 32-byte, 256-bit value H(b) from the block header using the SHA-256 algorithm. The first four bytes of the last eight bytes of H(b) are denoted as x, and the last four bytes as y. Therefore, the coordinates P(b) of the new block can be represented as (R... x *x / 2 32 -1, R y *y / 2 32 -1); where R x and R y This indicates the range of the horizontal and vertical coordinates in the primary storage node coordinate system.
[0064] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0065] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons. First, let's explain the relevant concepts: Definition 1: Consensus Node Consensus nodes are nodes that participate in the blockchain consensus mechanism, and are also responsible for logical storage topology and executing block allocation algorithm operations. Definition 2: Consensus Group The set of consensus nodes; Definition 3: Storage Node It is the smallest unit of storage, responsible for storing blocks and responding to request block message operations; Definition 4: Storage group It is the unit of block allocation. During system initialization, all storage nodes are divided into several storage groups. After the consensus group generates a new block, it will directly allocate the block to the storage group to which it belongs. Definition 5: Primary storage node It is a storage node randomly selected from the storage group, responsible for maintaining the corresponding storage group information, interacting with the consensus group, and broadcasting the block to other storage nodes in the storage group when it receives a block from the consensus group. Definition 6: Network Distance This refers to the network transmission latency between two nodes; Its characteristic is that it includes the following steps: Step 1: Generate storage group During system initialization, all storage nodes are divided into several storage groups; Step 2: Select the primary storage node Each storage group randomly selects a node belonging to this storage group to become the primary storage node; Step 3: Generate storage topology After the primary storage node is selected, it will communicate with the consensus group. The consensus group will allocate coordinates to the primary storage node based on its relevant information and generate a storage topology based on weighted Thiessen polygons. Step 4: Allocate newly generated blocks After a consensus group generates a block, the storage group for storing the block is determined according to the block allocation algorithm, and the block is unicast to the corresponding master storage node. At the same time, the block header of the block is broadcast to all storage nodes in the system to ensure that all storage nodes know the current state of the blockchain. Step 5: Block broadcast within the storage group After receiving the block sent by the consensus group, the primary storage node broadcasts the block to the other storage nodes in the storage group; Step 6: Process the addition of storage nodes When a new storage node joins, if the number of new storage nodes is insufficient to form a storage group, the new storage node will only receive block headers or request blocks from other storage nodes, but will not receive requests for storage blocks. This continues until there are enough new nodes to form a new storage node group. Then, the newly generated primary storage node reports to the consensus group, and the consensus group performs logical storage topology changes according to the block allocation algorithm. After that, the newly formed storage group begins to receive storage block requests. Step 7: Process storage node exit If a storage node exits, the storage group with the exiting node will report to the consensus group. The consensus group will then make a logical storage topology change and will no longer allocate blocks to that storage group. At this time, the storage group will only perform operations such as receiving block headers, requesting blocks, or responding to block requests until the number of nodes in the storage group is restored to the specified value.
2. The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons as described in claim 1, characterized in that, The aforementioned heterogeneous data storage method refers to the separation of the consensus group and storage group in the blockchain system. The consensus group, as the executor of the consensus algorithm, is only responsible for block generation and allocation; the storage group is the carrier of block storage and is responsible for the storage of the blockchain. In consortium blockchains, different consortia may adopt different ledger formats, and the method is applicable to different consortium blockchain ledger structures.
3. The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons as described in claim 1, characterized in that, After the storage group is generated, the consensus group will broadcast the generated logical storage topology information to all storage nodes, and all storage nodes will process block requests according to the storage topology information.
4. The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons as described in claim 1, characterized in that, Step 3, which involves allocating coordinates to primary storage nodes, employs a multidimensional scaling analysis method to allocate coordinates based on the network distance between primary storage nodes. Let P be an n*m matrix representing the coordinates of n main storage nodes in an m-dimensional virtual space; let B denote the standard product matrix of P, i.e., B = PP. T Let D = [ND] ij ] represents the network distance matrix of n primary storage nodes, where ND ij This represents the network distance between primary storage nodes i and j; matrices B and D have the following relationship: B=-1 / 2JD (2) J; Among them, D (2) =[ND ij 2 ]; J = I⁻¹ / nA; Where I represents an n-order identity matrix, and A represents an n-order matrix consisting of n ones; Assume the eigenvalues of matrix B, from largest to smallest, are λ1…λ2. n The corresponding eigenvectors are e1…e n Take λ1…λ m Generate a diagonal matrix D, with corresponding m eigenvectors e1…e m Forming matrix Q, then P=QD 1 / 2 ; When m=2, the calculated P is the two-dimensional coordinate matrix of the primary storage node.
5. The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons as described in claim 1, characterized in that, Step 3, which involves generating a storage topology based on weighted Thiessen polygons, uses the Fortune algorithm to generate Thiessen polygons on a generated two-dimensional virtual plane. The specific steps are as follows: Step 3.1: Sort the primary storage nodes in ascending order of their y-coordinates, and insert each node into the Beachline in turn; Step 3.2: In Beachline, each generated point corresponds to an arc segment. For ease of calculation, each arc segment is represented as a quadratic curve between three foci, which include the current generated point and its two adjacent generated points. Step 3.3: In the Beachline, each arc segment represents a portion of a Thiessen polygonal unit, the boundary of which is composed of perpendicular segments between adjacent arc segments; Step 3.4: Calculate the intersection points between adjacent arc segments in Beachline. These intersection points correspond to the vertices in the Thiessen polygon graph. Step 3.5: At each intersection, split the adjacent arc segments and reconnect the Beachline; Step 3.6: Repeat steps 3.4 and 3.5 until there are no more arc segments in the Beachline; at this point, all the intersections and arc segments constitute the complete Thiessen polygon.
6. The heterogeneous data storage method for consortium blockchains based on weighted Thiessen polygons as described in claim 1, characterized in that, When allocating a newly generated block in step 4, the block header of the new block is used to generate a 32-byte, 256-bit value H(b) according to the SHA-256 algorithm. The first 4 bytes of the last 8 bytes of H(b) are denoted as x, and the last 4 bytes are denoted as y. Then the coordinates P(b) of the new block are represented as (R... x *x / 2 32 -1, R y *y / 2 32 -1); where R x and R y This indicates the range of the horizontal and vertical coordinates in the primary storage node coordinate system.
Citation Information
Patent Citations
Double-fragmentation alliance block chain storage method
CN114741386A
Block chain structure storage architecture optimization method and device
CN115587142A