CN111563129B - Distributed storage area block chain account book method - Google Patents

Distributed storage area block chain account book method Download PDF

Info

Publication number
CN111563129B
CN111563129B CN202010677418.1A CN202010677418A CN111563129B CN 111563129 B CN111563129 B CN 111563129B CN 202010677418 A CN202010677418 A CN 202010677418A CN 111563129 B CN111563129 B CN 111563129B
Authority
CN
China
Prior art keywords
storage
data
verification
result
value
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.)
Active
Application number
CN202010677418.1A
Other languages
Chinese (zh)
Other versions
CN111563129A (en
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.)
Jiangsu Rongzer Information Technology Co Ltd
Original Assignee
Jiangsu Rongzer Information Technology Co Ltd
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 Jiangsu Rongzer Information Technology Co Ltd filed Critical Jiangsu Rongzer Information Technology Co Ltd
Priority to CN202010677418.1A priority Critical patent/CN111563129B/en
Publication of CN111563129A publication Critical patent/CN111563129A/en
Application granted granted Critical
Publication of CN111563129B publication Critical patent/CN111563129B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Abstract

The invention discloses a distributed storage area block chain account book method, which utilizes a distributed data counting module to count and divide used storage data and unused storage data, thereby being convenient for providing support for subsequent data distribution; the transaction data acquisition module is used for acquiring the transaction request data from any child node, so that the processing efficiency of the block chain on the transaction data can be improved; the storage distribution module is used for distributing through the preset first weight and the storage proportion, so that the storage effect of each sub-node can be effectively improved, and the problem that the capacity upper limit is easy to appear due to inconsistent storage of each sub-node is solved; the data verification module can be used for effectively eliminating the abnormity of the data in the transmission process; the transaction request data is distributed according to the storage distribution result by the data distribution module by utilizing the verification result, so that the defect that the storage capacity of a single child node in a block chain cluster in the existing scheme is easy to become the capacity upper limit of the whole block chain is overcome.

Description

Distributed storage area block chain account book method
Technical Field
The invention relates to the technical field of block chains, in particular to a method for storing a block chain account book in a distributed mode.
Background
Distributed computing is a research direction in computer science, and researches how to divide a problem which needs huge computing power to solve into a plurality of small parts, then the parts are distributed to a plurality of computers for processing, and finally the computing results are integrated to obtain a final result; the distributed network storage technology is used for dispersedly storing data on a plurality of independent machine devices; the distributed network storage system adopts an expandable system structure, utilizes a plurality of storage servers to share storage load, and utilizes the position server to position storage information, thereby not only solving the bottleneck problem of a single storage server in the traditional centralized storage system, but also improving the reliability, the availability and the expansibility of the system;
the block chain is a distributed shared account book and a database, and has the characteristics of decentralization, no tampering, trace retaining in the whole process, traceability, collective maintenance, openness and transparency and the like; the blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm.
Publication number CN111177149A discloses a method and a system for marking on a blockchain of distributed storage data, where the method and the system for marking on a blockchain of distributed storage data include the following steps: s1: accessing a block chain database, and selecting block chain data needing to be marked; s2: fragmenting the blockchain data into a plurality of separate data packets; s3: marking the data packet with a hash value to form a hash value table, simultaneously marking the discrete hash value and the whole hash value in a trading system and a block of a block chain, and marking the ownership of the data through backtracking the block or trading examination and timestamp verification; s4: and retrieving the data through hash value retrieval, and discretely storing the data by using the hash value. The marking method and the marking system on the block chain for storing the data in the distributed mode can ensure the safety and ownership, can safely and quickly find the data to be processed, and can authorize others to access or authorize the processing through the marking. But has the defect that the storage capacity of a single child node in a block chain cluster is easy to become the upper limit of the capacity of the whole block chain.
Disclosure of Invention
The invention aims to provide a method, a device, an electronic device and a computer readable storage medium for a distributed storage area block chain account book, and mainly aims to solve the technical problem that the storage capacity of a single sub-node in a block chain cluster is easy to become the upper limit of the capacity of the whole block chain.
The purpose of the invention can be realized by the following technical method: a method for storing a block chain account book in a distributed mode comprises the following specific steps:
s1: the method comprises the steps of obtaining first storage data of each child node, and sending the first storage data of each child node to a centralized processing node, wherein the first storage data comprise used storage data and unused storage data of each child node;
s2: receiving and combining the first storage data of all the child nodes by using the centralized processing node to obtain second storage data, wherein the second storage data comprises used storage data and unused storage data in all the child nodes;
s3: setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
s4: receiving the request command by using the centralized processing node, and performing storage proportion distribution on the first weight according to the request command to obtain a storage distribution result, wherein the storage distribution result comprises each child node and a distributed storage unit;
s5: respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result;
s6: and distributing the transaction request data according to the storage distribution result by using the verification result.
Further, the allocating the storage proportion of the first weight according to the request command to obtain a storage allocation result includes:
s21: using formulas
Figure 965745DEST_PATH_IMAGE001
Calculating a ratio of unused stored data of the child node in the first weight, resulting in a first ratio, wherein,
Figure 343637DEST_PATH_IMAGE002
representing unused storage data of said child node,
Figure 944382DEST_PATH_IMAGE003
the first weight is represented by a first value,
Figure 843943DEST_PATH_IMAGE004
=1、……、
Figure 188337DEST_PATH_IMAGE005
s22: arranging and combining a plurality of first proportion ratios in a descending order to obtain a proportion distribution set;
s23: carrying out proportion division on unused storage data in the first storage data by using the proportion distribution set to obtain memory division data;
s24: and combining the proportion allocation set and the memory division data to obtain a storage allocation result.
Further, the separately calculating a storage verification value of the storage allocation result and a verification weight value of the transaction request data includes:
s31: acquiring the distributed memory of each child node in the storage distribution result;
s32: using formulas
Figure 686314DEST_PATH_IMAGE006
Calculating to obtain a first conversion value; wherein the content of the first and second substances,
Figure 130065DEST_PATH_IMAGE007
indicating the allocated memory of each child node,
Figure 346283DEST_PATH_IMAGE004
=1、……、
Figure 228788DEST_PATH_IMAGE005
Figure 518955DEST_PATH_IMAGE008
and
Figure 195924DEST_PATH_IMAGE009
representing different preset scale factors;
Figure 633859DEST_PATH_IMAGE010
representing a first correction factor, having a value of 0.23112;
s33: combining a plurality of first conversion values to obtain a storage verification value;
s34: acquiring a memory value of the transaction request data;
s35: using formulas
Figure 711534DEST_PATH_IMAGE011
And calculating to obtain a verification weight value, wherein,
Figure 856208DEST_PATH_IMAGE012
a memory value representing the transaction request data,
Figure 969657DEST_PATH_IMAGE013
=1、……、
Figure 832571DEST_PATH_IMAGE005
Figure 56879DEST_PATH_IMAGE014
representing a second correction factor, and having a value of 0.46224.
Further, the comparing and verifying the stored verification value and the verification weight value to obtain a verification result includes:
if the compared storage verification value is the same as the verification weight value, a first identifier is obtained, the first identifier represents that the storage distribution result is normally distributed, and the next operation can be carried out;
if the compared storage verification value is different from the verification weight value, a second identifier is obtained, the second identifier represents that the distribution of the storage distribution result is abnormal, and the next operation is stopped; wherein the first identifier or the second identifier constitutes a verification result.
Further, the allocating the transaction request data according to the storage allocation result using the verification result includes:
s51: sending the storage allocation result to the first child node by using the verification result;
s52: carrying out proportion division on the transaction request data by utilizing the first child node according to the storage distribution result to obtain a transaction data division set;
s53: sending the transaction data partition set to a plurality of child nodes in the storage distribution result;
s54: the sub-nodes receive and store the transaction data partition sets and generate a plurality of storage results;
s55: updating the first storage data by using the storage result to obtain third storage data, and sending a plurality of third storage data to the centralized processing node;
s56: and updating the second storage data by using a plurality of third storage data to obtain fourth storage data, and setting unused storage data in the fourth storage data as a second weight.
The method comprises a distribution data statistics module, a transaction data acquisition module, a storage distribution module, a data verification module and a data distribution module;
the distributed data statistics module is used for acquiring first storage data of each child node, sending the first storage data of each child node to a centralized processing node, receiving and combining the first storage data of all child nodes by using the centralized processing node to obtain second storage data, wherein the first storage data comprises used storage data and unused storage data of all child nodes;
the transaction data acquisition module is used for setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit;
the data verification module is used for respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result;
the data distribution module is used for distributing the transaction request data according to the storage distribution result by using the verification result.
The invention has the beneficial effects that:
in each aspect disclosed by the invention, a distributed data statistical module is used for acquiring first storage data of each child node, the first storage data of each child node is sent to a centralized processing node, the first storage data comprises used storage data and unused storage data of each child node, the centralized processing node is used for receiving and combining the first storage data of all child nodes to obtain second storage data, and the second storage data comprises the used storage data and the unused storage data of all child nodes; through statistics and division of used storage data and unused storage data, support is provided for subsequent data distribution conveniently;
setting unused storage data in the second storage data as a first weight by using a transaction data acquisition module, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data; the transaction request data is acquired through any child node, so that the processing efficiency of the block chain on the transaction data can be improved;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit; through the preset first weight and the distribution of the storage proportion, the storage effect of each sub-node can be effectively improved, and the problem that the capacity upper limit is easy to appear due to the fact that the storage of each sub-node is different is solved;
respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data by using a data verification module, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result; the method can effectively eliminate the abnormity of the data in the transmission process, can process the abnormal data in time, and can effectively improve the integrity of the data;
the transaction request data is distributed according to the storage distribution result by the data distribution module by utilizing the verification result, so that the defect that the storage capacity of a single child node in a block chain cluster in the existing scheme is easy to become the capacity upper limit of the whole block chain is overcome.
Drawings
The invention will be further described with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for storing a blockchain ledger book in a distributed storage area according to the present invention.
Fig. 2 is a schematic block diagram of a method for storing a blockchain ledger book according to the present invention.
Fig. 3 is a schematic structural diagram of an electronic device of an apparatus for storing a blockchain account book according to the present invention.
Detailed Description
The technical method in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Referring to fig. 1-2, the present invention is a method for storing a block chain account book in a distributed storage area, which specifically includes the steps of:
s1: the method comprises the steps of obtaining first storage data of each child node, and sending the first storage data of each child node to a centralized processing node, wherein the first storage data comprise used storage data and unused storage data of each child node.
In the embodiment of the invention, the first storage data of each child node comprises used memory storage data and unused memory storage data, and the memory storage data of each child node is counted and summarized in the early stage, so that the subsequent account book data distribution is supported conveniently.
S2: and receiving and combining the first storage data of all the child nodes by using the centralized processing node to obtain second storage data, wherein the second storage data comprises used storage data and unused storage data in all the child nodes.
In the embodiment of the invention, the centralized processing node is used for collecting and counting the first storage data of the plurality of sub-nodes, verifying the data and reasonably distributing the data, so that the integrity and the sustainable distribution of the book data are improved.
S3: setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data.
In the embodiment of the present invention, the first weight is used to reasonably distribute the plurality of child nodes according to the transaction request data, the transaction request data may be account book data, and the first child node may be any one of the plurality of child nodes.
S4: and receiving the request command by using the centralized processing node, and performing storage proportion distribution on the first weight according to the request command to obtain a storage distribution result, wherein the storage distribution result comprises each child node and a distributed storage unit. The method comprises the following steps:
using formulas
Figure 383955DEST_PATH_IMAGE015
Calculating a ratio of unused stored data of the child node in the first weight, resulting in a first ratio, wherein,
Figure 605989DEST_PATH_IMAGE002
representing unused storage data of said child node,
Figure 752937DEST_PATH_IMAGE003
the first weight is represented by a first value,
Figure 780936DEST_PATH_IMAGE004
=1、……、
Figure 398736DEST_PATH_IMAGE005
arranging and combining a plurality of first proportion ratios in a descending order to obtain a proportion distribution set;
carrying out proportion division on unused storage data in the first storage data by using the proportion distribution set to obtain memory division data;
and combining the proportion allocation set and the memory division data to obtain a storage allocation result.
In the embodiment of the invention, the ratio of the rest unused storage data in each sub-node to all the unused storage data is obtained through calculation, and the accounting book data is subjected to proportion division by utilizing the ratio, so that the aim of distributed proportion storage is achieved, and the defect that the storage capacity of a single sub-node is easy to become the upper limit of the capacity of the whole block chain can be effectively overcome.
S5: and respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result. The method comprises the following steps:
acquiring the distributed memory of each child node in the storage distribution result;
using formulas
Figure 853989DEST_PATH_IMAGE006
Calculating to obtain a first conversion value; wherein the content of the first and second substances,
Figure 753811DEST_PATH_IMAGE007
indicating the allocated memory of each child node,
Figure 257605DEST_PATH_IMAGE004
=1、……、
Figure 293694DEST_PATH_IMAGE005
Figure 919848DEST_PATH_IMAGE008
and
Figure 41387DEST_PATH_IMAGE009
representing different preset scale factors;
Figure 348872DEST_PATH_IMAGE010
representing a first correction factor, having a value of 0.23112;
combining a plurality of first conversion values to obtain a storage verification value;
acquiring a memory value of the transaction request data;
using formulas
Figure 505047DEST_PATH_IMAGE011
And calculating to obtain a verification weight value, wherein,
Figure 302101DEST_PATH_IMAGE012
a memory value representing the transaction request data,
Figure 848620DEST_PATH_IMAGE013
=1、……、
Figure 756534DEST_PATH_IMAGE005
Figure 767215DEST_PATH_IMAGE014
representing a second correction factor, and having a value of 0.46224.
Wherein:
if the compared storage verification value is the same as the verification weight value, a first identifier is obtained, the first identifier represents that the storage distribution result is normally distributed, and the next operation can be carried out;
if the compared storage verification value is different from the verification weight value, a second identifier is obtained, the second identifier represents that the distribution of the storage distribution result is abnormal, and the next operation is stopped; wherein the first identifier or the second identifier constitutes a verification result.
In the embodiment of the invention, the verification result is obtained by obtaining the storage verification value of the storage distribution result and the verification weight value of the transaction request data and comparing and verifying the verification values, and whether the distributed data is complete or not is judged by the verification result, so that the completeness of the data storage of the account book can be effectively improved, and the defect that the abnormal operation of the account book data in distributed storage is caused when the account book data is distributed and transmitted is avoided.
S6: and distributing the transaction request data according to the storage distribution result by using the verification result. The method comprises the following steps:
sending the storage allocation result to the first child node by using the verification result;
carrying out proportion division on the transaction request data by utilizing the first child node according to the storage distribution result to obtain a transaction data division set;
sending the transaction data partition set to a plurality of child nodes in the storage distribution result;
the sub-nodes receive and store the transaction data partition sets and generate a plurality of storage results;
updating the first storage data by using the storage result to obtain third storage data, and sending a plurality of third storage data to the centralized processing node;
and updating the second storage data by using a plurality of third storage data to obtain fourth storage data, and setting unused storage data in the fourth storage data as a second weight.
In the embodiment of the invention, after the account book data is reasonably distributed and safely verified, the storage data of each child node is updated in real time, so that each child node keeps the same storage degree.
The method comprises a distribution data statistics module, a transaction data acquisition module, a storage distribution module, a data verification module and a data distribution module;
the distributed data statistics module is used for acquiring first storage data of each child node, sending the first storage data of each child node to a centralized processing node, receiving and combining the first storage data of all child nodes by using the centralized processing node to obtain second storage data, wherein the first storage data comprises used storage data and unused storage data of all child nodes;
the transaction data acquisition module is used for setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit;
the data verification module is used for respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result;
the data distribution module is used for distributing the transaction request data according to the storage distribution result by using the verification result.
The working principle of the embodiment of the invention is as follows: acquiring first storage data of each child node by using a distribution data statistical module, sending the first storage data of each child node to a centralized processing node, receiving and combining the first storage data of all child nodes by using the centralized processing node to obtain second storage data, wherein the second storage data comprises used storage data and unused storage data of all child nodes;
the transaction data acquisition module is used for setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit; the method comprises the following steps: using formulas
Figure 171389DEST_PATH_IMAGE015
Calculating a ratio of unused stored data of the child node in the first weight, resulting in a first ratio, wherein,
Figure 267521DEST_PATH_IMAGE002
representing unused storage data of said child node,
Figure 979125DEST_PATH_IMAGE003
the first weight is represented by a first value,
Figure 47575DEST_PATH_IMAGE004
=1、……、
Figure 186433DEST_PATH_IMAGE005
(ii) a Arranging and combining a plurality of first proportion ratios in a descending order to obtain a proportion distribution set; carrying out proportion division on unused storage data in the first storage data by using the proportion distribution set to obtain memory division data; combining the proportion allocation set and the memory division data to obtain a storage allocation result;
the data verification module is used for respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and the storage verification value and the verification weight value are compared and verified to obtain a verification result; the method comprises the following steps: obtaining the storage allocation resultAllocating memory of each child node; using formulas
Figure 504282DEST_PATH_IMAGE006
Calculating to obtain a first conversion value; wherein the content of the first and second substances,
Figure 957260DEST_PATH_IMAGE007
indicating the allocated memory of each child node,
Figure 942533DEST_PATH_IMAGE004
=1、……、
Figure 252292DEST_PATH_IMAGE005
Figure 995120DEST_PATH_IMAGE008
and
Figure 48527DEST_PATH_IMAGE009
representing different preset scale factors;
Figure 324525DEST_PATH_IMAGE010
representing a first correction factor, having a value of 0.23112; combining a plurality of first conversion values to obtain a storage verification value; acquiring a memory value of the transaction request data; using formulas
Figure 805185DEST_PATH_IMAGE011
And calculating to obtain a verification weight value, wherein,
Figure 363205DEST_PATH_IMAGE012
a memory value representing the transaction request data,
Figure 892406DEST_PATH_IMAGE013
=1、……、
Figure 852272DEST_PATH_IMAGE005
Figure 503833DEST_PATH_IMAGE014
representing a second correction factor, having a value of 0.46224; wherein the content of the first and second substances,
if the compared storage verification value is the same as the verification weight value, a first identifier is obtained, the first identifier represents that the storage distribution result is normally distributed, and the next operation can be carried out;
if the compared storage verification value is different from the verification weight value, a second identifier is obtained, the second identifier represents that the distribution of the storage distribution result is abnormal, and the next operation is stopped;
the data distribution module is used for distributing the transaction request data according to the storage distribution result by using the verification result; the method comprises the following steps: sending the storage allocation result to the first child node by using the verification result; carrying out proportion division on the transaction request data by utilizing the first child node according to the storage distribution result to obtain a transaction data division set; sending the transaction data partition set to a plurality of child nodes in the storage distribution result; the sub-nodes receive and store the transaction data partition sets and generate a plurality of storage results; updating the first storage data by using the storage result to obtain third storage data, and sending a plurality of third storage data to the centralized processing node; updating the second storage data by using a plurality of third storage data to obtain fourth storage data, and setting unused storage data in the fourth storage data as a second weight;
compared with the prior art, in each aspect disclosed by the invention, a distributed data statistics module is used for acquiring first storage data of each child node, the first storage data of each child node is sent to a centralized processing node, the first storage data comprises used storage data and unused storage data of each child node, the centralized processing node is used for receiving and combining the first storage data of all child nodes to obtain second storage data, and the second storage data comprises used storage data and unused storage data of all child nodes; through statistics and division of used storage data and unused storage data, support is provided for subsequent data distribution conveniently;
setting unused storage data in the second storage data as a first weight by using a transaction data acquisition module, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data; the transaction request data is acquired through any child node, so that the processing efficiency of the block chain on the transaction data can be improved;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit; through the preset first weight and the distribution of the storage proportion, the storage effect of each sub-node can be effectively improved, and the problem that the capacity upper limit is easy to appear due to the fact that the storage of each sub-node is different is solved;
respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data by using a data verification module, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result; the method can effectively eliminate the abnormity of the data in the transmission process, can process the abnormal data in time, and can effectively improve the integrity of the data;
the transaction request data is distributed according to the storage distribution result by the data distribution module by utilizing the verification result, so that the defect that the storage capacity of a single child node in a block chain cluster in the existing scheme is easy to become the capacity upper limit of the whole block chain is overcome.
Fig. 3 is a schematic structural diagram of an electronic device of an apparatus for implementing a distributed storage area blockchain ledger according to the present invention.
The electronic device 1 may include a processor 10, a memory 11 and a bus, and may further include a computer program stored in the memory 11 and executable on the processor 10, such as a program 12 of a distributed memory blockchain ledger.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used to store not only application software installed in the electronic device 1 and various types of data, such as codes of a distributed storage area blockchain ledger, but also temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, executing a distributed memory block chain book, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The program 12 of the distributed storage block chain ledger stored by the memory 11 in the electronic device 1 is a combination of a plurality of instructions, which when run in the processor 10, may implement the steps in fig. 1.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the method of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above examples are only intended to illustrate the technical process of the present invention and not to limit the same, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical process of the present invention without departing from the spirit and scope of the technical process of the present invention.

Claims (6)

1. A method for storing a block chain account book in a distributed mode is characterized by comprising the following specific steps:
s1: the method comprises the steps of obtaining first storage data of each child node, and sending the first storage data of each child node to a centralized processing node, wherein the first storage data comprise used storage data and unused storage data of each child node;
s2: receiving and combining the first storage data of all the child nodes by using the centralized processing node to obtain second storage data, wherein the second storage data comprises used storage data and unused storage data in all the child nodes;
s3: setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
s4: receiving the request command by using the centralized processing node, and performing storage proportion distribution on the first weight according to the request command to obtain a storage distribution result, wherein the storage distribution result comprises each child node and a distributed storage unit;
s5: respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result;
s6: and distributing the transaction request data according to the storage distribution result by using the verification result.
2. The method of claim 1, wherein the allocating the first weight according to the request command to a storage proportion to obtain a storage allocation result comprises:
s21: using formulas
Figure DEST_PATH_IMAGE001
Calculating a ratio of unused stored data of the child node in the first weight, resulting in a first ratio, wherein,
Figure DEST_PATH_IMAGE002
representing unused storage data of said child node,
Figure DEST_PATH_IMAGE003
the first weight is represented by a first value,
Figure DEST_PATH_IMAGE004
=1、……、
Figure DEST_PATH_IMAGE005
s22: arranging and combining a plurality of first proportion ratios in a descending order to obtain a proportion distribution set;
s23: carrying out proportion division on unused storage data in the first storage data by using the proportion distribution set to obtain memory division data;
s24: and combining the proportion allocation set and the memory division data to obtain a storage allocation result.
3. The method of claim 1, wherein the calculating the storage verification value of the storage allocation result and the verification weight value of the transaction request data respectively comprises:
s31: acquiring the distributed memory of each child node in the storage distribution result;
s32: using formulas
Figure DEST_PATH_IMAGE006
Calculating to obtain a first conversion value; wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE007
indicating the allocated memory of each child node,
Figure 584530DEST_PATH_IMAGE004
=1、……、
Figure 501670DEST_PATH_IMAGE005
Figure DEST_PATH_IMAGE008
and
Figure DEST_PATH_IMAGE009
representing different preset scale factors;
Figure DEST_PATH_IMAGE010
representing a first correction factor, having a value of 0.23112;
s33: combining a plurality of first conversion values to obtain a storage verification value;
s34: acquiring a memory value of the transaction request data;
s35: using formulas
Figure DEST_PATH_IMAGE011
And calculating to obtain a verification weight value, wherein,
Figure DEST_PATH_IMAGE012
a memory value representing the transaction request data,
Figure DEST_PATH_IMAGE013
=1、……、
Figure 78145DEST_PATH_IMAGE005
Figure DEST_PATH_IMAGE014
representing a second correction factor, and having a value of 0.46224.
4. The method of claim 1, wherein the comparing the stored verification value with the verification weight value to obtain a verification result comprises:
if the compared storage verification value is the same as the verification weight value, obtaining a first identifier, wherein the first identifier represents that the storage distribution result is normally distributed, and performing the next operation;
if the compared storage verification value is different from the verification weight value, a second identifier is obtained, the second identifier represents that the distribution of the storage distribution result is abnormal, and the next operation is stopped; wherein the first identifier or the second identifier constitutes a verification result.
5. The method of claim 1, wherein the allocating the transaction request data according to the storage allocation result using the validation result comprises:
s51: sending the storage allocation result to the first child node by using the verification result;
s52: carrying out proportion division on the transaction request data by utilizing the first child node according to the storage distribution result to obtain a transaction data division set;
s53: sending the transaction data partition set to a plurality of child nodes in the storage distribution result;
s54: the sub-nodes receive and store the transaction data partition sets and generate a plurality of storage results;
s55: updating the first storage data by using the storage result to obtain third storage data, and sending a plurality of third storage data to the centralized processing node;
s56: and updating the second storage data by using a plurality of third storage data to obtain fourth storage data, and setting unused storage data in the fourth storage data as a second weight.
6. The device for the distributed storage area block chain account book is characterized by comprising an allocation data statistical module, a transaction data acquisition module, a storage allocation module, a data verification module and a data allocation module;
the distributed data statistics module is used for acquiring first storage data of each child node, sending the first storage data of each child node to a centralized processing node, receiving and combining the first storage data of all child nodes by using the centralized processing node to obtain second storage data, wherein the first storage data comprises used storage data and unused storage data of all child nodes;
the transaction data acquisition module is used for setting unused storage data in the second storage data as a first weight, acquiring transaction request data through a first child node, and sending a request command to the centralized processing node by using the first child node according to the transaction request data;
the storage allocation module is used for receiving the request command by using the centralized processing node, and performing storage proportion allocation on the first weight according to the request command to obtain a storage allocation result, wherein the storage allocation result comprises each child node and an allocated storage unit;
the data verification module is used for respectively calculating a storage verification value of the storage distribution result and a verification weight value of the transaction request data, and comparing and verifying the storage verification value and the verification weight value to obtain a verification result;
the data distribution module is used for distributing the transaction request data according to the storage distribution result by using the verification result.
CN202010677418.1A 2020-07-15 2020-07-15 Distributed storage area block chain account book method Active CN111563129B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010677418.1A CN111563129B (en) 2020-07-15 2020-07-15 Distributed storage area block chain account book method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010677418.1A CN111563129B (en) 2020-07-15 2020-07-15 Distributed storage area block chain account book method

Publications (2)

Publication Number Publication Date
CN111563129A CN111563129A (en) 2020-08-21
CN111563129B true CN111563129B (en) 2020-10-27

Family

ID=72072823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010677418.1A Active CN111563129B (en) 2020-07-15 2020-07-15 Distributed storage area block chain account book method

Country Status (1)

Country Link
CN (1) CN111563129B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328663A (en) * 2020-11-24 2021-02-05 深圳市鹰硕技术有限公司 Data discovery method and system applied to big data
CN112257078B (en) * 2020-12-21 2021-04-20 江苏荣泽信息科技股份有限公司 Block chain encryption and decryption service security trusted system based on TEE technology

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101891125B1 (en) * 2016-12-07 2018-08-24 데이터얼라이언스 주식회사 Distributed Network Node Service Contribution Evaluation System and Method
WO2019112193A1 (en) * 2017-12-08 2019-06-13 인제대학교 산학협력단 Block-chain system architecture and method
CN108650333B (en) * 2018-07-31 2021-02-02 泰链(厦门)科技有限公司 Method, medium, device and system for distributing node load in block chain system
CN111899001A (en) * 2018-08-30 2020-11-06 创新先进技术有限公司 Remittance method and device based on block chain

Also Published As

Publication number Publication date
CN111563129A (en) 2020-08-21

Similar Documents

Publication Publication Date Title
WO2021189826A1 (en) Message generation method and apparatus, electronic device, and computer-readable storage medium
CN111563129B (en) Distributed storage area block chain account book method
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN111694844A (en) Enterprise operation data analysis method and device based on configuration algorithm and electronic equipment
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN114490586A (en) Medical information safe storage cooperation system based on block chain
CN114612194A (en) Product recommendation method and device, electronic equipment and storage medium
CN111858604B (en) Data storage method and device, electronic equipment and storage medium
CN112948380A (en) Data storage method and device based on big data, electronic equipment and storage medium
CN112257078B (en) Block chain encryption and decryption service security trusted system based on TEE technology
CN115759746A (en) Configurable user early warning method and device, electronic equipment and storage medium
CN113918296A (en) Model training task scheduling execution method and device, electronic equipment and storage medium
CN114817408A (en) Scheduling resource identification method and device, electronic equipment and storage medium
CN115022171A (en) Optimization method and device for updating interface, electronic equipment and readable storage medium
CN114611477A (en) Design recommendation method and device for data table, electronic equipment and medium
CN114490137A (en) Service data real-time statistical method and device, electronic equipment and readable storage medium
CN114626948A (en) Block chain transaction accounting method and device, electronic equipment and storage medium
CN112446781A (en) Wind control data generation method, device, equipment and computer readable storage medium
CN113342867A (en) Data distribution and management method and device, electronic equipment and readable storage medium
CN113297228B (en) MySQL writing method, device, equipment and medium based on multiple live instances
CN113419916B (en) Wind control inspection program uninterrupted operation method, device, equipment and storage medium
CN114880125A (en) Batch running method, device, equipment and storage medium for single-thread data reading and distribution
CN114840595A (en) Data asynchronous link processing method and device, electronic equipment and storage medium
CN114840268A (en) Service code execution method and device, electronic equipment and storage medium
CN114841129A (en) Data import method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200821

Assignee: Nanjing Jiangbei new area Yangzi Technology Finance Leasing Co.,Ltd.

Assignor: JIANGSU RONGZER INFORMATION TECHNOLOGY Co.,Ltd.

Contract record no.: X2021320000067

Denomination of invention: A method of distributed storage of blockchain ledger

Granted publication date: 20201027

License type: Exclusive License

Record date: 20210805

EE01 Entry into force of recordation of patent licensing contract
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method of distributed storage of blockchain ledger

Effective date of registration: 20210811

Granted publication date: 20201027

Pledgee: Nanjing Jiangbei new area green Financing Guarantee Co.,Ltd.

Pledgor: JIANGSU RONGZER INFORMATION TECHNOLOGY Co.,Ltd.

Registration number: Y2021320000168

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20220905

Granted publication date: 20201027

Pledgee: Nanjing Jiangbei new area green Financing Guarantee Co.,Ltd.

Pledgor: JIANGSU RONGZER INFORMATION TECHNOLOGY CO.,LTD.

Registration number: Y2021320000168

EC01 Cancellation of recordation of patent licensing contract
EC01 Cancellation of recordation of patent licensing contract

Assignee: Nanjing Jiangbei new area Yangzi Technology Finance Leasing Co.,Ltd.

Assignor: JIANGSU RONGZER INFORMATION TECHNOLOGY CO.,LTD.

Contract record no.: X2021320000067

Date of cancellation: 20220921