CN107239954B - Method and device for increasing block generation speed - Google Patents

Method and device for increasing block generation speed Download PDF

Info

Publication number
CN107239954B
CN107239954B CN201710422544.0A CN201710422544A CN107239954B CN 107239954 B CN107239954 B CN 107239954B CN 201710422544 A CN201710422544 A CN 201710422544A CN 107239954 B CN107239954 B CN 107239954B
Authority
CN
China
Prior art keywords
transaction information
block
hash value
database
verified
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
CN201710422544.0A
Other languages
Chinese (zh)
Other versions
CN107239954A (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.)
Beijing Huitong Jincai Information Technology Co ltd
State Grid Digital Technology Holdings Co ltd
State Grid Corp of China SGCC
Original Assignee
Beijing Huitong Jincai Information Technology Co ltd
State Grid Corp of China SGCC
State Grid E Commerce 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 Beijing Huitong Jincai Information Technology Co ltd, State Grid Corp of China SGCC, State Grid E Commerce Co Ltd filed Critical Beijing Huitong Jincai Information Technology Co ltd
Priority to CN201710422544.0A priority Critical patent/CN107239954B/en
Publication of CN107239954A publication Critical patent/CN107239954A/en
Application granted granted Critical
Publication of CN107239954B publication Critical patent/CN107239954B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a method and a device for improving block generation speed, wherein the method comprises the following steps: when the block stores data, transaction information is stored in a database, and the hash value is stored in the block; establishing an index relation between the hash value and transaction information in the database; and when the true existence of the transaction information is verified, downloading the transaction information to be verified for verification according to the index relation. The invention reduces the transaction information confirmation event, improves the block generation speed and further realizes the purpose of improving the transaction efficiency of the block chain network.

Description

Method and device for increasing block generation speed
Technical Field
The present invention relates to the field of financial technologies, and in particular, to a method and an apparatus for increasing block generation speed.
Background
In recent years, the blockchain technology is used as a bottom layer technology of bitcoin, is a distributed database and account book recording technology which is almost impossible to change, and is enabled to go to the center, record the sequence of transaction events on the basis of ensuring data security and have the characteristic of being not capable of being tampered, so that the blockchain technology is undergoing a rapid development stage.
The encryption digital currency system constructed by taking the block chain as the bottom layer technology has high data recording safety due to the distributed characteristic. However, each node has a complete account book, and each record needs to be traced back when confirming a transaction, so that performance problems occur when transaction data is excessively large as time advances, for example, all historical transaction records need to be downloaded for normal operation when the transaction is used for the first time, or each historical transaction needs to be traced back to calculate a balance in order to verify that the transaction has enough money. Moreover, the capacity of a single block is limited, and as the data stored in the block is increased, the efficiency is lower when the data is used for trading compared with the traditional central server or trading operator, and the demand for timely processing of large-batch trading orders cannot be met at present.
Disclosure of Invention
In view of the above problems, the present invention provides a method and an apparatus for increasing block generation speed, so as to achieve the purpose of increasing transaction efficiency of a block chain network.
In order to achieve the above object, according to a first aspect of the present invention, there is provided a method of increasing a block generation speed, the method including:
when the block stores data, transaction information is stored in a database, and the hash value is stored in the block;
establishing an index relation between the hash value and transaction information in the database;
and when the true existence of the transaction information is verified, downloading the transaction information to be verified for verification according to the index relation.
Preferably, when the transaction information is stored in the block, the method further comprises:
and extracting the transaction information from the block and storing the transaction information into a database.
Preferably, the establishing an index relationship between the hash value and the transaction information in the database includes:
setting the number of a block storing the hash value;
acquiring transaction information corresponding to the hash value in a database, and setting the number of the transaction information to be the same as the number of the block storing the hash value;
and establishing an index relationship between the transaction information with the same block number and the hash value stored in the block.
Preferably, when the true existence of the transaction information is verified, the downloading the transaction information to be verified for verification according to the index relationship includes:
when the true existence of the transaction information is verified, downloading the transaction information needing verification in the database;
acquiring a hash value corresponding to the transaction information to be verified according to the index relation;
and verifying the transaction information to be verified by verifying the hash value.
Preferably, the database is a local database or a remote database.
According to a second aspect of the present invention, there is provided an apparatus for increasing a block generation speed, the apparatus comprising:
the storage module is used for storing the transaction information into the database and storing the hash value into the block when the data is stored in the block;
the establishing module is used for establishing an index relation between the hash value and the transaction information in the database;
and the verification module is used for downloading the transaction information to be verified for verification according to the index relation when the true existence of the transaction information is verified.
Preferably, when the transaction information is stored in the block, the apparatus further comprises:
and the extraction module is used for extracting the transaction information from the block and storing the transaction information into a database.
Preferably, the establishing module includes:
a first setting unit configured to set a number of a block storing the hash value;
the second setting unit is used for acquiring transaction information corresponding to the hash value in a database and setting the number of the transaction information to be the same as the number of the block for storing the hash value;
and the establishing unit is used for establishing the index relationship between the transaction information with the same block number and the hash value stored in the block.
Preferably, the verification module includes:
the downloading unit is used for downloading the transaction information needing to be verified in the database when the authenticity of the transaction information is verified;
the acquisition unit is used for acquiring a hash value corresponding to the transaction information to be verified according to the index relation;
and the verification unit is used for verifying the hash value to realize the verification of the transaction information to be verified.
Compared with the prior art, the transaction information is stored in the database when the data is stored in the block, only the hash value is stored in the block, the capacity of the data stored in the block is reduced, the authenticity of the transaction information is verified when the transaction information is confirmed, the specific transaction information can be indexed through the hash value according to the index relation, only the transaction information to be verified needs to be downloaded, and verification is performed through the hash value, so that the downloading time is saved, confirmation events are reduced, the block generation speed is increased, and the transaction efficiency of the block chain network can be greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for increasing block generation speed according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for increasing block generation speed according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the 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.
The terms "first" and "second," and the like in the description and claims of the present invention and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not set forth for a listed step or element but may include steps or elements not listed.
Example one
Fig. 1 is a flowchart illustrating a method for increasing block generation speed according to an embodiment of the present invention, the method including the following steps:
s11, when the block stores data, storing the transaction information into the database, and storing the hash value into the block;
it can be understood that, in the existing blockchain technology, transaction information and hash values are both stored in a block, which increases the capacity of the block, and in the embodiment of the present invention, the transaction information is stored in a database, and only key data, namely, the hash values, are stored in the block, which reduces the capacity of the block for storing data. Meanwhile, the database stored by the transaction information can be a local database or a foreign database.
Preferably, if the existing block in the block chain already stores the transaction information, the transaction information may also be extracted from the corresponding block, and the extracted transaction information is stored in the database.
S12, establishing an index relationship between the hash value and the transaction information in the database;
specifically, the specific method steps adopted for establishing the index relationship in the embodiment of the present invention are as follows:
setting the number of a block storing the hash value;
acquiring transaction information corresponding to the hash value in a database, and setting the number of the transaction information to be the same as the number of the block storing the hash value;
and establishing an index relationship between the transaction information with the same block number and the hash value stored in the block.
Correspondingly, other methods for establishing an index in the prior art may also be adopted, as long as the index relationship between the hash value and the transaction information in the database can be established, and the specific establishment method is not specifically limited in the present invention.
And S13, when the true existence of the transaction information is verified, downloading the transaction information to be verified for verification according to the index relation.
Specifically, the verification process includes:
when the true existence of the transaction information is verified, downloading the transaction information needing verification in the database;
acquiring a hash value corresponding to the transaction information to be verified according to the index relation;
and verifying the transaction information to be verified by verifying the hash value.
According to the technical scheme disclosed by the embodiment of the invention, the transaction information is stored in the database, only the hash value is stored in the block, the specific transaction information can be indexed through the hash value, and then the index relationship between the hash value and the transaction information in the database is established.
Example two
Corresponding to the method for increasing the block generation speed disclosed in the first embodiment of the present invention, a second embodiment of the present invention further provides a device for increasing the block generation speed, and fig. 2 is a schematic structural diagram of the device for increasing the block generation speed provided in the second embodiment of the present invention, where the device includes:
the storage module 1 is used for storing the transaction information into a database and storing the hash value into the block when the block stores data;
the establishing module 2 is used for establishing an index relationship between the hash value and the transaction information in the database;
and the verification module 3 is used for downloading the transaction information to be verified for verification according to the index relation when the true existence of the transaction information is verified.
Correspondingly, when the transaction information is stored in the block, the device further comprises:
and the extraction module is used for extracting the transaction information from the block and storing the transaction information into a database.
Specifically, the establishing module 2 includes:
a first setting unit 21 for setting the number of a block storing the hash value;
the second setting unit 22 is configured to acquire transaction information corresponding to the hash value in the database, and set the number of the transaction information to the same number as that of the block storing the hash value;
the establishing unit 23 is configured to establish an index relationship between the transaction information with the same block number and the hash value stored in the block.
Specifically, the verification module 3 includes:
the downloading unit 31 is used for downloading the transaction information needing to be verified in the database when the true existence of the transaction information is verified;
the obtaining unit 32 is configured to obtain, according to the index relationship, a hash value corresponding to the transaction information to be verified;
and the verification unit 33 is configured to verify the transaction information to be verified by verifying the hash value.
In the second embodiment of the invention, the transaction information is stored in the database through the storage module, and the hash value is stored in the block, so that the capacity of data stored in the block is reduced, as the specific transaction information can be indexed through the hash value, namely, the index relationship between the hash value and the transaction information in the database is established in the establishing module, when the authenticity of the transaction information is verified through the verifying module, only the transaction information to be verified needs to be downloaded, and the verification is carried out through the hash value, so that the downloading time is saved, the confirmation time is reduced, the block generation speed is increased, the transaction efficiency of the block chain network can be greatly increased, and the promotion effect on the promotion of the block chain network payment is also achieved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (5)

1. A method for increasing block generation speed, the method comprising:
when the block stores data, transaction information is stored in a database, and a hash value is stored in the block, or when the block stores the transaction information, the transaction information is extracted from the block and stored in the database;
establishing an index relationship between the hash value and the transaction information in the database, wherein the establishing of the index relationship between the hash value and the transaction information in the database comprises: setting the number of a block storing the hash value; acquiring transaction information corresponding to the hash value in a database, and setting the number of the transaction information to be the same as the number of a block storing the hash value; establishing an index relationship between the transaction information with the same number as the block and the hash value stored in the block;
and when the true existence of the transaction information is verified, downloading the transaction information to be verified for verification according to the index relation.
2. The method according to claim 1, wherein when verifying the true existence of the transaction information, downloading the transaction information to be verified for verification according to the index relationship comprises:
when the true existence of the transaction information is verified, downloading the transaction information needing verification in the database;
acquiring a hash value corresponding to the transaction information to be verified according to the index relation;
and verifying the transaction information to be verified by verifying the hash value.
3. The method of claim 1, wherein the database is a local database or an offsite database.
4. An apparatus for increasing block generation speed, the apparatus comprising:
the storage module is used for storing the transaction information into the database and storing the hash value into the block when the data is stored in the block, or extracting the transaction information from the block and storing the transaction information into the database when the transaction information is stored in the block;
an establishing module, configured to establish an index relationship between the hash value and the transaction information in the database, where the establishing module includes: a first setting unit configured to set a number of a block storing the hash value; the second setting unit is used for acquiring transaction information corresponding to the hash value in a database and setting the number of the transaction information to be the same as that of a block storing the hash value; the establishing unit is used for establishing the index relationship between the transaction information with the same number as the block and the hash value stored in the block;
and the verification module is used for downloading the transaction information to be verified for verification according to the index relation when the authenticity of the transaction information is verified.
5. The apparatus of claim 4, wherein the verification module comprises:
the downloading unit is used for downloading the transaction information needing to be verified in the database when the authenticity of the transaction information is verified;
the acquisition unit is used for acquiring a hash value corresponding to the transaction information to be verified according to the index relation;
and the verification unit is used for verifying the hash value to realize the verification of the transaction information to be verified.
CN201710422544.0A 2017-06-07 2017-06-07 Method and device for increasing block generation speed Active CN107239954B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710422544.0A CN107239954B (en) 2017-06-07 2017-06-07 Method and device for increasing block generation speed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710422544.0A CN107239954B (en) 2017-06-07 2017-06-07 Method and device for increasing block generation speed

Publications (2)

Publication Number Publication Date
CN107239954A CN107239954A (en) 2017-10-10
CN107239954B true CN107239954B (en) 2021-01-22

Family

ID=59986043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710422544.0A Active CN107239954B (en) 2017-06-07 2017-06-07 Method and device for increasing block generation speed

Country Status (1)

Country Link
CN (1) CN107239954B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993526B (en) * 2018-01-02 2021-07-06 中国移动通信有限公司研究院 Block chain checking method, processing node and storage medium
CN110020943A (en) * 2018-01-10 2019-07-16 巍乾全球技术有限责任公司 Carbon record and method of commerce, equipment, block chain node, computer media and system based on block chain
CN108401026B (en) * 2018-02-26 2020-06-19 深圳智乾区块链科技有限公司 Block chain-based data storage method, system and computer-readable storage medium
CN109086325A (en) * 2018-06-29 2018-12-25 阿里巴巴集团控股有限公司 Data processing method and device based on block chain
CN111090385A (en) * 2018-10-23 2020-05-01 中思博安科技(北京)有限公司 Data management method and device based on block chain
CN109658238B (en) * 2018-10-26 2020-06-16 阿里巴巴集团控股有限公司 Data processing method and device
CN109461079B (en) * 2018-10-29 2022-04-05 众安信息技术服务有限公司 Transaction processing method and device based on block chain
CN109583896A (en) * 2018-11-30 2019-04-05 元灵通智能科技(深圳)有限公司 Transaction verification method, block chain node and storage medium
WO2019072307A2 (en) 2018-12-28 2019-04-18 Alibaba Group Holding Limited Accelerating transaction deliveries in blockchain networks using acceleration nodes
EP3566393B1 (en) 2018-12-28 2021-09-01 Advanced New Technologies Co., Ltd. Accelerating transaction deliveries in blockchain networks using transaction resending
EP3571808A4 (en) 2018-12-28 2020-03-04 Alibaba Group Holding Limited Improving blockchain transaction speeds using global acceleration nodes
CN110032664A (en) * 2019-03-07 2019-07-19 上海七印信息科技有限公司 A method of quickly establishing the full node address index of bit coin block chain
CN109977699B (en) * 2019-03-26 2022-04-01 贝富(广州)新技术有限公司 House property information storage method, system and storage medium based on block chain
CN110113168B (en) * 2019-04-03 2022-04-22 厦门历思科技服务有限公司 Information authentication method, client, system and computer readable storage medium
CN110188243A (en) * 2019-05-10 2019-08-30 北京农业信息技术研究中心 A kind of anti-fake information storage and method for quickly querying and the device of tracing to the source of agricultural product
CN110096522B (en) * 2019-05-15 2023-07-28 西安电子科技大学 Block chain data processing method, device and equipment supporting relational retrieval
CN110489234A (en) * 2019-08-16 2019-11-22 中国银行股份有限公司 Message processing method, device, equipment and the readable storage medium storing program for executing of block link layer
CN111368330B (en) * 2020-03-03 2022-08-05 泰华智慧产业集团股份有限公司 Ethernet intelligent contract auditing system and method based on block chain
CN111339106B (en) * 2020-05-18 2020-08-28 杭州趣链科技有限公司 Block chain data indexing method
CN113157203A (en) * 2021-01-19 2021-07-23 湖南汽车工程职业学院 Storage method of network computer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105719185A (en) * 2016-01-22 2016-06-29 杭州复杂美科技有限公司 Block chain data comparison and consensus method
CN105931052A (en) * 2016-04-21 2016-09-07 四川大学 Virtual currency transaction validation method based on block chain multi-factor cross-validation

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107851111A (en) * 2015-05-05 2018-03-27 识卡公司 Use the identity management services of block chain
CN106548349B (en) * 2016-11-02 2020-09-29 江苏通付盾科技有限公司 Transaction information verification method and system
CN106506638B (en) * 2016-11-04 2020-01-07 江苏通付盾科技有限公司 Block storage method and device in block chain
CN106682907A (en) * 2016-12-10 2017-05-17 江苏恒为信息科技有限公司 Comparison and consensus method for block chain data
CN106682528B (en) * 2016-12-31 2019-06-11 杭州复杂美科技有限公司 Block chain encrypts search method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105719185A (en) * 2016-01-22 2016-06-29 杭州复杂美科技有限公司 Block chain data comparison and consensus method
CN105931052A (en) * 2016-04-21 2016-09-07 四川大学 Virtual currency transaction validation method based on block chain multi-factor cross-validation

Also Published As

Publication number Publication date
CN107239954A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
CN107239954B (en) Method and device for increasing block generation speed
CN108062629B (en) Transaction event processing method, terminal device and medium
CN105337928B (en) Method for identifying ID, safety protection problem generation method and device
CN109598598A (en) Transaction processing method and device, electronic equipment based on block chain
CN109544335B (en) Transaction data processing method, device, equipment and storage medium based on blockchain
CN109598504A (en) Transaction processing method and device, electronic equipment based on block chain
CN110992053B (en) Secure payment system and method based on finger vein recognition and blockchain technology
CN111585767A (en) Data exchange method and device for main chain and side chain
CN112036995A (en) Large-scale enterprise financial data management method and system based on block chain and readable storage medium
CN107358763A (en) A kind of method, apparatus and system of ATM checking identity
CN114677188B (en) Full-amount acquisition method and device suitable for paperless certificate data
CN110009339A (en) Data processing method and device based on block chain
WO2018210097A1 (en) Method and device for execution transaction mode by classification
CN112053232B (en) Self-service equipment business accounting consistency processing method and device
CN113656497A (en) Data verification method and device based on block chain
CN105184559A (en) System and method for payment
CN106934708B (en) Event recording method and device
CN116302889A (en) Performance test method and device for functional module and server
CN109558064B (en) Electronic invoice data chain synchronization method, device, medium and electronic equipment
KR101561979B1 (en) Centralized server using personal information service delete and restore and certification system of mobile terminal and method of the same
CN114462998A (en) Log tamper-proofing method, system and storage medium
KR20210117731A (en) The blockchain-based transaction history confirmation system
CN110910091A (en) Data processing method, device and medium
CN110765318A (en) Method and device for inquiring block chain data
CN110599272A (en) Method for issuing electronic invoice and related product

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100094 room 1103, building 11, yard 68, Beiqing Road, Haidian District, Beijing

Patentee after: BEIJING HUITONG JINCAI INFORMATION TECHNOLOGY Co.,Ltd.

Patentee after: State Grid Digital Technology Holdings Co.,Ltd.

Patentee after: State Grid Corporation of China

Address before: 100094 room 1103, building 11, yard 68, Beiqing Road, Haidian District, Beijing

Patentee before: BEIJING HUITONG JINCAI INFORMATION TECHNOLOGY Co.,Ltd.

Patentee before: STATE GRID ELECTRONIC COMMERCE Co.,Ltd.

Patentee before: State Grid Corporation of China