CN109213767A - A kind of account data management method suitable for block chain - Google Patents

A kind of account data management method suitable for block chain Download PDF

Info

Publication number
CN109213767A
CN109213767A CN201811094998.0A CN201811094998A CN109213767A CN 109213767 A CN109213767 A CN 109213767A CN 201811094998 A CN201811094998 A CN 201811094998A CN 109213767 A CN109213767 A CN 109213767A
Authority
CN
China
Prior art keywords
account
node
block chain
account data
management method
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.)
Granted
Application number
CN201811094998.0A
Other languages
Chinese (zh)
Other versions
CN109213767B (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.)
Hangzhou Maocai Network Technology Co ltd
Original Assignee
Dig Wealth Network 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 Dig Wealth Network Technology Co Ltd filed Critical Dig Wealth Network Technology Co Ltd
Priority to CN201811094998.0A priority Critical patent/CN109213767B/en
Publication of CN109213767A publication Critical patent/CN109213767A/en
Application granted granted Critical
Publication of CN109213767B publication Critical patent/CN109213767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Hardware Redundancy (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of account data management methods suitable for block chain, comprising: calculates the liveness of an account, the account data of the account is stored in a node of block chain;Judge the relationship of the account data liveness of the account and the threshold value of setting;When the account data satisfaction and threshold value relativeness condition of the account, the account data of account is subjected to compression and forms compression account data;Compression account data is stored in compressed data storage region and records its index;Delete the meta account data of account.The invention has the beneficial effects that: provide that a kind of logic is simple, realizes the scheme of easily and fast effective block chain node account data storage management.

Description

A kind of account data management method suitable for block chain
Technical field
The present invention relates to a kind of account data management methods suitable for block chain.
Background technique
As with the emergence for the block chain 2.0 that " intelligent contract " is mark, more and more users participate in these blocks Platform chain (such as ether mill), and start to arrange the intelligent contract of oneself on chain.This brings pressure for storage, because of system Node can carry more and more account datas.As in current ether mill system, each node can institute in storage system Some account informations, this causes very big pressure to the hard disk of node, ten for wanting to participate in the user in the system Divide unfriendly.The invention proposes a kind of methods for clearing up inactive account, to reduce the pressure of account data storage.
Also underway to the research of node account data storage pressure at present, there are no mature solutions, at present There are two solutions in research:
(1) fragment (sharding): the node in cluster is divided into several groups, every group of a part of account data of storage.
(2) distributed document stores: data being shared storage using the bottoms distributed document memory technology such as IPFS.
The realization of above-mentioned two scheme is all very complicated, and mature engineering science is not realized, is badly in need of alleviating block chain storage pressure The scheme of power.
Summary of the invention
A kind of account data management method suitable for block chain, comprising: calculate the liveness of an account, the account of the account User data is stored in a node of block chain;Judge the relationship of the account data liveness of the account and the threshold value of setting; When the account data satisfaction and threshold value relativeness condition of the account, the account data of account is subjected to compression and forms compression account User data;Compression account data is stored in compressed data storage region and records its index;Delete the meta account number of account According to.
Further, the node of block chain is classified;Judge the type of the node of block chain;When node is general section The liveness of account is calculated when calculating the node on the account when point.
Further, it is important node that the method for classification, which includes: by several node definitions before in block chain, if will be preceding Node definition after dry node is general node.
Further, the method for classification further include: general node sends application for upgrading to several important nodes;It is several important Node examines application for upgrading, and is known together using PBFT algorithm;When the important node quantity of common recognition is greater than upgrade threshold, one As node be converted to important node.
Further, including at least the quantity of the account of the storage of general node in application for upgrading.
Further, the relationship for judging the account data liveness of account and the threshold value of setting includes: enlivening when account When degree is less than first threshold, the label account is active account.
Further, the relationship for judging the account data liveness of account and the threshold value of setting includes: enlivening when account When degree is greater than first threshold and is less than second threshold, the label account is regular account.
Further, the relationship for judging the account data liveness of account and the threshold value of setting includes: enlivening when account When degree is greater than second threshold, the label account is blunt account.
Further, suitable for the account data management method of block chain further include:
Account data is searched according to index, and by the data decompression of account.
Further, suitable for the account data management method of block chain further include:
The request of inquiry account data is sent to important node, important node sends anti-according to the data storage condition of account Feedback;
General node judges whether to need to establish data connection with important node according to the feedback of important node.
The invention has the beneficial effects that:
Provide that a kind of logic is simple, realizes the side of easily and fast effective block chain node account data storage management Case.In addition, the present invention also possesses according to the liveness of account the manner of cleaning up for carrying out different levels, reach wanting of clearing up on demand It asks.
Detailed description of the invention
Fig. 1 is the recycling process diagram to some account a for being stored in some node A in block chain;
Fig. 2 is the flow chart using the data of a account of the node A on block chain.
Specific embodiment
Block chain is formed by connecting by several nodes.
General node and two kinds of node types of important node are defined, is classified to the node in block chain.By each Preceding n node sets in block chain including wound generation node are important node.(n+1)th and later node are when founding It is defined as general node.The type of node is marked by the name or node address data of node, other nodes pass through The type of the node can be judged by reading the label.
Account information is stored on node.
The account liveness being stored on node is judged, for the account a of storage on node a, definition is active It spends Deactive (a), the function for calculating liveness Deactive (a) can indicate are as follows:
Deactive (a)=currentDate (a)-lastRelatedDate (a)
Deactive (a) is to indicate that the upper relationship trading distance of a account calls the date differences at function moment.
CurrentDate indicate current date, the unit of current date can be the second, point, when, day, Yue Deng chronomere.
LastRelatedDate indicates last trade date related with account a, due to each pen on block chain Transaction record all at least will record " sender ", " recipient ", " timestamp " this three samples information, and LastRelatedDate (a) takes Max (with a being for the last time the time of the transaction of recipient for the time of the transaction of sender or last time with a) can be calculated ?.The unit of lastRelatedDate and the unit of currentDate are consistent.
It is being as chronomere using " day ", if a account had sent one before one day transfers accounts or have received one It transfers accounts, then Deactive (a) is just 1.
Removal process to some account a for being stored in some node A in block chain includes such as step S100:
In step S101, define liveness threshold value in the wound generation block of block chain, liveness threshold value include first threshold with Second threshold, first threshold and second threshold are all as unit of the time, and first threshold < second threshold;
In step S102, the type of stage A is judged, if node A is important node, the data of account a are not appointed What is operated;If node A is general node, S103 is entered step;
In step S103, the transaction record of a is obtained, is calculated Deactive (a);
In step S104, Deactive (a) is compared with liveness threshold value, and according to comparison result, executes respectively Different recycling algorithms: if Deactive (a)≤first threshold, not carrying out any operation to the data of account a, while can be with Account a is labeled as active account;If first threshold < Deactive (a) < second threshold, enters step S105;If Deactive (a) >=second threshold, then enter step S106;
In step S105, the data of account a are compressed, and the compression number by compressed data storage on disk According to storage region and recording indexes.Then the initial data of the account is deleted from local disk.It, can be in step S105 Account a is labeled as regular account;
In step S106, the important node into block chain sends inquiry request, and request, which is inquired in these important nodes, to be had The record data for closing account a, if storing the data in relation to account a in some important node, which sends out to node A Send feedback.Node A record storage has the quantity of the important node of account a data.
In step S107, the quantity for being stored with the important node of account a data is compared with storage threshold value, when the quantity When more than storage threshold value, it is believed that there is sufficient amount of important node to store the data of account a, nothing in the local disk of node A Repetition storage need to be carried out again to remove the content of the account from disk at this point, entering step S108.It is deposited if the quantity is less than Store up threshold value, then it is assumed that the data of account a are volatile, are compressed at this point, entering step S105 to the data of account a, and will Compressed data storage region of the compressed data storage on disk and recording indexes, then the account from local disk Initial data delete.In step S107, account a can also be labeled as blunt account.
When the local disk storage pressure of some node is larger, node maintenance person can choose touching and pass through step S100 The account stored on node is handled, in processing, if not needing to redefine liveness threshold value, step can be saved S101。
After the processing of S100, the account storage data quantity on block chain is compressed, and is being needed using block chain On node A a account data when, step S200 includes:
In step S201, the account number for searching a is carried out from the uncompressed data space in the local disk of node A According to, if having found the account data of a, enter step S204, by the data take out use, if in the local disk of node A The account data less than a is searched in interior uncompressed data space, then enters step S202;
In step S202, the account number of a is searched in the region of storage compression account data out of node A local disk According to if having found the account data of a, entering step S205, which taken out and decompressed.The local disk of node A The account data less than a is searched in the region of interior storage compression account data, then enters step S203.It is carried out in step S202 When lookup, the index generated in step S106 can use, to improve the speed of step S202 operation.
In step S203, other important node broadcast requests into block chain, the content of request includes the important node The data of account a whether are contained, the positive reply that important node issues is received, and request to transmit account a with the important node Data.
Benefit can be being really needed for regular account or blunt account by the data recovery operation of step S200 It is stored with when account data in the data to the regular account or blunt account, reduces the storage of node local disk Pressure.
As can be seen from the above description, important node has serviced entire block chain, therefore, steady, the efficient fortune of important node Row, it is most important to the recycling using S100, S200, the block catenary system of recovery algorithms.Draw in block chain operation architecture Enter the economic limit water cut based on ballot to important node, the step of mechanism includes:
Each general node when restoring account data from important node by step S203, record recovery account and Data volume and wallet address.By wallet address, the user of general node initiatively can transfer accounts to important node offer Excitation.
Such incentive mechanism is introduced, so that the user of rationality tends to alleviate by service as important node The disk pressure of oneself.And if important node cannot reward, will power shortage storage service is provided.
Simultaneously as also having encouraged general node to become important node there are economic incentives, having avoided important node excessively Centralization caused by single.
The method that following general node is converted to important node: this method packet can also be set in block chain operation rule It includes:
Other important nodes of node general first into block chain broadcast an application for upgrading message, which disappears Breath is that is, the general node declares it oneself is important node.The application for upgrading message is at least made of following three parts:
(1) quantity of the account of the general node storage;
(2) these account amounts of the general node storage are in local corresponding storing data size;
(3) in the general node any one inactive account complete transaction information, Transaction Information include transaction go through Records of the Historian record, remaining sum, foundation time etc..
Wherein, the quantity of account and be locally stored the two information of size of data for other node specifications issue upgrade The node of application has stored enough account informations.Storing enough account informations is that a node upgrading is attached most importance to Want the precondition of node.
It further include the complete transaction information of inactive account in application for upgrading message, which will be responsible for Whether the application for upgrading for examining other nodes of this application to be used to judge that the general node to issue is to forge.Because of Transaction Information What usually more than two nodes were completed jointly, other nodes can be by the trading object traded with the node filed an application The transaction record of node judges the application for upgrading of the node filed an application with the presence or absence of forgery.As optional embodiment, It (3) can be the Transaction Information of any one active account.
Other important nodes for receiving the application for upgrading are responsible for examining this message and know together, and specific mode can To use PBFT algorithm, after being more than that a certain number of important nodes are reached common understanding, which will be by Upgrade to important node.
In addition, in step S203, it is understood that there may be general node can not receive account from the important node for sending feedback The case where data, in this case, it is believed that the important node for sending feedback is " malice ".If a general node is in step When being restored in rapid S203, data needed for can not obtaining in an important node are local important about this being recorded in Increase the malice degree of the important node in the parameter of malicious behaviors of nodes degree., whereas if the important node services successfully, it is being recorded in The malice degree of the important node is reduced in the local parameter about the important node malice degree.Malice degree can be used for reviewing weight It wants the qualification of node or carries out other operations.
The basic principles, main features and advantages of the invention have been shown and described above.The technical staff of the industry should Understand, the above embodiments do not limit the invention in any form, all obtained by the way of equivalent substitution or equivalent transformation Technical solution is fallen within the scope of protection of the present invention.

Claims (10)

1. a kind of account data management method suitable for block chain, it is characterised in that:
The account data management method suitable for block chain includes:
The liveness of an account is calculated, the account data of the account is stored in a node of block chain;
Judge the relationship of the account data liveness of the account and the threshold value of setting;
When the account data satisfaction and threshold value relativeness condition of the account, the account data of the account is subjected to compressed shape At compression account data;
The compression account data is stored in compressed data storage region and records its index;
Delete the meta account data of the account.
2. the account data management method according to claim 1 suitable for block chain, which is characterized in that further include:
The node of block chain is classified;
Judge the type of the node of block chain;
The liveness of account is calculated when calculating the node on the account when node is general node.
3. the account data management method according to claim 2 suitable for block chain, which is characterized in that the classification Method includes:
It is important node by several node definitions before in block chain, is general by the node definition after several preceding nodes Node.
4. the account data management method according to claim 3 suitable for block chain, which is characterized in that the classification Method further include:
General node sends application for upgrading to the important node;
The important node examines the application for upgrading, and is known together using PBFT algorithm;
When the important node quantity of common recognition is greater than upgrade threshold, general node is converted to important node.
5. the account data management method according to claim 4 suitable for block chain, which is characterized in that
The quantity of the account of the general node storage is included at least in the application for upgrading.
6. the account data management method according to claim 1 suitable for block chain, which is characterized in that judge the account The relationship of the threshold value of the account data liveness and setting at family includes:
When the liveness of the account is less than first threshold, the label account is active account.
7. the account data management method according to claim 1 suitable for block chain, which is characterized in that judge the account The relationship of the threshold value of the account data liveness and setting at family includes:
When the liveness of the account
When greater than first threshold and being less than second threshold, the label account is regular account.
8. the account data management method according to claim 1 suitable for block chain, which is characterized in that judge the account The relationship of the threshold value of the account data liveness and setting at family includes:
When the liveness of the account
When greater than second threshold, the label account is blunt account.
9. the account data management method according to claim 1 suitable for block chain, it is characterised in that:
The account data management method suitable for block chain further include:
Account data is searched according to index, and by the data decompression of the account.
10. the account data management method according to claim 1 suitable for block chain, it is characterised in that:
The account data management method suitable for block chain further include:
The request of inquiry account data is sent to important node, important node sends anti-according to the data storage condition of the account Feedback;General node judges whether to need to establish data connection with the important node according to the feedback of important node.
CN201811094998.0A 2018-09-19 2018-09-19 Account data management method suitable for block chain Active CN109213767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811094998.0A CN109213767B (en) 2018-09-19 2018-09-19 Account data management method suitable for block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811094998.0A CN109213767B (en) 2018-09-19 2018-09-19 Account data management method suitable for block chain

Publications (2)

Publication Number Publication Date
CN109213767A true CN109213767A (en) 2019-01-15
CN109213767B CN109213767B (en) 2020-07-21

Family

ID=64984799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811094998.0A Active CN109213767B (en) 2018-09-19 2018-09-19 Account data management method suitable for block chain

Country Status (1)

Country Link
CN (1) CN109213767B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008203A (en) * 2019-01-31 2019-07-12 阿里巴巴集团控股有限公司 A kind of data clearing method, device and equipment
CN111695885A (en) * 2019-03-14 2020-09-22 中国科学技术大学 Digital certificate block chain compression method based on transaction input reduction
CN112015697A (en) * 2020-10-27 2020-12-01 暗链科技(深圳)有限公司 Method and system for archiving data on block chain
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170048209A1 (en) * 2015-07-14 2017-02-16 Fmr Llc Crypto Key Recovery and Social Aggregating, Fractionally Efficient Transfer Guidance, Conditional Triggered Transaction, Datastructures, Apparatuses, Methods and Systems
CN106503992A (en) * 2016-10-18 2017-03-15 北京天德科技有限公司 A kind of block chain that Transaction Information and accounts information are stored respectively
CN106940866A (en) * 2017-02-22 2017-07-11 深圳市喜悦智慧实验室有限公司 A kind of asset management system based on many account managements
CN107240018A (en) * 2017-07-25 2017-10-10 成都励睿德企业管理有限公司 A kind of method and system for being used to pay tranaction costs in block chain network
CN107248074A (en) * 2017-03-29 2017-10-13 阿里巴巴集团控股有限公司 A kind of method for processing business and equipment based on block chain
CN107807951A (en) * 2017-09-18 2018-03-16 联动优势科技有限公司 A kind of block chain generation method, data verification method, node and system
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium
CN108446969A (en) * 2018-03-29 2018-08-24 张文昌 A kind of unified public transport book keeping operation and transaction system based on block chain

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170048209A1 (en) * 2015-07-14 2017-02-16 Fmr Llc Crypto Key Recovery and Social Aggregating, Fractionally Efficient Transfer Guidance, Conditional Triggered Transaction, Datastructures, Apparatuses, Methods and Systems
CN106503992A (en) * 2016-10-18 2017-03-15 北京天德科技有限公司 A kind of block chain that Transaction Information and accounts information are stored respectively
CN106940866A (en) * 2017-02-22 2017-07-11 深圳市喜悦智慧实验室有限公司 A kind of asset management system based on many account managements
CN107248074A (en) * 2017-03-29 2017-10-13 阿里巴巴集团控股有限公司 A kind of method for processing business and equipment based on block chain
CN107240018A (en) * 2017-07-25 2017-10-10 成都励睿德企业管理有限公司 A kind of method and system for being used to pay tranaction costs in block chain network
CN107807951A (en) * 2017-09-18 2018-03-16 联动优势科技有限公司 A kind of block chain generation method, data verification method, node and system
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium
CN108446969A (en) * 2018-03-29 2018-08-24 张文昌 A kind of unified public transport book keeping operation and transaction system based on block chain

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008203A (en) * 2019-01-31 2019-07-12 阿里巴巴集团控股有限公司 A kind of data clearing method, device and equipment
CN110008203B (en) * 2019-01-31 2023-06-06 创新先进技术有限公司 Data clearing method, device and equipment
CN111695885A (en) * 2019-03-14 2020-09-22 中国科学技术大学 Digital certificate block chain compression method based on transaction input reduction
CN111695885B (en) * 2019-03-14 2023-08-29 中国科学技术大学 Digital voucher block chain compression method based on reduced transaction input
CN112015697A (en) * 2020-10-27 2020-12-01 暗链科技(深圳)有限公司 Method and system for archiving data on block chain
CN112015697B (en) * 2020-10-27 2021-02-02 暗链科技(深圳)有限公司 Method and system for archiving data on block chain
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109213767B (en) 2020-07-21

Similar Documents

Publication Publication Date Title
CN109213767A (en) A kind of account data management method suitable for block chain
CN109391645B (en) Block chain lightweight processing method, block chain node and storage medium
CN100384161C (en) Method and system for processing service behaviour abnormal
CN104484743A (en) Recyclable resource managing system and method
US20150142735A1 (en) Memory searching system and method, real-time searching system and method, and computer storage medium
CN108399186A (en) A kind of collecting method and device
CN111368147B (en) Graph feature processing method and device
CN103201756A (en) Utilizing metadata to optimize efficiency for archiving emails
CN101667976B (en) Method for determining mail push mode, pushing method, pushing device
CN102438205B (en) Method and system for pushing service based on action of mobile user
CN103366117B (en) A kind of viral restorative procedure of infection type and system
CN109657063A (en) A kind of processing method and storage medium of magnanimity environment-protection artificial reported event data
CN111813900B (en) Multi-round dialogue processing method and device, electronic equipment and storage medium
CN101646140A (en) Message log processing method and system
CN111008183B (en) Storage method and system for business wind control log data
CN100477582C (en) Method and system for processing real-time multi-media information in instant telecommunication
US8756093B2 (en) Method of monitoring a combined workflow with rejection determination function, device and recording medium therefor
CN111694832A (en) Resource management method and system for internet data center
CN105677478A (en) Method and apparatus for resources management
CN117131460A (en) Telecom fraud account identification model training method, device, equipment and medium
CN111182485A (en) Single ticket total traffic control system and method
CN111464687A (en) Strange call request processing method and device
CN113221984B (en) User drunk driving behavior analysis and prediction method, device, equipment and storage medium
CN110955760A (en) Evaluation method of judgment result and related device
CN107104889A (en) A kind of rough draft mail synchronization method, device and terminal based on IMAP protocol

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230106

Address after: Room 1502, 1503, 1504 and 1505, Floor 15, Building 3, No. 96, Huaxing Road, Xihu District, Hangzhou, Zhejiang Province, 310000

Patentee after: HANGZHOU MAOCAI NETWORK TECHNOLOGY Co.,Ltd.

Address before: 18 / F, No.96, Huaxing Road, Xihu District, Hangzhou, Zhejiang 310000

Patentee before: WACAI NETWORK TECHNOLOGY CO.,LTD.