CN110210856A - Block chain data processing method, device, server and storage medium - Google Patents
Block chain data processing method, device, server and storage medium Download PDFInfo
- Publication number
- CN110210856A CN110210856A CN201910365838.3A CN201910365838A CN110210856A CN 110210856 A CN110210856 A CN 110210856A CN 201910365838 A CN201910365838 A CN 201910365838A CN 110210856 A CN110210856 A CN 110210856A
- Authority
- CN
- China
- Prior art keywords
- node
- contribution
- block
- index
- margin
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3827—Use of message hashing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
Abstract
The embodiment of the invention provides a kind of block chain data processing method, device, server and storage mediums, wherein method includes: the untreated business datum in response to receiving, and business datum is packaged into block respectively by multiple nodes that instruction block chain network includes;Obtain the contribution index of each node in multiple nodes;Destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation.Using the embodiment of the present invention, common recognition process time-consuming can be reduced, block efficiency is improved out.
Description
Technical field
The present invention relates to block chain technical field more particularly to a kind of block chain data processing method, device, server and
Storage medium.
Background technique
Block chain network is with hot spot the advantages that its decentralization and common recognition mechanism as current research.Wherein, block chain
The common recognition mechanism of network is the core of block chain network, and so-called common recognition mechanism can refer to: by common recognition algorithm from block chain network
Multiple nodes in select a certain node complete certain go out block operation.Currently used common recognition algorithm may include workload card
Bright (Proof of Work, PoW) algorithm, PoW algorithm are mainly to pass through to calculate the Hash hash for meeting a certain bit coin block head
Value fights for out the right of block operation, this process needs to realize by largely calculating, and consumes vast resources, and process of knowing together
It takes a long time, it is lower so as to cause the block efficiency out of block chain network.
Summary of the invention
The embodiment of the invention provides a kind of block chain data processing method, device, server and storage mediums, realize
For going out the destination node of block, reduction common recognition process is time-consuming for contribution index selection based on each node in block chain network,
Improve out block efficiency.
In a first aspect, the embodiment of the invention provides a kind of block chain data processing methods, this method comprises:
In response to the untreated business datum received, multiple nodes that instruction block chain network includes are respectively by business
Data are packaged into block;
Obtain the contribution index of each node in multiple nodes;
Destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation.
Optionally, the contribution index of each node in multiple nodes is obtained, comprising:
The corresponding contribution information of each node is determined from the contribution index account of node each in multiple nodes;
Based on contribution information, the contribution index of each node is determined.
Optionally, contribution information includes contribution margin and contribution time corresponding with contribution margin, is based on contribution information, is determined
The contribution index of each node, comprising:
According to the corresponding contribution time of each each contribution margin of node, when determining that each node meets default
Between condition contribution margin;
The tribute of each node is calculated according to the contribution margin for each node determined and corresponding contribution time
Offer index.
Optionally, destination node is determined from multiple nodes based on contribution index, comprising:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from multiple nodes according to the block probability that goes out of each node.
Optionally, the contribution index based on each node calculates the block probability out of each node, comprising:
Total contribution index is calculated in contribution index based on each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
Optionally, data processing method further include:
Contribution index account is created for each node in multiple nodes;
When detecting that first node provides service for corresponding user, the information on services of this service is obtained, wherein the
One node is any node in multiple nodes;
When determining that first node provides this service contribution margin obtained and corresponding contribution according to information on services
Between;
Contribution margin obtained and corresponding contribution time are stored in the corresponding contribution index account of first node.
Optionally, information on services includes service type, service data amount and service time, determines first according to information on services
Node provides this and services contribution margin obtained and corresponding contribution time, comprising:
Basic contribution margin corresponding with service type is obtained, service type includes data query business, operational data storage
And any one or more in block business out;
Contribution margin increment is determined according to service data amount and default contribution margin delta rule;
First node is obtained according to basic contribution margin and contribution margin incremental computations, and this service contribution margin obtained is provided,
And service time is determined as first node, the contribution time of this service is provided.
Second aspect, the embodiment of the invention provides a kind of block chain data processing equipment, block chain data processing dresses
It sets in any node being configured in block chain network, which includes:
Processing unit indicates that block chain network includes multiple for the untreated business datum in response to receiving
Business datum is packaged into block respectively by node;
Acquiring unit, for obtaining the contribution index of each node in multiple nodes;
Determination unit, for determining destination node from multiple nodes based on contribution index;
Processing unit is also used to indicate that destination node executes out block operation.
Optionally, acquiring unit is specifically used for:
The contribution information of each node is determined from the contribution index account of node each in multiple nodes;
Based on contribution information, the contribution index of each node is determined.
Optionally, acquiring unit is performed the following operations when determining the contribution index of each node based on contribution information:
According to the corresponding contribution time of each contribution margin of each node, determine that each node meets preset time condition
Contribution margin;
The contribution index of each node is calculated according to the contribution margin for each node determined and corresponding contribution time.
Optionally, determination unit is performed the following operations when determining destination node from multiple nodes based on contribution index:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from multiple nodes according to the block probability that goes out of each node.
Optionally, determination unit calculates when going out block probability of each node in the contribution index based on each node, executes
Following operation:
Total contribution index is calculated in contribution index based on each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
Optionally, data processing equipment further includes creating unit and storage unit:
Creating unit, for creating contribution index account for node each in multiple nodes;
Acquiring unit is also used to when detecting that first node provides service for corresponding user, obtains this service
Information on services, wherein first node is any node in multiple nodes;
Determination unit is also used to determine that first node provides this and services contribution margin obtained according to information on services, with
And corresponding contribution time;
Storage unit, for the contribution times such as contribution margin obtained and correspondence to be stored in the corresponding tribute of first node
It offers in index account.
Optionally, information on services includes service type, service data amount and service time;Determination unit is believed according to service
When breath determines that first node provides this service contribution margin obtained and corresponding contribution time, perform the following operations:
Basic contribution margin corresponding with service type is obtained, service type includes data query business, operational data storage
And any one or more in block business out;
Contribution margin increment is determined according to service data amount and default contribution margin delta rule;
First node is obtained according to basic contribution margin and contribution margin incremental computations, and this service contribution margin obtained is provided,
And service time is determined as first node, the contribution time of this service is provided.
The third aspect, the embodiment of the invention provides server, which can be any section in block chain network
Point device, including processor, network interface and memory, processor, network interface and memory are connected with each other, wherein storage
Device is used to store the computer program for supporting server to execute the above method, and computer program includes program instruction, processor quilt
It is configured to caller instruction, executes above-mentioned first aspect and its any optional block chain data processing method.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, computer readable storage mediums
It is stored with computer program, computer program includes program instruction, and program instruction executes processor when being executed by a processor
Above-mentioned first aspect and its any optional block chain data processing method.
In the embodiment of the present invention, in response to the untreated business datum received, indicate that block chain network includes more
Business datum is packaged into block respectively by a node;Obtain the contribution index of each node in multiple nodes;Further, it is based on
Contribution index determines destination node from multiple nodes, and indicates that destination node executes out block operation;It knows together and calculates with existing PoW
Method is compared, and the contribution index based on each node is selection target node to complete out block, reduces the selection of block node out
Calculation amount and time needed for journey improve out block efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of schematic diagram of block chain network provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of block chain data processing method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another block chain data processing method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of block chain data processing equipment provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of server provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Block chain data processing method provided in an embodiment of the present invention can be applied in block chain network, be applied particularly to
In alliance's chain, such as e-commerce alliance, logistics alliance, the foodstuff traceability alliance etc. of different company's composition.With reference to Fig. 1, it is
A kind of structural schematic diagram of block chain network provided in an embodiment of the present invention.
It may include multiple nodes such as node 1, node 2, node 3 and fourth node in block chain network as shown in Figure 1,
Multiple nodes can be terminal or server (illustratively, assuming that multiple nodes are server in the embodiment of the present invention), more
Each node in a node, which can be performed in block chain network, goes out block business.Block chain network can be in multiple nodes
Each node creates contribution index account, for example creates the first contribution index account for node 1, for second contribution of the creation of node 2
Index account 2 and for node 3 create third contribution index account.
In one embodiment, when detecting that each node provides service for corresponding user, block chain network can be according to
The contribution information of this time service is calculated according to information on services.It wherein, may include contribution margin and corresponding contribution time in contribution information;
Information on services includes service type and service data volume, and the corresponding contribution margin of different service types is different, and service data amount is bigger,
The contribution margin of acquisition is higher.Block chain network makees calculated each node contribution margin and contribution time corresponding with contribution margin
It is stored in the contribution index account of each node for contribution information.It follows that the corresponding contribution index account of each node
In be stored with from contribution index account and establish in the current period, all contribution informations of the node.For contribution margin and
The determination method of contribution time will be described in detail in the embodiment below.
In one embodiment, if block chain network receives untreated business datum, block chain network indicates area
Untreated business datum is packaged into block respectively by multiple nodes that block chain network includes;Then it notifies every in multiple nodes
A node carries out out block node election process, namely selection executes the block out about untreated business datum from multiple nodes
The destination node of business selects the block for being packaged which node as the target area for being directed to untreated business datum in other words
Block.In the election process of block node out, block chain network can obtain often from the contribution index account of each node first
The contribution index of a node;Contribution index again based on each node determines destination node from multiple nodes, then indicates
Block operation is executed out by the destination node elected.
Optionally, the embodiment that block chain network obtains the contribution index of each node can be with are as follows: according to each node
Contribution index account in include contribution margin, contribution time and present system time determine.Optionally, it is based on each node
Contribution index to determine that the embodiment of destination node may is that from multiple nodes true according to the contribution index of each node
Fixed each node goes out block probability;The block probability that goes out based on each node determines destination node from multiple nodes again.The portion
The optional embodiment divided will specifically describe in the embodiment below.
In one embodiment, the destination node elected goes out after the completion of block, can initiate out the notice of block completion
To inform that each node is completed about the block that goes out of this untreated business datum.Block link network provided by the embodiment of the present invention
In network, the selection of contribution index based on each node is for going out the destination node of block, since the contribution index of each node can be with
It is that the contribution information based on each node obtains, the contribution information of each node is pre-stored, therefore obtains each section
The required time of the contribution index of point is less, so that the time of selection target node is less, so that block effect can be improved out
Rate.
Based on block chain network shown in FIG. 1, the embodiment of the invention provides a kind of block chain data processing methods, such as scheme
Shown in 2.The block chain data processing method of Fig. 2 can be applied in block chain network, may include multiple sections in block chain network
Point, block chain data processing method can be executed by block chain network, and block chain data processing method may include following steps:
S201, the untreated business datum in response to receiving, multiple nodes difference that instruction block chain network includes
Business datum is packaged into block.
In one embodiment, business datum is alternatively referred to as traded, and can refer to appointing for the not confirmed in block chain network
What data, such as digital cash transaction, virtual coin transaction, the change of the information such as file, identity information or logistics information, the present invention
Embodiment is without limitation.
It should be appreciated that block chain network is the single entry chain structure by being interconnected to form between multiple blocks, namely
Block is the data element in block chain network, therefore block chain network needs untreated business datum being packaged into block.
It may include one or more business datums in one block, the size of block is limited in 1M or so.Block can be by
Block head and block body composition, may include in block head the identity identification information of this block, timestamp, business datum data
The information such as amount, block size and head cryptographic Hash.Wherein, the head cryptographic Hash of this block and father's cryptographic Hash of next block are complete
It is identical, it should be understood that, for two adjacent blocks, the head cryptographic Hash in preceding block and father's cryptographic Hash phase in rear block
It is both to realize being serially connected to obtain the block chain orderly connected of two adjacent blocks.So, pass through area
Any block in block chain, all blocks before or after this block can be traced;It may include by testing in block body
The untreated business datum of card.In the embodiment of the present invention, multiple nodes that block chain network includes are respectively to receiving not
The business datum of processing carries out packing processing, obtains the corresponding block of each node.
S202, the contribution index for obtaining each node in multiple nodes.
In one embodiment, the contribution index of each node can be mentions for evaluating each node in preset time period
For the index of the importance for the service crossed, preset time can be any for one month, ten days or 1 year or institute's having time etc.
Period.
The contribution index of each node is determined according to the contribution information of each node.Illustratively, multiple sections are obtained
The contribution index of each node in point, comprising: each node is determined from the contribution index account of node each in multiple nodes
Corresponding contribution information, contribution information include contribution margin and contribution time corresponding with contribution margin;Based on contribution information, determine
The contribution index of each node.Wherein, it is each node creation that the contribution index account of each node is block chain network in advance
, it is after each node creates contribution index account in block chain network, it is corresponding use that block chain network, which monitors each node,
Family provides service scenario, and the contribution index of each node is determined according to offer server conditions.
Below by taking the first node for including in multiple nodes as an example, introduce how block chain network is pair according to each node
The user that answers provides service scenario, determines the contribution index of each node, wherein first node be block chain network include it is more
Any one node in a node.Specifically, contribution index account is created for node each in multiple nodes;When detecting
When one node provides service for corresponding user, the information on services of this service is obtained;First node is determined according to information on services
This is provided and services contribution margin obtained and corresponding contribution time;By contribution margin obtained and corresponding contribution
Time is stored in the corresponding contribution index account of first node.
In one embodiment, information on services includes service type, service data amount and service time, different service classes
The corresponding contribution margin of type is different, and the corresponding contribution margin of different data amount is not also identical, determines that first node mentions according to information on services
Contribution margin obtained and corresponding contribution time are serviced for this, it may include: obtain basic tribute corresponding with service type
Offer value, wherein service type includes data query business, operational data storage and any one in block business or more out
Kind;Contribution margin increment is determined according to service data amount and default contribution margin delta rule;Increased according to basic contribution margin and contribution margin
Amount is calculated first node and provides this service contribution margin obtained, and really provides service time to this for first node
The contribution time of service.
Optionally, block chain network can be different according to the complexity or time-consuming degree of each service type in advance
The corresponding basic contribution margin of service type setting, such as the corresponding basic contribution margin of data query can be X;Data storage pair
The basic contribution margin answered is Y;The corresponding basic contribution margin of block business is Z out.Default contribution margin delta rule may is that and will service
Data volume is divided into multiple quantitative levels according to size, and each grade corresponds to the increment contribution margin of fixed quantity.According to service number
It determines that contribution incremental value can refer to according to amount and default contribution margin delta rule and judges quantitative levels belonging to service data amount, will count
The increment contribution margin in grade is measured as contribution margin increment corresponding with service data amount.
For example, service data amount is divided into three grades: the service data amount by quantity less than A is the first estate, greatly
It is divided into the tertiary gradient in the service data amount of B, the service data amount greater than A less than B is divided into the second grade;It assumes again that, the
The corresponding increment contribution margin X of one grade, the corresponding increment contribution margin Y of the second grade, the corresponding increment contribution margin of the tertiary gradient are
Z.If detect that first node provides service for corresponding user, this service information on services in include service data
Amount falls into the first data volume grade, then using X contribution margin increment corresponding as the service data amount serviced with this.
S203, destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation.
In one embodiment, from the foregoing it will be appreciated that each node can be by untreated business number in block chain network
According to being packaged into block, but be not the corresponding block of all nodes is all connected on the existing block of block chain network with by
Longer block chain network is gradually formed, but needs to select target block from multiple blocks that multiple nodes are packaged into, it will
Target block is as the block being connected in block chain network on existing block.The above process is properly termed as out block, destination node
Execute out the target block that block operation refers to the block that is packaged destination node to untreated business datum as this.
In one embodiment, determine that the embodiment of destination node can be with from multiple nodes based on contribution index are as follows:
Preset a contribution index threshold value;It selects to be greater than to contribute in preset time range from the contribution index of multiple nodes and refer to
The corresponding node of contribution index of number threshold value is as destination node.If the quantity for the destination node determined through the above way
It greater than 1, then can also expand the preset time range of determining contribution index, recalculate the contribution index of each destination node,
The biggish destination node of contribution index is determined from each destination node.
For example, it is assumed that preset range is one month, block chain network chooses the contribution letter of nearest one month each node
The contribution index to determine each node is ceased, contribution index and contribution index threshold value is then based on and selects two from multiple nodes
Destination node.At this point, block chain network can be obtained from the contribution index account of each destination node of two destination nodes
The nearest bimestrial contribution information of each destination node, recalculates the contribution index of each destination node, then from two
Select to recalculate the biggish destination node of rear contribution index in destination node as the block node out for target block.
In the embodiment of the present invention, in response to the untreated business datum received, indicate that block chain network includes more
Business datum is packaged into target block respectively by a node;Obtain the contribution index of each node in multiple nodes;Further,
Destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation;With existing PoW
Common recognition algorithm is compared, and is selected the destination node of block business based on contribution index to complete out block, is reduced the choosing of block node out
Calculation amount and time needed for process are selected, block efficiency is improved out.
Referring to Fig. 3, for another block chain data processing method provided in an embodiment of the present invention, block chain shown in Fig. 3
Data processing method can include:
S301, the untreated business datum in response to receiving, multiple nodes difference that instruction block chain network includes
Business datum is packaged into block.
S302, the contribution index for obtaining each node in multiple nodes.
By the embodiment of Fig. 2 it is found that the embodiment of step S302 is specifically as follows: each node from multiple nodes
The corresponding contribution information of each node is determined in contribution index account;Based on contribution information, the contribution index of each node is determined.
Illustratively, contribution information includes contribution margin and contribution time corresponding with contribution margin, and above-mentioned to be based on contribution information, determination is every
The contribution index of a node may include: to determine each node according to the corresponding contribution time of each contribution margin of each node
Meet the contribution margin of preset time condition;It is calculated according to the contribution margin for each node determined and corresponding contribution time each
The contribution index of node.
Wherein, each node may include multiple contribution margins, and each contribution margin corresponds to a contribution time, in simple terms,
Based on the corresponding contribution information of each node, determine the contribution index of each node can refer to according to each node include it is multiple
The corresponding contribution time of each contribution margin determines the contribution index of each node in contribution margin and multiple contribution margins.Preset time item
Part can refer to a time range, such as preset time condition can be any times such as nearest one month, nearest one week, 1 year
Section, the contribution margin for meeting preset time condition can refer to the corresponding contribution margin of the contribution time fallen into preset time condition, example
Such as, it is assumed that preset time condition is on March 29, -2019 years on the 1st March in 2019, includes in the contribution index account of some node
Contribution information contribute the corresponding contribution time of value 1 be on November 28th, 2018;The corresponding contribution time of contribution margin 5 is 2019
On March 15, in;The corresponding contribution time of contribution margin 7 is on March 29th, 2019.As it can be seen that contribution time on March 15th, 2019 and
On March 29th, 2019 meets preset time condition, so contribution margin 5 and contribution margin 7 are that the node meets preset time condition
Contribution margin.
Optionally, by taking the arbitrary node for including in multiple nodes as an example, the contribution for each node that above-mentioned basis is determined
Value and corresponding contribution time calculate the contribution index of each node, can be realized by following formula (1):
Wherein, P indicates that the contribution index of arbitrary node, i indicate the i-th service that arbitrary node provides, and n is indicated default
The service times that arbitrary node provides in period, ciIndicate that arbitrary node provides i-th and services contribution margin obtained, tiTable
It is shown in i-th and services the corresponding contribution time of contribution margin obtained, now indicates present system time.
As an example it is assumed that including 3 nodes in block chain network, it is expressed as v1, v2 and v3;Present system time is
On March 29th, 2019 (in order to briefly describe, Hour Minute Second is saved behind the time).For v1, it is assumed that the contribution index account of v1
The contribution information stored in family are as follows: it is 2 that offer on March 1st, 2019, which services contribution margin obtained,;Offer on March 8th, 2019 clothes
The acquired contribution margin of business is 2;It is 3 that offer on March 9th, 2019, which services contribution margin obtained,;It can be calculated by formula (1)
The contribution index p1 of v1 out:
P1=(29-1) * 2+ (29-8) * 2+ (29-9) * 3=158
For v2, it is assumed that the contribution information stored in the contribution index account of v2 are as follows: offer on March 2nd, 2019 clothes
Be engaged in contribution margin obtained be 1;It is 12 that offer on March 21st, 2019, which services contribution margin obtained,;It can be calculated by formula (1)
The contribution index p2 of v2 out:
P2=(29-2) * 1+ (29-21) * 12=123
For v3, it is assumed that the contribution information stored in the contribution index account of v3 are as follows: offer on March 1st, 2019 clothes
Be engaged in contribution margin obtained be 3;It is 2 that offer on March 3rd, 2019, which services contribution margin obtained,;Offer on March 9th, 2019 clothes
Be engaged in contribution margin obtained be 1;It is 1 that offer on March 17th, 2019, which services contribution margin obtained,;It can be calculated by formula (1)
The contribution index p3 of v3:
P3=(29-1) * 3+ (29-3) * 2+ (29-9) * 1+ (29-17) * 1=168
S303, the contribution index based on each node calculate the block probability out of each node;
In determining multiple nodes after the contribution index of each node, block chain network can be based on each node
Contribution index determines destination node from multiple nodes, optionally, block chain network can by step S303- step S304 from
Destination node is determined in multiple nodes.
The embodiment of step S303 can include: total contribution index is calculated in the contribution index based on each node;Root
The block probability out of each node is calculated according to the contribution index and total contribution index of each node.Wherein, total contribution index is
Refer to the sum of the contribution index of each node in multiple nodes, such as based on the citing in step S302, includes in block chain network
Tri- nodes of v1, v2 and v3, the corresponding contribution index of each node are respectively P1, P2 and P3, and total contribution index P is equal to P1+P2+
P3=449.In one embodiment, each node is calculated in the above-mentioned contribution index according to each node and total contribution index
Go out block probability, can be indicated by following formula (2):
Wherein, poi indicates that the block probability out of i-th of node, Pi indicate that the contribution index of i-th of node, ∑ P indicate total tribute
Offer index.
Contribution index based on formula (2) and each node can determine the block probability out of each node, for example, being based on
The block probability that goes out of citing in step S302, node v1 is 158/499=35.1%;The block probability that goes out of node v2 is 123/499
=27.3%;The block probability that goes out of node v3 is 168/499=37.4%.
S304, destination node is determined from multiple nodes according to the block probability that goes out of each node.
S305, instruction destination node execute out block operation.
In one embodiment, step S304 determines target section based on the block probability that goes out of each node from multiple nodes
The embodiment of point can be with are as follows: the node for selecting block maximum probability is determined as destination node.For example, in above-mentioned v1, v2 and v3
In three nodes, v3's goes out block probability highest, and v3 is determined as destination node.In further embodiment, the implementation of step S304
Mode can be with are as follows: selects block probability and is greater than the node of block probability threshold value as destination node, for example, it is assumed that block probability out
Threshold value is 36%, in above-mentioned v1, in tri- nodes of v2 and v3, and the block probability out for going out block probability and being respectively less than 36%, v3 of v1 and v2
Greater than 36%, therefore v3 can be determined as destination node.
After determining destination node, instruction destination node executes out block business.Optionally, it has been executed out in destination node
Block operation after, block chain network according to the service type for including in the corresponding block of destination node and including service data amount
Size is that destination node records contribution margin and contribution time, is stored into the contribution index account of destination node.
In the embodiment of the present invention, in response to the untreated business datum received, indicate that block chain network includes more
Business datum is packaged into block respectively by a node;Obtain the contribution index of each node in multiple nodes;Based on each node
Contribution index calculate each node go out block probability;Further, block probability is gone out from multiple nodes according to each node
It determines destination node, and indicates that destination node executes out block operation.During above-mentioned determining destination node, based on each
The contribution index of node determines that the mode for going out block probability of each node realizes that simple computation amount is few, and the contribution of each node refers to
Number is stored in advance in the contribution index account of each node, and block chain network obtains the contribution index process of each node
It is time-consuming less, to improve out block efficiency.
It is a kind of structural schematic diagram of block chain data processing equipment provided in an embodiment of the present invention, block chain with reference to Fig. 4
Data processing equipment is configured in any node in block chain network, and block chain data processing equipment as shown in Figure 4 can wrap
It includes: processing unit 401, acquiring unit 402 and determination unit 403:
Processing unit 401 indicates that block chain network includes more for the untreated business datum in response to receiving
Business datum is packaged into block respectively by a node;
Acquiring unit 402, for obtaining the contribution index of each node in multiple nodes;
Determination unit 403, for determining destination node from multiple nodes based on contribution index;
Processing unit 401 is also used to indicate that destination node executes out block operation.
Optionally, acquiring unit 402 is specifically used for:
The contribution information of each node is obtained from the contribution index account of node each in multiple nodes;
Based on contribution information, the contribution index of each node is determined.
Optionally, contribution information includes that contribution margin and contribution time corresponding with contribution margin, acquiring unit 402 are being based on
Contribution information performs the following operations when determining the contribution index of each node:
According to the corresponding contribution time of each contribution margin of each node, determine that each node meets preset time condition
Contribution margin;
The contribution index of each node is calculated according to the contribution margin for each node determined and corresponding contribution time.
Optionally, determination unit 403 executes following behaviour when determining destination node from multiple nodes based on contribution index
Make:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from multiple nodes according to the block probability that goes out of each node.
Optionally, determination unit 403 determines when going out block probability of each node in the contribution index based on each node, holds
The following operation of row:
Total contribution index is calculated in contribution index based on each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
Optionally, block chain data processing equipment further includes creating unit 404 and storage unit 405:
Creating unit 404, for creating contribution index account for node each in multiple nodes;
Acquiring unit 402 is also used to obtain this service when detecting that first node provides service for corresponding user
Information on services, wherein first node be multiple nodes in any node;
Determination unit 403 is also used to determine that first node provides this and services contribution margin obtained according to information on services,
And corresponding contribution time;
Storage unit 405, it is corresponding for contribution margin obtained and corresponding contribution time to be stored in first node
Contribution index account in.
Optionally, information on services includes service type, service data amount and service time, and determination unit 403 is according to clothes
When business information determines that first node provides this service contribution margin obtained and corresponding contribution time, following behaviour is executed
Make:
Basic contribution margin corresponding with service type is obtained, service type includes data query business, operational data storage
And any one or more in block business out;
Contribution margin increment is determined according to service data amount and default contribution margin delta rule;
First node is obtained according to basic contribution margin and contribution margin incremental computations, and this service contribution margin obtained is provided,
And service time is determined as first node, the contribution time of this service is provided.
In the embodiment of the present invention, in response to the untreated business datum received, processing unit 401 indicates block link network
Business datum is packaged into block respectively by multiple nodes that network includes;Acquiring unit 402 obtains each node in multiple nodes
Contribution index;Further, determination unit 403 is based on contribution index and determines destination node from multiple nodes, and handles list
Member 404 indicates that destination node executes out block operation;Compared with existing PoW knows together algorithm, the contribution index based on each node
During selection target node is to complete out block, calculation amount and the time needed for reducing the selection of block node out, improve out
Block efficiency.
It is understood that the function of each functional unit of the data processing equipment of the present embodiment, unit can be according to above-mentioned
Method specific implementation in Fig. 2 and embodiment of the method shown in Fig. 3, specific implementation process are referred to above-mentioned Fig. 2 and Fig. 3 institute
The associated description for the embodiment of the method shown, details are not described herein again.
It is a kind of schematic block diagram of server provided in an embodiment of the present invention referring to Fig. 5.This implementation as shown in Figure 5
Server in example can be any node equipment in block chain network, and server may include: one or more processors
501;One or more network interfaces 502 and memory 503.Above-mentioned processor 501, network interface 502 and memory 503 pass through
Bus 504 connects.Memory 503 is for storing computer program, and computer program includes program instruction, and processor 501 is used for
Execute the program instruction that memory 503 stores.Wherein, processor 501 is configured for caller instruction execution:
In response to the untreated business datum received, multiple nodes that instruction block chain network includes are respectively by business
Data are packaged into block;
Obtain the contribution index of each node in multiple nodes;
Destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation.
Optionally, processor 501 performs the following operations in obtaining multiple nodes when the contribution index of each node:
The corresponding contribution information of each node is obtained from the contribution index account of node each in multiple nodes;
Based on contribution information, the contribution index of each node is determined:
Optionally, contribution information includes contribution margin and contribution time corresponding with contribution margin, and processor 501 is based on contribution
Information performs the following operations when determining the contribution index of each node:
According to the corresponding contribution time of each contribution margin of each node, determine that each node meets preset time condition
Contribution margin;
The contribution index of each node is calculated according to the contribution margin for each node determined and corresponding contribution time.
Optionally, processor 501 is held when the contribution index based on each node determines destination node from multiple nodes
The following operation of row:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from multiple nodes according to the block probability that goes out of each node.
Optionally, processor 501 calculates when going out block probability of each node in the contribution index based on each node, executes
Following operation:
Total contribution index is calculated based on the contribution index determination of each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
Optionally, processor 501 is configured for caller instruction also execution:
Contribution index account is created for each node in multiple nodes;
When detecting that first node provides service for corresponding user, the information on services of this service is obtained, wherein the
One node is any node in multiple nodes;
When determining that first node provides this service contribution margin obtained and corresponding contribution according to information on services
Between;
First node contribution margin obtained and corresponding contribution time are stored in the corresponding contribution of first node to refer to
In number account.
Optionally, information on services includes service type, service data amount and service time, and processor 501 is according to service
When information determines that first node provides this service contribution margin obtained and corresponding contribution time, perform the following operations:
Basic contribution margin corresponding with service type is obtained, service type includes data query business, operational data storage
And any one or more in block business out;
Contribution margin increment is determined according to service data amount and default contribution margin delta rule;
First node is obtained according to basic contribution margin and contribution margin incremental computations, and this service contribution margin obtained is provided,
And service time is determined as first node, the contribution time of this service is provided.
It should be appreciated that in embodiments of the present invention, alleged processor 501 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at
Reason device is also possible to any conventional processor etc..
Network interface 502 is for receiving or sending data when connecting network.
The memory 503 may include read-only memory and random access memory, and to processor 501 provide instruction and
Data.The a part of of memory 503 can also include nonvolatile RAM.For example, memory 503 can also be deposited
Store up the information of device type.
In the specific implementation, the block chain that Fig. 2 and Fig. 3 is provided can be performed in processor 501 described in the embodiment of the present invention
Block chain data processing equipment described in Fig. 4 also can be performed in implementation described in data processing method embodiment
Implementation, details are not described herein.
A kind of computer readable storage medium is provided in an embodiment of the present invention, and computer-readable recording medium storage has
Computer program, computer program include program instruction, realization when program instruction is executed by processor:
In response to the untreated business datum received, multiple nodes that instruction block chain network includes are respectively by business
Data are packaged into target block;
Obtain the contribution index of each node in multiple nodes;
Destination node is determined from multiple nodes based on contribution index, and indicates that destination node executes out block operation.
Optionally, program instruction executes in being executed by processor the multiple nodes of acquisition when the contribution index of each node
Following operation:
The contribution information of each node is obtained from the contribution index account of node each in multiple nodes;
Based on contribution information, determine the contribution index of each node.
Optionally, contribution information includes contribution margin and contribution time corresponding with contribution margin, and program instruction is by processor
It executes and is performed the following operations when determining the contribution index of each node based on contribution information:
According to the corresponding contribution time of each contribution margin of each node, determine that each node meets preset time condition
Contribution margin;
The contribution index of each node is calculated according to the contribution margin for each node determined and corresponding contribution time.
Optionally, program instruction is executed by processor when determining destination node, is held from multiple nodes based on contribution index
The following operation of row:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from multiple nodes according to the block probability that goes out of each node.
Optionally, program instruction be executed by processor the contribution index based on each node calculate each node go out block it is general
When rate, perform the following operations:
Total contribution index is calculated in contribution index based on each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
Optionally, it is also realized when program instruction is executed by processor:
Contribution index account is created for each node in multiple nodes;
When detecting that first node provides service for corresponding user, the information on services of this service is obtained, wherein the
One node is any node in multiple nodes;
When determining that first node provides this service contribution margin obtained and corresponding contribution according to information on services
Between;
Contribution margin obtained and corresponding contribution time are stored in the corresponding contribution index account of first node.
Optionally, information on services includes that service type, service data amount and service time, program instruction are executed by processor
When determining this service contribution margin obtained of the first offer and corresponding contribution time according to information on services, execute as follows
Operation:
Basic contribution margin corresponding with service type is obtained, service type includes data query business, operational data storage
And any one or more in block business out;
Contribution margin increment is determined according to service data amount and default contribution margin delta rule;
First node is obtained according to basic contribution margin and contribution margin incremental computations, and this service contribution margin obtained is provided,
And service time is determined as every first node, the contribution time of this service is provided.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Instruct relevant hardware to complete by computer program, program can be stored in a computer-readable storage medium,
The program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium can for magnetic disk, CD,
Read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory,
RAM) etc..
Above disclosed is only a preferred embodiment of the present invention, cannot limit the power of the present invention with this certainly
Sharp range, those skilled in the art can understand all or part of the processes for realizing the above embodiment, and weighs according to the present invention
Benefit requires made equivalent variations, still belongs to the scope covered by the invention.
Claims (10)
1. a kind of block chain data processing method, which is characterized in that the described method includes:
In response to the untreated business datum received, multiple nodes that instruction block chain network includes are respectively by the business
Data are packaged into block;
Obtain the contribution index of each node in the multiple node;
Destination node is determined from the multiple node based on the contribution index, and indicates that the destination node executes out block behaviour
Make.
2. the method as described in claim 1, which is characterized in that the contribution for obtaining each node in the multiple node refers to
Number, comprising:
The contribution information of each node is determined from the contribution index account of node each in the multiple node;
Based on the contribution information, the contribution index of each node is determined.
3. method according to claim 2, which is characterized in that the contribution information include contribution margin and with the contribution margin
Corresponding contribution time, it is described to be based on the contribution information, determine the contribution index of each node, comprising:
According to the corresponding contribution time of each each contribution margin of node, determine that each node meets preset time item
The contribution margin of part;
Referred to according to the contribution that the contribution margin for each node determined and corresponding contribution time calculate each node
Number.
4. method according to any one of claims 1 to 3, which is characterized in that it is described based on the contribution index from described
Destination node is determined in multiple nodes, comprising:
Contribution index based on each node calculates the block probability out of each node;
Destination node is determined from the multiple node according to the block probability that goes out of each node.
5. method as claimed in claim 4, which is characterized in that the contribution index based on each node calculates each
Node goes out block probability, comprising:
Total contribution index is calculated in contribution index based on each node;
The block probability out of each node is calculated according to the contribution index of each node and total contribution index.
6. the method as described in claim 1, which is characterized in that the method also includes:
Contribution index account is created for node each in the multiple node;
When detecting that first node provides service for corresponding user, the information on services of this service is obtained, wherein described the
One node is any node in the multiple node;
Determine that the first node provides this and services contribution margin obtained and corresponding contribution according to the information on services
Time;
The contribution margin obtained and the corresponding contribution time are stored in the contribution index account of the first node
In family.
7. method as claimed in claim 6, which is characterized in that the information on services include service type, service data amount and
It is service time, described to determine that the first node provides this and services contribution margin obtained according to the information on services, and
Corresponding contribution time, comprising:
Basic contribution margin corresponding with the service type is obtained, the service type includes data query business, data storage
Any one or more in business and out block business;
Contribution margin increment is determined according to the service data amount and default contribution margin delta rule;
It obtains the first node according to the basic contribution margin and the contribution margin incremental computations this service is provided being obtained
Contribution margin, and by the service time be determined as the first node provide this service contribution time.
8. a kind of block chain data processing equipment, which is characterized in that the block chain data processing equipment is configured at block link network
In any node in network, described device includes:
Processing unit indicates multiple nodes that block chain network includes for the untreated business datum in response to receiving
The business datum is packaged into block respectively;
Acquiring unit, for obtaining the contribution index of each node in the multiple node;
Determination unit, for determining destination node from the multiple node based on the contribution index;
The processing unit is also used to indicate that the destination node executes out block operation.
9. a kind of server, which is characterized in that including processor, network interface and memory, the processor, the network are connect
Mouth and the memory are connected with each other, and for the memory for storing computer program, the computer program includes that program refers to
It enables, processor is configured for calling described program instruction, and perform claim requires the described in any item block chain data processings of 1-7
Method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey
Sequence, the computer program include program instruction, and described program instruction executes the processor such as
The described in any item block chain data processing methods of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910365838.3A CN110210856A (en) | 2019-04-30 | 2019-04-30 | Block chain data processing method, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910365838.3A CN110210856A (en) | 2019-04-30 | 2019-04-30 | Block chain data processing method, device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110210856A true CN110210856A (en) | 2019-09-06 |
Family
ID=67785482
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910365838.3A Pending CN110210856A (en) | 2019-04-30 | 2019-04-30 | Block chain data processing method, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110210856A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110782122A (en) * | 2019-09-16 | 2020-02-11 | 腾讯大地通途(北京)科技有限公司 | Data processing method and device and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107341660A (en) * | 2017-05-27 | 2017-11-10 | 唐盛(北京)物联技术有限公司 | A kind of block chain bottom common recognition mechanism and the block catenary system based on the common recognition mechanism |
US9875510B1 (en) * | 2015-02-03 | 2018-01-23 | Lance Kasper | Consensus system for tracking peer-to-peer digital records |
CN108712487A (en) * | 2018-05-11 | 2018-10-26 | 北京奇虎科技有限公司 | Logical card distribution method, device and equipment based on block chain |
-
2019
- 2019-04-30 CN CN201910365838.3A patent/CN110210856A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9875510B1 (en) * | 2015-02-03 | 2018-01-23 | Lance Kasper | Consensus system for tracking peer-to-peer digital records |
CN107341660A (en) * | 2017-05-27 | 2017-11-10 | 唐盛(北京)物联技术有限公司 | A kind of block chain bottom common recognition mechanism and the block catenary system based on the common recognition mechanism |
CN108712487A (en) * | 2018-05-11 | 2018-10-26 | 北京奇虎科技有限公司 | Logical card distribution method, device and equipment based on block chain |
Non-Patent Citations (1)
Title |
---|
BB财经: "聚焦丨星云币:被低估的潜力股,"区块链上的谷歌", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/47060303》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110782122A (en) * | 2019-09-16 | 2020-02-11 | 腾讯大地通途(北京)科技有限公司 | Data processing method and device and electronic equipment |
CN110782122B (en) * | 2019-09-16 | 2023-11-24 | 腾讯大地通途(北京)科技有限公司 | Data processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107368259A (en) | A kind of method and apparatus that business datum is write in the catenary system to block | |
WO2019196255A1 (en) | Time period selection method and device for telephone sales, terminal equipment and medium | |
CN105391594B (en) | The method and device of identification feature account | |
CN108711047B (en) | Automatic repayment method, system and terminal equipment | |
CN110390585B (en) | Method and device for identifying abnormal object | |
CN109408590B (en) | Method, device and equipment for expanding distributed database and storage medium | |
CN108932582A (en) | Risk information determines method, apparatus, computer equipment and storage medium | |
CN108683605A (en) | A kind of current-limiting method and device of service call | |
CN108733799A (en) | A kind of method for processing report data, device and terminal | |
CN109614263B (en) | Disaster tolerance data processing method, device and system | |
CN110210856A (en) | Block chain data processing method, device, server and storage medium | |
CN113596107A (en) | Data synchronization method and device based on block chain | |
CN112001786B (en) | Method and device for configuring credit card limit of customer based on knowledge graph | |
CN109697117A (en) | Terminal control method, device and computer readable storage medium | |
CN106855821A (en) | A kind of distributed transaction processing method and device | |
CN106156185A (en) | A kind of service request performs the querying method of state, Apparatus and system | |
CN108985933A (en) | A kind of bookkeeping methods and device | |
CN105763608B (en) | A kind of message treatment method and device for cloud storage system | |
CN108804640B (en) | Data grouping method, device, storage medium and equipment based on maximized IV | |
CN110021166B (en) | Method and device for processing user travel data and computing equipment | |
CN112947858A (en) | Method, device and medium for updating RAID5 check value | |
CN111857670A (en) | Application architecture determination method and device | |
CN110148044A (en) | A kind of buffer threshold setting method and device for book keeping operation | |
CN110232525A (en) | A kind of business risk monitoring method, device, server and storage medium | |
CN110298679A (en) | A kind of method and apparatus calculating the distance between sample data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |