A lightweight data storage device and method suitable for graph blockchain

By adopting a lightweight data storage device in the schema blockchain, through transaction merger and reference deletion solutions, the problem of excessive data storage overhead in the txDAG schema blockchain project is solved, and high scalability and performance are achieved Improved while maintaining the security of the system.

CN113641664BActive Publication Date: 2025-02-11HUAZHONG UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110792745.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2025-02-11
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

While improving system performance, the txDAG schema blockchain project has brought high data storage overhead, especially in the case of serious redundancy of account data and reference data, resulting in a sharp increase in storage space, exceeding ordinary nodes storage capacity.

Method used

A lightweight data storage device and method suitable for schema blockchain is proposed. Through periodic transaction merging and transaction reference deletion schemes, the redundancy of account data and reference data is reduced, thereby reducing data storage overhead.

Benefits of technology

It realizes high scalability in schema blockchain, reduces data storage overhead, improves system performance and throughput, and maintains the parallelization characteristics and security of the original schema blockchain system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113641664B_ABST
    Figure CN113641664B_ABST
Patent Text Reader

Abstract

The present invention relates to a lightweight data storage device suitable for a graph blockchain, which at least includes a common transaction construction module for users to initiate new transactions and a network broadcast module for broadcasting transactions, and is characterized in that it also includes a transaction merging construction module and a transaction deletion module, the transaction merging construction module is used to perform a first lightweight processing on the transaction when it determines that the number of transactions initiated by the account meets the first preset condition, the transaction deletion module is used to perform a second lightweight processing on the transaction obtained after the first lightweight processing and whose verification reference meets the second preset condition, and the network broadcast module broadcasts the processed transaction. Through the transaction merging and transaction reference deletion schemes combined with each other proposed by the present invention, the purpose of reducing the data storage overhead in the graph blockchain can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a lightweight data storage device and method suitable for a graph blockchain. Background Art

[0002] Due to its advantages such as immutability, transparency and traceability, blockchain technology is expected to become the cornerstone of trust in reshaping public governance and business logic. These advantages of blockchain technology have also promoted its application in various scenarios, such as cryptocurrency, data traceability and trusted storage. The core of the traditional chain blockchain model is to ensure the uniqueness of the legal data chain through the uniqueness of miners (bookkeeping rights). The basic unit of the chain blockchain is the block, which is connected by hash pointers, which ensure the integrity, continuity and legality of the data. Each block consists of a block header and a block body. The block is generated by miners, who collect transactions within a certain period of time and package them, and then encapsulate them with technologies such as timestamps and asymmetric encryption. Finally, the miners broadcast it to other users, and the users who receive the block extend and improve the local data view. Inheriting the characteristics of the Genesis project Bitcoin, most blockchain systems adopt a sequential chain data model. In this data model, the subsequent block contains the hash of its previous block. Although this chain data structure can prevent malicious tampering of transactions, it also hinders the performance of the blockchain system. For example, Bitcoin and Ethereum systems, which are mainstream blockchain platforms, can only process 7 and 15 transactions per second respectively.

[0003] A linked list is a chain formed by many nodes connected, and each node contains a link to the previous node. The reason why blockchain can be connected into a chain is that there is a pointer to the previous block in the new block, so the data structure of the blockchain is a linked list. But the problem with the blockchain is that it is a line. Assuming that the time for a block to be generated is fixed, then such a line structure will cause a performance bottleneck. Because only one block is allowed to be added to the chain at this fixed time. So to improve the performance of the blockchain, there are probably two ideas. One is to shorten the time to generate a block, and the other is to use DAG technology to change the structure of the data so that new data can be added in parallel.

[0004] Compared with chain-type blockchain, the advantage of DAG (Directed Acyclic Graph) blockchain lies in its good scalability. Chain-type blockchain is limited by the chain-type organization of data, and any fork will be considered illegal. The uniqueness of the permission to write to the database and the one-way extension of data greatly limit the scalability and concurrency of chain-type blockchain. In terms of data organization, DAG-type blockchain allows each block to have two or more hash pointers, and the blocks within a period of time will form a directed acyclic graph. In terms of write permissions, DAG-type blockchain allows multiple (or even every) users to have write permissions. The generator of each block can choose to reference multiple historical blocks on its own, and then broadcast them, and the users who receive the blocks will save them in the local database. These two improvements have greatly improved the scalability and concurrency of DAG-type blockchain.

[0005] DAG is a distributed ledger technology different from mainstream blockchain. It upgrades synchronous accounting to asynchronous accounting. The core technical problem that currently restricts the development of blockchain is efficiency, and the DAG model provides the possibility for blockchain to improve efficiency. DAG mainly solves three major problems in the blockchain system. 1. Improve transaction speed: DAG can be multi-threaded, while blockchain can only be single-threaded, and the more traders in DAG, the faster the speed. 2. Save costs: DAG directly delegates the transaction confirmation environment to the transaction itself, so no handling fee is required. 3. Save resources: There is no miner role in DAG, so there is no need to consume social resources. In order to improve the performance of the blockchain system, some blockchain projects have introduced the Directed Acyclic Graph (DAG) structure as a basic data model. This model is expected to provide powerful functions for parallel transaction processing and verification. Factors that affect the performance of traditional blockchains include block size, generation speed, and transaction confirmation speed. Unlike traditional blockchains, DAG chains do not have the concept of blocks, so there is no limit on block capacity. TX (transaction) is regarded as a message, and multiple messages are combined into a data block, which is called a unit. Units are linked to each other to form a DAG graph. Blockchain is single-threaded, and DAG is multi-threaded. In terms of transaction verification, the new unit can choose to link to any one or more old units, and complete the verification by verifying the new transaction and referencing the old transaction, which is referred to as "DAG consensus". This allows temporary minor differences between users' ledgers, weakens the consistency of the data block in the entire network in a short period of time, and is therefore less likely to be blocked, which can increase the transaction concurrency. Therefore, the larger the scale of the DAG chain network nodes and the larger the transaction volume, the shorter the transaction confirmation time.

[0006] In general, DAG-based blockchain systems can be divided into two categories: blockDAG and txDAG. The former (such as Conflux and Phantom consensus algorithms) is similar to traditional chain blockchains, organizing and processing multiple transactions in blocks. In theory, this allows different nodes to create new blocks in parallel, thereby improving the throughput of the system. However, in actual operation, there may be a large amount of transaction overlap in the concurrently generated blocks, so that the system can only achieve limited performance improvement. In contrast, many projects such as IOTA, Byteball and Nano belong to the txDAG type, which uses a more fine-grained "transaction" as a storage unit, which can achieve higher parallelism and become the mainstream in graph blockchain projects.

[0007] In the prior art, a patent document with publication number CN111080288A proposes a blockchain consensus reaching method and device based on a directed acyclic graph. In the blockchain consensus reaching method proposed therein, when a network node on the blockchain publishes a transaction, a new block corresponding to the transaction can be created in the current DAG view, and the axis tree in the current DAG view and the current DAG view can be updated according to the rules of the optimal axis tree and the new block. The entire blockchain network can also reach a consensus on the axis tree of the updated DAG view according to the PBFT algorithm, thereby ensuring that the processing efficiency of the blockchain system is improved under the premise of decentralization and security.

[0008] The patent document with publication number CN111901350A in the prior art proposes a blockchain system, data processing method, computer equipment and storage medium, which belongs to the field of blockchain technology. The data processing method of blockchain improves the storage efficiency of blocks by constructing a blockchain with a directed acyclic graph structure, compresses the data stored in the blocks, and effectively increases the storage space of the blocks; transmits data in an aggregated manner, which improves the network communication efficiency of the blockchain; synchronizes transaction information in each node using the POA protocol, reduces the complexity of verification, and accelerates the consensus verification efficiency between nodes; and uses the side chain protocol and sharding strategy to control data interaction between blocks, which accelerates the interaction efficiency between blocks.

[0009] However, while the existing txDAG graph blockchain projects have improved system performance, they have also brought high data storage overhead. More precisely, compared with blockDAG graph blockchain projects or chain blockchain projects, the storage overhead problem of txDAG projects is more severe. This is because the txDAG system requires each transaction to contain additional hash fields to reference past transactions, and these transaction fields often take up a lot of storage space. Specifically, the size of the hash field is often larger than other fields, such as the former requires 32 bytes, while the random number in the latter often only requires 8 bytes or 4 bytes. Therefore, the txDAG system can easily accumulate up to TB (Terabyle) or even more data, which exceeds the storage capacity of ordinary nodes. Especially in scenarios with limited device resources such as the Internet of Things (IoT), the high storage overhead problem of nodes needs to be solved urgently.

[0010] In addition, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making the present invention, but due to space limitations, not all details and contents are listed in detail. However, this does not mean that the present invention does not have the characteristics of these prior arts. On the contrary, the present invention already has all the characteristics of the prior art, and the applicant reserves the right to add relevant prior art to the background technology. Summary of the invention

[0011] The existing lightweight data storage solutions proposed for blockchain systems are mainly proposed for chain blockchain structures. In chain blockchain systems, due to the low transaction frequency, the redundancy of account data is also relatively low, and there is no mutual reference between transactions in chain blockchain systems, so there is no redundancy problem of reference data. In contrast, the graph blockchain, especially the txDAG graph blockchain, uses a more fine-grained "transaction" as a storage unit, which can obtain a higher degree of parallelism, but while improving the system performance, it also brings high data storage overhead. The redundancy problem of account data and reference data in the graph blockchain is serious. In this regard, the present invention proposes a lightweight data storage device and method suitable for graph blockchain, or it can also be called a flexible and scalable data storage model and system for graph blockchain, which realizes high scalability in the graph blockchain. The present invention analyzes the redundancy of data in the graph blockchain system and proposes two data redundancy problems: account data redundancy and reference data redundancy. In this regard, the present invention proposes a periodic transaction merging scheme to reduce the redundancy of account data; and by analyzing the coverage relationship between reference data, the covered references and transactions are deleted to reduce the redundancy of reference data. Through the transaction merging and transaction reference deletion schemes combined with each other proposed in the present invention, the purpose of reducing the data storage overhead in the graphical blockchain can be achieved.

[0012] The present invention proposes a lightweight data storage device suitable for a graphical blockchain, which at least includes a common transaction construction module for users to initiate new transactions and a network broadcast module for broadcasting transactions, and is characterized in that it also includes a merged transaction construction module and a transaction deletion module. The merged transaction construction module is used to perform a first lightweight processing on the transaction when it determines that the number of transactions initiated by the account meets the first preset condition, and the transaction deletion module is used to perform a second lightweight processing on the transaction obtained after the first lightweight processing and whose verification reference meets the second preset condition, and the network broadcast module broadcasts the processed transaction. The first lightweight processing refers to merging the transaction. The second lightweight processing refers to deleting the transaction.

[0013] According to a preferred embodiment, the merged transaction building module is configured to periodically determine whether the number of transactions initiated by the account satisfies a first preset condition for performing merge processing.

[0014] According to a preferred embodiment, the lightweight data storage device further includes a common transaction construction module, which is used to construct new transaction data initiated by the user.

[0015] According to a preferred embodiment, the merged transaction construction module is used to collect at least one transaction initiated before the new transaction is constructed and merge the collected transaction with the constructed new transaction.

[0016] According to a preferred embodiment, the merged transaction construction module may generate at least one of the content area, the header area, the verification area and the signature area of ​​the merged transaction through the first lightweight processing.

[0017] According to a preferred embodiment, the lightweight data storage device further comprises a content area compression module, which is used to uniformly store content areas in different merged transactions of the same account.

[0018] The present application also proposes a lightweight data storage method suitable for a graphical blockchain, which is characterized in that it at least includes: determining whether the number of transactions initiated by an account meets a first preset condition; when the number of transactions meets the first preset condition, merging the transactions; determining whether the verification reference of the transaction meets a second preset condition; when the verification reference meets the second preset condition, deleting the transaction; broadcasting the merged transaction.

[0019] According to a preferred embodiment, it is periodically determined whether the number of transactions initiated by the account satisfies a first preset condition for performing merging processing.

[0020] According to a preferred embodiment, the first preset condition includes: the current number of transactions initiated by the account is an integer multiple of a preset transaction number threshold.

[0021] According to a preferred implementation, at least two transactions corresponding to a preset transaction number threshold among the transactions initiated by the account are merged to obtain a merged transaction.

[0022] According to a preferred embodiment, the step of performing transaction merging processing at least includes: combining the verification references in each transaction to jointly form a verification area in the merged transaction.

[0023] According to a preferred implementation, the second preset condition includes: at least one transaction in the merged transaction reaches a reference coverage state.

[0024] According to a preferred embodiment, the step of performing transaction deletion processing at least includes: deleting the verification reference data of the transaction that has reached the reference coverage state.

[0025] According to a preferred implementation, if the number of transactions initiated by the account does not satisfy the first preset condition, the account constructs a common transaction and broadcasts the common transaction.

[0026] The present invention also proposes a lightweight data storage device suitable for a graphical blockchain, which includes at least a general transaction construction module for users to initiate new transactions, and also includes: a merged transaction construction module, which is configured to collect at least one transaction previously initiated by the account, and merge the relevant fields in the at least one transaction previously initiated and the new transaction; a reference coverage calculation module, which is used to calculate the coverage relationship of the verification reference contained in the new transaction; a transaction deletion module, which is used to delete transactions that have reached the reference coverage state.

[0027] The present invention also proposes a lightweight data storage device suitable for a graph blockchain, comprising a computer device, characterized in that the computer device is programmed or configured to execute the steps of the lightweight data storage method suitable for a graph blockchain proposed in the present invention, or the storage medium of the computer device stores a computer program programmed or configured to execute the lightweight data storage method suitable for a graph blockchain proposed in the present invention, or the computer-readable storage medium stores a computer program programmed or configured to execute the lightweight data storage method suitable for a graph blockchain proposed in the present invention.

[0028] Through the technical solution conceived by the present invention, at least one of the following beneficial effects can be achieved:

[0029] (1) The present invention designs a lightweight data storage model for the graph blockchain, which is expected to greatly reduce the data storage overhead of the blockchain system and improve the scalability of the system. At the same time, the model can ensure the parallelization characteristics of the original graph blockchain system, thereby ensuring a higher system throughput. In addition, the model will not affect the cumulative confirmation consensus algorithm used in the graph blockchain system, thereby maintaining the original security of the graph blockchain system.

[0030] (2) The present invention proposes a lightweight data storage model for graph-based blockchains, which will also be of reference significance for the design of data storage models for blockchains under other structures. For example, for traditional chain-structured blockchain systems and graph-chain hybrid blockchain systems that may appear in the future, the merging and deletion methods proposed in the present invention are expected to reduce the data storage overhead of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a simplified flow chart of a lightweight data storage method applicable to a graphical blockchain provided by the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0033] For ease of understanding, technical terms of the present invention are explained as follows.

[0034] DAG, Directed Acyclic Graph, is a directed acyclic graph. According to the mathematical definition, DAG refers to a finite directed graph without directed cycles. It consists of a finite number of vertices and directed edges. Each directed edge points from one vertex to another. Starting from any vertex, you cannot return to the original vertex through these directed edges. In the computer field, a directed acyclic graph is a data structure, that is, a way of organizing data.

[0035] Graph blockchain mainly refers to blockchain based on DAG, also known as DAG ledger, which uses DAG data structure to organize ledger data and store it. Each vertex of DAG ledger represents a storage unit, which can be a single transaction or a block composed of multiple transactions within a period of time. The general single-chain blockchain is a special case of DAG ledger, that is, the entire system can only generate one block in each time period. The difference is that DAG ledger allows different nodes to create storage units at their own pace, as long as each storage unit selects one or more units as its subunits. The advantages of DAG ledger over traditional chain blockchain are very obvious, mainly in scalability and transaction throughput. Because DAG data structure is used to organize the ledger, each node does not need to wait for the data of other nodes to reach unity before processing new transactions, avoiding time waste caused by network delays and data synchronization. Therefore, the nodes participating in DAG accounting can be easily extended significantly. In addition, the end of the DAG ledger can add any amount of new data in parallel, so it has a natural high concurrency feature and can provide a high transaction throughput. This is even more superior to chain blockchain. The chain blockchain can only increase the amount of data by one block at a time, so the transaction throughput provided is limited and difficult to increase significantly.

[0036] Elastic scalability, which in the present invention can refer to a technology or protocol that can process more transactions in a fixed time. Traditional payment networks like Visa can process thousands of transactions per second, but most blockchains can currently only process a small number of transactions at the same time.

[0037] Blockchain, a blockchain is maintained by a group of nodes with consensus protocols (proof of work, proof of stake, and proof of stake authorization). Each full node retains a local copy of the entire blockchain, so each node can access historical information, complete search transactions, and calculate balances. However, as the amount of data contained in the blockchain gradually increases, the storage space required continues to increase. For example, a complete digital certificate block consists of a block header and a block body, where the block header occupies 80 bytes and contains basic information about the block, such as the version number, the block header hash value of the previous block, the Merkle root hash, timestamp, target value, and random number, etc.; the block body includes transaction data. The transaction data contained in the block body is used to build a Merkle tree, and the roots of the Merkle tree are stored in the block header. Each transaction is signed by the sender using a digital signature to ensure that the transaction cannot be forged. A transaction includes several transaction inputs and several transaction outputs. Each input of a transaction corresponds to the output of a previous transaction, represented by a hash pointer, which occupies 32 bytes and is called previous tx hash. Since each transaction has at least one input, and the size of the hash field is often larger than other fields, such as the former requires 32 bytes, while the random number in the latter often only requires 8 bytes or 4 bytes, the hash pointer will take up a lot of space in the block.

[0038] In order to reduce the data storage overhead of the diagram blockchain system, the present invention proposes a lightweight data storage method suitable for the diagram blockchain, which method includes at least steps S1 to S10. Although the lightweight data storage method in the specific embodiment of the present invention is depicted in a specific order, this should not be understood as requiring such operations to be completed in the specific order shown or in a sequential order, or to perform all illustrated operations to obtain the desired results. In some cases, multitasking or parallel processing can be beneficial. Similarly, although the above discussion contains certain specific implementation details, this should not be interpreted as limiting the scope of any invention or claim, but should be interpreted as a description of a specific embodiment that can be directed to a specific invention. Certain features described in the context of separate embodiments in this specification may also be integrated and implemented in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately in multiple embodiments or in any suitable subcombination.

[0039] S1: For the Nth transaction initiated by the account, determine whether N is an integer multiple of K. This determination corresponds to the first preset condition. Figure 1The N%Y==0 shown is equivalent to: N is divisible by Y, that is, N is an integer multiple of Y. If N%Y==0 holds, go to step S2; otherwise, go to step S3. The merging of transactions is performed according to a certain period to avoid the computational overhead caused by frequent merging. Without loss of generality, the period is set to K transactions. That is: every time the account initiates K transactions, it attempts to perform a merge operation. In this application, the K value is a preset transaction number threshold.

[0040] S2: Account construction normal transaction T N , broadcast the normal transaction.

[0041] Preferably, a normal transaction T N It can contain a parent reference field, two verification reference fields, sender account field, receiver account field, transfer amount field, timestamp field, random number field and signature field. Among them, the parent reference field points to the previous transaction hash issued by the account, and the verification reference field randomly points to two end node transaction hashes in the network.

[0042] Preferably, to ensure that ordinary transactions can be merged in the subsequent stage, step S2 may also include: if a transaction is not referenced by any other transaction using the verification reference field, the transaction is considered to be an end node transaction. Generally speaking, end node transactions represent some newly generated transactions. In addition, due to different network views of different accounts and certain latency of the network, different accounts may reference the same end node transaction at the same time.

[0043] S3: For the Nth transaction that meets the merging cycle, merge the K-1 transactions before it. Get the K-1 transactions initiated by the account before: T N-K+1 , T N-K+2 , …, T N-1 , merged into TU N .

[0044] Preferably, in order to reduce the data storage overhead of the merged transaction, step S3 may further include at least one of S31 to S34.

[0045] S31: According to the importance of the transaction content, the content of each transaction can be divided into two categories: core content and auxiliary content. The core content includes the recipient account, transfer amount, timestamp, random number and other fields of the transaction; while the auxiliary content mainly includes the parent reference and verification reference fields. N-K+1 , T N-K+2 ,…,T N-1 , T N For each transaction in the merger, the core content of the transaction is retained in the merger transaction, forming the core content area of ​​the merger transaction.

[0046] S32: Process the parent reference in the auxiliary content and convert T N-K+1 The parent reference and the current account in the transaction form the header area in the merged transaction.

[0047] S33: Process the verification reference in the auxiliary content and convert T N-K+1 , T N-K+2 ,…,T N-1 , T N The verification references in are combined together to form the verification zone of the merged transaction.

[0048] For multiple merged transactions issued by the same account, the content area data in different merged transactions have a high duplication ratio. S34: The core content area data in the merged transaction is uniformly stored in a common content area (CCS, Common Content Site), and a pointer to a different part of the CCS is generated for each merged transaction to indicate the number of content areas of the merged transaction.

[0049] S34: Finally, sign the entire merged transaction and append it to the end of the merged transaction.

[0050] S4: Let i = N-K+1. At this time, i corresponds to the N-K+1th transaction T N-K+1 .

[0051] S5: Determine whether i<N. This determination corresponds to the second preset condition. If i<N is established, go to step S6. Otherwise, go to step S10.

[0052] S6: Update the reference count of the i-th transaction. Specifically, if a new transaction references a previous transaction, the reference count of the referenced transaction is incremented by 1. The reference count of the i-th transaction is updated to ensure the existence of the object it references. This will not affect the cumulative confirmation consensus algorithm used in the graph blockchain system.

[0053] S7: Determine whether the verification reference in the previous i-th transaction has reached the "reference coverage" state. This is used to further simplify the verification zone data in the merged transaction. If yes, proceed to step S8; if not, proceed to step S9.

[0054] Preferably, for any two verification references, if the head node and tail node of the references belong to the same account, the verification reference with a later timestamp is said to have overwritten the verification reference with an earlier timestamp. If all verification references in a transaction are overwritten, the transaction is said to have reached the "reference overwrite" state.

[0055] S8: Delete the i-th transaction to reduce data storage space.

[0056] S9: Increment the value of i and go to step S5 to process the next transaction. By incrementing the value of i, K transactions in the current transaction cycle can be traversed. Figure 1 The i++ shown is equivalent to incrementing the value of i.

[0057] S10: Broadcast TU N ,Finish.

[0058] Preferably, in order to reduce the network transmission overhead in TU broadcasting, the current user only needs to broadcast the recipient account, transfer amount, timestamp, random number, verification reference field in the new transaction, and the signature field in the new TU. After receiving the above field information, other users can construct the complete content of the new TU (merged transaction) based on the existing transaction data.

[0059] The lightweight data storage device for a graph blockchain proposed in the present application includes at least one of a common transaction building module, a merged transaction building module, a reference count update module, a reference coverage calculation module, a transaction deletion module, a content area compression module, and a network broadcast module. The lightweight data storage device of the present invention is preferably, for example, a computer, a server, etc., and other devices or systems using a lightweight data storage device. According to an embodiment of the present invention, in addition to the common transaction building module, the merged transaction building module, the reference count update module, the reference coverage calculation module, the transaction deletion module, the content area compression module, and the network broadcast module, the shard storage device may also include other components such as a central processing unit, a communication unit, a storage unit, and an I / O unit. For example, the common transaction building module, the merged transaction building module, the reference count update module, the reference coverage calculation module, the transaction deletion module, the content area compression module, and the network broadcast module are respectively connected to the central processing unit, and all interact with the central processing unit for information. Or for example, the common transaction building module, the merged transaction building module, the reference count update module, the reference coverage calculation module, the transaction deletion module, the content area compression module, and the network broadcast module are connected to each other in sequence for information interaction.

[0060] As an example, various exemplary logic blocks, modules and circuits described in conjunction with the present disclosure may be implemented or executed with a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components or any combination thereof for performing the functions described herein. A general-purpose processor may be a microprocessor, or a processor may be any common processor, controller, microcontroller or state machine. A processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, a combination of one or more microprocessors and a DSP core, or any other such structure. As an example, embodiments of the present disclosure may be described in the context of machine executable instructions, such as program modules executed in a device on a real or virtual processor of a target. In general, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functions of program modules may be merged or split between the described program modules. Machine executable instructions for program modules may be executed in local or distributed devices. In a distributed device, program modules may be located in both local and remote storage media.

[0061] The general transaction building module is used by users to initiate new transactions. The general transaction building module builds transaction data when there is no need to merge transactions. Building transaction data includes signing the generated new transaction.

[0062] The merged transaction construction module is used to collect K-1 transactions previously initiated by the account. The merged transaction construction module merges the relevant fields in these K-1 transactions and the new transaction. The merged transaction construction module can generate the content area, header area, verification area and signature area in the merged transaction.

[0063] The reference count update module is used to update the reference counts of other nodes pointed to by the new transaction.

[0064] The reference coverage calculation module is used to calculate the coverage relationship of the verification references included in the new transaction. The reference coverage calculation module can mark the covered verification references.

[0065] The transaction pruning module is used to prune transactions whose verification references have been overwritten, thereby reducing the data storage overhead in the system.

[0066] The content area compression module is used to uniformly store the content areas in different merged transactions of the same account. The data redundancy in the merged transaction is compressed, which can effectively reduce the data storage overhead.

[0067] The network broadcast module is used to collect the recipient account, transfer amount, timestamp, random number, verification reference field in the new transaction, and the signature field in the new TU. The network broadcast module combines these fields into TU increments to achieve lightweight network broadcasting.

[0068] It should be noted that the above-mentioned specific embodiments are exemplary, and those skilled in the art can come up with various solutions inspired by the disclosure of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the protection scope of the present invention. Those skilled in the art should understand that the present invention specification and its drawings are illustrative and do not constitute a limitation on the claims. The scope of protection of the present invention is defined by the claims and their equivalents. The present invention specification contains multiple inventive concepts, such as "preferably", "according to a preferred embodiment" or "optionally", all of which indicate that the corresponding paragraph discloses an independent concept, and the applicant reserves the right to file a divisional application based on each inventive concept.

Claims

1. A lightweight data storage device suitable for a graph blockchain, comprising at least a common transaction building module for a user to initiate a new transaction and a network broadcasting module for broadcasting transactions, It is characterized in that It also includes a merged transaction construction module and a transaction deletion module. The merged transaction construction module is used to perform a first lightweight processing on the transaction when it determines that the number of transactions initiated by the account meets the first preset condition of being an integer multiple of the preset transaction number threshold K, so as to merge K-1 transactions before the Nth transaction that meets the merging cycle into a merged transaction, and the ordinary transaction construction module constructs an ordinary transaction from the Nth transaction. The transaction deletion module is used to perform a deletion processing on the merged transaction obtained after the first lightweight processing and whose verification reference meets the second preset condition. The network broadcast module broadcasts the ordinary transaction and the merged transaction obtained by the processing. The second preset condition includes: at least one transaction in the merged transaction reaches the reference coverage state. For any two verification references, if the head node and the tail node of the reference belong to the same account, the verification reference with the later timestamp is said to cover the verification reference with the earlier timestamp. If all verification references in a transaction are covered, the transaction is said to have reached the reference coverage state.

2. The lightweight data storage device according to claim 1, characterized in that: The merged transaction building module is configured to periodically determine whether the number of transactions initiated by the account meets a first preset condition for performing merge processing.

3. The lightweight data storage device according to claim 1 or 2, characterized in that: The merged transaction construction module is used to collect at least one transaction initiated before the new transaction is constructed and merge the collected transaction with the constructed new transaction.

4. The lightweight data storage device according to claim 1, characterized in that: The merged transaction construction module generates at least one of a content area, a header area, a verification area, and a signature area of ​​the merged transaction through a first lightweight process.

5. The lightweight data storage device according to claim 4, characterized in that: The lightweight data storage device further comprises a content area compression module, which is used for uniformly storing content areas in different merged transactions of the same account.

6. A lightweight data storage method suitable for a graph blockchain, characterized in that: At least: Determine whether the number of transactions initiated by the account meets a first preset condition, the first preset condition including: the current number of transactions initiated by the account is an integer multiple of a preset transaction number threshold K; When the number of transactions meets the first preset condition, the transactions are subjected to a first lightweight processing, so as to merge K-1 transactions before the Nth transaction that meets the merging period into a merged transaction, and the Nth transaction is constructed into a common transaction; Determining whether the verification reference of the merged transaction obtained after the first lightweight processing satisfies a second preset condition; When the verification reference satisfies the second preset condition, the merged transaction is deleted; Broadcast normal transactions and processed merged transactions, The second preset condition includes: at least one transaction in the merged transaction reaches the reference coverage state. For any two verification references, if the head node and the tail node of the reference belong to the same account, the verification reference with the later timestamp is said to cover the verification reference with the earlier timestamp. If all verification references in a transaction are covered, the transaction is said to have reached the reference coverage state.

7. The lightweight data storage method according to claim 6, characterized in that: Periodically determine whether the number of transactions initiated by the account meets a first preset condition for merging processing.

8. The lightweight data storage method according to claim 6 or 7, characterized in that: At least two transactions corresponding to a preset transaction number threshold among the transactions initiated by the account are merged to obtain a merged transaction.

Citation Information

Patent Citations

  • Block chain consensus achieving method and device based on directed acyclic graph

    CN111080288A

  • Block chain system, data processing method, computer equipment and storage medium

    CN111901350A

  • An edge cooperation method based on block chain

    CN109508991A

  • Data processing method and device based on block chain and server

    CN110046990A