WO2020042779A1 - 数据存储的控制方法、装置、服务器及可读存储介质 - Google Patents
数据存储的控制方法、装置、服务器及可读存储介质 Download PDFInfo
- Publication number
- WO2020042779A1 WO2020042779A1 PCT/CN2019/095601 CN2019095601W WO2020042779A1 WO 2020042779 A1 WO2020042779 A1 WO 2020042779A1 CN 2019095601 W CN2019095601 W CN 2019095601W WO 2020042779 A1 WO2020042779 A1 WO 2020042779A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- abnormal
- database
- consensus
- immediate
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
Definitions
- the embodiments of the present specification relate to the field of blockchain technology, and in particular, to a method, a device, a server, and a readable storage medium for controlling data storage.
- Blockchain technology also known as distributed ledger technology, is a distributed Internet database technology.
- a network constructed based on blockchain technology can be referred to as a blockchain network.
- the blockchain network contains network nodes (blockchain nodes). Each node corresponds to at least one blockchain. Each blockchain has at least one Contains a block.
- the blockchain network has the characteristics of decentralization, openness and transparency, immutability, and trust.
- the embodiments of the present specification provide a data storage control method, device, server, and readable storage medium.
- an embodiment of the present specification provides a data storage control method for controlling the storage of non-immediate data for a blockchain system.
- the method includes receiving non-immediate data and verifying the non-immediate data. ; After the verification is passed, storing the non-immediate data in a database of the blockchain system; performing consensus processing on the non-immediate data, determining abnormal data according to a consensus processing result, and targeting the abnormal data Managed in the database storage.
- an embodiment of the present specification provides a data storage control device for controlling non-immediate data storage for a blockchain system.
- the device includes: a data receiving unit for receiving non-immediate data; verification A unit for verifying non-immediate data; a storage control unit for storing the non-immediate data in a database of the blockchain system after the verification is passed; a consensus unit for non-immediate data
- the data is subjected to consensus processing; the abnormal data determining unit is configured to determine abnormal data according to a consensus processing result; the abnormal management unit is configured to manage storage of the abnormal data in the database.
- an embodiment of the present specification provides a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- a server including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor executes the program, any one of the foregoing is implemented. Method steps.
- an embodiment of the present specification provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in any one of the foregoing are implemented.
- FIG. 1 is a schematic diagram of an application scenario of a data storage control method according to an embodiment of the present specification
- FIG. 2 is a flowchart of a data storage control method in the first aspect of the embodiment of the present specification
- FIG. 3 is a schematic diagram of an example of a data storage control method according to the first aspect of the embodiment of the present specification
- FIG. 4 is a schematic structural diagram of a data storage control device according to a second aspect of the embodiment of the present specification.
- FIG. 5 is a schematic structural diagram of a server according to a third aspect of the embodiment of the present specification.
- FIG. 1 it is a schematic diagram of an application scenario of a data storage control method according to an embodiment of the present specification.
- the client 10 communicates with the blockchain system 20, and the blockchain system 20 receives data from the client 10 and performs data upload operations.
- Blockchain is a technical system that is jointly maintained by multiple parties, using cryptography to ensure transmission and access security, and can achieve consistent data storage, tamper-proof, and non-repudiation.
- a typical blockchain implements data storage with a blockchain structure.
- Immediate data generally refers to business data, including, for example, data with high real-time requirements for transaction processing; non-immediate data can include certificate data and status description data, where certificate data refers to the indexing of business data or the location of business data Data, such as key / value (kv) data; status description data refers to data describing business data status information.
- certificate data refers to the indexing of business data or the location of business data Data, such as key / value (kv) data
- status description data refers to data describing business data status information.
- the process of data on-chain includes three phases: acceptance phase, consensus phase and storage phase.
- the acceptance stage can be understood as the data to be uploaded is received by a blockchain node in the blockchain network, and the blockchain node accepts the data;
- the consensus stage can be understood as the blockchain node is accepting the data After that, other blockchain nodes in the blockchain network need to participate in the consensus processing of the data.
- the storage phase After the data passes the consensus, it can enter the storage phase; the storage node can be understood as the blockchain node uploading the data passed by the consensus. deal with.
- the data storage control method provided in the embodiments of the present specification is used to control the storage of non-real-time data for a blockchain system.
- an embodiment of the present specification provides a data storage control method for controlling non-real-time data storage for a blockchain system. Please refer to FIG. 2, the data storage control method includes S201-S205.
- non-immediate data refers to data that does not require high immediacy, including certificate data and status description data.
- the blockchain system receives the certificate data of the blockchain business data from the client.
- Credential data can be understood as data used to index business data or mark the location of business data, including, for example, key / value (kv) data.
- Blockchain certificate business is an important business form in blockchain technology, which aims to archive data of certain types of transaction data submitted, and subsequently provide proof of existence based on transaction hash.
- Transaction hash is a hash value obtained by hashing a transaction or a block header using a specific hash algorithm in blockchain technology. It is often used to retrieve and verify related information.
- the verification process includes, for example:
- transaction information (including certificate data or other data, such as transaction data) is obtained, and a hash value 001 of transaction-related information is calculated; "hash value 001 + private Key "to perform a signature operation to generate a signature, and the external broadcast content is” transaction information + signature ";
- the above-mentioned "transaction information + signature" is obtained by broadcasting; the signature is decrypted by the public key of node 001 to obtain a hash value of 001; the transaction information is hashed to obtain a hash value. 002; Compare whether the hash value 001 and the hash value 001 are the same. If they are the same, the verification is passed. If they are not, the verification is not passed.
- step S203 is performed to immediately start the operation of storing non-immediate data.
- a very core part of blockchain technology is its ledger database.
- Traditional databases use a CS (client-server) network structure. In this way, the user can modify the data. At the same time, the control of the database is also in a central organization, such as a company or organization. After they authenticate the client, they will provide access to the database.
- Traditional databases have obvious traces of centralized services.
- the blockchain database is different, it is composed of multiple distributed decentralized nodes. All nodes participate in data management. Any data added to the ledger database is confirmed by the nodes. These ledgers are open and transparent to all nodes. Just like to increase transaction data in Bitcoin's ledger, consensus must be achieved, and nodes can enter the block only after confirmation. This consensus algorithm guarantees the security of the network and makes it immutable.
- the consensus mechanism is also the authorization certification POS and the delegation authorization certification DPOS.
- the instant storage of non-immediate data can be achieved by the following steps:
- S204 Perform consensus processing on non-real-time data.
- S205 Determine abnormal data according to the consensus processing result, and manage the abnormal data stored in the database.
- the embodiment of the present specification does not consider the consensus result and stores all non-instant data to the database, in order to ensure the validity of the data, the data of the consensus failure stored in the database may be managed according to the consensus result.
- the consensus mechanism is a core mechanism in blockchain technology.
- "consensus” means that participants reach a common understanding of the state of a blockchain. Because the blockchain is decentralized, any "decision / state / change, etc.” requires all nodes (participants) to use a mechanism to achieve the same understanding. This is the consensus mechanism of the blockchain.
- the consensus mechanism is also called consensus algorithm.
- the consensus algorithms in the embodiments of the present specification include, but are not limited to: proof of work (PoW), proof of equity (POS), proof of share authorization (DPoS), practical Byzantine fault tolerance (PBFT), authorized Byzantine fault tolerance (DBFT), and so on.
- determining abnormal data according to a consensus processing result includes:
- the corresponding abnormal data is determined by the abnormal flag information.
- the abnormal flag information refers to flag information for marking abnormal non-immediate data, for example, including abnormal hash values, or the abnormal flag information may include the block height information of the failed block in addition to the abnormal hash value.
- the purpose of attaching the block height information of the failed block is to avoid hash collisions in a wide range according to the block height information.
- the process of managing abnormal data stored in the database may be: deleting the abnormal data when the blockchain system is idle, or within a predetermined period of time, or triggered by a predetermined event.
- a fixed time period such as a morning Time
- different nodes can be controlled to execute S203 (the step of storing non-immediate data to a database) and S204 (the step of performing consensus processing on non-immediate data).
- S203 the step of storing non-immediate data to a database
- S204 the step of performing consensus processing on non-immediate data.
- the advantage of this processing is that by storing And consensus operations are processed on different nodes (physical devices) respectively to improve processing efficiency.
- the storage control operation is performed on node A and the consensus processing operation is performed on node B.
- Due to storage control and computer input / output ( I / O performance is closely related, and consensus processing efficiency is closely related to the computer's CPU throughput. Therefore, physical devices that are more suitable for the above two steps can be selected for special processing without affecting each other and improving processing efficiency.
- FIG. 3 is a schematic diagram of an example of a data storage control method according to the first aspect of the embodiment of the present specification.
- the distributed kv database of the blockchain system is taken as an example to describe the storage of the certificate data.
- Distributed kv (key / value) is also called distributed key-value pair storage, which refers to a kv database system maintained by a cluster of multiple machines. The data is stored on each node of the network, rather than a single machine kv storage.
- step 301 the blockchain system receives the certificate data from the client; then, in step 302, the certificate data is verified; in step 303, the certificate data is inserted into the kv database;
- step 304 consensus processing of the documented data can be performed at the same time;
- step 305 the consensus processed data is calculated by the virtual machine;
- step 306 update the kv database according to the abnormal flag information;
- step 307 the kv database according to the exception
- the tag information asynchronously cleans up the abnormal evidence data. For example, when the system is idle, the invalid Tx-hash key-value data is asynchronously deleted and cleaned from the transaction database based on the local abnormal tag information.
- the data is asynchronously submitted to the distribution immediately after the hash calculation.
- the kv system writes data, so that the local consensus process and the distributed kv data write process are synchronized and parallel to achieve efficient logical parallelism of the cluster system, thereby significantly improving system throughput performance.
- For the transactions that fail consensus local files are stored, and the post-order is asynchronous and practical.
- the program centrally cleans up the database when the system is idle; the embodiments of this specification are applicable to the alliance chain blockchain system (Permissioned), especially the alliance chain and blockchain system with a practical distributed architecture.
- an embodiment of the present specification provides a data storage control device for controlling non-real-time data storage for a blockchain system.
- the device includes:
- a data receiving unit 401 configured to receive non-immediate data
- a storage control unit 403, configured to store the non-instant data into a database of the blockchain system after the verification is passed;
- a consensus unit 404 configured to perform consensus processing on non-immediate data
- An abnormal data determining unit 405, configured to determine abnormal data according to a consensus processing result
- the abnormality management unit 406 is configured to manage storage of the abnormal data in the database. In an optional manner, the method further includes:
- An asynchronous submission thread creation unit 407 configured to create an asynchronous submission thread
- the storage control unit 403 inserts the non-immediate data into a database of the blockchain system by starting the asynchronous submission thread.
- the abnormal data determining unit 405 is specifically configured to: insert the abnormal tag information corresponding to the non-immediate data of the failed block of which the consensus fails or the upload fails; and, in the database, In the database, corresponding abnormal data is determined by using the abnormal flag information.
- the abnormal flag information includes an abnormal hash value, or the abnormal flag information includes an abnormal hash value and block height information of a failed block.
- the pair of exception management unit 406 is specifically configured to delete the abnormal data when the blockchain system is idle, or within a predetermined period of time or triggered by a predetermined event.
- the storage control unit 403 and the consensus unit 404 are executed by different nodes, respectively.
- the non-instant data includes credential data or status description data.
- the present invention further provides a server, as shown in FIG. 5, including a memory 504, a processor 502, and stored in the memory 504 and can be processed.
- a server as shown in FIG. 5, including a memory 504, a processor 502, and stored in the memory 504 and can be processed.
- a computer program running on a processor 502. When the processor 502 executes the program, the steps of any method of the data storage control method described above are implemented.
- the bus architecture (represented by the bus 500).
- the bus 500 may include any number of interconnected buses and bridges.
- the bus 500 will include one or more processors represented by the processor 502 and memory 504.
- the various circuits of the memory are linked together.
- the bus 500 can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, they are not described further herein.
- the bus interface 506 provides an interface between the bus 500 and the receiver 501 and the transmitter 503.
- the receiver 501 and the transmitter 503 may be the same element, that is, a transceiver, providing a unit for communicating with various other devices on a transmission medium.
- the processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used to store data used by the processor 502 when performing operations.
- the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the foregoing data storage is implemented. Control method steps of any method.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a particular manner such that the instructions stored in the computer-readable memory produce a manufactured article including the instruction device, the instructions
- the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本说明书实施例提供了一种数据存储的控制方法,用于针对区块链系统对非即时数据的存储进行控制,在验证完成之后,立即启动将非即时数据存储至数据库的操作,可达成高效的集群系统逻辑并行,从而显著提升系统吞吐量。
Description
本说明书实施例涉及区块链技术领域,尤其涉及一种数据存储的控制方法、装置、服务器及可读存储介质。
区块链技术也称为分布式账本技术,是一种分布式互联网数据库技术。基于区块链技术构建的网络可以称为区块链网络,在该区块链网络中包含网络节点(区块链节点),每一个节点对应至少一个区块链,每一个区块链上至少包含一个区块。区块链网络具备去中心化、公开透明、不可篡改、可信任等特点。
发明内容
本说明书实施例提供一种数据存储的控制方法、装置、服务器及可读存储介质。
第一方面,本说明书实施例提供一种数据存储的控制方法,用于针对区块链系统对非即时数据的存储进行控制,所述方法包括:接收非即时数据,并对非即时数据进行验证;在所述验证通过后,将所述非即时数据存储至所述区块链系统的数据库中;对所述非即时数据进行共识处理,根据共识处理结果确定异常数据,并针对所述异常数据在所述数据库的存储进行管理。
第二方面,本说明书实施例提供一种数据存储的控制装置,用于针对区块链系统对非即时数据的存储进行控制,所述装置包括:数据接收单元,用于接收非即时数据;验证单元,用于对非即时数据进行验证;存储控制单元,用于在所述验证通过后,将所述非即时数据存储至所述区块链系统的数据库中;共识单元,用于对非即时数据进行共识处理;异常数据确定单元,用于根据共识处理结果确定异常数据;异常管理单元,用于对所述异常数据在所述数据库的存储进行管理。
第三方面,本说明书实施例提供一种服务器,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任一项所述方法的步骤。
第四方面,本说明书实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任一项所述方法的步骤。
本说明书实施例有益效果如下:
本说明书实施例中,为了保证达到高效存储、提升系统吞吐量的目的,在验证完成之后,立即启动将非即时数据存储至数据库的操作,而不是等待其他操作(例如共识处理、虚拟机处理等)完成后才进行存储,这种打破原有的从共识排序到数据落盘写入顺序的方式,可达成高效的集群系统逻辑并行,从而显著提升系统吞吐量,尤其适用于分布式架构的联盟链。
图1为本说明书实施例的数据存储的控制方法应用场景示意图;
图2本说明书实施例第一方面的数据存储的控制方法流程图;
图3本说明书实施例第一方面的数据存储的控制方法实例示意图;
图4本说明书实施例第二方面的数据存储的控制装置结构示意图;
图5本说明书实施例第三方面的服务器结构示意图。
为了更好的理解上述技术方案,下面通过附图以及具体实施例对本说明书实施例的技术方案做详细的说明,应当理解本说明书实施例以及实施例中的具体特征是对本说明书实施例技术方案的详细的说明,而不是对本说明书技术方案的限定,在不冲突的情况下,本说明书实施例以及实施例中的技术特征可以相互组合。
参见图1,为本说明书实施例数据存储的控制方法应用场景示意图。客户端10与区块链系统20通信,区块链系统20从客户端10接收数据并进行数据上链的操作。
区块链是一种由多方共同维护,使用密码学保证传输和访问安全,能够实现数据一致存储、防篡改、防抵赖的技术体系。典型的区块链是以块链结构实现数据存储的。
区块链上链的数据对即时性的要求程度不同,可区分为即时数据和非即时数据。即时数据一般是指业务数据,例如包括交易处理实时性要求较高的数据;非即时数据可以包括存证数据以及状态描述数据,其中,存证数据是指用于索引业务数据或标记业务数 据位置的数据,例如key/value(kv)数据;状态描述数据是指描述业务数据状态信息的数据。
数据上链的过程包括三个阶段:受理阶段、共识阶段和存储阶段。受理阶段可以理解为待上链的数据被区块链网络中的某一区块链节点接收到,并由该区块链节点受理该数据;共识阶段可以理解为区块链节点在受理该数据之后,需要由区块链网络中的其他区块链节点参与对该数据进行共识处理,数据通过共识后,可以进入存储阶段;存储节点可以理解为区块链节点将共识通过的数据进行上链处理。
本说明书实施例提供的数据存储的控制方法,用于针对区块链系统对非即时数据的存储进行控制。
第一方面,本说明书实施例提供一种数据存储的控制方法,用于针对区块链系统对非即时数据的存储进行控制。请参考图2,该数据存储的控制方法包括S201-S205。
S201:接收非即时数据。
如前所述,非即时数据是指对即时性要求不高的数据,包括存证数据和状态描述数据。
以存证数据为例,接收存证数据的具体过程,例如,区块链系统从客户端接收区块链业务数据的存证数据。存证数据可以理解为是用于索引业务数据或标记业务数据位置的数据,例如包括key/value(kv)数据。区块链存证业务是区块链技术中重要的业务形式,旨在对于提交的某类交易数据进行数据归档,后续根据交易哈希提供存在性证明。
S202:对非即时性数据进行验证。
为了保证两个区块链节点之间传输数据的正确性及未更改,需要对数据进行验证。交易哈希(块哈希)是区块链技术中利用特定的哈希算法对交易或区块头进行哈希运算所得的哈希值,常用于检索和验证相关信息。
验证的过程例如包括:
在记录交易的节点(记为:节点001),得到交易信息(包括存证数据,或者还包括其他数据,例如交易数据),计算交易相关信息的哈希值001;“哈希值001+私钥”进行签名运算生成一个签名,对外广播内容为“交易信息+签名”;
在验证交易的节点(记为:节点002),由广播得到上述“交易信息+签名”;通过节点001公钥对签名进行解密得到哈希值001;对交易信息进行哈希计算得到哈希值002; 比对哈希值001和哈希值001是否一致,如果一致,则验证通过,如果不一致,则验证不通过。
本说明书实施例中,不论是针对记录交易的节点或验证交易的节点都适用,即,不论哪个节点,只要在验证通过后,即执行步骤S203,立即启动将非即时数据进行存储的操作。
S203:在验证通过后,将非即时数据存储至区块链系统的数据库中。
区块链技术中很核心的一部分是它的账本数据库。传统数据库使用CS(client-server)网络结构。这样,用户可以修改数据。同时,数据库的控制权也在一个中心机构,比如公司或机构,它们对客户端身份验证之后,就会提供对数据库的访问权限,传统的数据库有明显的中心化服务的痕迹。区块链数据库则不同,它由多个分布式去中心化的节点组成。所有节点都参与数据管理,在账本数据库增加任何数据,都得到节点确认,这些账本对于所有节点都是公开和透明的。就像比特币的账本中要增加交易数据,必须取得共识,在节点们确认后才能进入区块。这种共识算法保证了网络的安全,也让它不可篡改。共识的机制除了算力竞争的POW,还是授权证明POS和委托授权证明DPOS等。
在一种可选的实现方式中,可通过如下步骤实现对非即时数据的即时存储:
(1)创建异步提交线程;
(2)当验证通过后,立即启动异步提交线程,将非即时数据插入至区块链系统的数据库中。
S204:对非即时数据进行共识处理。
S205:根据共识处理结果确定异常数据,并针对异常数据在数据库的存储进行管理。
由于本说明书实施例没有考虑共识结果而将所有非即时数据存储至数据库,因此,为了保证数据的有效性,可根据共识结果对数据库所存储的共识失败的数据进行管理。
在一种可选方式中,在验证后,在进行非即时数据存储的同时,进行共识处理。后续,根据共识结果,确定异常数据,并对异常数据在数据库的存储进行管理。
共识机制是区块链技术中的一个核心机制。在区块链里,“共识”的意思是参与者就某一区块链状态达成共同的认识。由于区块链是去中心化的,因此任何“决策/状态/改变等”都要所有节点(参与者)一起使用某种机制来达成相同的认识,这就是区块链的共识机制。共识机制也称为共识算法。本说明书实施例中共识算法包括但不限于:工作量 证明(PoW)、权益证明(POS)、股份授权证明(DPoS)、实用拜占庭容错(PBFT)、授权拜占庭容错(DBFT)等。
为了去除共识失败的异常数据,首先需要根据共识结果确定出异常数据,并将异常数据对应的异常标记信息插入到数据库中;然后,在合适时机(例如数据库空闲时),通过异常标记信息,确定出异常数据并进行删除等操作。
在一种可选方式中,根据共识处理结果确定异常数据,包括:
(1)将共识失败或上链失败的失败区块的非即时数据对应的异常标记信息插入到数据库;
(2)在数据库中,通过异常标记信息确定对应的异常数据。
其中,异常标记信息是指用于标记异常的非即时数据的标志信息,例如包括异常哈希值,或者,异常标记信息除了包括异常哈希值之外,还可以包括失败区块的块高度信息,附加上失败区块的块高度信息的目的在于,可以根据块高度信息来避免广泛域上的哈希碰撞。
在一种可选方式中,对异常数据在数据库的存储进行管理的过程可以是:在区块链系统空闲时,或者在预定时间段内,或者在预定事件触发下,对异常数据进行删除。
例如,可以通过统计系统内存状态确定系统是否储于空闲状态,并预先配置在空闲状态对异常数据进行删除操作;也可以预置异常数据删除时间段,例如,设置一个固定时间段(例如凌晨一段时间)每周清理一次异常数据;或者,在某些特定事件(例如数据库存储能力不足)时,启动对异常数据的删除。
在一种可选方式中,可控制由不同节点分别执行S203(将非即时数据存储至数据库的步骤)和S204(对非即时数据进行共识处理的步骤),这样处理的好处在于,通过将存储及共识的操作分别在不同节点(物理设备)上处理,从而提高处理效率,例如,在节点A进行存储控制的操作,在节点B进行共识处理的操作,由于存储控制与计算机的输入/输出(I/O)性能紧密相关,而共识处理效率与计算机的CPU吞吐量紧密相关,因此可以选择更适合上述两个步骤的物理设备分别进行专门处理,互不影响,提高处理效率。当然,将上述两个步骤放置在同一个物理设备上执行也是可行的。
可见,本说明书实施例中,为了保证达到高效存储、提升系统吞吐量的目的,在数据验证通过之后,立即启动将非即时数据存储至数据库的操作,而不是等待其他操作(例如共识处理、虚拟机处理等)完成后才进行存储,这种打破原有的从共识排序到数据落 盘写入顺序的方式,可达成高效的集群系统逻辑并行,从而显著提升系统吞吐量,尤其适用于分布式架构的联盟链。
参见图3,为本说明书实施例第一方面的数据存储控制方法实例示意图。
在该实例中,以区块链系统的分布式kv数据库为例,对存证数据的存储进行说明。分布式kv(key/value)亦称为分布式键值对存储,是指集群式多机维护的kv数据库系统,数据存放在网络各节点上,而非单机kv存储。
首先,在步骤301,区块链系统从客户端接收到存证数据;然后,在步骤302,对存证数据进行验证;在步骤303,将存证数据插入至kv数据库;在步骤303的执行过程中,可同时执行步骤304:对存证数据进行共识处理;步骤305:将共识处理后的数据经过虚拟机进行计算;步骤306:根据异常标记信息更新kv数据库;步骤307:kv数据库根据异常标记信息对异常存证数据进行异步清理,例如,系统空闲时,根据本地异常标记信息,通过实用程序将无效的Tx-hash键值对数据从交易数据库中异步进行删除清理。
可见,在该实例中,针对存证业务型交易哈希键值对数据,通过打破正常从共识排序到数据落盘写入顺序的相应技术和方式,在哈希计算后立即异步提交给分布式kv系统进行数据写入,使得本地共识过程和分布式kv数据写入过程同步并行,达成高效的集群系统逻辑并行从而显著提升系统吞吐量性能,对于共识失败的交易存本地文件,后序异步实用程序在系统闲时集中清理数据库;本说明书实施例适用于联盟链区块链系统(Permissioned),尤其实用分布式架构的联盟链、区块链系统。
第二方面,基于同一发明构思,本说明书实施例提供一种数据存储的控制装置,用于针对区块链系统对非即时数据的存储进行控制,请参考图4,所述装置包括:
数据接收单元401,用于接收非即时数据;
验证单元402,用于对非即时数据进行验证;
存储控制单元403,用于在所述验证通过后,将所述非即时数据存储至所述区块链系统的数据库中;
共识单元404,用于对非即时数据进行共识处理;
异常数据确定单元405,用于根据共识处理结果确定异常数据;
异常管理单元406,用于对所述异常数据在所述数据库的存储进行管理。在一种可选方式中,还包括:
异步提交线程创建单元407,用于创建异步提交线程;
存储控制单元403通过启动所述异步提交线程,将所述非即时数据插入至所述区块链系统的数据库中。
在一种可选方式中,所述异常数据确定单元405具体用于:将共识失败或上链失败的失败区块的非即时数据对应的异常标记信息插入到所述数据库;以及,在所述数据库中,通过所述异常标记信息确定对应的异常数据。
在一种可选方式中,所述异常标记信息包括异常哈希值,或者,所述异常标记信息包括异常哈希值及失败区块的块高度信息。
在一种可选方式中,所述对异常管理单元406具体用于:在所述区块链系统空闲时,或者在预定时间段内或根据预定事件触发下,对所述异常数据进行删除。
在一种可选方式中,所述存储控制单元403和所述共识单元404分别由不同节点执行。
在一种可选方式中,所述非即时数据包括存证数据或状态描述数据。
第三方面,基于与前述实施例中数据存储控制方法同样的发明构思,本发明还提供一种服务器,如图5所示,包括存储器504、处理器502及存储在存储器504上并可在处理器502上运行的计算机程序,所述处理器502执行所述程序时实现前文所述数据存储的控制方法的任一方法的步骤。
其中,在图5中,总线架构(用总线500来代表),总线500可以包括任意数量的互联的总线和桥,总线500将包括由处理器502代表的一个或多个处理器和存储器504代表的存储器的各种电路链接在一起。总线500还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口506在总线500和接收器501和发送器503之间提供接口。接收器501和发送器503可以是同一个元件,即收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器502负责管理总线500和通常的处理,而存储器504可以被用于存储处理器502在执行操作时所使用的数据。
第四方面,基于与前述实施例中数据存储控制方法的发明构思,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前文所述数据存储的控制方法的任一方法的步骤。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的设备。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令设备的制造品,该指令设备实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本说明书的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本说明书范围的所有变更和修改。
显然,本领域的技术人员可以对本说明书进行各种改动和变型而不脱离本说明书的精神和范围。这样,倘若本说明书的这些修改和变型属于本说明书权利要求及其等同技术的范围之内,则本说明书也意图包含这些改动和变型在内。
Claims (16)
- 一种数据存储的控制方法,用于针对区块链系统对非即时数据的存储进行控制,所述方法包括:接收非即时数据,并对非即时数据进行验证;在所述验证通过后,将所述非即时数据存储至所述区块链系统的数据库中;对所述非即时数据进行共识处理,根据共识处理结果确定异常数据,并针对所述异常数据在所述数据库的存储进行管理。
- 根据权利要求1所述的方法,还包括:创建异步提交线程;所述将所述非即时数据存储至所述区块链系统的数据库中,包括:启动所述异步提交线程,将所述非即时数据插入至所述区块链系统的数据库中。
- 根据权利要求1所述的方法,所述根据共识处理结果确定异常数据,包括:将共识失败或上链失败的失败区块的数据对应的异常标记信息插入到所述数据库中;在所述数据库中,通过所述异常标记信息确定对应的异常数据。
- 根据权利要求3所述的方法,所述异常标记信息包括异常哈希值,或者,所述异常标记信息包括异常哈希值及失败区块的块高度信息。
- 根据权利要求3所述的方法,所述对所述异常数据在所述数据库的存储进行管理,包括:在所述区块链系统空闲时,或者在预定时间段内,或者在预定事件触发下,对所述异常数据进行删除。
- 根据权利要求1-5任一项所述的方法,控制由不同节点分别执行所述将所述非即时数据存储至数据库的步骤和所述对所述非即时数据进行共识处理的步骤。
- 根据权利要求1-5任一项所述的方法,所述非即时数据包括存证数据或状态描述数据。
- 一种数据存储的控制装置,用于针对区块链系统对非即时数据的存储进行控制,所述装置包括:数据接收单元,用于接收非即时数据;验证单元,用于对非即时数据进行验证;存储控制单元,用于在所述验证通过后,将所述非即时数据存储至所述区块链系统的数据库中;共识单元,用于对非即时数据进行共识处理;异常数据确定单元,用于根据共识处理结果确定异常数据;异常管理单元,用于对所述异常数据在所述数据库的存储进行管理。
- 根据权利要求8所述的装置,还包括:异步提交线程创建单元,用于创建异步提交线程;所述存储控制单元,启动所述异步提交线程,将所述非即时数据插入至所述区块链系统的数据库中。
- 根据权利要求9所述的装置,所述异常数据确定单元具体用于:将共识失败或上链失败的失败区块的非即时数据对应的异常标记信息插入到所述数据库;以及,在所述数据库中,通过所述异常标记信息确定对应的异常数据。
- 根据权利要求10所述的装置,所述异常标记信息包括异常哈希值,或者,所述异常标记信息包括异常哈希值及失败区块的块高度信息。
- 根据权利要求10所述的装置,所述对异常管理单元具体用于:在所述区块链系统空闲时,或者在预定时间段内或根据预定事件触发下,对所述异常数据进行删除。
- 根据权利要求8-12任一项所述的装置,所述存储控制单元和所述共识单元分别由不同节点执行。
- 根据权利要求8-12任一项所述的装置,所述非即时数据包括存证数据或状态描述数据。
- 一种服务器,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1-7任一项所述方法的步骤。
- 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现权利要求1-7任一项所述方法的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811015576.X | 2018-08-31 | ||
| CN201811015576.XA CN109299335A (zh) | 2018-08-31 | 2018-08-31 | 数据存储的控制方法、装置、服务器及可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020042779A1 true WO2020042779A1 (zh) | 2020-03-05 |
Family
ID=65165811
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/095601 Ceased WO2020042779A1 (zh) | 2018-08-31 | 2019-07-11 | 数据存储的控制方法、装置、服务器及可读存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| CN (2) | CN109299335A (zh) |
| TW (1) | TWI698763B (zh) |
| WO (1) | WO2020042779A1 (zh) |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109299335A (zh) * | 2018-08-31 | 2019-02-01 | 阿里巴巴集团控股有限公司 | 数据存储的控制方法、装置、服务器及可读存储介质 |
| CN110704428A (zh) * | 2019-09-06 | 2020-01-17 | 深圳壹账通智能科技有限公司 | 区块链的数据索引方法、装置、计算机设备和存储介质 |
| CN110597466B (zh) * | 2019-09-16 | 2021-10-26 | 腾讯科技(深圳)有限公司 | 区块链节点的控制方法、装置、存储介质和计算机设备 |
| CN110808839B (zh) * | 2019-10-30 | 2022-07-12 | 百度在线网络技术(北京)有限公司 | 一种区块链异常数据的处理方法、装置、设备和介质 |
| CN111539829B (zh) | 2020-07-08 | 2020-12-29 | 支付宝(杭州)信息技术有限公司 | 一种基于区块链一体机的待过滤交易识别方法及装置 |
| CN111541783B (zh) | 2020-07-08 | 2020-10-20 | 支付宝(杭州)信息技术有限公司 | 一种基于区块链一体机的交易转发方法及装置 |
| CN111541726B (zh) | 2020-07-08 | 2021-05-18 | 支付宝(杭州)信息技术有限公司 | 一种基于区块链一体机的重放交易识别方法及装置 |
| CN111541784B (zh) * | 2020-07-08 | 2021-07-20 | 支付宝(杭州)信息技术有限公司 | 一种基于区块链一体机的交易处理方法及装置 |
| CN113010920B (zh) * | 2021-04-01 | 2022-07-12 | 浙江永旗区块链科技有限公司 | 一种区块链数据安全防护系统及其防护方法 |
| CN113254467B (zh) * | 2021-07-02 | 2022-05-10 | 支付宝(杭州)信息技术有限公司 | 在区块链系统中执行交易的方法和区块链节点 |
| CN114285848B (zh) * | 2021-12-20 | 2024-03-19 | 上海简苏网络科技有限公司 | 区块链资源的可计量方法、系统、电子设备和可读介质 |
| CN115388931B (zh) * | 2022-10-27 | 2023-02-03 | 河北省科学院应用数学研究所 | 传感器异常数据的可信监测方法、监测终端及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170163733A1 (en) * | 2015-12-02 | 2017-06-08 | Olea Networks, Inc. | System and method for data management structure using auditable delta records in a distributed environment |
| CN107807951A (zh) * | 2017-09-18 | 2018-03-16 | 联动优势科技有限公司 | 一种区块链生成方法、数据验证方法、节点及系统 |
| CN107888375A (zh) * | 2017-11-08 | 2018-04-06 | 深圳市携网科技有限公司 | 一种基于区块链技术的电子证据保全系统及方法 |
| US20180158034A1 (en) * | 2016-12-07 | 2018-06-07 | International Business Machines Corporation | Dynamic reordering of blockchain transactions to optimize performance and scalability |
| CN109299335A (zh) * | 2018-08-31 | 2019-02-01 | 阿里巴巴集团控股有限公司 | 数据存储的控制方法、装置、服务器及可读存储介质 |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10339523B2 (en) * | 2015-07-14 | 2019-07-02 | Fmr Llc | Point-to-point transaction guidance apparatuses, methods and systems |
| CN105719185B (zh) * | 2016-01-22 | 2019-02-15 | 杭州复杂美科技有限公司 | 区块链的数据对比及共识方法 |
| SG11201805542TA (en) * | 2016-02-23 | 2018-09-27 | Nchain Holdings Ltd | Secure multiparty loss resistant storage and transfer of cryptographic keys for blockchain based systems in conjunction with a wallet management system |
| ES2835784T3 (es) * | 2016-04-05 | 2021-06-23 | Zamna Tech Limited | Método y sistema para gestionar información personal dentro de sistemas informáticos independientes y redes digitales |
| CN106548091A (zh) * | 2016-10-14 | 2017-03-29 | 北京爱接力科技发展有限公司 | 一种数据存证、验证的方法及装置 |
| CN106874393A (zh) * | 2017-01-13 | 2017-06-20 | 北京众享比特科技有限公司 | 基于区块链的业务数据同步方法及系统、数据库系统 |
| CN106991165B (zh) * | 2017-03-31 | 2020-07-31 | 京东数字科技控股有限公司 | 基于区块链的处理金融数据的方法、装置及电子设备 |
| CN107657438B (zh) * | 2017-09-18 | 2020-12-04 | 联动优势科技有限公司 | 一种区块链生成方法、数据验证方法、节点及系统 |
| CN107844976B (zh) * | 2017-10-25 | 2020-11-13 | 武汉天喻信息产业股份有限公司 | 一种基于区块链的存证应用交易系统及方法 |
| CN108898032A (zh) * | 2018-07-20 | 2018-11-27 | 杭州尚尚签网络科技有限公司 | 一种基于区块链技术的电子数据存证的高效处理方法 |
-
2018
- 2018-08-31 CN CN201811015576.XA patent/CN109299335A/zh active Pending
-
2019
- 2019-03-04 CN CN201910161727.0A patent/CN109815373B/zh active Active
- 2019-03-14 TW TW108108598A patent/TWI698763B/zh active
- 2019-07-11 WO PCT/CN2019/095601 patent/WO2020042779A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170163733A1 (en) * | 2015-12-02 | 2017-06-08 | Olea Networks, Inc. | System and method for data management structure using auditable delta records in a distributed environment |
| US20180158034A1 (en) * | 2016-12-07 | 2018-06-07 | International Business Machines Corporation | Dynamic reordering of blockchain transactions to optimize performance and scalability |
| CN107807951A (zh) * | 2017-09-18 | 2018-03-16 | 联动优势科技有限公司 | 一种区块链生成方法、数据验证方法、节点及系统 |
| CN107888375A (zh) * | 2017-11-08 | 2018-04-06 | 深圳市携网科技有限公司 | 一种基于区块链技术的电子证据保全系统及方法 |
| CN109299335A (zh) * | 2018-08-31 | 2019-02-01 | 阿里巴巴集团控股有限公司 | 数据存储的控制方法、装置、服务器及可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202011239A (zh) | 2020-03-16 |
| CN109815373B (zh) | 2020-02-21 |
| TWI698763B (zh) | 2020-07-11 |
| CN109299335A (zh) | 2019-02-01 |
| CN109815373A (zh) | 2019-05-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI698763B (zh) | 資料儲存的控制方法、裝置、伺服器及可讀儲存媒體 | |
| US12603783B2 (en) | Decentralized database optimizations | |
| US12204673B2 (en) | Immutable logging of access requests to distributed file systems | |
| CA3072719C (en) | Immutable datastore for low-latency reading and writing of large data sets | |
| US10114970B2 (en) | Immutable logging of access requests to distributed file systems | |
| CN106406896B (zh) | 一种并行PipeLine技术的区块链建块方法 | |
| US11120024B2 (en) | Dual-stack architecture that integrates relational database with blockchain | |
| US20170364450A1 (en) | Immutable datastore for low-latency reading and writing of large data sets | |
| WO2010015143A1 (zh) | 一种分布式文件系统及其数据块一致性管理的方法 | |
| JP7561398B2 (ja) | データベースクエリ結果を検証するための方法及びそのデバイス | |
| KR102284422B1 (ko) | 블록체인 시스템에서 노드 사이의 통신 확립 방법 및 디바이스 | |
| CN111555860B (zh) | 一种区块链节点共识方法、装置、电子设备及存储介质 | |
| CN112817912A (zh) | 文件管理方法、装置、计算机设备和存储介质 | |
| CN111640018A (zh) | 一种区块链交易存在性验证方法及装置 | |
| CN117786742A (zh) | 基于分布式控制与区块链的文档管理系统及方法 | |
| CN119156797A (zh) | 使用区块链的数据保留证明 | |
| CN121193758A (zh) | 数据同步方法、数据同步装置、门禁系统和存储介质 | |
| Kida et al. | Accelerating BFT Database with Transaction Reconstruction | |
| CN122001899A (zh) | 双活仲裁的跨域数据同步方法、系统、设备及介质 | |
| CN121037364A (zh) | 一种区块链的交易处理方法及区块链 | |
| HK40045874A (zh) | 文件管理方法、装置、计算机设备和存储介质 | |
| CN117194482A (zh) | 数据查询方法、装置、计算机设备和存储介质 | |
| HK40027033B (zh) | 在区块链系统中的节点之间建立通信的方法和设备 | |
| HK40031022B (zh) | 拍摄区块链数据的快照 | |
| HK40033372B (zh) | 提供不可变记录的系统和方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19855411 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19855411 Country of ref document: EP Kind code of ref document: A1 |