CN116049315A - Block chain storage method, system, device and storage medium - Google Patents

Block chain storage method, system, device and storage medium Download PDF

Info

Publication number
CN116049315A
CN116049315A CN202310087799.1A CN202310087799A CN116049315A CN 116049315 A CN116049315 A CN 116049315A CN 202310087799 A CN202310087799 A CN 202310087799A CN 116049315 A CN116049315 A CN 116049315A
Authority
CN
China
Prior art keywords
remainder
block
hash
node
remainder system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310087799.1A
Other languages
Chinese (zh)
Inventor
汪卫星
唐燚
徐光侠
马创
刘俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Polytechnic Institute
Original Assignee
Guangdong Polytechnic Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Polytechnic Institute filed Critical Guangdong Polytechnic Institute
Priority to CN202310087799.1A priority Critical patent/CN116049315A/en
Publication of CN116049315A publication Critical patent/CN116049315A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a block chain storage method, a system, a device and a storage medium, wherein the method comprises the following steps: establishing a redundant remainder system based on the remainder system; based on the time stamp of the entering block, performing node mapping hash ring through a consistent hash algorithm; and responding to the transaction update of the target block, and updating the block data based on the error checking and correcting of the transaction information by the redundant remainder system. The invention ensures that the represented computing system has redundancy by referring to the redundant remainder system, ensures the correctness of the operation result, combines a consistency hash algorithm to carry out node mapping hash rings, and can effectively solve the load balancing problem. The invention can effectively reduce the data storage capacity of each node in the block chain system, improve the transaction speed of the block chain and can be widely applied to the technical field of block chain storage.

Description

Block chain storage method, system, device and storage medium
Technical Field
The present invention relates to the technical field of blockchain storage, and in particular, to a blockchain storage method, a system, a device and a storage medium.
Background
Blockchain is a model for implementing and managing transaction (transaction) processing in a peer-to-peer network environment by constructing a non-counterfeitable, non-tamperable, and traceable blockchain data structure (in time-stamped order) through transparent and trusted rules. The method performs storage synchronization on all nodes of the whole network through storage resources of the distributed nodes, ensures the effectiveness of the internal nodes on storage content change through corresponding consensus technology, and maintains a complete searchable database. In this system, all that is stored is a change or total remainder of the balance between in-chain generated accounts, although some more sophisticated system functions also include storing data state maintenance of sub-accounts in the database for multiple accounts.
Blockchain technology allows any user to establish trust relationships without requiring a third party trust authority, such trust relationships result from the user's trust in the entire system, without trust in a single node, such technical features will bring great revolution to inter-organizational collaboration relationships, business models in various areas, however, current blockchain systems generally have serious performance scalability bottlenecks: transaction throughput is inadequate. However, the current common blockchain system generally needs to generate a block every about 10min, and theoretically only can support 7 transactions/s, and the best blockchain system only supports 15 transactions/s at the highest, so that the performance of the blockchain system is difficult to meet the practical application requirements in the face of most business scenes (especially high-frequency transactions).
In view of this, how to effectively solve the performance bottleneck and capacity bottleneck of blockchain storage is a problem that needs to be solved.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a blockchain storage method, system, device, and storage medium, which can effectively reduce the data storage amount of each node in a blockchain system, and increase the transaction speed of the blockchain.
In one aspect, an embodiment of the present invention provides a blockchain storage method, including:
establishing a redundant remainder system based on the remainder system;
based on the time stamp of the entering block, performing node mapping hash ring through a consistent hash algorithm;
and responding to the transaction update of the target block, and updating the block data based on the error checking and correcting of the transaction information by the redundant remainder system.
Optionally, establishing a redundant remainder system based on the remainder system includes:
establishing a remainder system, and determining a dynamic range according to a modulus set of the remainder system; wherein, the moduli are concentrated in pairs;
based on the remainder system, introducing a redundancy check base to establish a redundancy remainder system;
determining an error range according to the redundancy check base; and the redundant remainder system performs error detection and correction through redundant information in an error range.
Optionally, the method further comprises:
determining a remainder base for each node in the blockchain based on the remainder system;
according to Yu Shuji, modular operation is performed on account data of the blockchain node, so that bit width compression of the account data is realized.
Optionally, performing the node mapping hash ring by a consistent hash algorithm based on the timestamp of the incoming block includes:
taking the time stamp of the entering block as a sequence, and obtaining a hash ring through a consistent hash algorithm;
obtaining a hash abstract based on block head data of a block to be built, and further obtaining a mapping position of the block to be built on a hash ring through a consistent hash algorithm;
and obtaining a target node by using the time stamp corresponding to the mapping position, creating a block to be built by the target node, and broadcasting the block in the whole network.
Optionally, in response to the transaction update of the target block, performing error checking and correction of the transaction information based on the redundant remainder system, updating the block data, including:
responding to the transaction update of the target block, utilizing a redundant remainder system to combine with the overflow judgment theorem, and adopting the Chinese remainder theorem to carry out error checking and correction on the transaction information; the dynamic range and the error range determined by the redundant remainder system are used as judgment standards for error detection and correction;
and updating the information of the mapping position of the transaction information with the error checking completion by using a consistent hash algorithm, and writing the updated information into the target block.
Optionally, the step of implementing the consistent hashing algorithm includes:
presetting a mapping to interval 0,23 2 -1]A hash function thereon;
the intervals are connected end to form a hash ring which grows clockwise;
determining node marks of all nodes in a hash ring through hashing the labels of all the nodes;
responsive to the mapping requirement, determining a corresponding hash ring flag by a hash function;
and obtaining the target node mark based on the position relation between the hash ring mark and each node mark.
In another aspect, embodiments of the present invention provide a blockchain storage system, comprising:
a first module for establishing a redundant remainder system based on the remainder system;
the second module is used for carrying out node mapping hash rings through a consistent hash algorithm based on the time stamps of the entering blocks;
and a third module for updating the block data based on the redundancy remainder system for error checking of the transaction information in response to the transaction update of the target block.
Optionally, the method further comprises:
a fourth module for determining a remainder base for each node in the blockchain based on the remainder system; and performing modular operation on account data of the block chain nodes according to the residual number base to realize bit width compression of the account data.
In another aspect, embodiments of the present invention provide a blockchain storage device including a processor and a memory;
the memory is used for storing programs;
the processor executes a program to implement the method as before.
In another aspect, embodiments of the present invention provide a computer-readable storage medium storing a program for execution by a processor to perform a method as previously described.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the foregoing method.
The embodiment of the invention firstly establishes a redundant remainder system based on the remainder system; based on the time stamp of the entering block, performing node mapping hash ring through a consistent hash algorithm; and responding to the transaction update of the target block, and updating the block data based on the error checking and correcting of the transaction information by the redundant remainder system. The invention ensures that the represented computing system has redundancy by referring to the redundant remainder system, ensures the correctness of the operation result, combines a consistency hash algorithm to carry out node mapping hash rings, and can effectively solve the load balancing problem. The invention can effectively reduce the data storage capacity of each node in the block chain system and improve the transaction speed of the block chain.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a block chain storage method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an error detection and correction procedure for RNNS according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a specific application of a blockchain storage method according to an embodiment of the present invention;
fig. 4 is a block chain storage method architecture diagram based on a redundant remainder system and a consistent hashing algorithm according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In one aspect, referring to fig. 1, an embodiment of the present invention provides a blockchain storage method, including:
s100, establishing a redundant remainder system based on the remainder system;
it should be noted that, in some embodiments, a remainder system is first established, and a dynamic range is determined according to a modulus set of the remainder system; wherein, the moduli are concentrated in pairs; based on the remainder system, introducing a redundancy check base to establish a redundancy remainder system; determining an error range according to the redundancy check base; and the redundant remainder system performs error detection and correction through redundant information in an error range.
In some embodiments, the method further comprises: determining a remainder base for each node in the blockchain based on the remainder system; according to Yu Shuji, modular operation is performed on account data of the blockchain node, so that bit width compression of the account data is realized.
Specifically, in some embodiments, step S100 includes the steps of:
s110, establishing a remainder system (RNS), taking the modulus x i I=1, 2,3, …, n, intermodular, note
Figure BDA0004069340660000041
I.e., the least common multiple of all moduli, referred to as the dynamic range; mapping the original data to a remainder system through Gaussian modulo operation to obtain a remainder vector { x } 1 ,x 2 ,…,x n Compression of the data bit width is achieved. Each node in the blockchain randomly selects a remainder base from the modulus when joining the networkThe remainder base, once selected, is stored locally and cannot be altered. And then performing modulo operation on all account data in the blockchain node to obtain a plurality of corresponding remainders, wherein the bit width of each remainder is obviously reduced relative to the bit width of the original account data. At this time, each node stores a remainder of a remainder base corresponding to the plurality of account data. Namely, compressing the blockchain account data by using a remainder system; />
S120, establishing a redundant remainder system (RNNS). The blockchain account data may be compressed by the remainder system in step S110, but the original account data needs to be recovered in the transaction information verification stage to verify whether the transaction information is correct. So choose modulus x i I=1, 2,3, …, k, k+1, …, k+l, intermodular, note two-by-two
Figure BDA0004069340660000042
I.e. the least common multiple of the total modulus, where x 1 <x 2 <…<x k+l ;x 1 ,x 2 ,…,x k Is information base, x k+1 ,x k+2 ,…,x k+l Let n=k+l, < > for redundancy check base>
Figure BDA0004069340660000043
Wherein M is k For dynamic range, N n Is of error range according to N n The redundant information provided can be used for error checking and correction of the block transaction information.
S200, performing node mapping hash rings through a consistent hash algorithm based on the time stamps of the entering blocks;
in some embodiments, the hash ring is obtained by a consistent hash algorithm with the time stamp of the incoming block as a sequence; obtaining a hash abstract based on block head data of a block to be built, and further obtaining a mapping position of the block to be built on a hash ring through a consistent hash algorithm; and obtaining a target node by using the time stamp corresponding to the mapping position, creating a block to be built by the target node, and broadcasting the block in the whole network.
Of which, in some embodiments, oneThe implementation of the sexual hash algorithm comprises the following steps: presetting a mapping to interval 0,23 2 -1]A hash function thereon; the intervals are connected end to form a hash ring which grows clockwise; determining node marks of all nodes in a hash ring through hashing the labels of all the nodes; responsive to the mapping requirement, determining a corresponding hash ring flag by a hash function; and obtaining the target node mark based on the position relation between the hash ring mark and each node mark.
Specifically, in some embodiments, step S200 includes the steps of:
s210, generating a hash ring to enter a timestamp T of the block h For the sequence, a hash ring R is obtained through a consistent hash algorithm, namely, the corresponding T is obtained according to a common hash algorithm h Hash to a hash with 2 32 In the space of the secondary nodes, i.e. 0-2 32 -1 in the digital space; let hash (key) be mapped to interval 0,2 32 -1]A hash function thereon. The intervals are connected end to form a hash ring which grows clockwise, and all slots (or nodes) N 0 ,..,N n-1 The reference numerals 0, …, n-1 of the whole main blockchain are sequentially used as the input of a hash function to hash, the results are marked on the rings (node marks are obtained) respectively, and the operation is that the backup of the whole main blockchain is stored on each service node, and a data structure is built on the service node to quickly search indexes;
s220, hash mapping, for T h I.e. mapping requirements, to find z=hash (T h ) Marked on the ring (i.e., hash ring mark): if z happens to fall on the slot marker (i.e., the node marker), the corresponding slot index for this slot marker is returned, i.e., the position corresponding to the index in the hash ring that was already established in S210. Otherwise, the nearest slot to z is found clockwise along the ring, returning the slot index. With time stamp T h+1 Block B to be built i+1 The block header data of (1) is used for obtaining a hash abstract HD, and the mapping position L on the hash ring R is obtained through a consistent hash algorithm i
S230, creating block nodes to map the position L i The corresponding timestamp in S210 requires T h Obtaining a nodeN i (i.e., target node), node N i Creating virtual block B i+1 Broadcasting the block to the whole network to prepare for the follow-up formal uplink;
s300, responding to transaction updating of the target block, and updating block data based on error checking and correcting of transaction information by a redundant remainder system;
it should be noted that, in some embodiments, in response to the transaction update of the target block, the redundancy remainder system is utilized to combine with the overflow judgment theorem, and the Chinese remainder theorem is adopted to perform the error checking and correction of the transaction information; the dynamic range and the error range determined by the redundant remainder system are used as judgment standards for error detection and correction; and updating the information of the mapping position of the transaction information with the error checking completion by using a consistent hash algorithm, and writing the updated information into the target block.
Specifically, in some embodiments, step S300 includes the steps of:
s310, when there is a block transaction update, using the corresponding timestamp T in step 200 h The remainder generated by the hash function is then reused by a redundant remainder system and overflow decision theorem. Wherein the overflow judgment theorem is used for judging that when the correct remainder vector is more than the wrong remainder vector in the redundant remainder system, the Chinese Remainder Theorem (CRT) is adopted for carrying out error detection and correction on transaction information, and when the calculated remainder is positioned in the error range M n The existence of malicious nodes falsifies the local remainder to try to manufacture a false account, error correction is carried out, and the current steps are repeated until the remainder is positioned in the dynamic range M k Until now, the specific flow is referred to fig. 2: initially, the local receiver calculates CRT (Φ ')' l+t ) If no erroneous remainder exists, there is a CRT (phi)' l+t )≤M k -1, then directly output CRT (Φ ')' l+t ) The method comprises the steps of carrying out a first treatment on the surface of the If there is an erroneous remainder, there must be a CRT (phi)' l+t )>M k -1. To recover the correct transaction data X, the local receiver will continue to recover the remainder set Φ' l+t Selecting a subset phi' l And calculate
Figure BDA0004069340660000061
X mod M l Obtaining X e If X e ≤M k -1, then output X e As long as the local receiver can obtain not less than 2/3 correct remainder modulus pairs, the original data can be recovered, i.e. the block transaction is acknowledged as correct;
s320, after the step S310 is completed, the local information of the mapping position is changed by utilizing a consistent hash algorithm, the validity of the transaction is ensured through verification of the adjacent backup nodes, and the block information is updated in the main chain synchronously after the information is updated.
The following further describes the technical scheme of the present invention with reference to specific examples, and it should be noted that the following is merely illustrative of the present invention and should not be construed as limiting the present invention:
referring to fig. 3, a flowchart of a specific application of the blockchain storage method based on the redundancy remainder system and the consistent hash algorithm is implemented in the present invention, and the implementation steps of the specific architecture of the blockchain storage method based on the redundancy remainder system and the consistent hash algorithm shown in fig. 4 are as follows:
step 1: and establishing a redundant remainder system.
1.1 Remainder system (RNS), taking the modulus x i I=1, 2,3, …, n, intermodular, note
Figure BDA0004069340660000062
I.e., the least common multiple of all moduli, referred to as the dynamic range; mapping the original data to a remainder system through Gaussian modulo operation to obtain a remainder vector { x } 1 ,x 2 ,…,x n -compression of the data bit width is achieved;
1.2 Establishing redundant remainder system (RNNS), selecting modulus x i I=1, 2,3, …, k, k+1, …, k+l, intermodular, note two-by-two
Figure BDA0004069340660000063
I.e. the least common multiple of the total modulus, where x 1 <x 2 <…<x k+l ;x 1 ,x 2 ,…,x k For letterRest group, x k+1 ,x k+2 ,…,x k+l Let n=k+l, < > for redundancy check base>
Figure BDA0004069340660000064
Wherein M is k For dynamic range, M n For error range, according to M n The redundant information provided can be used for error checking and correction of the block transaction information;
step 2: the nodes map the hash ring.
2.1 Generating a hash ring to enter a timestamp T of a block h For the sequence, a hash ring R is obtained through a consistent hash algorithm, namely, the corresponding T is obtained according to a common hash algorithm h Hash to a hash with 2 32 In the space of the secondary nodes, i.e. 0-2 32 -1 in the digital space; let hash (key) be mapped to interval 0,2 32 -1]A hash function thereon. The intervals are connected end to form a hash ring which grows clockwise, and all slots (or nodes) N 0 ,..,N n-1 The reference numerals 0, …, n-1 of the whole main block chain are sequentially used as the input of a hash function to hash, the results are marked on the ring respectively, and the operation is that the backup of the whole main block chain is stored on each service node, and a data structure quick search index is built on the service node;
2.2 For T) hash mapping h Is mapped to determine z=hash (T h ) Marked on the ring: if z happens to fall on the slot, the index of this slot is returned, i.e., the position corresponding to the index in the hash ring that was already established in 2.1. Otherwise, the nearest slot to z is found clockwise along the ring, returning the slot index. With time stamp T h+1 Block B to be built i+1 The block header data of (1) is used for obtaining a hash abstract HD, and the mapping position L on the hash ring R is obtained through a consistent hash algorithm i
2.3 Block node is created to map position L i The corresponding timestamp in 2.1 requires T h Obtaining node N i With node N i Creating virtual block B i+1 Preparing for the subsequent formal uplink;
step 3: updating the block data.
3.1 When there is a block transaction update, the timestamp T in step 2 is utilized h The remainder generated by the hash function is then reused by a redundant remainder system and overflow decision theorem. Wherein the overflow judgment theorem is used for judging that when the correct remainder vector is more than the wrong remainder vector in the redundant remainder system, the Chinese Remainder Theorem (CRT) is adopted for carrying out error detection and correction on transaction information, and when the calculated remainder is positioned in the error range M n The existence of malicious nodes falsifies the local remainder to try to manufacture a false account, error correction is carried out, and the current steps are repeated until the remainder is positioned in the dynamic range M k Until now, the specific flow is referred to fig. 2: initially, the local receiver calculates CRT (Φ ')' l+t ) If no erroneous remainder exists, there is a CRT (phi)' l+t )≤M k -1, then directly output CRT (Φ ')' l+t ) The method comprises the steps of carrying out a first treatment on the surface of the If there is an erroneous remainder, there must be a CRT (phi)' l+t )>M k -1. To recover the correct transaction data X, the local receiver will continue to recover the remainder set Φ' l+t Selecting a subset phi' l And calculate
Figure BDA0004069340660000071
X mod M l Obtaining X e If X e ≤M k -1, then output X e As long as the local receiver can obtain not less than 2/3 correct remainder modulus pairs, the original data can be recovered, i.e. the block transaction is acknowledged as correct;
3.2 After the step 3.1 is completed, the local information of the mapping position is changed by utilizing a consistent hash algorithm, the validity of the transaction is ensured through verification of the adjacent backup nodes, and the block information is updated in the main chain synchronously after the information is updated.
In summary, the classical problem solved by the consistent hashing algorithm of the present invention is the load balancing problem, and the goal is to distribute a large amount of load "data" evenly to the server cluster formed by nodes. The redundant remainder system (Redundant Res idue Number System, RRNS) makes the computing system it characterizes redundant by introducing redundant remainder bases into the remainder system (Res idue Number System, RNS). The method is characterized in that all operation channels in RRNS are redundant, and the calculation of all the channels is independent; when an error occurs in a part of the remainder components, the error is not spread among the components, and a correct operation result can be obtained through the redundancy relation among the remainder components. The invention can effectively reduce the data storage capacity of each node in the block chain system and improve the transaction speed of the block chain.
In another aspect, embodiments of the present invention provide a blockchain storage system, comprising: a first module for establishing a redundant remainder system based on the remainder system; the second module is used for carrying out node mapping hash rings through a consistent hash algorithm based on the time stamps of the entering blocks; the third module is used for responding to the transaction updating of the target block, carrying out error checking and correction of transaction information based on a redundant remainder system, and updating the segment corresponding to the blood oxygen signal slice data of the block data low ventilation; the two-stage classification results include normal breathing, hypopnea, and apnea.
In some embodiments, further comprising: a fourth module for determining a remainder base for each node in the blockchain based on the remainder system; and performing modular operation on account data of the block chain nodes according to the residual number base to realize bit width compression of the account data.
The content of the method embodiment of the invention is suitable for the system embodiment, the specific function of the system embodiment is the same as that of the method embodiment, and the achieved beneficial effects are the same as those of the method.
Another aspect of the embodiments of the present invention also provides a blockchain storage device, including a processor and a memory;
the memory is used for storing programs;
the processor executes a program to implement the method as before.
The content of the method embodiment of the invention is suitable for the device embodiment, the specific function of the device embodiment is the same as that of the method embodiment, and the achieved beneficial effects are the same as those of the method.
Another aspect of the embodiments of the present invention also provides a computer-readable storage medium storing a program that is executed by a processor to implement a method as described above.
The content of the method embodiment of the invention is applicable to the computer readable storage medium embodiment, the functions of the computer readable storage medium embodiment are the same as those of the method embodiment, and the achieved beneficial effects are the same as those of the method.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the foregoing method.
In some alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flowcharts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed, and in which sub-operations described as part of a larger operation are performed independently.
Furthermore, while the invention is described in the context of functional modules, it should be appreciated that, unless otherwise indicated, one or more of the described functions and/or features may be integrated in a single physical device and/or software module or one or more functions and/or features may be implemented in separate physical devices or software modules. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary to an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be apparent to those skilled in the art from consideration of their attributes, functions and internal relationships. Accordingly, one of ordinary skill in the art can implement the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and are not intended to be limiting upon the scope of the invention, which is to be defined in the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution apparatus, device, or apparatus, such as a computer-based apparatus, processor-containing apparatus, or other apparatus that can fetch the instructions from the instruction execution apparatus, device, or apparatus and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution apparatus, device, or apparatus.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the embodiments described above, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are included in the scope of the present invention as defined in the appended claims.

Claims (10)

1. A blockchain storage method, comprising:
establishing a redundant remainder system based on the remainder system;
based on the time stamp of the entering block, performing node mapping hash ring through a consistent hash algorithm;
and responding to the transaction updating of the target block, and updating the block data based on the error checking and correcting of the transaction information of the redundant remainder system.
2. The blockchain storage method of claim 1, wherein the establishing a redundant remainder system based on the remainder system includes:
establishing a remainder system, and determining a dynamic range according to a modulus set of the remainder system; wherein, each module in the module set is of two-to-two quality;
based on the remainder system, introducing a redundancy check base to establish a redundancy remainder system;
determining an error range according to the redundancy check base; and the redundancy remainder system performs error detection and correction through the redundancy information of the error range.
3. The blockchain storage method of claim 2, further comprising:
determining a remainder base for each node in the blockchain based on the remainder system;
and performing modular operation on account data of the blockchain node according to the remainder base to realize bit width compression of the account data.
4. The blockchain storage method of claim 1, wherein the performing a node mapping hash loop based on the timestamp of the incoming block by a consistent hashing algorithm comprises:
taking the time stamp of the entering block as a sequence, and obtaining a hash ring through a consistent hash algorithm;
obtaining a hash abstract based on block head data of a block to be built, and further obtaining a mapping position of the block to be built on the hash ring through a consistent hash algorithm;
and obtaining a target node by using the timestamp corresponding to the mapping position, creating the block to be built by the target node, and performing whole network broadcasting.
5. The blockchain storage method of claim 1, wherein the updating the block data based on the redundancy remainder system for error checking of the transaction information in response to the transaction update of the target block includes:
responding to the transaction update of the target block, and performing error checking and correction of transaction information by adopting the Chinese remainder theorem by utilizing the redundant remainder system in combination with the overflow judgment theorem; the dynamic range and the error range determined by the redundant remainder system are used as determination standards for error detection and correction;
and updating the information of the mapping position of the transaction information with the error checking completion by using a consistent hash algorithm, and writing the updated information into the target block.
6. The blockchain storage method of claim 1, wherein the step of implementing the consistent hashing algorithm includes:
presetting a mapping to interval 0,23 2 -1]Hash function onA number;
the intervals are connected end to form a hash ring which grows clockwise;
determining node marks of all nodes in a hash ring through hashing the labels of all the nodes;
responsive to a mapping requirement, determining a corresponding hash ring token by the hash function;
and obtaining a target node mark based on the position relation between the hash ring mark and each node mark.
7. A blockchain storage system, comprising:
a first module for establishing a redundant remainder system based on the remainder system;
the second module is used for carrying out node mapping hash rings through a consistent hash algorithm based on the time stamps of the entering blocks;
and a third module, configured to respond to the transaction update of the target block, and update the block data based on the redundancy remainder system for error checking and correction of the transaction information.
8. The blockchain storage system of claim 7, further comprising:
a fourth module for determining a remainder base for each node in the blockchain based on the remainder system; and performing modular operation on account data of the blockchain node according to the Yu Shuji to realize bit width compression of the account data.
9. A blockchain storage device includes a processor and a memory;
the memory is used for storing programs;
the processor executing the program implements the method of any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the storage medium stores a program that is executed by a processor to implement the method of any one of claims 1 to 6.
CN202310087799.1A 2023-01-18 2023-01-18 Block chain storage method, system, device and storage medium Pending CN116049315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310087799.1A CN116049315A (en) 2023-01-18 2023-01-18 Block chain storage method, system, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310087799.1A CN116049315A (en) 2023-01-18 2023-01-18 Block chain storage method, system, device and storage medium

Publications (1)

Publication Number Publication Date
CN116049315A true CN116049315A (en) 2023-05-02

Family

ID=86125354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310087799.1A Pending CN116049315A (en) 2023-01-18 2023-01-18 Block chain storage method, system, device and storage medium

Country Status (1)

Country Link
CN (1) CN116049315A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116089402A (en) * 2023-04-07 2023-05-09 山东财经大学 Block chain asset data intelligent processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116089402A (en) * 2023-04-07 2023-05-09 山东财经大学 Block chain asset data intelligent processing system

Similar Documents

Publication Publication Date Title
US11095451B2 (en) Optimal data storage configuration in a blockchain
US11196542B2 (en) Checkpointing for increasing efficiency of a blockchain
US11334439B2 (en) Checkpointing for increasing efficiency of a blockchain
US11823178B2 (en) Optimization of high volume transaction performance on a blockchain
US20200073962A1 (en) Checkpointing for increasing efficiency of a blockchain
WO2020042586A1 (en) Method and apparatus for generating address of smart contract, computer device, and readable storage medium
CN107391291B (en) Block chain error-correcting method and system for modifying block chain namely block body data
US9245011B2 (en) Data model versioning for document databases
US11953984B1 (en) Systems and methods for blockchain repair assurance tokens
EP4018596A1 (en) Pruning entries in tamper-evident data stores
CN116049315A (en) Block chain storage method, system, device and storage medium
CN111679893A (en) Operation system construction method and device, electronic equipment and storage medium
WO2023016429A1 (en) Binary consensus method and apparatus capable of revoting, electronic device, and storage medium
CN111611290B (en) Address rapid positioning method and device, computer equipment and storage medium
CN110276609B (en) Business data processing method and device, electronic equipment and computer readable medium
CN107451007B (en) Verification method and system of block chain for error correction aiming at added blocks
US8712964B2 (en) Systems and methods for updating a data store using a transaction store
CN111444206B (en) Synchronous processing method, device, equipment and medium
CN116980281A (en) Node selection method, node selection device, first node, storage medium and program product
US20210064604A1 (en) Method, apparatus, and computer readable medium for generating an audit trail of an electronic data record
CN111857883B (en) Page data checking method and device, electronic equipment and storage medium
CN113157479A (en) Data error correction method, system, device, equipment and storage medium
CN112365247A (en) Block chain storage optimization method based on remainder system and RAFT algorithm
CN112560952A (en) Supplier assessment method and device, electronic equipment and storage medium
CN107451179B (en) Query method and system for block chain for increasing overall error of block

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination