CN112948497B - Parallel chain block generation method, computer device, and storage medium - Google Patents

Parallel chain block generation method, computer device, and storage medium Download PDF

Info

Publication number
CN112948497B
CN112948497B CN202110246891.9A CN202110246891A CN112948497B CN 112948497 B CN112948497 B CN 112948497B CN 202110246891 A CN202110246891 A CN 202110246891A CN 112948497 B CN112948497 B CN 112948497B
Authority
CN
China
Prior art keywords
block
parallel chain
chain
parallel
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110246891.9A
Other languages
Chinese (zh)
Other versions
CN112948497A (en
Inventor
马登极
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202110246891.9A priority Critical patent/CN112948497B/en
Publication of CN112948497A publication Critical patent/CN112948497A/en
Application granted granted Critical
Publication of CN112948497B publication Critical patent/CN112948497B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention provides a parallel chain block generation method, computer equipment and a storage medium, wherein the method comprises the following steps: receiving first parallel chain transactions of a first parallel chain, and storing the first parallel chain transactions to a first parallel chain transaction cache queue of the first parallel chain; in response to the mining right of the first main chain block with the first height, determining a second parallel chain transaction cache queue of the transaction to be pulled according to the first height, a pre-configured block packing rule and a block packing parameter of each parallel chain; pulling a plurality of transactions from the second parallel chain transaction buffer queue to generate a first main chain block; the block packing parameter is also used for the parallel chain node of each parallel chain to judge whether the first height, the block packing rule are matched with the block packing parameter of the parallel chain where the block packing parameter is located: if yes, generating a first parallel chain block according to each transaction in the first main chain block; otherwise, the first block head of the first main chain block is synchronized. The parallel chain transaction is verified more quickly to generate a parallel chain block.

Description

Parallel chain block generation method, computer device, and storage medium
Technical Field
The present application relates to the field of parallel chain technologies, and in particular, to a parallel chain block generation method, a computer device, and a storage medium.
Background
In the prior art, it is assumed that there are main, parallel chains pc1 in the blockchain network; the main chain block (101) comprises main chain transactions tx1 and tx2, and parallel chain transactions tx3 and tx4 of pc 1; after a parallel chain node of the pc1 acquires tx3 and tx4 from the block (101), the corresponding parallel chain block cannot be generated directly through tx3 and tx4, but whether the transaction in the block (101) is tampered or not needs to be verified; the verification method comprises the following steps: acquiring a Merckel path of tx3 and a Merckel root of block (101) to verify whether tx3 is tampered, acquiring a Merckel path of tx4 and a Merckel root of block (101) to verify whether tx4 is tampered, and generating corresponding parallel chain blocks according to tx3 and tx4 under the condition that neither tx3 nor tx4 is tampered.
In the above mechanism, it takes a long time for the main chain node to generate the merckel path of tx3, tx4, and it also takes a long time for the parallel chain node to verify whether tx3, tx4 is tampered.
Disclosure of Invention
In view of the above-mentioned deficiencies or inadequacies in the prior art, it would be desirable to provide a parallel chain block generation method, computer device, and storage medium that is less time consuming.
In a first aspect, the present invention provides a method for generating parallel chain blocks suitable for a main chain node, where block packing parameters of parallel chains are recorded on a main chain, and the block packing parameters are different from each other, where the method includes:
receiving first parallel chain transactions of a first parallel chain, and storing the first parallel chain transactions to a first parallel chain transaction cache queue of the first parallel chain;
in response to the mining right of the first main chain block with the first height, determining a second parallel chain transaction cache queue of the transaction to be pulled according to the first height, a pre-configured block packing rule and a block packing parameter of each parallel chain;
pulling a plurality of transactions from the second parallel chain transaction buffer queue to generate a first main chain block;
wherein the block packing parameters are further used for parallel chain nodes of each parallel chain:
judging whether the first height and the block packing rule are matched with the block packing parameters of the parallel chain in which the first height and the block packing rule are positioned:
if yes, generating a first parallel chain block according to each transaction in the first main chain block;
otherwise, the first block head of the first main chain block is synchronized.
In a second aspect, the present invention provides a method for generating parallel chain blocks suitable for parallel chain nodes, where block packing parameters of each parallel chain are recorded on a main chain, the block packing parameters are different from each other, and parallel chain transactions of each parallel chain are stored in a parallel chain transaction cache queue of a corresponding parallel chain by the main chain node, including:
judging whether the first height of the first main chain block, the pre-configured block packing rule and the block packing parameter of the current parallel chain are matched:
if yes, generating a first parallel chain block according to each transaction in the first main chain block;
if not, synchronizing the first block head of the first main chain block;
the first main chain block is generated by pulling a plurality of transactions from a first parallel chain transaction cache queue by a main chain node in response to the mining right of the first main chain block with the first height, and the first parallel chain transaction cache queue is determined according to the first height, a block packing rule and block packing parameters of each parallel chain.
In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a parallel chain block generation method provided according to embodiments of the present invention.
In a fourth aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the parallel chain block generation method provided according to the embodiments of the present invention.
In the parallel chain block generation method, the computer device, and the storage medium according to embodiments of the present invention, a first parallel chain transaction of a first parallel chain is received, and the first parallel chain transaction is stored in a first parallel chain transaction buffer queue of the first parallel chain; in response to the mining right of the first main chain block with the first height, determining a second parallel chain transaction cache queue of the transaction to be pulled according to the first height, a pre-configured block packing rule and a block packing parameter of each parallel chain; pulling a plurality of transactions from the second parallel chain transaction buffer queue to generate a first main chain block; the block packing parameter is also used for the parallel chain node of each parallel chain to judge whether the first height, the block packing rule are matched with the block packing parameter of the parallel chain where the block packing parameter is located: if yes, generating a first parallel chain block according to each transaction in the first main chain block; otherwise, the method of synchronizing the first block head of the first main chain block can verify the parallel chain transaction more quickly to generate the parallel chain block.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a parallel chain block generation method according to an embodiment of the present invention.
Fig. 2 is a flowchart of another parallel chain block generation method according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a parallel chain block generation method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides a parallel chain block generation method suitable for a main chain node, where block packing parameters of parallel chains are recorded on a main chain, and the block packing parameters are different from each other, where the method includes:
s12: receiving first parallel chain transactions of a first parallel chain, and storing the first parallel chain transactions to a first parallel chain transaction cache queue of the first parallel chain;
s14: in response to the mining right of the first main chain block with the first height, determining a second parallel chain transaction cache queue of the transaction to be pulled according to the first height, a pre-configured block packing rule and a block packing parameter of each parallel chain;
s16: pulling a plurality of transactions from the second parallel chain transaction buffer queue to generate a first main chain block;
wherein the block packing parameters are further used for parallel chain nodes of each parallel chain:
judging whether the first height and the block packing rule are matched with the block packing parameters of the parallel chain in which the first height and the block packing rule are positioned:
if yes, generating a first parallel chain block according to each transaction in the first main chain block;
otherwise, the first block head of the first main chain block is synchronized.
Specifically, S14 includes "calculating a first remainder for the first height and the first numerical value in response to obtaining the mining weight for the first backbone block of the first height; determining a transaction cache queue with the block packing parameter as a first remainder as a first transaction cache queue, and judging whether the first height, the block packing rule and the block packing parameter of the parallel chain are matched or not, wherein the judgment comprises the steps of calculating the first remainder of the first height and the first numerical value; judging whether the first remainder is the same as the block packing parameter of the parallel chain, wherein the first numerical value is 10 for example; assuming that a main chain maincalin exists in the block chain, and parallel chains parachain 1-3 (hereinafter abbreviated as pc 1-pc 3); the block packing parameters corresponding to pc 1-pc 3 are 1-3; at this time, the queue1 (parallel chain transaction cache queue of pc1) of the current node has tx1 to tx5, and the queue2 has tx6 to tx 10; the quee 3 has tx 11-tx 15; the current node receives tx20(pc1), tx30(pc2) and tx40(pc3) successively; the current node acquires the mining right of a first main chain block with a first height, wherein the first main chain block with the first height is a block (101);
the current node performs step S12, receives tx20, and stores tx20 to queue 1;
the current node performs step S12, receives tx30, and stores tx30 to queue 2;
the current node performs step S12, receives tx40, and stores tx40 to queue 3;
at this time, the queue1 of the current node has tx 1-tx 5 and tx 20; the quee 2 comprises tx 6-tx 10 and tx 30; the quee 3 comprises tx 11-tx 15 and tx 40;
in response to obtaining the mining right of the block (101), the current node executes step S14, calculates a remainder according to 101 and 10, where the remainder is 1, and determines the queue1 as a parallel chain transaction cache queue of the transaction to be pulled;
the current node executes step S16, and pulls tx 1-tx 5 and tx20 from the queue1 to generate block (101); in the current embodiment, the total amount of data occupied by tx1 to tx5 and tx20 should be much smaller than the total amount of transaction data that can be stored in one main-chain block, so tx1 to tx5 and tx20 are pulled; in practice, the number of transactions pulled should be subject to the actual condition, that is, if a large number of transactions are cached in the queue1 and the total amount of data required to be occupied is greater than the total amount of transaction data that can be stored in one block, a plurality of transactions should be pulled according to the transaction queuing rule to generate the first main chain block;
calculating the remainder of 101 and 10 by each parallel chain node of pc1, wherein the remainder is 1 and is the same as the block packing parameter of pc1, and then generating a parallel chain block by each parallel chain link point of pc1 according to tx 1-tx 5 and tx 20;
calculating the remainder of 101 and 10 by each parallel chain node of pc2, wherein the remainder is 1, and if the remainder is different from the block packing parameter of pc2, each node of pc2 synchronizes a block header (101); the operation of each parallel link point of pc3 is the same as that of pc2, and will not be described in detail here.
In further embodiments, S14 may also be configured according to actual requirements, for example, configured to determine the parallel chain transaction buffer queue with the same block packing parameter and mantissa of the block height as the first parallel chain transaction buffer queue, so as to achieve the same technical effect; correspondingly, whether the first height, the block packing rule and the block packing parameter of the located parallel chain are matched or not is judged, and whether the mantissa of the first height is the same as the block packing parameter of the located parallel chain or not is judged.
In further embodiments, the first value may be configured according to actual requirements, for example, configured as 100, and the same technical effect may be achieved. The first value is preferably configured to be related to the total number of parallel chains in the current blockchain network, for example, when the total number of parallel chains in the blockchain network is 20, the first value is configured to be 100.
It will be appreciated by those skilled in the art that the above embodiments are illustrated by the example of queue1 ultimately having tx1 to tx5, tx 20; if there are no transactions in its queue1, then each node of pc1 will generate a parallel chain empty block.
It should be understood by those skilled in the art that the main chain has block packing parameters recorded thereon for each parallel chain, and the effect of different block packing parameters can be achieved by different methods, such as: receiving and executing a block packing parameter registration transaction of the fourth parallel chain including the second block packing parameter; when any third block packing parameter which is the same as the second block packing parameter does not exist on the main chain, recording the second block packing parameter of the fourth parallel chain on the main chain; or, the block packing parameter of each parallel chain is written in the configuration file at the beginning, and the block packing parameter of each parallel chain is automatically read when the main chain node starts the block chain service, or realized by other methods.
It will be appreciated by those skilled in the art that when the first remainder is other than 1-3, the backbone node will pull several backbone transactions to generate a backbone block.
In the prior art, it is assumed that there are main, parallel chains pc1 in the blockchain network; the main chain block (101) comprises main chain transactions tx1 and tx2, and parallel chain transactions tx3 and tx4 of pc 1; after a parallel chain node of the pc1 acquires tx3 and tx4 from the block (101), a corresponding parallel chain block cannot be generated directly through tx3 and tx4, but whether the transaction in the block (101) is tampered or not needs to be verified; the verification method comprises the following steps: acquiring a Merckel path of tx3 and a Merckel root of block (101) to verify whether tx3 is tampered, acquiring a Merckel path of tx4 and a Merckel root of block (101) to verify whether tx4 is tampered, and generating corresponding parallel chain blocks according to tx3 and tx4 under the condition that neither tx3 nor tx4 is tampered.
In the application, as the block (101) only comprises the transaction of the pc1, each parallel chain node of the pc1 does not need to acquire a mercker path of each transaction of the pc1 in the block (101), only needs to directly calculate a mercker root according to each transaction in the block (101), and if the calculated mercker root is the same as the mercker root carried by the block header (101), the transaction is not tampered, a parallel chain block can be directly generated according to each transaction in the block (101), and the parallel chain transaction is verified more quickly to generate the parallel chain block.
In the prior art, if a large amount of parallel chain transactions of pc3 are generated within a period of time, the packaging resources of the main chain transaction can be squeezed by the parallel chain transaction peak of pc3, and further the packaging congestion of the main chain transaction is caused; the embodiment can disperse the transaction of the parallel chain to different blocks, and can effectively stabilize the crowding of the transaction peak.
In the prior art, when the packing congestion situation occurs, the problem of improvement of transaction commission charge is caused; additional transaction fee costs may be incurred for some parallel chain transactions that are not particularly urgent for the uplink (e.g., parallel chain consensus transactions); the embodiment can reduce the commission cost while stabilizing the exchange peak.
Preferably, determining the first parallel chain transaction buffer queue of the transaction to be pulled according to the first height, the pre-configured block packing rule, and the block packing parameter of each parallel chain comprises:
calculating a first remainder of the first height and the first numerical value;
determining the parallel chain transaction cache queue with the block packing parameter as a first remainder as a first parallel chain transaction cache queue;
judging whether the first height and the block packing rule are matched with the block packing parameters of the parallel chain in which the first height and the block packing rule are positioned comprises the following steps:
calculating a first remainder of the first height and the first numerical value;
and judging whether the first remainder is the same as the block packing parameter of the parallel chain.
The parallel chain block generation principle of the above embodiment can refer to the method shown in fig. 1, and is not described herein again.
Preferably, the method further comprises:
receiving first request information which is sent by a third parallel chain node of a third parallel chain and requests first block data;
judging whether the second height of the main chain block where the first block data is located, the block packing rule and the first block packing parameter of the third parallel chain are matched or not:
if yes, returning the first block data;
otherwise, returning error information.
In the prior art, since the same main chain block can have parallel chain transactions of different parallel chains, the parallel chain link point of pc1 can obtain transaction information of parallel chain transactions of other parallel chains through the main chain block;
the above-described embodiments ensure data non-shareability between different parallel chains.
Fig. 2 is a flowchart of another parallel chain block generation method according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the present invention provides a method for generating parallel chain blocks suitable for parallel chain nodes, where block packing parameters of each parallel chain are recorded on a main chain, the block packing parameters are different from each other, and parallel chain transactions of each parallel chain are stored in a parallel chain transaction cache queue of a corresponding parallel chain by the main chain node, including:
s21: judging whether the first height of the first main chain block, the pre-configured block packing rule and the block packing parameter of the current parallel chain are matched:
if yes, go to step S22: generating a first parallel chain block according to each transaction in the first main chain block;
otherwise, step S23 is executed: synchronizing a first block header of a first backbone block;
the first main chain block is generated by pulling a plurality of transactions from a first parallel chain transaction cache queue by a main chain node in response to the mining right of the first main chain block with the first height, and the first parallel chain transaction cache queue is determined according to the first height, a block packing rule and block packing parameters of each parallel chain.
The parallel chain block generation principle of the above embodiment can refer to the method shown in fig. 1, and is not described herein again.
Preferably, the first parallel chain cache queue is a parallel chain transaction cache queue with a first remainder being the same as the block packing parameter, and the first remainder is calculated according to the first height and the first numerical value; determining whether the first height of the first backbone block, the pre-configured block packing rule, and the block packing parameter of the current parallel chain match comprises:
calculating a first remainder of the first height and the first numerical value;
and judging whether the first remainder is the same as the block packing parameter of the current parallel chain.
The parallel chain block generation principle of the above embodiment can refer to the method shown in fig. 1, and is not described herein again.
Preferably, the above method further comprises:
generating first request information for requesting the first block data and sending the first request information to a first main chain node, so that the first main chain node:
judging whether the second height of the main chain block where the first block data is located, the block packing rule and the block packing parameter of the current parallel chain are matched or not:
if yes, returning the first block data;
otherwise, returning error information.
The parallel chain block generation principle of the above embodiment can refer to a method of a preferred embodiment shown in fig. 1, and is not described herein again.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
As shown in fig. 3, as another aspect, the present application also provides a computer apparatus including one or more Central Processing Units (CPUs) 301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the computer apparatus are also stored. The CPU301, ROM302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a computer-readable storage medium that exists separately and is not assembled into a computer device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (6)

1. A parallel chain block generation method is characterized in that block packing parameters of each parallel chain are recorded on a main chain, the block packing parameters are different from each other, the method is suitable for main chain nodes, and the method comprises the following steps:
receiving a first parallel chain transaction of a first parallel chain, and storing the first parallel chain transaction to a first parallel chain transaction buffer queue of the first parallel chain;
in response to the mining right of a first main chain block with a first height, determining a second parallel chain transaction cache queue of a transaction to be pulled according to the first height, a pre-configured block packing rule and block packing parameters of each parallel chain;
pulling transactions from the second parallel chain transaction buffer queue to generate the first backbone block;
wherein the block packing parameter is further for parallel chain nodes of each parallel chain:
judging whether the first height, the block packing rule and the block packing parameter of the parallel chain are matched or not:
if yes, generating a first parallel chain block according to each transaction in the first main chain block;
if not, synchronizing the first block head of the first main chain block;
the determining a second parallel chain transaction buffer queue of the transaction to be pulled according to the first height, the pre-configured block packing rule and the block packing parameters of each parallel chain comprises:
calculating a first remainder of the first height and the first numerical value;
determining the parallel chain transaction cache queue with the block packing parameter as the first remainder as the second parallel chain transaction cache queue;
the judging whether the first height, the block packing rule and the block packing parameter of the parallel chain are matched comprises:
calculating a first remainder of the first height and the first numerical value;
and judging whether the first remainder is the same as the block packing parameter of the parallel chain.
2. The method of claim 1, further comprising:
receiving first request information which is sent by a third parallel chain node of a third parallel chain and requests first block data;
judging whether the second height of the main chain block where the first block data is located, the block packing rule and the first block packing parameter of the third parallel chain are matched or not:
if yes, returning the first block data;
otherwise, returning error information.
3. A parallel chain block generation method is characterized in that block packing parameters of each parallel chain are recorded on a main chain, the block packing parameters are different from each other, parallel chain transactions of each parallel chain are stored to a parallel chain transaction cache queue of the corresponding parallel chain by a main chain node, the method is suitable for the parallel chain node, and the method comprises the following steps:
judging whether the first height of the first main chain block, the pre-configured block packing rule and the block packing parameter of the current parallel chain are matched:
if yes, generating a first parallel chain block according to each transaction in the first main chain block;
if not, synchronizing the first block head of the first main chain block;
the first main chain block is generated by a main chain node in response to the mining right of a first main chain block with a first height, pulling a plurality of transactions from a second parallel chain transaction cache queue, wherein the second parallel chain transaction cache queue is determined according to the first height, the block packing rule and block packing parameters of each parallel chain, the second parallel chain transaction cache queue is a parallel chain transaction cache queue with a first remainder being the same as the block packing parameters, and the first remainder is calculated according to the first height and a first numerical value; the determining whether the first height of the first backbone block, the pre-configured block packing rule, and the block packing parameter of the current parallel chain match comprises:
calculating a first remainder of the first height and the first numerical value;
and judging whether the first remainder is the same as the block packing parameter of the current parallel chain.
4. The method of claim 3, further comprising:
generating first request information for requesting the first block data and sending the first request information to a first main chain node, so that the first main chain node can:
judging whether the second height of the main chain block where the first block data is located, the block packing rule and the block packing parameter of the current parallel chain are matched or not:
if yes, returning the first block data;
otherwise, returning error information.
5. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-4.
6. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-4.
CN202110246891.9A 2021-03-05 2021-03-05 Parallel chain block generation method, computer device, and storage medium Active CN112948497B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110246891.9A CN112948497B (en) 2021-03-05 2021-03-05 Parallel chain block generation method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110246891.9A CN112948497B (en) 2021-03-05 2021-03-05 Parallel chain block generation method, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN112948497A CN112948497A (en) 2021-06-11
CN112948497B true CN112948497B (en) 2022-05-24

Family

ID=76228534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110246891.9A Active CN112948497B (en) 2021-03-05 2021-03-05 Parallel chain block generation method, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN112948497B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018076760A1 (en) * 2016-10-27 2018-05-03 上海亿账通区块链科技有限公司 Block chain-based transaction processing method, system, electronic device, and storage medium
CN109587271A (en) * 2018-12-29 2019-04-05 杭州复杂美科技有限公司 Main chain parallel chain architecture system and block synchronous method, equipment and storage medium
CN110392121A (en) * 2019-09-02 2019-10-29 杭州复杂美科技有限公司 Parallel chain block generation method, equipment and storage medium
CN110866826A (en) * 2018-08-28 2020-03-06 傲为信息技术(江苏)有限公司 Transaction method based on parallel chain and block chain system
CN111798316A (en) * 2020-07-03 2020-10-20 杭州复杂美科技有限公司 Parallel chain consensus method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018076760A1 (en) * 2016-10-27 2018-05-03 上海亿账通区块链科技有限公司 Block chain-based transaction processing method, system, electronic device, and storage medium
CN110866826A (en) * 2018-08-28 2020-03-06 傲为信息技术(江苏)有限公司 Transaction method based on parallel chain and block chain system
CN110868438A (en) * 2018-08-28 2020-03-06 傲为信息技术(江苏)有限公司 Block chain network system
CN109587271A (en) * 2018-12-29 2019-04-05 杭州复杂美科技有限公司 Main chain parallel chain architecture system and block synchronous method, equipment and storage medium
CN110392121A (en) * 2019-09-02 2019-10-29 杭州复杂美科技有限公司 Parallel chain block generation method, equipment and storage medium
CN111798316A (en) * 2020-07-03 2020-10-20 杭州复杂美科技有限公司 Parallel chain consensus method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
跨链技术发展综述;徐卓嫣等;《计算机应用研究》;20210205;正文第341-346页 *

Also Published As

Publication number Publication date
CN112948497A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN110083745B (en) Data query method, device and storage medium
CN110287196B (en) Block storage method, parallel chain transaction acquisition method, equipment and storage medium
US20120317069A1 (en) Throughput sustaining support system, device, method, and program
CN110796545A (en) Batch processing method, equipment and storage medium for blockchain transaction
CN111242780A (en) Method, device and storage medium for sending consensus transaction
CN108549592A (en) A kind of monitoring method and monitoring device, application server of database connection pool
CN110837505A (en) State data storage method, state data synchronization device and storage medium
CN111008249A (en) Parallel chain block synchronization method, device and storage medium
CN112948497B (en) Parallel chain block generation method, computer device, and storage medium
CN111259074A (en) Block synchronization method, device and storage medium
CN110597920A (en) Information processing method and device
CN110298756B (en) Parallel chain self-consensus method, device and storage medium
CN111415259B (en) Transaction queuing method, device and storage medium
CN112328693A (en) Block synchronization method, device and storage medium
CN110765592B (en) Simulation model, design method and information updating method thereof, equipment and storage medium
CN114489963A (en) Management method, system, equipment and storage medium of artificial intelligence application task
CN114268799B (en) Streaming media transmission method and device, electronic equipment and medium
CN112819625B (en) Parallel chain arbitration consensus method, computer device, and storage medium
CN112948495B (en) Parallel chain constant block output method, computer device and storage medium
CN112804322B (en) Block generation method, computer device and storage medium
CN112948496B (en) Parallel chain block generation method, computer device and storage medium
CN112380040B (en) Message processing method and device, electronic equipment and storage medium
CN108733560A (en) A kind of test method and device
CN112733202A (en) Parallel chain supervision consensus method, computer device and storage medium
CN112131267B (en) Count processing method, device, server and count processing system

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