CN106446067B - Method and device for acquiring transaction data - Google Patents

Method and device for acquiring transaction data Download PDF

Info

Publication number
CN106446067B
CN106446067B CN201610806518.3A CN201610806518A CN106446067B CN 106446067 B CN106446067 B CN 106446067B CN 201610806518 A CN201610806518 A CN 201610806518A CN 106446067 B CN106446067 B CN 106446067B
Authority
CN
China
Prior art keywords
transaction data
accounting node
storage area
accounting
node
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
CN201610806518.3A
Other languages
Chinese (zh)
Other versions
CN106446067A (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.)
Union Mobile Pay Co Ltd
Original Assignee
Union Mobile Pay 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 Union Mobile Pay Co Ltd filed Critical Union Mobile Pay Co Ltd
Priority to CN201610806518.3A priority Critical patent/CN106446067B/en
Publication of CN106446067A publication Critical patent/CN106446067A/en
Application granted granted Critical
Publication of CN106446067B publication Critical patent/CN106446067B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The embodiment of the invention relates to the technical field of internet, in particular to a method and a device for acquiring transaction data, which are used for solving the problem that the transaction data in a block chain network is easy to lose in the prior art. In the embodiment of the invention, a first accounting node monitors the capability of processing transaction data by the first accounting node to obtain a first monitoring index, wherein the first accounting node is any one accounting node in the block chain network; the first accounting node obtains the capability of acquiring transaction data from the storage area according to the first monitoring index; and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data. By introducing a single storage area to store the transaction data of each application, the method for acquiring the transaction data by the accounting node in the prior art is changed, and the corresponding amount of transaction data is directly acquired from the storage area according to the monitoring index of the accounting node, so that the problem of partial transaction data loss in the peak of transaction is avoided.

Description

Method and device for acquiring transaction data
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a method and a device for acquiring transaction data.
Background
The block chain technology is a technical scheme for maintaining a reliable database collectively in a decentralized and trust-removing mode, and more generally speaking, the block chain technology is a mode for people to participate in accounting.
In the blockchain network, the blockchain network receives transaction data sent by each application, wherein a certain accounting node in the blockchain network generates a block according to the received transaction data so as to be used by other nodes in the blockchain network to download the block, thereby achieving the mode of citizen participating in accounting. With the development of services, the transaction amount of a transaction system gradually increases, a transaction peak occurs in a certain period of time, when a large amount of transaction data flow into a block chain network and exceed the range capable of being processed by a billing node, bottlenecks occur in the broadcasting capacity of the network and the capacity of the billing node for processing the transaction data, so that the services cannot normally operate, in the prior art, partial data are abandoned and recorded through a custom rule to ensure the processing capacity of the transaction in the network, and thus partial transaction data are lost.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring transaction data, which are used for solving the problem that the transaction data in a block chain network is easy to lose in the prior art.
The embodiment of the invention provides a method for acquiring transaction data, which is applied to a block chain network and comprises the following steps:
the method comprises the steps that a first accounting node monitors the transaction data processing capacity of the first accounting node to obtain a first monitoring index, wherein the first accounting node is any one accounting node in a block chain network;
the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area;
and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
Optionally, the first accounting node monitors the capability of processing transaction data by itself to obtain a first monitoring index, including:
the first accounting node periodically monitors the transaction data processing capacity of the first accounting node to obtain a first monitoring index; the ability to process the transaction data is related to at least the network environment in which the first billing node resides and the current device processing capabilities of the first billing node.
Optionally, after the first accounting node acquires a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data, the method further includes:
the block chain network comprises M nodes, wherein the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes, and if the first accounting node generates nodes for the blocks of the corresponding amount of transaction data, the first accounting node broadcasts the blocks of the corresponding amount of transaction data to the M-1 nodes in the block chain network;
otherwise, the first accounting node downloads the block of the transaction data generated by the second accounting node, and the second accounting node is any accounting node except the first accounting node in the block chain network.
Optionally, the method further includes:
the storage area carries out persistent storage on the transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
Optionally, after the first accounting node broadcasts the blocks of the corresponding amount of transaction data to M-1 nodes in the block chain network, when the first accounting node acquires the transaction data from the storage area again, the first accounting node queries the identifier of the transaction data in the storage area, and the identified transaction data is not acquired again, but only new transaction data that is not identified is acquired.
The embodiment of the invention provides a device for acquiring transaction data, which is applied to a first accounting node in a block chain network and comprises the following components:
the monitoring module is used for monitoring the capability of the first accounting node for processing the transaction data to obtain a first monitoring index, and the first accounting node is any one accounting node in the block chain network;
the judging module is used for obtaining the capability of acquiring the transaction data from the storage area according to the first monitoring index, and the transaction data submitted by each application are stored in the storage area;
and the acquisition module acquires the corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
Optionally, the monitoring module is specifically configured to:
the method comprises the steps of periodically monitoring the transaction data processing capacity of a first accounting node to obtain a first monitoring index; the ability to process the transaction data is related to at least the network environment in which the first billing node resides and the current device processing capabilities of the first billing node.
Optionally, the method further includes:
the block is used for broadcasting and recording the corresponding amount of transaction data to M-1 nodes in the block chain network; or downloading the block of the transaction data generated by the second accounting node from the second accounting node, wherein the second accounting node is any accounting node except the first accounting node in the block chain network, the block chain network comprises M nodes, and the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes.
Optionally, the obtaining module is specifically configured to:
the storage area carries out persistent storage on the transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
Optionally, the obtaining module is further configured to:
after the first accounting node broadcasts the blocks with the corresponding amount of transaction data to the M-1 nodes in the block chain network, when the first accounting node acquires the transaction data from the storage area again, the identification of the transaction data in the storage area is inquired first, the identified transaction data cannot be acquired repeatedly, and only new transaction data which is not identified is acquired.
The embodiment of the invention provides a method and a device for acquiring transaction data, wherein a first accounting node monitors the capability of processing the transaction data by the first accounting node to obtain a first monitoring index, and the first accounting node is any accounting node in a block chain network; the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area; and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
Each accounting node monitors the transaction data processing capacity of the accounting node to obtain a corresponding monitoring index, and each accounting node obtains the transaction data acquisition capacity from the storage area according to the corresponding monitoring index; because the capability of acquiring the transaction data from the storage area corresponds to the amount of the transaction data acquired from the storage area, each accounting node acquires the corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data, so that the transaction data amount processed by each accounting node in the block chain network is controlled within the range capable of being processed by the accounting node.
The embodiment of the invention changes the mode of acquiring the transaction data by the accounting node in the prior art by introducing a single storage area to store the transaction data of each application, and directly acquires the corresponding amount of transaction data from the storage area according to the monitoring index of the accounting node, thereby avoiding the problem of partial transaction data loss in the peak time of transaction.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that are required to be used in the description of the embodiments will be briefly described below.
FIG. 1 is a schematic flow chart illustrating a method for obtaining transaction data according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating another method for obtaining transaction data according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for acquiring transaction data according to an embodiment of the present invention
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a schematic flow chart illustrating a method for acquiring transaction data according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
step 101, a first accounting node monitors the capability of processing transaction data by the first accounting node to obtain a first monitoring index, wherein the first accounting node is any one accounting node in a block chain network;
102, the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area;
and 103, acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
In one embodiment, the blockchain infrastructure is divided into 6 layers, including: the system comprises a data layer, a network layer, a consensus layer, an excitation layer, a contract layer and an application layer, wherein each layer respectively completes a core function, and the layers are matched with each other to realize a decentralized trust mechanism. The data layer mainly describes the physical form of the blockchain technology, and the physical implementation of the blockchain technology is a chain formed by blocks with the same specification through a chain structure. The main purpose of the network layer is to exchange information between nodes in a blockchain network, which is essentially a Peer-to-Peer network (P2P network), and each node receives and generates information. The consensus layer is responsible for providing a mechanism for highly dispersed nodes to efficiently agree on the validity of block data in a decentralized system. Common consensus mechanisms include: proof of workload (POW), Proof of rights (POS) certificate of rights (delete Proof of stamp, DPOS). The incentive layer aims to provide certain incentive measures to encourage the nodes to participate in the safety verification work of the block chain. The contract layer encapsulates various types of scripting code, algorithms, and more complex intelligent contracts generated thereby, of the blockchain system. The transaction of the bitcoin depends on the content of the script, which specifies the mode of transaction and the details, and this feature makes the bitcoin a programmable currency. The application layer is primarily a user-oriented programmable application.
The accounting node is a main body for executing and recording transaction data, the working process of the accounting node is to collect all transaction data which are not confirmed and to collect the transaction data into a data block, the accounting node broadcasts the data to other nodes one by one for verification, the transaction data are placed into a built-in batch processing queue after verification, when a batch processing space is saturated or reaches overtime, the accounting node writes the transaction data into a preprocessed block space, meanwhile, the accounting node calculates a hash value in a specific format, the process of calculating the hash value in the specific format by the accounting node is accounting, the process of calculating the hash value in the specific format by the accounting node is called accounting success, and after the accounting is successful, the accounting node packs the verified transaction data in the period of time into a block and broadcasts the block to other nodes for synchronization.
A block is a basic unit constituting a block chain, and the block contains information required to be described by a specific application. For example, a block in the bitcoin blockchain stores transaction information.
In step 101, a first accounting node monitors the capability of processing transaction data by the first accounting node to obtain a first monitoring index, wherein the first accounting node is any one accounting node in a block chain network; the transaction data specifically refers to different forms of data needing to be recorded, such as transaction records, transfer records and other valuable information data; the capacity of the accounting node for processing the transaction data refers to the speed of the accounting node for reading and writing the transaction data in the block chain network, the monitoring index is an index related to the capacity of the accounting node for processing the transaction data, which is obtained by monitoring the network flow of the accounting node, the computing capacity of the node, the space size of a queue built in the accounting node and the like, the accounting node can periodically monitor the capacity of the accounting node for processing the transaction data, and the setting period can be determined according to specific conditions.
In step 102, the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the storage area stores the transaction data submitted by each application; specifically, the storage area stores data submitted by each application, so that the application does not directly submit transaction data to the blockchain network, and the storage area can adopt various storage forms, such as message queues. The application may be various applications that generate transaction data, such as Taobao, Paobao, etc.; the capability of acquiring the transaction data refers to the amount of the transaction data acquired from the storage area by the accounting node;
in step 103, a corresponding amount of transaction data is obtained from the storage area based on the ability to obtain transaction data. Specifically, when acquiring the transaction data from the storage area, each accounting node acquires the transaction data according to its own capability of acquiring the transaction data, and since the capabilities of acquiring the transaction data of each accounting node are different, and each accounting node only monitors its own capability of acquiring the transaction data and does not know the capabilities of acquiring the transaction data of other nodes, the transaction data amounts acquired from the storage area by each accounting node may be the same or different. The embodiment of the invention provides an example that each accounting node determines to acquire transaction data volume from a storage area, four accounting nodes A, B, C and D are set in a network, when an application submits transaction data to the storage area for local persistent storage, the transaction data submitted by the application is set to include 1, 2, 3, 4, 5, 6, 7, 8 and 9; at this time, the four accounting nodes, namely the accounting node A, the accounting node B, the accounting node C and the accounting node D, monitor the transaction processing capacity of the accounting node A, determine the transaction data acquisition capacity according to the transaction processing capacity of the accounting node A, and pull different amounts of data from the message queue at different speeds, for example, the network flow of the accounting node A is large, so that the transaction pulling speed is high, for example, two pieces of data can be pulled per second; the network traffic of the accounting node B is moderate, but the built-in queue space is large, the data pulling speed is moderate, but the pulling amount is large, for example, 1 data can be pulled per second, the network traffic of the accounting node C and the accounting node D is low, only one transaction can be pulled for two seconds, the transaction data acquired by the accounting node 1 in the 4 th second is 1, 2, 3, 4, 5, 6, 7, and 8, the transaction data acquired by the accounting node B is 1, 2, 3, and 4, the transaction data acquired by the accounting node C is 1 and 2, and the transaction data acquired by the accounting node D is 1 and 2.
By the method, the storage area stores the transaction data submitted by each application, so that the transaction data of each application is not directly submitted to the blockchain network, each accounting node determines the capability of acquiring the transaction data from the storage area according to the capability of processing the transaction data per se, and acquires the corresponding amount of transaction data from the storage area, so that the transaction data processed by each accounting node in the blockchain network is controlled in the range capable of being processed by the accounting node, and the problem of partial transaction data loss at a transaction peak is avoided.
Optionally, the first accounting node periodically monitors the capability of processing the transaction data by itself to obtain a first monitoring index; the ability to process the transaction data is related to at least the network environment in which the first billing node resides and the current device processing capabilities of the first billing node. In a specific implementation, the quality of a network environment where an accounting node in a blockchain network is located is affected by a plurality of factors, such as bandwidth flow of the accounting node; the network environment in which the billing node is located may affect the speed of the billing node broadcast, which in turn affects the ability of the billing node to process transactions. The accounting node needs to perform a large amount of mathematical calculations in the accounting process, the current hardware device of the accounting node affects the computing power of the accounting node itself, and further affects the transaction data Processing capability of the accounting node, and the hardware device used by the accounting node for accounting may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a special chip, or the like.
Optionally, after the first accounting node acquires a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data, the method further includes:
the block chain network comprises M nodes, wherein the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes, and if the first accounting node generates nodes for the blocks of the corresponding amount of transaction data, the first accounting node broadcasts the blocks of the corresponding amount of transaction data to the M-1 nodes in the block chain network; otherwise, the first accounting node downloads the block of the transaction data generated by the second accounting node, and the second accounting node is any accounting node except the first accounting node in the block chain network.
In a specific implementation, the blockchain network includes a plurality of nodes, the accounting node is a part of all nodes, and each node participating in accounting belongs to an accounting node, for example, 100 nodes are shared in the blockchain network, where there are 60 nodes participating in accounting, and then there are 60 accounting nodes and 40 common nodes in the blockchain network. And the 60 accounting nodes acquire corresponding transaction data from the storage area according to the capability of acquiring and processing the transaction data respectively, and collect the transaction data into respective batch processing queues, and when the batch processing queues reach saturation or reach overtime, the accounting nodes write the acquired transaction data into a preprocessed block space. When the accounting nodes acquire transaction data, the accounting nodes perform accounting operation, one accounting node in 60 accounting nodes is successful in accounting at first, the winning accounting node is a block generation node, the block generation node packages verified transactions in the period of time into a block broadcast and synchronizes the block broadcast to other 99 nodes, the other 59 accounting nodes except the block generation node in the block chain network stop the current accounting operation after receiving the broadcast and download the block broadcast by the block generation node, meanwhile, the downloaded transaction data in the block is compared with the transaction data in the batch processing queue, the transaction data in the batch processing queue which is the same as the transaction data in the downloaded block is deleted, and 40 common nodes also download the block broadcast by the block generation node. On one hand, the embodiment of the invention changes the mode that accounting nodes acquire the transaction data in the prior art, and each accounting node directly acquires the transaction data to be processed from the storage area according to the transaction data processing capacity of the accounting node, rather than passively receiving the transaction data, so that the transaction data processed by each accounting node is controlled in a reasonable range, and the problem of transaction data loss in a transaction peak is avoided. On the other hand, each accounting node does not broadcast transaction data and monitoring indexes to other nodes one by one and receive information fed back by other nodes, so that when a transaction peak period occurs, a broadcast storm caused by excessive data broadcast in a block chain network is avoided.
Optionally, the method further includes:
the storage area carries out persistent storage on the transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
Optionally, after the first accounting node broadcasts the blocks of the corresponding amount of transaction data to M-1 nodes in the blockchain network, when the first accounting node acquires the transaction data from the storage area again, the first accounting node queries the identifier of the transaction data in the storage area first, and the identified transaction data is not acquired again, but only new transaction data that is not identified is acquired.
In the specific implementation process, each accounting node acquires corresponding transaction data volume from the storage area according to the capability of acquiring the transaction data, and meanwhile, each accounting node starts accounting operation, and when one accounting node succeeds in accounting, the accounting node broadcasts generated blocks to other nodes and identifies the acquired transaction data in the storage area; after each accounting node processes the last group of transaction data, when new transaction data is acquired from the storage area, firstly, the identifier in the storage area is inquired according to the last group of data transaction of the synchronized block, the acquired transaction data can not be acquired repeatedly, and only new transaction data which is not identified can be acquired. When the transaction data are acquired from the storage area by each accounting node, the corresponding transaction data amount is determined to be acquired from the storage area according to the transaction data acquisition capacity of each accounting node, and the transaction data which are not identified are acquired by inquiring the identification in the storage area, so that the transaction data acquired from the storage area by each accounting node are independent from each other, but part of the transaction data acquired from each accounting node may be the same. Because each accounting node marks the acquired transaction data in the storage area while broadcasting the blocks of the corresponding amount of transaction data, if the accounting node goes down when the blocks of the transaction data are not broadcasted, the accounting node does not mark the transaction data in the corresponding blocks in the storage area, and the transaction data in the blocks can be continuously acquired and processed by other accounting nodes, thereby effectively solving the problem that the transaction data which is not broadcasted is lost when a certain accounting node goes down. The storage area stores the transaction data submitted by each application persistently, so that each accounting node can acquire the transaction data more conveniently and prepare for analyzing the subsequent transaction data.
To more clearly describe the above method flow, fig. 2 is a schematic flow chart of another method for acquiring transaction data according to an embodiment of the present invention, as shown in fig. 2,
the transaction data are submitted to a storage area 201 by an application A, an application B, an application C and an application D, the transaction data submitted by the application A, the application B, the application C and the application D are stored in the storage area 201, a block chain network 202 comprises a billing node 1, a billing node 2 and a billing node 3, the billing node 1, the billing node 2 and the billing node 3 all comprise a monitoring module, and the billing node 1 monitors the processing capacity of the monitoring module on the transaction data to obtain a corresponding monitoring index 1; the accounting node 2 monitors the processing capacity of the accounting node to the transaction data through the monitoring module to obtain a corresponding monitoring index 2; the accounting node 3 monitors the processing capacity of the accounting node to the transaction data through the monitoring module to obtain a corresponding monitoring index 3; the accounting node 1, the accounting node 2 and the accounting node 3 each obtain corresponding transaction data from the storage area 201 according to their own monitoring indexes.
As can be seen from the above, in the method and apparatus for acquiring transaction data provided in the embodiments of the present invention, a first accounting node monitors its capability of processing transaction data to obtain a first monitoring index, where the first accounting node is any one accounting node in the blockchain network; the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area; and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
Each accounting node monitors the transaction data processing capacity of the accounting node to obtain a corresponding monitoring index, and each accounting node obtains the transaction data acquisition capacity from the storage area according to the corresponding monitoring index; because the capability of acquiring the transaction data from the storage area corresponds to the amount of the transaction data acquired from the storage area, each accounting node acquires the corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data, so that the transaction data amount processed by each accounting node in the block chain network is controlled within the range capable of being processed by the accounting node.
The embodiment of the invention changes the mode of acquiring the transaction data by the accounting node in the prior art by introducing a single storage area to store the transaction data of each application, and directly acquires the corresponding amount of transaction data from the storage area according to the monitoring index of the accounting node, thereby avoiding the problem of partial transaction data loss in the peak time of transaction.
Fig. 3 is a schematic structural diagram illustrating an apparatus for acquiring transaction data according to an embodiment of the present invention.
Based on the same conception, the apparatus for acquiring transaction data provided by the embodiment of the invention, as shown in fig. 2, includes a monitoring module 301, a determining module 302, an acquiring module 303 and a processing module 304; wherein:
the monitoring module 301 is configured to monitor a capability of the first accounting node to process the transaction data, so as to obtain a first monitoring index, where the first accounting node is any one accounting node in the block chain network;
the judging module 302 is configured to obtain, according to the first monitoring index, a capability of acquiring transaction data from a storage area, where the transaction data submitted by each application is stored;
the obtaining module 303 obtains a corresponding amount of transaction data from the storage area according to the capability of obtaining transaction data.
Optionally, the monitoring module 301 is specifically configured to:
the method comprises the steps of periodically monitoring the transaction data processing capacity of a first accounting node to obtain a first monitoring index; the ability to process the transaction data is related to at least the network environment in which the first billing node resides and the current device processing capabilities of the first billing node.
Optionally, the processing module 304 is further included:
the block is used for broadcasting and recording the corresponding amount of transaction data to M-1 nodes in the block chain network; or downloading the block of the transaction data generated by the second accounting node from the second accounting node, wherein the second accounting node is any accounting node except the first accounting node in the block chain network, the block chain network comprises M nodes, and the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes.
Optionally, the obtaining module 303 is specifically configured to:
the storage area carries out persistent storage on the transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
Optionally, the obtaining module 303 is further configured to:
after the first accounting node broadcasts the blocks with the corresponding amount of transaction data to the M-1 nodes in the block chain network, when the first accounting node acquires the transaction data from the storage area again, the identification of the transaction data in the storage area is inquired first, the identified transaction data cannot be acquired repeatedly, and only new transaction data which is not identified is acquired.
As can be seen from the above, in the method and apparatus for acquiring transaction data provided in the embodiments of the present invention, a first accounting node monitors its capability of processing transaction data to obtain a first monitoring index, where the first accounting node is any one accounting node in the blockchain network; the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area; and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
Each accounting node monitors the transaction data processing capacity of the accounting node to obtain a corresponding monitoring index, and each accounting node obtains the transaction data acquisition capacity from the storage area according to the corresponding monitoring index; because the capability of acquiring the transaction data from the storage area corresponds to the amount of the transaction data acquired from the storage area, each accounting node acquires the corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data, so that the transaction data amount processed by each accounting node in the block chain network is controlled within the range capable of being processed by the accounting node.
The embodiment of the invention changes the mode of acquiring the transaction data by the accounting node in the prior art by introducing a single storage area to store the transaction data of each application, and directly acquires the corresponding amount of transaction data from the storage area according to the monitoring index of the accounting node, thereby avoiding the problem of partial transaction data loss in the peak time of transaction.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method for acquiring transaction data, which is applied to a block chain network, comprises the following steps:
the first accounting node periodically monitors the transaction data processing capacity of the first accounting node to obtain a first monitoring index; the capability of processing transaction data is related to at least a network environment in which the first billing node is located and a current device processing capability of the first billing node; the first accounting node is any one accounting node in the block chain network, and the transaction data processing capacity is the reading and writing speed of the accounting node on the transaction data in the block chain network;
the first accounting node obtains the capability of acquiring transaction data from a storage area according to the first monitoring index, wherein the transaction data submitted by each application are stored in the storage area;
and acquiring a corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
2. The method of claim 1, wherein said first accounting node, after obtaining a corresponding amount of transactional data from said storage area based on said ability to obtain transactional data, further comprises:
the block chain network comprises M nodes, wherein the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes, and if the first accounting node generates nodes for the blocks of the corresponding amount of transaction data, the first accounting node broadcasts the blocks of the corresponding amount of transaction data to the M-1 nodes in the block chain network;
otherwise, the first accounting node synchronously downloads the block of the transaction data generated by a second accounting node, wherein the second accounting node is any accounting node except the first accounting node in the block chain network.
3. The method of claim 2, further comprising:
the storage area is used for carrying out persistent storage on transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
4. The method as claimed in claim 2 or 3, wherein after the first accounting node broadcasts the corresponding number of blocks of transaction data to M-1 nodes in the blockchain network, when the first accounting node acquires transaction data from the storage area again, the first accounting node firstly queries the identification of the transaction data in the storage area, and the identified transaction data is not acquired again, but only new transaction data which is not identified is acquired.
5. An apparatus for obtaining transaction data, applied to a first accounting node in a blockchain network, comprising:
the monitoring module is used for periodically monitoring the transaction data processing capacity of the first accounting node to obtain a first monitoring index; the capability of processing the transaction data is at least related to the network environment where the first accounting node is located and the current device processing capability of the first accounting node, the first accounting node is any one accounting node in the blockchain network, and the capability of processing the transaction data is the speed of reading and writing the transaction data in the blockchain network by the accounting node;
the judging module is used for obtaining the capability of acquiring transaction data from a storage area according to the first monitoring index, and the transaction data submitted by each application are stored in the storage area;
and the acquisition module acquires the corresponding amount of transaction data from the storage area according to the capability of acquiring the transaction data.
6. The apparatus of claim 5, further comprising a processing module:
the processing module is used for broadcasting the blocks recording the corresponding amount of transaction data to M-1 nodes in the block chain network; or downloading the block of the transaction data generated by the second accounting node from the second accounting node, wherein the second accounting node is any accounting node except the first accounting node in the block chain network, the block chain network comprises M nodes, and the M nodes comprise N +1 accounting nodes and M-N-1 non-accounting nodes.
7. The apparatus of claim 6, wherein the acquisition module is specifically configured to:
the storage area is used for carrying out persistent storage on transaction data submitted by each application; after the first accounting node acquires the corresponding amount of transaction data from the storage area, if the first accounting node becomes a block generation node of the corresponding amount of transaction data, the block generation node identifies the corresponding amount of transaction data in the storage area.
8. The apparatus of claim 6 or 7, wherein the acquisition module is further configured to:
after the first accounting node broadcasts the blocks of the corresponding amount of transaction data to the M-1 nodes in the block chain network, when the first accounting node acquires the transaction data from the storage area again, the first accounting node firstly queries the identification of the transaction data in the storage area, and the identified transaction data is not acquired repeatedly, but only new transaction data which is not identified is acquired.
CN201610806518.3A 2016-09-06 2016-09-06 Method and device for acquiring transaction data Active CN106446067B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610806518.3A CN106446067B (en) 2016-09-06 2016-09-06 Method and device for acquiring transaction data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610806518.3A CN106446067B (en) 2016-09-06 2016-09-06 Method and device for acquiring transaction data

Publications (2)

Publication Number Publication Date
CN106446067A CN106446067A (en) 2017-02-22
CN106446067B true CN106446067B (en) 2020-02-18

Family

ID=58165076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610806518.3A Active CN106446067B (en) 2016-09-06 2016-09-06 Method and device for acquiring transaction data

Country Status (1)

Country Link
CN (1) CN106446067B (en)

Families Citing this family (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685743B (en) * 2017-03-09 2018-02-06 上海亿账通区块链科技有限公司 Block scm cluster processing system and method
CN107196772B (en) * 2017-03-24 2020-03-13 创新先进技术有限公司 Method and device for broadcasting message
CN107450979B (en) * 2017-03-28 2020-06-02 创新先进技术有限公司 Block chain consensus method and device
CN113282659A (en) 2017-03-28 2021-08-20 创新先进技术有限公司 Data processing method and device based on block chain
CN107395659B (en) * 2017-03-28 2021-08-24 创新先进技术有限公司 Method and device for service acceptance and consensus
CN106991607B (en) * 2017-03-29 2020-04-10 杭州溪塔科技有限公司 Disordered transaction control method based on block chain account model
CN107124460A (en) * 2017-04-28 2017-09-01 北京汇通金财信息科技有限公司 A kind of alliance's catenary system, the method and apparatus of alliance's chain accounting nodes communication
CN107122477A (en) * 2017-05-02 2017-09-01 成都中远信电子科技有限公司 A kind of block chain storage system
CN107395665B (en) 2017-05-22 2020-04-24 创新先进技术有限公司 Block chain service acceptance and service consensus method and device
CN107395664B (en) * 2017-05-22 2019-09-03 阿里巴巴集团控股有限公司 A kind of method and device that business executes
CN107222478B (en) * 2017-05-27 2019-09-17 暨南大学 Software defined network control layer security mechanism construction method based on block chain
CN107609010A (en) * 2017-07-27 2018-01-19 北京瑞卓喜投科技发展有限公司 Information processing method and device based on block chain technology
CN107481011A (en) * 2017-08-11 2017-12-15 杭州秘猿科技有限公司 A kind of transaction rapid acknowledgment method based on license chain
CN108985757B (en) * 2017-11-27 2021-03-30 京东数字科技控股有限公司 Information processing method, device and system, storage medium and electronic equipment
CN108063758A (en) * 2017-11-27 2018-05-22 众安信息技术服务有限公司 For the node in the signature verification method of block chain network and block chain network
CN108334792B (en) * 2018-02-13 2022-08-19 中国银行股份有限公司 Financial industry foreign aid information sharing method and device
CN108596588B (en) * 2018-04-28 2022-05-20 百度在线网络技术(北京)有限公司 Block data processing method and device, computing equipment and storage medium
CN108769144A (en) * 2018-05-11 2018-11-06 中国联合网络通信集团有限公司 Storage processing method, transaction node, memory node and communication equipment
CN108769142B (en) * 2018-05-11 2021-08-10 中国联合网络通信集团有限公司 Transaction information processing method and block generation node
CN108650267B (en) * 2018-05-14 2021-02-09 百度在线网络技术(北京)有限公司 Block chain data transmission method, device, equipment and storage medium
CN108933778A (en) * 2018-05-23 2018-12-04 广州西麦科技股份有限公司 Product trading monitoring method, device and storage medium based on system for cloud computing
CN108881428B (en) * 2018-06-13 2020-11-24 明阳智慧能源集团股份公司 Block chain system with supervision mechanism
CN109043750B (en) * 2018-08-17 2021-03-16 浙江合式信息科技有限公司 Intelligent bracelet based on block chain technology
CN109008095B (en) * 2018-08-17 2020-12-11 深圳市友宏科技有限公司 Comfortable intelligent bracelet for identity authentication based on block chain technology
CN109410044B (en) * 2018-08-22 2020-10-23 泰链(厦门)科技有限公司 Block chain system and method for utilizing idle computing resources of non-producer nodes in same
CN109462631B (en) * 2018-08-31 2021-11-19 腾讯科技(深圳)有限公司 Data processing method, data processing device, storage medium and electronic device
CN109033883A (en) * 2018-09-06 2018-12-18 深圳市律远汇智科技有限公司 It is a kind of based on block chain technology can automatically scanning mobile phone card reader
CN108898039A (en) * 2018-09-06 2018-11-27 深圳市晓控通信科技有限公司 A kind of shatter-resistant based on block chain technology and energy-efficient barcode scanning gun
CN109214209B (en) * 2018-09-06 2020-12-04 联动优势科技有限公司 Data sending method, data storage method and device
CN108835779B (en) * 2018-09-06 2021-11-05 深圳老玩童网络有限公司 Intelligent payment bracelet convenient to scan based on block chain technology
CN109222350B (en) * 2018-09-06 2021-11-02 中食安泓(广东)健康产业有限公司 Intelligent bracelet with emergency function based on block chain technology
CN109035552B (en) * 2018-09-06 2021-10-15 深圳市万际通电子有限公司 Smart phone card reader based on block chain technology
CN108851388A (en) * 2018-09-06 2018-11-23 深圳市乐业科技有限公司 A kind of Intelligent bracelet with fingerprint identification function based on block chain technology
CN109274499B (en) * 2018-09-29 2021-10-08 四川赢才多多科技有限公司 Timestamp distribution acquisition method for block chain
CN109472924A (en) * 2018-10-12 2019-03-15 深圳市雷凌广通技术研发有限公司 A kind of vending machine with monitoring and regulating function based on block chain technology
CN109377644A (en) * 2018-10-12 2019-02-22 深圳市贝优通新能源技术开发有限公司 A kind of vending machine with anti-theft function based on block chain technology
CN109493521B (en) * 2018-10-12 2021-06-01 广东乘心电器实业有限公司 Unmanned vending machine based on block chain technology
CN109461079B (en) * 2018-10-29 2022-04-05 众安信息技术服务有限公司 Transaction processing method and device based on block chain
CN109544310A (en) * 2018-11-13 2019-03-29 孙晞瑜 A kind of quick common recognition bookkeeping methods and its system based on block chain alliance chain
CN109766389B (en) * 2019-01-09 2020-09-22 华东师范大学 Block chain light client verification query method based on bitmap index
CN111614709B (en) * 2019-02-26 2022-12-16 傲为有限公司 Partition transaction method and system based on block chain
CN110008233A (en) * 2019-03-31 2019-07-12 杭州复杂美科技有限公司 A kind of information inquiry and know together method, system, equipment and storage medium
CN110099106B (en) * 2019-04-24 2022-04-19 福建方维信息科技有限公司 Method and terminal for data synchronization between nodes in block chain
CN110245147B (en) * 2019-06-19 2021-08-13 腾讯科技(深圳)有限公司 Block chain data processing method and device, readable storage medium and computer equipment
CN110598882B (en) * 2019-09-29 2023-09-19 腾讯科技(深圳)有限公司 Method, device and storage medium for recycling recyclable packages
CN111562984B (en) * 2020-05-08 2024-04-16 中国工商银行股份有限公司 Distributed transaction processing method, device and system based on alliance chain

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098236A (en) * 2006-06-30 2008-01-02 西门子通信技术(北京)有限公司 Exchange management method and system between distributed equity network entities
CN102263618A (en) * 2010-05-31 2011-11-30 中国移动通信集团公司 Method, device and system for controlling wireless network congestion
CN103268321A (en) * 2013-04-19 2013-08-28 中国建设银行股份有限公司 Data processing method and device for high concurrency transaction
CN103326950A (en) * 2013-06-20 2013-09-25 交通银行股份有限公司 Bank card data flow control method and system
CN105488675A (en) * 2015-11-25 2016-04-13 布比(北京)网络技术有限公司 Distributed shared general ledger construction method of block chain
CN105488665A (en) * 2015-11-25 2016-04-13 布比(北京)网络技术有限公司 Decentralized transaction method
CN105719185A (en) * 2016-01-22 2016-06-29 杭州复杂美科技有限公司 Block chain data comparison and consensus method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098236A (en) * 2006-06-30 2008-01-02 西门子通信技术(北京)有限公司 Exchange management method and system between distributed equity network entities
CN102263618A (en) * 2010-05-31 2011-11-30 中国移动通信集团公司 Method, device and system for controlling wireless network congestion
CN103268321A (en) * 2013-04-19 2013-08-28 中国建设银行股份有限公司 Data processing method and device for high concurrency transaction
CN103326950A (en) * 2013-06-20 2013-09-25 交通银行股份有限公司 Bank card data flow control method and system
CN105488675A (en) * 2015-11-25 2016-04-13 布比(北京)网络技术有限公司 Distributed shared general ledger construction method of block chain
CN105488665A (en) * 2015-11-25 2016-04-13 布比(北京)网络技术有限公司 Decentralized transaction method
CN105719185A (en) * 2016-01-22 2016-06-29 杭州复杂美科技有限公司 Block chain data comparison and consensus method

Also Published As

Publication number Publication date
CN106446067A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN106446067B (en) Method and device for acquiring transaction data
US10831562B2 (en) Method and system for operating a data center by reducing an amount of data to be processed
CN112714192B (en) Data synchronization method and device, computer readable medium and electronic equipment
EP4300323A1 (en) Data processing method and apparatus for blockchain network, computer device, computer readable storage medium, and computer program product
TW201128407A (en) Cloud-computating resource scheduling method and system applying the same
CN105630731A (en) Network card data processing method and device in multi-CPU (Central Processing Unit) environment
CN107645483B (en) Risk identification method, risk identification device, cloud risk identification device and system
CN110166541B (en) Rendering method based on block chain, related equipment and system
US10069779B2 (en) Method of hybrid message passing with shared memory
CN106131175A (en) A kind of acquisition of information, information-pushing method and equipment
CN111858751A (en) Data storage method and device based on block chain
CN114003351A (en) Data processing method and device and storage medium
CN110909072B (en) Data table establishment method, device and equipment
CN109389306B (en) User order synchronization method and device
CN111241069A (en) Data flattening method and system based on block chain
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN103502941B (en) A kind of method for parallel processing and device
CN110363515B (en) Rights and interests card account information inquiry method, system, server and readable storage medium
CN107943902B (en) Call bill collection method and device
CN110471922B (en) Content extension method and device for accounting node and computer readable storage medium
CN114035943A (en) Task processing method and device applied to heterogeneous computational system
CN112866296A (en) Application online verification method, device, equipment and storage medium
CN112783613A (en) Unit scheduling method and device
CN111522654A (en) Scheduling processing method, device and equipment for distributed crawler
CN107103003B (en) Method for acquiring data in link, acquisition equipment, processing equipment and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant