Multi-task asynchronous execution method and device based on layered blockchain

By adopting a hierarchical blockchain architecture and asynchronous execution model in blockchain technology, the problems of high operation load and low information retrieval efficiency in multi-task scenarios are solved, more efficient block generation and information retrieval are achieved, and the utilization of node computing resources is optimized.

CN116112507BActive Publication Date: 2025-04-22HUNAN TIAN HE GUO YUN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211733309.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-04-22
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In the existing blockchain technology, the operating load is high in multi-task scenarios, the information retrieval efficiency is low, the task parallelism is not high, and the transaction factor analysis is high, resulting in waste of node computing resources and limited performance improvement.

Method used

A multi-task asynchronous execution method based on hierarchical blockchain is adopted. By building an upper-level chain and multiple underlying chains, the packaging and consensus separation of transaction information is achieved. The asynchronous execution model is adopted to improve efficiency, and query, retrieval and verification functions are provided through the upper-level chain, supporting coordinated processing between different chains.

Benefits of technology

It improves the efficiency of block generation in multi-task scenarios, reduces the operating load, improves the efficiency of information retrieval, reduces the complexity of transaction factor analysis, and optimizes the utilization of node computing resources through asynchronous execution and hierarchical architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112507B_ABST
    Figure CN116112507B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for asynchronous execution of multiple tasks based on a layered blockchain, the method comprising constructing an upper chain and multiple underlying chains linked to the upper chain, wherein the multiple underlying chains have a collaborative relationship; the upper chain sets a receiving threshold, packages the transaction information of multiple underlying chains into candidate blocks and broadcasts them; the consensus nodes of the upper chain receive the broadcasted candidate blocks and reach a consensus, and a new height block is formed after consensus is received. Compared with the related art, the method and device for asynchronous execution of multiple tasks based on a layered blockchain provided by the present invention improves the efficiency of consensus and the efficiency of generating new height blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a multi-task asynchronous execution method and device based on a layered blockchain. Background Art

[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is a chain data structure that combines data blocks in a sequential manner in chronological order, and a distributed ledger that cannot be tampered with or forged by cryptography. Due to the characteristics of decentralization, information cannot be tampered with, and autonomy, blockchain has also received more and more attention and application. With the rapid development of blockchain technology, more and more blockchain scenarios involve collaborative operations between multiple chains, but this collaboration is mostly carried out in a synchronous manner.

[0003] In the infinite prediction execution system of blockchain transactions of patent 202210308971.7, the transaction packaging behavior of the second candidate block must wait for the event reception signal of the completion of packaging of the first block before it can be executed; and, the consensus behavior of the second candidate block must also wait for the first block to complete the consensus and send a consensus completion confirmation signal before it can be executed, that is, its packaging and consensus process is a synchronous rather than asynchronous process, and the strict timing of the operation process may strictly affect the improvement of the overall performance; because the consensus of the first candidate block has not been completed when the second candidate block packages the transaction, the direct transaction read-write sets of the two candidate blocks may cause conflicts. Before reaching a consensus, the second candidate block needs to determine whether the currently packaged transaction conflicts with the transaction read-write set that has been on the chain. If there is a conflict, all transactions need to be packaged again, which will cause a waste of node computing resources.

[0004] In the data prediction method, device and computer-readable storage medium of patent 202111664993.9, its dual-chain structure includes an asset chain, a transaction chain and a cross-chain transaction chain. When conducting on-chain transactions, the transaction chain needs to first obtain the asset chain information across domains through the summary chain. After the transaction is completed, the transaction information must first be uploaded to the transaction chain, and then the changed asset information will need to be uploaded and recorded on the asset chain, which may increase the operating load of the business and reduce the efficiency of information retrieval.

[0005] Therefore, it is necessary to provide a new type of multi-task asynchronous execution method and device based on layered blockchain to overcome the above-mentioned defects. Summary of the invention

[0006] The purpose of the present invention is to provide a novel multi-task asynchronous execution method and device based on layered blockchain to solve the defects of high operating load, low information retrieval efficiency, low task parallelism and high transaction factor analysis in multi-task scenarios in the prior art.

[0007] In order to achieve the above object, the present invention provides a multi-task asynchronous execution method based on a layered blockchain, comprising:

[0008] Construct an upper chain and multiple underlying chains linked to the upper chain. The multiple underlying chains have a collaborative relationship. When any underlying chain executes a transaction task, the task summary information of other chain transactions associated with the task ID can be queried in the upper chain;

[0009] The proposal node of the upper chain packages the transaction information uploaded by multiple underlying chains into candidate blocks and broadcasts them by setting the receiving threshold; the consensus node of the upper chain receives the broadcasted candidate blocks and reaches a consensus, and a new height block is formed after the consensus is received.

[0010] The present invention also provides a multi-task asynchronous execution device based on a layered blockchain, the device comprising:

[0011] The upper chain is used for multi-chain collaboration, providing query, retrieval and verification functions, and providing operation record proof and cross-domain interaction capabilities for the coordination between different chains;

[0012] The bottom chain is used to record the data and operation changes required for the transaction, and send the task summary information of the transaction to the upper chain for storage;

[0013] The package consensus module is used to monitor transactions and package them into candidate blocks after pre-execution, and to reach consensus on the candidate blocks to form a new height block.

[0014] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the multi-task asynchronous execution method based on the layered blockchain are implemented.

[0015] The present invention also provides a computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the multi-task asynchronous execution method based on a layered blockchain when executing the computer program.

[0016] Compared with the related art, the present invention adopts a two-layer blockchain architecture with multi-chain collaboration. The core of this architecture is to add an upper-layer alliance chain on the basis of multiple chains to provide query, retrieval and verification functions for multi-chain collaboration, and provide operation record proof and security guarantee for the coordinated processing between different tasks; at the same time, the block generation operation is divided into packaging operation and consensus operation according to stages, realizing the asynchronous execution of packaging and consensus, and improving the efficiency of block generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0018] Figure 1 This is a flow chart of the method for asynchronous execution of multi-tasks based on a layered blockchain according to the present invention;

[0019] Figure 2 This is an architectural diagram of the layered blockchain of the present invention;

[0020] Figure 3 Flowchart of asynchronous operations for packaging pre-consensus for the present invention. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] See also Figure 1 The present invention provides a multi-task asynchronous execution method based on a layered blockchain, comprising:

[0023] S1. Build an upper chain and multiple underlying chains linked to the upper chain. The multiple underlying chains have a collaborative relationship. When any underlying chain executes a transaction task, it can query the task summary information of other chain transactions associated with the task ID in the upper chain;

[0024] S2. The proposal node of the upper chain packages the transaction information uploaded by multiple underlying chains into candidate blocks and broadcasts them by setting the receiving threshold; the consensus node of the upper chain receives the broadcasted candidate blocks and reaches a consensus, and a new height block is formed after consensus is received.

[0025] The present invention provides a layered blockchain asynchronous execution method in a multi-task concurrent scenario. The layered blockchain includes a bottom-level task blockchain (public chain, alliance chain, private chain) and an upper-level summary chain (alliance chain). Figure 2 As shown, the specific steps are as follows:

[0026] In a multi-task concurrent scenario, there are three concurrent tasks A, B, and C. Tasks A, B, and C have a collaborative relationship. Each task has an independent blockchain a, chain b, chain c, and alliance chain β, where chain a, chain b, and chain c are the underlying chains and chain β is the upper chain.

[0027] (1) Generate task summary information based on the source information of task A, and upload the data information and operation records of task A to chain A where task A is located; and upload the task summary information of task A to alliance chain β; the task summary information includes task ID, data information, and operation records. After querying the task summary information of task A from alliance chain β, task B updates its own status and performs relevant operations of task B; after task B is completed, the current data information and operation records are uploaded to chain B where it is located, and its own task summary information is uploaded to alliance chain β; task C queries the task summary information of task B on alliance chain β, updates its own status and performs relevant operations of task C. After the execution of task C, the current data information and operation records are uploaded to chain B where it is located, and its own task summary information is uploaded to alliance chain β.

[0028] Repeat the above steps until the collaborative task of Task A, Task B, and Task C is completed.

[0029] (2) In step (1), when any chain executes a task, the task summary information under the task ID associated with another task can be queried in the alliance chain β, and then the execution status of the related task can be queried in the related task chain through the task summary information to determine whether the task has been completed.

[0030] (3) In the present invention, local chains and cross-domain chains can be deployed separately. The deployment type of the local chain can be a public chain or a private chain, and the deployment type of the cross-domain chain can be an alliance chain. The local chain is used to bear the accounting function of the data and operation changes required for the task. The alliance chain records the task summary information of the local chain, provides the other local chains with the cross-domain interaction capability of searching and querying data, and provides hierarchical verification of task operations.

[0031] (4) In the present invention, the on-chain operation in the alliance chain is divided into a packaging stage and a consensus stage according to the different operation stages of each block on the chain; Figure 3 , the generation of a complete block includes the following steps:

[0032] The proposal node of the first block packages the candidate blocks: the proposal node receives the transactions broadcasted in the transaction pool of the underlying chain, selects the transaction according to the receiving threshold U (for example, 0.5), and puts the transaction into the cache transaction queue for pre-execution; the receiving threshold is pre-set according to historical experience; the strategy for whether the transaction is received is as follows: before each transaction is stored in the cache queue, a random probability in the interval x∈(0,1) is generated. If x≤U, it means that the transaction is selected and the transaction is added to the cache queue; otherwise, it means that the transaction is abandoned, and the next transaction is selected to determine whether to put it into the cache transaction queue; iterative execution continues until the cache transaction queue is full. When the cache transaction queue is full, all transactions in the cache are compared with the transaction read-write set after being uploaded to the chain (the concept of fabric read-write set RWsets is borrowed, which is generated during the operation of the chain and is used to verify the submitted transaction status and update the transaction status key-value pair) to determine whether there is a conflict. If there is no conflict, they are packaged to form a candidate block. If there is a conflict, all transactions in the cache queue are abandoned; the receiving threshold represents the probability between (0, 1], that is, when a node receives a broadcast transaction, how likely it is to put the transaction into its own cache transaction queue; the cache transaction queue is used to temporarily store the received transaction queue; pre-execution refers to the pre-order configuration that needs to be done before the transaction officially starts.

[0033] The proposal node reaches a consensus on the candidate block: When the proposal node completes the packaging operation on the candidate block, it generates a confirmation message of the completion of the packaging event and broadcasts the candidate block at the same time; when the consensus node receives the broadcasted candidate block, it reaches a consensus on the candidate block, and after the consensus is completed, a new height block is generated.

[0034] (5) Consensus nodes are elected from ordinary nodes by all nodes through election strategies. Consensus nodes are limited in term, and the default term is 6 block confirmation times. Consensus nodes can only participate in the generation, broadcast, and consensus of new blocks during their selected term. When the term of a consensus node ends, the functions of generating, broadcasting, and consensus of new blocks need to be handed over to the next consensus node, and the consensus node will be converted back to a non-consensus node. In the present invention, all alliance chain nodes are divided into three categories: consensus nodes, committee nodes, and idle nodes. Each round of election process of consensus nodes includes the following steps:

[0035] Activate idle nodes: Some idle nodes will be activated as candidate nodes to participate in the election of consensus nodes for that term.

[0036] Predicting computing needs for the next term: The committee node will combine, analyze, and simulate past experience, actual parameters, and needs to predict computing needs for the next term.

[0037] Evaluation of candidate consensus nodes: The candidate node broadcasts information such as the computing resources it can provide in one term to every member of the committee. The committee node assigns a score to each candidate node based on the established scoring system. Scoring components that can comprehensively score candidate nodes: The performance of the entire node is scored mainly based on 9 indicators, including RPS (number of requests sent per second), TPS (number of transactions processed per second), QPS (number of requests processed per second), system throughput, system response time, system concurrency, node disk size, node computing power, and node average bandwidth.

[0038] Determine the consensus node: The committee selects the consensus node that can become the next term from the candidate nodes based on the election strategy and scores.

[0039] The strategy for the election committee nodes adopts a practical Byzantine fault-tolerant consensus mechanism; the election process for the election committee nodes is as follows:

[0040] Ordinary nodes broadcast the request for election committee members to other ordinary nodes (excluding consensus nodes within the confirmation time of this block).

[0041] Nodes execute the three-phase consensus process of PBFT consensus.

[0042] After the node completes the three-phase consensus process, it will be transformed from a normal node to an election committee node when it waits to receive replies with the same result from m+1 nodes, where m represents the maximum number of faulty nodes allowed by the system.

[0043] The exit strategy of the election committee node is as follows:

[0044] When a node just becomes a member of the election committee, a default parameter active value Period is set to 255. The active value Period represents whether the election committee node is active. If Period is greater than 0, it means that the committee node is active and can elect a consensus node; otherwise, it cannot elect a consensus node.

[0045] Each time a consensus node election is performed, a random decay will be performed, and the decay value d is a random integer between 1 and 5, that is, Next_Period = Current_Period-d; where Next_Period represents the next round of active value, Current_Period represents the current active value, and d represents the decay value.

[0046] When the active value Period is less than or equal to 0, the election committee node cannot participate in the election of consensus nodes, and sets its role to a common node and exits the election committee.

[0047] (6) Two different election scoring strategies: The highest score selection strategy is to select the candidate node with the highest score as the consensus node for the next term. In other words, we hope to select the candidate node with the best computing resources as the consensus node. The present invention designs this strategy in the hope of performing consensus processing with the highest efficiency. However, this will make the nodes with huge resource advantages obtain the vast majority of consensus opportunities, while the nodes with relatively poor computing resources will become tail nodes and obtain a relatively small chance of consensus. This is obviously contrary to the principle of relative fairness and is not conducive to the healthy maintenance of the entire alliance chain.

[0048] The gradient selection strategy is to divide the scores according to the gradient. Each score gradient will obtain an activation ratio. The candidate nodes within the score gradient can get the opportunity to become consensus nodes according to this activation ratio. The present invention designs this strategy in the hope of sacrificing a certain efficiency to ensure that all participating nodes in the alliance chain can get the opportunity to become consensus nodes with a relatively fair probability. This strategy is also conducive to preventing Byzantine attacks. Even if the malicious node has an absolute advantage in computing resources, it still cannot guarantee its own success rate in doing evil, thereby maintaining the security and stability of the entire alliance chain.

[0049] The present invention adopts a two-layer blockchain architecture that supports multi-chain collaboration. The core of the architecture is to add an upper-layer alliance chain on the basis of multiple chains to provide query, retrieval and verification functions when multiple chains collaborate. The multiple chains have different positioning and division of labor, as well as synchronization and interaction between data according to their different processing tasks; the information and status between different tasks are recorded on the chain respectively, and the information on the chain cannot be tampered with and can be traced throughout the process based on the consensus mechanism of the blockchain, providing operation record proof and security guarantee for the coordinated processing between different tasks.

[0050] The present invention divides the block generation operation into packaging operation and consensus operation according to the stages. The packaging operation is performed by all nodes to monitor the transaction and pre-execute it to form a candidate block, and then the node broadcasts its own candidate block; after the consensus node of the current term receives the broadcasted candidate block, it reaches a consensus on the candidate block, and forms a new height block after consensus reception; at the same time, a solution of reducing the candidate block and the transaction read-write set on the chain is adopted, and the rate of receiving broadcasted transactions is controlled by setting a receiving threshold, and then the permitted transactions are stored in the transaction cache queue, and the permitted transactions will perform pre-operation first; when the cache queue is full, all transactions in the cache queue are compared with the transaction read-write set on the chain, and if there is a conflict, all transactions in the transaction cache queue are abandoned, otherwise all transactions in the transaction cache queue are packaged, and the above steps are repeated until the entire candidate block is packaged.

[0051] The present invention adopts asynchronous selection of consensus nodes and a scoring component that can comprehensively score candidate nodes. Candidate nodes can be scored according to information such as computing resources, thereby improving consensus efficiency and improving the efficiency of generating new height blocks.

[0052] The present invention also provides a multi-task asynchronous execution device based on a layered blockchain, the device comprising:

[0053] The upper chain is used for multi-chain collaboration, providing query, retrieval and verification functions, and providing operation record proof and cross-domain interaction capabilities for the coordination between different chains;

[0054] The bottom chain is used to record the data and operation changes required for the transaction, and send the task summary information of the transaction to the upper chain for storage;

[0055] The package consensus module is used to monitor transactions and package them into candidate blocks after pre-execution, and to reach consensus on the candidate blocks to form a new height block.

[0056] The present invention constructs a multi-chain collaborative double-layer blockchain architecture with multiple chains as the bottom chain and the alliance chain as the upper chain, which can not only realize the independent execution of different tasks on different chains, but also provide the bottom multi-chain with the function of tamper-proof and full traceability of chain information through the alliance chain, and provide operation record proof and security guarantee for the coordinated processing between different tasks; by dividing the generation of blocks into two steps of packaging and consensus, and the packaging operation is performed by the packaging node, and the consensus operation is performed by the consensus node, the asynchronous execution of packaging and consensus is realized, and the efficiency of generating blocks is improved; by setting the receiving threshold and establishing the transaction cache queue, the possibility of conflict between the candidate block packaging transaction and the chain transaction read-write set is reduced, which is conducive to improving the packaging efficiency of the packaging node; the method of asynchronously selecting consensus nodes can effectively improve the efficiency of electing consensus nodes and improve the ability to resist Byzantine attacks by introducing a scoring mechanism and a committee election mechanism; by designing two different election strategies in the election strategy, namely the highest score election strategy and the gradient election strategy, the entire system can select a suitable election strategy according to multiple dimensions such as efficiency, resistance to Byzantine attacks, and election fairness.

[0057] On the other hand, the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned multi-task asynchronous execution method based on layered blockchain are implemented.

[0058] As an extension of another aspect of the present invention, a computer terminal is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned multi-task asynchronous execution method based on a layered blockchain when executing the computer program.

[0059] When the processor executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are realized. Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0060] The computer terminal may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. It may include, but is not limited to, a processor and a memory. It may include more or fewer components, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, buses, etc.

[0061] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0062] The memory may be an internal storage unit, such as a hard disk or a memory. The memory may also be an external storage device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory may include both an internal storage unit and an external storage device. The memory is used to store the computer program and other programs and data. The memory may also be used to temporarily store data that has been output or is to be output.

[0063] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0064] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0065] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0066] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0067] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0068] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0069] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0070] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A multi-task asynchronous execution method based on a layered blockchain, characterized in that: include: Construct an upper chain and multiple underlying chains linked to the upper chain. The multiple underlying chains have a collaborative relationship. When any underlying chain executes a transaction task, the task summary information of other chain transactions associated with the task ID can be queried in the upper chain; The proposal node of the upper chain packages the transaction information uploaded by multiple underlying chains into candidate blocks and broadcasts them by setting the receiving threshold; the consensus node of the upper chain receives the broadcasted candidate blocks and reaches a consensus, and a new height block is formed after consensus is received; The proposal node packages the task information uploaded by multiple underlying chains into candidate blocks and broadcasts them by setting the receiving threshold, including: The proposal node receives the transaction broadcasted in the transaction pool of the underlying chain, selects the transaction according to the receiving threshold U, and puts the transaction into the cache transaction queue for pre-execution; The receiving threshold is pre-set based on historical experience; before each transaction is stored in the cache queue, a A random probability in the interval, if , it means that the transaction is selected and added to the cache queue; otherwise, it means that the transaction is abandoned and the next transaction is selected to determine whether to put it into the cache transaction queue; iterative execution until the cache transaction queue is full; When the cached transaction queue is full, all transactions in the cache are compared with the transaction read-write set after being uploaded to the chain to determine whether there is a conflict. If there is no conflict, they are packaged to form a candidate block; The consensus nodes of the upper chain receive the broadcasted candidate blocks and reach a consensus. After consensus is received, a new height block is formed, including: All nodes elect consensus nodes from ordinary nodes through election strategies; Consensus nodes improve the efficiency of generating new height blocks through election scoring strategies.

2. The method for asynchronous execution of multi-tasks based on layered blockchain according to claim 1 is characterized in that: All nodes elect consensus nodes from ordinary nodes through election strategies, including: The upper chain nodes include consensus nodes, committee nodes and idle nodes. The election process of each round of consensus nodes is as follows: Activate idle nodes: Some idle nodes will be activated as candidate nodes to participate in the election of consensus nodes for this term; Election of committee nodes: Use the practical Byzantine fault-tolerant consensus mechanism to determine some idle nodes as committee nodes; Predicting computing needs for the next term: The committee node will combine, analyze, and simulate past experience, actual parameters, and needs to predict computing needs for the next term; Evaluate candidate consensus nodes: The candidate node broadcasts the computing resources it can provide in one term to each committee node. The committee node assigns a score to each candidate node based on the established scoring system. Determine the consensus node: The committee node selects the consensus node that can become the next term from the candidate nodes based on the election strategy and score.

3. The method for asynchronous execution of multi-tasks based on layered blockchain according to claim 2 is characterized in that: The consensus node improves the efficiency of generating new height blocks through the election scoring strategy, including: The committee node constructs a scoring component to score performance based on the number of requests sent per second, the number of transactions processed per second, the number of requests processed per second, system throughput, system response time, system concurrency, node disk size, node computing power size, and node average bandwidth; The committee node uses the highest score selection strategy to select the candidate node with the relatively highest score as the consensus node for the next term. At the same time, the gradient selection strategy is used to divide the score by gradient. Each score gradient will obtain an activation ratio, and the candidate nodes within the score gradient can become consensus nodes, thereby improving the efficiency of generating new height blocks.

4. A device for applying the method for asynchronous execution of multi-tasks based on a layered blockchain as described in any one of claims 1 to 3, characterized in that: The device includes: The upper chain is used for multi-chain collaboration, providing query, retrieval and verification functions, and providing operation record proof and cross-domain interaction capabilities for the coordination between different chains; The bottom chain is used to record the data and operation changes required for the transaction, and send the task summary information of the transaction to the upper chain for storage; The package consensus module is used to monitor transactions and package them into candidate blocks after pre-execution, and to reach consensus on the candidate blocks to form a new height block.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the multi-task asynchronous execution method based on a layered blockchain as described in any one of claims 1 to 3 are implemented.

6. A computer terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the layered blockchain multi-task asynchronous execution method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Data processing method and device for double-block-chain architecture in data bank scene

    CN114331729A

  • A method and system for seamless prediction and execution of blockchain transactions

    CN114416765B

  • Block chain consensus method based on switching of network topology modes

    CN110138596A

  • Extensible and secure consensus method and system, storage medium and intelligent terminal

    CN113452747A