CN112083950A - Block chain consensus node to-be-packaged data selection method based on branch and bound method - Google Patents
Block chain consensus node to-be-packaged data selection method based on branch and bound method Download PDFInfo
- Publication number
- CN112083950A CN112083950A CN202010958716.8A CN202010958716A CN112083950A CN 112083950 A CN112083950 A CN 112083950A CN 202010958716 A CN202010958716 A CN 202010958716A CN 112083950 A CN112083950 A CN 112083950A
- Authority
- CN
- China
- Prior art keywords
- data
- packaged
- packed
- value
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a block chain consensus node to-be-packed data selection method based on a branch and bound method, which comprises the following steps of: s1, receiving each data to be packaged from the P2P network, and obtaining the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged; s2, storing the data to be packaged which are not included in the block and are verified to be legal into a data pool to be packaged; s3, acquiring N data to be packaged from the data pool to be packaged, and calculating a unit excitation value; s4, arranging the N data to be packaged in a descending order; s5, dividing the sorted data to be packaged into 3 sets; s6, solving a maximum excitation value; s7, packing the data to be packed corresponding to the maximum stimulus value into a block, and selecting the data to be packed by the block chain consensus node; the invention solves the problem that in the prior block chain application adopting a PoW consensus mechanism, the data to be packed is selected to be packed into a block based on the priority, and the obtained result is not a global optimal solution.
Description
Technical Field
The invention relates to the field of block chains, in particular to a block chain consensus node to-be-packaged data selection method based on a branch and bound method.
Background
The blockchain is a new technology which is gradually raised along with the increasing popularization of digital cryptocurrency, and is essentially a distributed ledger database of a peer-to-peer network (peer-to-peer). It is itself a string of linked data blocks whose linking pointers are the hash of the block header generated by the cryptographic hash algorithm processing the block header. Each data block records a set of Merck tree data state information formed by adopting Hash algorithm, thus ensuring that the data in each block can not be tampered
In the application of a blockchain adopting a PoW consensus mechanism, a consensus node generally selects data to be packaged to enter a block on the basis of priority, which is a greedy algorithm idea, and the result is not a global optimal solution.
Disclosure of Invention
Aiming at the defects in the prior art, the method for selecting the data to be packaged of the block chain consensus node based on the branch and bound method solves the problem that the result is not the global optimal solution when the data to be packaged is selected to be packaged into a block based on the priority in the block chain application adopting the PoW consensus mechanism.
In order to achieve the purpose of the invention, the invention adopts the technical scheme that: a block chain consensus node data to be packaged selection method based on a branch and bound method comprises the following steps:
s1, receiving each data to be packaged from the P2P network, and obtaining the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
s2, storing the data to be packaged which are not included in the block and are verified to be legal into a data pool to be packaged according to the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
s3, acquiring N data to be packaged from the data pool to be packaged, and calculating a unit excitation value according to the excitation value and the volume of each data to be packaged;
s4, arranging the N data to be packaged in a descending order according to the unit excitation value;
s5, dividing the sorted data to be packaged into 3 sets;
s6, processing the 3 sets by adopting a branch and bound method, and solving a maximum excitation value;
and S7, packing the data to be packed corresponding to the maximum excitation value into a block, and realizing that the block chain consensus node selects the data to be packed.
Further: the content verified for the data to be packaged in step S2 is:
A. the version of the data package to be packaged, the organization mode of the data to be packaged, the length of the fixed field of the data to be packaged and other fields of the data to be packaged meet the specification;
B. the volume of the data to be packed is less than or equal to the maximum volume of the data to be packed:
wherein transactionisize is the volume of a single data to be packed,for data to be packedThe volume of each input, m is the input number of the data to be packaged, n is the output number of the data to be packaged,for data to be packedThe volume of the output of the individual cells,for data to be packedThe number of the inputs is such that,for data to be packedS _ maxTransactionSize is the maximum volume of the data to be packed;
C. the total number of the input values of the data to be packed is more than or equal to the total number of the output values of all the data to be packed:
wherein the content of the first and second substances,for data to be packedThe number of the input values is such that,for data to be packedThe transactionFee is an excitation value given to the consensus node, m is the input number of data to be packed,for data to be packedN is the output number of the data to be packaged;
D. the input and output of the data to be packed are valid.
Further: the effective input condition of the data to be packaged in the D pieces is as follows: the UTXO model used by the data to be packaged is not used by other data to be packaged in the block chain, and the unlocking script used by the data to be packaged is effective;
the effective output condition of the data to be packaged is as follows: the output value of the data to be packed is positive and greater than the dust threshold:
wherein the content of the first and second substances,for data to be packedThe output value, V _ DustThreshold, is the dust threshold.
The beneficial effects of the above further scheme are: and the data to be packaged are ensured to be in accordance with the specification, so that the specification of the subsequent block is ensured.
Further: the calculation formula of the unit excitation value in step S3 is:
wherein, UjFor the unit excitation value, V, of the jth data to be packedjFor the excitation value of the jth data to be packed, WjIs the volume of the jth data to be packed.
Further: in step S5, the 3 sets are: s1: selecting a set of data to be packaged entering a block; s2: selecting a set of data to be packaged entering a backpack; s3: a set of data to be packed that has not been selected.
Further: step S6 includes the following substeps:
s61, initialization S1、S2And S3Collecting and setting pruning parameters;
S1=φS2=φS3={0,1,2,...,N-1}
s62, establishing a root node X, and satisfying the following constraint equation:
X.b=0 X.k=0 X.S1=φ X.S2=φ X.S3=S
wherein X.b is the maximum excitation value of the loading block under the root node X, X.k is the search depth of the root node X, X.S1For the data to be packed of the chunk under root node X, X.S2Data to be packaged for backpacking under root node X, X.S3The data to be packaged which is not selected under the root node X is represented by S, an original set of the sorted data to be packaged is represented by phi, and the phi is an empty set;
s63, judging whether X.k is equal to N, if yes, ending the substeps, and X.S1The loading block is used as data to be packaged, X.b is the maximum excitation value of the data to be packaged in the loading block, if not, the step is jumped to S64;
s64, establishing a first branch node Y according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Y of the block to obtain S1、S2And S3The collection is as follows:
S1(k+1)=S1(k)∪{k}
S2(k+1)=S2(k)
S3(k+1)=S3(k)-{k}
node Y satisfies the following constraint equation:
Y.S2=X.S2
Y.k=X.k+1
wherein, Y.S2Data to be packaged for knapsack filling under node Y, Y.k is search depth of node Y, S1(k) For searching S with depth of k1Set, S2(k) For searching S with depth of k2Set, S3(k) For searching S with depth of k3Gathering;
s65, calculating an excitation value upper bound Y.b of the branch node Y, and inserting Y.b larger than the pruning parameters into a priority queue;
s66, establishing a node Z of a second branch according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Z of the block to obtainS1、S2And S3The collection is as follows:
S1(k+1)=S1(k)
S2(k+1)=S2(k)∪{k}
S3(k+1)=S3(k)-{k}
node Z satisfies the following constraint equation:
Z.S2=X.S2∪{X.k}
Z.k=X.k+1
wherein, Z.S2Data to be packaged of a backpack is loaded under the node Z, and Z.k is the search depth of the node Z;
s67, calculating an excitation value upper bound Z.b of the branch node Z, and inserting Z.b larger than the pruning parameters into a priority queue;
s68 at S3If the number of the elements in the priority queue is not equal to the upper bound of the excitation values of all the elements in the priority queue, judging whether the pruning parameters are larger than the upper bound of the excitation values of all the elements in the priority queue, if so, setting the pruning parameters as the maximum excitation values, and jumping to the step S69, otherwise, jumping to the step S69;
s69, taking each element in the priority queue as the root node X in turn, execute steps S63 to S68.
The beneficial effects of the above further scheme are: by comparing the maximum incentive value magnitude relation of the branch nodes, meaningless search is avoided, and the search efficiency is improved.
Further: in step S65, formula Y.b is calculated as:
wherein MY is the volume value of all the data to be packed in the current node Y, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) CollectionVolume value of the ith element in the sum, WjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the first element in the set, Y.b, is the upper bound of the excitation value of the branch node Y when the depth is k, x is the quotient of the block capacity minus M and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set.
Further: the formula for calculating Z.b in step S67 is:
MZ is the volume value of all the data to be packed in the current node Z, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) Volume value, W, of the ith element in the setjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the first element in the set, Z.b, is the upper bound of the excitation value of the branch node Z when the depth is k, x is the quotient of the block capacity minus M and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set.
The beneficial effects of the above further scheme are: the generation packed data combination with the global optimal solution is successfully selected according to the branch and bound method.
In conclusion, the beneficial effects of the invention are as follows: the data to be packaged is selected by using a branch and bound method, so that the sum of the excitation values of the selected data is larger than the sum of the excitation values selected by using the priority, and the problem that in the existing blockchain application adopting a PoW consensus mechanism, the data to be packaged is selected to be packaged into a block based on the priority, and the obtained result is not a global optimal solution is solved.
Drawings
FIG. 1 is a flow chart of a block chain consensus node to-be-packaged data selection method based on a branch and bound method;
FIG. 2 is a comparison graph of the sum of excitation values for two selection results;
FIG. 3 is a graph of percentage boost of an excitation value using branch and bound method.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate the understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and it will be apparent to those skilled in the art that various changes may be made without departing from the spirit and scope of the invention as defined and defined in the appended claims, and all matters produced by the invention using the inventive concept are protected.
As shown in fig. 1, a block chain consensus node to-be-packed data selection method based on a branch and bound method includes the following steps:
s1, receiving each data to be packaged from the P2P network, and obtaining the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
s2, storing the data to be packaged which are not included in the block and are verified to be legal into a data pool to be packaged according to the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
the content verified for the data to be packaged in step S2 is:
A. the version of the data package to be packaged, the organization mode of the data to be packaged, the length of the fixed field of the data to be packaged and other fields of the data to be packaged meet the specification;
B. the volume of the data to be packed is less than or equal to the maximum volume of the data to be packed:
wherein transactionisize is the volume of a single data to be packed,for data to be packedThe volume of each input, m is the input number of the data to be packaged, n is the output number of the data to be packaged,for data to be packedThe volume of the output of the individual cells,for data to be packedThe number of the inputs is such that,for data to be packedS _ maxTransactionSize is the maximum volume of the data to be packed;
C. the total number of the input values of the data to be packed is more than or equal to the total number of the output values of all the data to be packed:
wherein the content of the first and second substances,for data to be packedThe number of the input values is such that,for data to be packedThe transactionFee is an excitation value given to the consensus node, m is the input number of data to be packed,for data to be packedN is the output number of the data to be packaged;
D. the input and output of the data to be packed are valid.
The effective input condition of the data to be packaged in the D pieces is as follows: the UTXO model used by the data to be packaged is not used by other data to be packaged in the block chain, and the unlocking script used by the data to be packaged is effective;
the effective output condition of the data to be packaged is as follows: the output value of the data to be packed is positive and greater than the dust threshold:
wherein the content of the first and second substances,for data to be packedThe output value, V _ DustThreshold, is the dust threshold.
S3, acquiring N data to be packaged from the data pool to be packaged, and calculating a unit excitation value according to the excitation value and the volume of each data to be packaged;
the calculation formula of the unit excitation value in step S3 is:
wherein, UjFor the unit excitation value, V, of the jth data to be packedjFor the excitation value of the jth data to be packed, WjIs the volume of the jth data to be packed.
S4, arranging the N data to be packaged in a descending order according to the unit excitation value;
s5, dividing the sorted data to be packaged into 3 sets;
in step S5, the 3 sets are: s1: selecting a set of data to be packaged entering a block; s2: selecting a set of data to be packaged entering a backpack; s3: a set of data to be packed that has not been selected.
S6, processing the 3 sets by adopting a branch and bound method, and solving a maximum excitation value;
step S6 includes the following substeps:
s61, initialization S1、S2And S3Collecting and setting pruning parameters;
S1=φS2=φS3={0,1,2,...,N-1}
s62, establishing a root node X, and satisfying the following constraint equation:
X.b=0 X.k=0 X.S1=φ X.S2=φ X.S3=S
wherein X.b is the maximum excitation value of the loading block under the root node X, X.k is the search depth of the root node X, X.S1For the data to be packed of the chunk under root node X, X.S2Data to be packaged for backpacking under root node X, X.S3The data to be packaged which is not selected under the root node X is represented by S, an original set of the sorted data to be packaged is represented by phi, and the phi is an empty set;
s63, determine X.k if N, if so, tieBundling step, X.S1The loading block is used as data to be packaged, X.b is the maximum excitation value of the data to be packaged in the loading block, if not, the step is jumped to S74;
s64, establishing a first branch node Y according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Y of the block to obtain S1、S2And S3The collection is as follows:
S1(k+1)=S1(k)∪{k}
S2(k+1)=S2(k)
S3(k+1)=S3(k)-{k}
node Y satisfies the following constraint equation:
Y.S2=X.S2
Y.k=X.k+1
wherein, Y.S2Data to be packaged for knapsack filling under node Y, Y.k is search depth of node Y, S1(k) For searching S with depth of k1Set, S2(k) For searching S with depth of k2Set, S3(k) For searching S with depth of k3Gathering;
s65, calculating Y.b, and inserting Y.b larger than the pruning parameters into a priority queue;
in step S65, formula Y.b is calculated as:
wherein MY is the volume value of all the data to be packed in the current node Y, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) Volume value, W, of the ith element in the setjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the first element in the set, Y.b, is the upper bound of the excitation value of the branch node Y when the depth is k, x is the quotient of the block capacity minus M and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set.
S66, establishing a node Z of a second branch according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Z of the block to obtain S1、S2And S3The collection is as follows:
S1(k+1)=S1(k)
S2(k+1)=S2(k)∪{k}
S3(k+1)=S3(k)-{k}
node Z satisfies the following constraint equation:
Z.S2=X.S2∪{X.k}
Z.k=X.k+1
wherein, Z.S2Data to be packaged of a backpack is loaded under the node Z, and Z.k is the search depth of the node Z;
s67, calculating Z.b, and inserting Z.b larger than the pruning parameters into a priority queue;
the formula for calculating Z.b in step S67 is:
MZ is the volume value of all the data to be packed in the current node Z, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) Volume value, W, of the ith element in the setjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the first element in the set, Z.b, is the upper bound of the excitation value of the branch node Z when the depth is k, x is the quotient of the block capacity minus M and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set. S68 at S3If the number of the elements in the priority queue is not equal to the upper bound of the excitation values of all the elements in the priority queue, judging whether the pruning parameters are larger than the upper bound of the excitation values of all the elements in the priority queue, if so, setting the pruning parameters as the maximum excitation values, and jumping to the step S69, otherwise, jumping to the step S69;
s69, taking each element in the priority queue as the root node X in turn, execute steps S63 to S68.
And S7, packing the data to be packed corresponding to the maximum excitation value into a block, and realizing that the block chain consensus node selects the data to be packed.
For the case that a block can fully hold data in a Tx (data to be packed) pool, the selection results based on the priority selection method and the branch and bound method are all Tx in the Tx pool, and there is no difference in the total sum of Tx and total excitation value results. So for the case where the block cannot fully accommodate all the Tx in the Tx pool under test (i.e. total volume of Tx is greater than the block capacity), the consensus node selects Tx to pack into the block with the aim of obtaining a higher stimulus value.
The test flow in this section is: the volume and stimulus value of each Tx in the Tx pool, and the block capacity, were simulated using random numbers, and the priority-based selection algorithm and the branch-and-bound-based selection algorithm were tested using the same test data.
The computer is configured as follows: a CPU: intel (R) core (TM) i5-8205U @1.60 GHz; a built-in RAM: 8.0 GB; operating the system: windows 1064 bit. The realization platform is as follows: the JAVA code is realized, the integrated development environment is eclipse 4.10.0.20181214-0600, the version of JDK is 10.0.1, and data obtained by testing are displayed by Matlab 2018 a.
(1) The test results are shown in table 1 and fig. 2:
TABLE 1
As can be seen from FIG. 3, the magnitude of the stimulus values can be significantly increased using the branch and bound method, and the percentage increase in the test data can be up to 10.5%.
(2) Analysis of Experimental results
It is known from experimental data that the use of the branch-and-bound method allows the sum of the excitation values to be selected to be larger than the sum of the excitation values to be selected using the priority, because the branch-and-bound method searches for the optimal solution in a larger solution space.
When solving the problem, the ordering time complexity of the greedy algorithm is O (nlogn), and the time consumption of the greedy selection is O (n), so the time complexity of the greedy algorithm for selecting the data problem is O (nlogn). The time complexity of the branch and bound selection data is O (2 n). The popular blockchain application sets the consensus node to generate a block in a given time of about 10 minutes, so the consensus node often uses a greedy algorithm. However, the excitation value difference of the two algorithm selection results is not negligible due to the improvement of hardware capabilities such as computer computing power and the like.
Claims (8)
1. A block chain consensus node data to be packaged selection method based on a branch and bound method is characterized by comprising the following steps:
s1, receiving each data to be packaged from the P2P network, and obtaining the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
s2, storing the data to be packaged which are not included in the block and are verified to be legal into a data pool to be packaged according to the volume maximum value, the dust threshold value and the corresponding output of the data to be packaged;
s3, acquiring N data to be packaged from the data pool to be packaged, and calculating a unit excitation value according to the excitation value and the volume of each data to be packaged;
s4, arranging the N data to be packaged in a descending order according to the unit excitation value;
s5, dividing the sorted data to be packaged into 3 sets;
s6, processing the 3 sets by adopting a branch and bound method, and solving a maximum excitation value;
and S7, packing the data to be packed corresponding to the maximum excitation value into a block, and realizing that the block chain consensus node selects the data to be packed.
2. The method for selecting data to be packaged by a blockchain consensus node based on branch and bound method according to claim 1, wherein the content verified in step S2 is:
A. the version of the data package to be packaged, the organization mode of the data to be packaged, the length of the fixed field of the data to be packaged and other fields of the data to be packaged meet the specification;
B. the volume of the data to be packed is less than or equal to the maximum volume of the data to be packed:
wherein TransactionSize is the volume, S ', of a single data to be packaged'iIs the volume of the ith input of the data to be packed, m is the input number of the data to be packed, n is the output number of the data to be packed, S ″jThe volume of the jth output of the data to be packed is I, the ith input of the data to be packed is j, the jth output of the data to be packed is j, and S _ maxTransactionSize is the maximum volume of the data to be packed;
C. the total number of the input values of the data to be packed is more than or equal to the total number of the output values of all the data to be packed:
wherein, v'iIs the ith input value of the data to be packed, i is the ith input of the data to be packed, transactionFee is the excitation value for the consensus node, and m is the data to be typedNumber of inputs, v ", of packet datajThe j output value of the data to be packaged, and n is the output number of the data to be packaged;
D. the input and output of the data to be packed are valid.
3. The method of claim 2, wherein the condition that the input of the data to be packed in the D pieces is valid is: the UTXO model used by the data to be packaged is not used by other data to be packaged in the block chain, and the unlocking script used by the data to be packaged is effective;
the effective output condition of the data to be packaged is as follows: the output value of the data to be packed is positive and greater than the dust threshold:
v″j≥V_dustThreshold
wherein, v ″)jFor the jth output value of the data to be packed, V _ dustThreshold is the dirty threshold.
4. The method for selecting data to be packed by a blockchain consensus node based on branch and bound method as claimed in claim 1, wherein the unit excitation value calculation formula in step S3 is:
wherein, UjFor the unit excitation value, V, of the jth data to be packedjFor the excitation value of the jth data to be packed, WjIs the volume of the jth data to be packed.
5. The method of claim 1, wherein 3 sets in the step S5 are as follows: s1: selecting a set of data to be packaged entering a block; s2: selecting a set of data to be packaged entering a backpack; s3: a set of data to be packed that has not been selected.
6. The method for selecting data to be packed by blockchain consensus node based on branch and bound method as claimed in claim 5, wherein said step S6 comprises the following sub-steps:
s61, initialization S1、S2And S3Collecting and setting pruning parameters;
S1=φS2=φS3={0,1,2,...,N-1}
s62, establishing a root node X, and satisfying the following constraint equation:
X.b=0 X.k=0 X.S1=φ X.S2=φ X.S3=S
wherein X.b is the maximum excitation value of the loading block under the root node X, X.k is the search depth of the root node X, X.S1For the data to be packed of the chunk under root node X, X.S2Data to be packaged for backpacking under root node X, X.S3The data to be packaged which is not selected under the root node X is represented by S, an original set of the sorted data to be packaged is represented by phi, and the phi is an empty set;
s63, judging whether X.k is equal to N, if yes, ending the substeps, and X.S1The loading block is used as data to be packaged, X.b is the maximum excitation value of the data to be packaged in the loading block, if not, the step is jumped to S64;
s64, establishing a first branch node Y according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Y of the block to obtain S1、S2And S3The collection is as follows:
S1(k+1)=S1(k)∪{k}
S2(k+1)=S2(k)
S3(k+1)=S3(k)-{k}
node Y satisfies the following constraint equation:
Y.S2=X.S2
Y.k=X.k+1
wherein, Y.S2For data to be packed that is backpacked under node Y, Y.k is a search for node YDepth, S1(k) For searching S with depth of k1Set, S2(k) For searching S with depth of k2Set, S3(k) For searching S with depth of k3Gathering;
s65, calculating an excitation value upper bound Y.b of the branch node Y, and inserting Y.b larger than the pruning parameters into a priority queue;
s66, establishing a node Z of a second branch according to the root node X, and loading the data to be packaged with the search depth of k into the branch node Z of the block to obtain S1、S2And S3The collection is as follows:
S1(k+1)=S1(k)
S2(k+1)=S2(k)∪{k}
S3(k+1)=S3(k)-{k}
node Z satisfies the following constraint equation:
Z.S2=X.S2∪{X.k}
Z.k=X.k+1
wherein, Z.S2Data to be packaged of a backpack is loaded under the node Z, and Z.k is the search depth of the node Z;
s67, calculating an excitation value upper bound Z.b of the branch node Z, and inserting Z.b larger than the pruning parameters into a priority queue;
s68 at S3If the number of the elements in the priority queue is not equal to the upper bound of the excitation values of all the elements in the priority queue, judging whether the pruning parameters are larger than the upper bound of the excitation values of all the elements in the priority queue, if so, setting the pruning parameters as the maximum excitation values, and jumping to the step S69, otherwise, jumping to the step S69;
s69, taking each element in the priority queue as the root node X in turn, execute steps S63 to S68.
7. The method as claimed in claim 6, wherein the step S65 of calculating Y.b formula as:
wherein MY is the volume value of all the data to be packed in the current node Y, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) Volume value, W, of the ith element in the setjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the first element in the set, Y.b, is the upper bound of the excitation value of the branch node Y when the depth is k, x is the quotient of the block capacity minus M and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set.
8. The method of claim 6, wherein the formula for calculating Z.b in step S67 is as follows:
MZ is the volume value of all the data to be packed in the current node Z, S1(k) For searching S with depth of k1Set of (1), S3(k) For searching S with depth of k3Set of WiIs S1(k) Volume value, W, of the ith element in the setjIs S3(k) Volume value of jth element in the set, WlIs S3(k) The volume value of the l-th element in the set, Z.b isWhen the depth is k, the excitation value of the branch node Z is up bound, x is the quotient of the value obtained by subtracting M from the block capacity and the block capacity, piIs S1Set the excitation value, p, of the ith elementjIs S3(k) Excitation value, p, of the jth element in the setlIs S3(k) The excitation value of the ith element in the set.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010958716.8A CN112083950B (en) | 2020-09-14 | 2020-09-14 | Block chain consensus node to-be-packaged data selection method based on branch and bound method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010958716.8A CN112083950B (en) | 2020-09-14 | 2020-09-14 | Block chain consensus node to-be-packaged data selection method based on branch and bound method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112083950A true CN112083950A (en) | 2020-12-15 |
CN112083950B CN112083950B (en) | 2022-02-11 |
Family
ID=73736974
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010958716.8A Active CN112083950B (en) | 2020-09-14 | 2020-09-14 | Block chain consensus node to-be-packaged data selection method based on branch and bound method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112083950B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114863169A (en) * | 2022-04-27 | 2022-08-05 | 电子科技大学 | Image classification method combining parallel ensemble learning and federal learning |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106452785A (en) * | 2016-09-29 | 2017-02-22 | 财付通支付科技有限公司 | Block chain network, branch node and block chain network application method |
CN108990002A (en) * | 2018-06-27 | 2018-12-11 | 柳州市蓝海数链科技有限公司 | A kind of block chain data processing method, device, terminal and storage medium |
CN109600230A (en) * | 2018-11-27 | 2019-04-09 | 北京零和商务有限公司 | A kind of block chain common recognition mechanism realizes system and its implementation |
KR102060435B1 (en) * | 2019-05-16 | 2019-12-30 | 주식회사 모파스 | Method and apparatus of blockchain smart contract using proof-of-repuation-of-network as consensus algorithm |
KR20190143115A (en) * | 2018-06-20 | 2019-12-30 | 삼성에스디에스 주식회사 | Method for managing data based on blockchain |
CN111177258A (en) * | 2019-12-13 | 2020-05-19 | 浙商银行股份有限公司 | Adaptive configuration transaction packaging method based on block chain platform |
-
2020
- 2020-09-14 CN CN202010958716.8A patent/CN112083950B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106452785A (en) * | 2016-09-29 | 2017-02-22 | 财付通支付科技有限公司 | Block chain network, branch node and block chain network application method |
KR20190143115A (en) * | 2018-06-20 | 2019-12-30 | 삼성에스디에스 주식회사 | Method for managing data based on blockchain |
CN108990002A (en) * | 2018-06-27 | 2018-12-11 | 柳州市蓝海数链科技有限公司 | A kind of block chain data processing method, device, terminal and storage medium |
CN109600230A (en) * | 2018-11-27 | 2019-04-09 | 北京零和商务有限公司 | A kind of block chain common recognition mechanism realizes system and its implementation |
KR102060435B1 (en) * | 2019-05-16 | 2019-12-30 | 주식회사 모파스 | Method and apparatus of blockchain smart contract using proof-of-repuation-of-network as consensus algorithm |
CN111177258A (en) * | 2019-12-13 | 2020-05-19 | 浙商银行股份有限公司 | Adaptive configuration transaction packaging method based on block chain platform |
Non-Patent Citations (2)
Title |
---|
XINLE YANG等: ""Effective scheme against 51% Attack on Proof-of-Work Blockchain with History Weighted Information"", 《IEEE》 * |
张思贤等: ""一种基于分组的区块链共识算法"", 《计算机应用与软件》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114863169A (en) * | 2022-04-27 | 2022-08-05 | 电子科技大学 | Image classification method combining parallel ensemble learning and federal learning |
Also Published As
Publication number | Publication date |
---|---|
CN112083950B (en) | 2022-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Rautiainen et al. | GraphAligner: rapid and versatile sequence-to-graph alignment | |
Rabosky et al. | FiSSE: a simple nonparametric test for the effects of a binary character on lineage diversification rates | |
Mehta et al. | ALGORITHM 643: FEXACT: a FORTRAN subroutine for Fisher's exact test on unordered r× c contingency tables | |
Fredman et al. | Trans-dichotomous algorithms for minimum spanning trees and shortest paths | |
Gopalan et al. | An FPTAS for# knapsack and related counting problems | |
Kamvar et al. | Extrapolation methods for accelerating PageRank computations | |
CN104067282B (en) | Counter operation in state machine lattice | |
Bai et al. | An improved algorithm for finding all minimal paths in a network | |
Snir et al. | Quartets MaxCut: a divide and conquer quartets algorithm | |
McDiarmid et al. | Counting phylogenetic networks | |
CN112083950B (en) | Block chain consensus node to-be-packaged data selection method based on branch and bound method | |
Song et al. | A high utility itemset mining algorithm based on subsume index | |
Sorge et al. | A new view on Rural Postman based on Eulerian Extension and Matching | |
Flick et al. | A parallel connectivity algorithm for de Bruijn graphs in metagenomic applications | |
Luna et al. | Efficient mining of top-k high utility itemsets through genetic algorithms | |
CN109685545A (en) | Virtual network resource predictor method, device and electronic equipment to be provided | |
Kristensen et al. | Methods for similarity-based virtual screening | |
Schidler | SAT-based local search for plane subgraph partitions (CG challenge) | |
CN106599122A (en) | Parallel frequent closed sequence mining method based on vertical resolution | |
CN107862166A (en) | A kind of intelligent Simulation experiment design system and design method | |
Pettersson | Enumerating hamiltonian cycles | |
Chernysheva et al. | Two-program package to calculate the ground and excited state wave functions in the Hartree—Fock—Dirac approximation | |
Chowdhury et al. | Cache-oblivious buffer heap and cache-efficient computation of shortest paths in graphs | |
Disanto et al. | Yule-generated trees constrained by node imbalance | |
Jabbar et al. | I/O efficient directed model checking |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |