A task processing method and device based on blockchain network

By encapsulating and executing nodes on the blockchain node, it will not affect the execution of the chain mission of the blockchain node when dealing with timing tasks, solve the problem of the task processing queue occupation of resources, and improve the execution efficiency.

CN111124631BActive Publication Date: 2025-01-28WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911214223.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-02
Publication Date
2025-01-28
Estimated Expiration
2039-12-02

AI Technical Summary

Technical Problem

When the prior art processes timing tasks through task processing queues, it will occupy the internal space and computing resources of the blockchain nodes, affecting the execution of tasks within the chain.

Method used

Package the task release node and task execution node on the blockchain node, release the timing task through the task release node, and perform the timing task when the task execution node meets the trigger conditions. Execute the result.

Benefits of technology

Avoid the impact of timely task processing on the execution of the chain mission of the blockchain node, improve the efficiency of the in -mission of the chain node, and avoid the mission obstruction through decoupled task and in -chain tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111124631B_ABST
    Figure CN111124631B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a task processing method and device based on a blockchain network. The task issuing node generates a task processing request for a scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task, and sends the task processing request for the scheduled task to the blockchain node connected to the task issuing node. The blockchain node calls each encapsulated task execution node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtains the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network. In the embodiment of the present invention, the publishing and execution process of the scheduled task is executed on an external node independent of the blockchain network, so that the processing of the scheduled task will not affect the execution of the in-chain tasks of the blockchain node, and by decoupling the scheduled task from the in-chain tasks of the blockchain node, the execution efficiency of the in-chain tasks of the blockchain node can also be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology (Finetch) and in particular to a task processing method and device based on a blockchain network. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming to financial technology (Fintech), and blockchain technology is no exception. However, due to the security and real-time requirements of the financial industry, the financial technology field has also put forward higher requirements for blockchain technology.

[0003] At present, blockchain networks usually adopt a strategy of sending and receiving tasks. In order to enable blockchain networks to support the processing of scheduled tasks, in one possible way, a task processing queue can be set up in the blockchain network, and the scheduled tasks and the timing rules of the scheduled tasks (such as trigger conditions, consensus nodes, etc.) can be stored in the task processing queue. When the trigger conditions of the scheduled tasks are met, the scheduled tasks can be processed and agreed upon by the consensus nodes, thereby obtaining the processing results of the scheduled tasks. However, the method of processing scheduled tasks using task processing queues will occupy the internal space of blockchain nodes, and will also occupy the computing resources of blockchain nodes, thereby affecting the execution of tasks within the blockchain nodes.

[0004] In summary, there is an urgent need for a task processing method based on a blockchain network to solve the technical problem that the in-chain tasks of blockchain nodes are affected by the existing technology of processing scheduled tasks through a task processing queue. Summary of the invention

[0005] The embodiments of the present invention provide a task processing method and device based on a blockchain network, so as to solve the technical problem that the tasks within the blockchain node are affected by processing scheduled tasks through a task processing queue in the prior art.

[0006] In a first aspect, an embodiment of the present invention provides a task processing method based on a blockchain network, the method comprising:

[0007] The task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task, sends the task processing request for the scheduled task to the blockchain node connected to the task issuing node, and receives the execution result of the scheduled task sent by the blockchain node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network.

[0008] In the embodiment of the present invention, by encapsulating a task publishing node and a task execution node on a blockchain node, and publishing a scheduled task based on the task publishing node, and executing the scheduled task based on the task execution node, the publishing and execution processes of the scheduled task are both executed on an external node independent of the blockchain network, so that the processing of the scheduled task will not affect the execution of the in-chain tasks of the blockchain node. At the same time, by decoupling the scheduled task from the in-chain tasks of the blockchain node, task blocking can also be avoided, thereby improving the execution efficiency of the in-chain tasks of the blockchain node.

[0009] In a possible implementation, the task publishing node generates a task processing request for the scheduled task based on the scheduled task to be processed and the triggering condition of the scheduled task, including: the task publishing node generates an execution contract for the scheduled task based on the scheduled task, and the execution contract of the scheduled task is sent to the blockchain node, and the blockchain node is also used to deploy the execution contract of the scheduled task in the blockchain network to obtain the contract address of the execution contract of the scheduled task; further, the task publishing node receives the contract address of the execution contract of the scheduled task sent by the blockchain node, and generates the task processing request for the scheduled task based on the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0010] In the above implementation, by publishing the scheduled task to the blockchain network in the form of an execution contract, it can be ensured that the scheduled task can be deployed in each blockchain node in the blockchain network, so that it can be ensured that there are enough task execution nodes to execute the scheduled task; and, the scheduled task is stored in the form of an execution contract, so that when the scheduled task is subsequently called, only the address of the execution contract of the scheduled task and the contract interface to be called need to be used, without the need to transmit the full amount of scheduled task data, thereby reducing the amount of data processing and improving task processing efficiency.

[0011] In a possible implementation, the task publishing node sends the task processing request of the scheduled task to the blockchain node connected to the task publishing node, including: the task publishing node determines the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task; the smart contract corresponding to the scheduled task is deployed in each blockchain node of the blockchain network; further, the task publishing node calls the first interface of the smart contract corresponding to the scheduled task according to the task processing request of the scheduled task to generate log information corresponding to the scheduled task in the blockchain node; the log information corresponding to the scheduled task is used for each task execution node encapsulated in the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0012] In the above implementation, by deploying smart contracts in each blockchain node of the blockchain network and using smart contracts to generate log information corresponding to scheduled tasks, it can be ensured that the task execution node accurately detects each scheduled task published to the blockchain network, thereby improving the accuracy of interactive tasks between blockchain nodes and task execution nodes.

[0013] In one possible implementation, the execution contract of the scheduled task includes authorization information, and the authorization information is the contract address of each smart contract that is allowed to access the execution contract of the scheduled task; before the task publishing node calls the first interface of the smart contract corresponding to the scheduled task, it also determines that the contract address of the smart contract corresponding to the scheduled task is located in the authorization information.

[0014] In the above implementation, by setting authorization information in the execution contract of the scheduled task and using the authorization information to authorize the smart contract, it is possible to limit the visitors who access the execution contract of the scheduled task while ensuring that the smart contract successfully accesses the execution contract of the scheduled task, thereby protecting the security of the execution contract of the scheduled task.

[0015] In a second aspect, an embodiment of the present invention provides a task processing method based on a blockchain network, the method comprising:

[0016] After the task execution node detects the log information corresponding to the scheduled task generated in the blockchain node encapsulated by the task execution node, it obtains the log information of the scheduled task; the task execution node determines the triggering condition of the scheduled task according to the log information of the scheduled task, and executes the scheduled task when the triggering condition of the scheduled task is met, and obtains the execution result of the scheduled task by the task execution node; the execution result of the scheduled task by the task execution node is used for the consensus of the blockchain node and other blockchain nodes in the blockchain network to obtain the execution result of the scheduled task.

[0017] In a possible implementation, the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task; the task execution node determines the triggering condition of the scheduled task based on the log information of the scheduled task, and executes the scheduled task when the triggering condition of the scheduled task is met, including: the task execution node calls the second interface of the smart contract corresponding to the scheduled task according to the log information of the scheduled task, and the second interface is used to call the contract interface of the execution contract of the scheduled task to execute the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, and the contract parameters when the triggering condition of the scheduled task is met.

[0018] In the above implementation, the smart contract can ensure that the scheduled task is executed under the set trigger conditions, and will not be executed in advance or overtime, thereby ensuring the accuracy of the execution of the scheduled task; and each task execution node that meets the execution conditions in the blockchain network can obtain and execute the scheduled task. Compared with the existing technology that only distributes the scheduled task to the corresponding blockchain nodes to execute the scheduled task, the flexibility of the scheduled task execution can be improved.

[0019] In a third aspect, an embodiment of the present invention provides a task processing device based on a blockchain network, the device comprising:

[0020] A generating module, used for generating a task processing request of the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task;

[0021] A transceiver module is used to send the task processing request of the scheduled task to the blockchain node connected to the task publishing node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network;

[0022] The transceiver module is also used to receive the execution result of the scheduled task sent by the blockchain node.

[0023] In a possible implementation, the generation module also generates an execution contract for the scheduled task based on the scheduled task; the transceiver module also sends the execution contract for the scheduled task to the blockchain node, and the blockchain node is also used to deploy the execution contract for the scheduled task in the blockchain network to obtain the contract address of the execution contract for the scheduled task; and, receive the contract address of the execution contract for the scheduled task sent by the blockchain node; accordingly, the generation module also generates a task processing request for the scheduled task based on the contract address of the execution contract for the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0024] In a possible implementation, the transceiver module is specifically used to: determine the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task; the smart contract corresponding to the scheduled task is deployed in each blockchain node of the blockchain network; further, according to the task processing request of the scheduled task, call the first interface of the smart contract corresponding to the scheduled task to generate log information corresponding to the scheduled task in the blockchain node; the log information corresponding to the scheduled task is used for each task execution node encapsulated in the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0025] In one possible implementation, the execution contract of the scheduled task includes authorization information, and the authorization information is the contract address of each smart contract that is allowed to access the execution contract of the scheduled task; before the transceiver module calls the first interface of the smart contract corresponding to the scheduled task, it also determines that the contract address of the smart contract corresponding to the scheduled task is located in the authorization information.

[0026] In a fourth aspect, an embodiment of the present invention provides a task processing device based on a blockchain network, the device comprising:

[0027] An acquisition module is used to acquire the log information of the scheduled task after detecting that the log information corresponding to the scheduled task is generated in the blockchain node encapsulated by the task execution node;

[0028] A processing module is used to determine the triggering condition of the scheduled task according to the log information of the scheduled task, and execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task by the task execution node; the execution result of the scheduled task by the task execution node is used for the consensus of the blockchain node and other blockchain nodes in the blockchain network to obtain the execution result of the scheduled task.

[0029] In one possible implementation, the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task; in a specific implementation, the processing module is specifically used to: call the second interface of the smart contract corresponding to the scheduled task according to the log information of the scheduled task, and the second interface is used to call the contract interface of the execution contract of the scheduled task to execute the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, and the contract parameters when the triggering condition of the scheduled task is met.

[0030] In a fifth aspect, an embodiment of the present invention provides a computing device, comprising at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the task processing method based on the blockchain network as described in any of the first or second aspects above.

[0031] In the sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device. When the program runs on the computing device, the computing device executes the task processing method based on the blockchain network described in any of the first or second aspects above.

[0032] These and other aspects of the present invention will become more apparent from the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0034] Figure 1 A schematic diagram of a system architecture of a blockchain network provided by an embodiment of the present invention;

[0035] Figure 2A flowchart corresponding to a task processing method based on a blockchain network provided by an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of the structure of a task processing device based on a blockchain network provided by an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the structure of another task processing device based on a blockchain network provided by an embodiment of the present invention;

[0038] Figure 5 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.

[0040] Figure 1 A schematic diagram of a system architecture of a blockchain network provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, one or more blockchain nodes may be provided in the blockchain network 100, such as blockchain node 101, blockchain node 102, blockchain node 103 and blockchain node 104; wherein any two blockchain nodes may be connected via a wired manner or wirelessly, so as to jointly maintain the blockchain network 100.

[0041] In an embodiment of the present invention, each blockchain node in the blockchain network 100 may have multiple functions, such as routing function, transaction function, blockchain function and consensus function, etc. The routing function means that the blockchain node can transmit the transaction information transmitted by the client to other blockchain nodes in the blockchain network 100 to realize communication between the various blockchain nodes. The transaction function and consensus function mean that the blockchain node can support transactions with users or transactions with other blockchain nodes through consensus, and can also record all transactions executed in the blockchain node (or blockchain network 100). The blockchain function means that the blockchain node can generate new blocks in the blockchain network 100 based on the execution of the transaction.

[0042] Among them, the routing function is a function that each blockchain node in the blockchain network 100 must have, and other functions can be set by technical personnel in this field according to actual needs.

[0043] It should be noted that the blockchain node in the blockchain network can be deployed on a physical machine (server), or can be specifically a process or a series of processes running in a physical machine; for example, blockchain node 101 can be a process running on a server, or can also refer to a server, without specific limitation.

[0044] based on Figure 1 The blockchain network shown, Figure 2 A flowchart of a task processing method provided by an embodiment of the present invention includes:

[0045] Step 201: The task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task.

[0046] like Figure 1 As shown, in the embodiment of the present invention, each blockchain node in the blockchain network 100 may be encapsulated with a corresponding proxy node, and the proxy node may be a software development kit (SDK) component deployed in the blockchain node, or may be a device independent of the blockchain node, and communicate with the blockchain node through a remote procedure call (RPC) protocol; and, although the proxy node is encapsulated in the blockchain node, the application running on the proxy node is independent of the application running on the blockchain node, the application running on the blockchain node is used to participate in transaction execution and consensus in the blockchain network, and the application running on the proxy node is used to publish scheduled tasks or execute scheduled tasks.

[0047] In an embodiment of the present invention, one blockchain node may be encapsulated with one proxy node or multiple proxy nodes, and multiple proxy nodes may be encapsulated on the blockchain node through different ports; if multiple proxy nodes are encapsulated on one blockchain node, the multiple proxy nodes may be used to execute different types of tasks.

[0048] by Figure 1 For example, Table 1 is a schematic table of the correspondence between proxy nodes and task types provided by an embodiment of the present invention.

[0049] Table 1: Schematic diagram of the correspondence between a proxy node and a task type

[0050] Agent Node Blockchain Node Task Type Agent node 1011 Blockchain Node 101 Transfer Task Agent node 1012 Blockchain Node 101 Liquidation tasks Agent node 1021 Blockchain Node 102 Liquidation tasks Agent node 1031 Blockchain Node 103 Points Tasks Agent node 1041 Blockchain Node 104 Transfer Task Agent node 1042 Blockchain Node 104 Liquidation tasks Agent node 1043 Blockchain Node 104 Points Tasks

[0051] As shown in Table 1, the blockchain node 101 encapsulates proxy node 1011 and proxy node 1012 respectively, the proxy node 1011 is used to perform the transfer task, and the proxy node 1012 is used to perform the settlement task; the blockchain node 102 only encapsulates proxy node 1021, and the proxy node 1021 is used to perform the settlement task; the blockchain node 103 only encapsulates proxy node 1031, and the proxy node 1031 is used to perform the integral task; the blockchain node 104 encapsulates proxy node 1041, proxy node 1042 and proxy node 1043 respectively, the proxy node 1041 is used to perform the transfer task, the proxy node 1042 is used to perform the settlement task, and the proxy node 1043 is used to perform the integral task.

[0052] It should be noted that Table 1 is only an exemplary and simple description and does not constitute a limitation on the solution. In specific implementations, the blockchain node may also divide the tasks performed by each proxy node in other ways, such as defining the tasks performed by each proxy node according to the execution time of the task, or defining the tasks performed by each proxy node according to the execution block of the task; accordingly, each proxy node may be connected to only one blockchain node, or may be connected to multiple blockchain nodes at the same time, without specific limitation.

[0053] In the following embodiments of the present invention, the proxy node that publishes the scheduled task is called the task publishing node, and the proxy node that executes the task published by the task publishing node is called the task execution node. For example, if the proxy node 1012 publishes a scheduled task a of the liquidation type to the blockchain network 100, the proxy node 1012 can be used as the task publishing node. Since the proxy nodes that can execute the liquidation task are the proxy nodes 1021 and the proxy node 1042, the proxy nodes 1021 and the proxy node 1042 can be used as the task execution nodes of the scheduled task a.

[0054] In a possible implementation, the task issuing node may generate a task processing request for a scheduled task through the following steps a to c:

[0055] Step a: The task publishing node generates an execution contract for the scheduled task based on the requirements of the scheduled task.

[0056] In an embodiment of the present invention, the demand for a scheduled task can be defined by a task publishing node, or it can also be defined by an external node to which the task publishing node is connected; taking the latter as an example, if an external node has a demand for a scheduled task, the external node can directly send the demand for the scheduled task to the task publishing node, so that the task publishing node generates an execution contract for the scheduled task based on the demand for the scheduled task, or the external node can first generate an execution contract for the scheduled task based on the demand for the scheduled task, and then send the execution contract for the scheduled task to the task publishing node, without specific limitation.

[0057] In a specific implementation, the task release node can first determine the execution process of the scheduled task according to the demand of the scheduled task, and then generate the execution interface (i.e., execution class function) of the scheduled task according to the execution process of the scheduled task; accordingly, the task release node can generate the execution contract of the scheduled task based only on the execution interface of the scheduled task, or can also generate the execution contract of the scheduled task based on the execution interface of the scheduled task and other information. Among them, other information can be any one or more of the identification of the node that has the demand for the scheduled task, the creation time of the execution contract, the state of the execution contract, and the authorization information of the execution contract; the state of the execution contract can be an unexecuted state, an executing state, or an executed state, the unexecuted state is used to identify that the scheduled task has not been locked by the task execution node, the executing state is used to identify that the scheduled task has been locked by the task execution node, and when it has not been executed by the task execution node, the executed state is used to identify that the scheduled task has been executed by the task execution node; the authorization information of the execution contract is the identification information of the smart contract that allows access to the execution contract, such as the address or name of the smart contract that allows access to the execution contract.

[0058] In one example, if the execution contract of a scheduled task is generated only based on the execution interface of the scheduled task, the execution contract of the scheduled task may have the following format:

[0059]

[0060] Among them, Process is the execution contract of the scheduled task. The Process contract defines the execution interface doAction1 of the scheduled task. args is the parameter of the doAction1 execution interface, and "public returns (bool)" defines that the return value of the doAction1 execution interface is Boolean. "..." defines the specific execution process of the scheduled task.

[0061] In another example, if the execution contract of the scheduled task is generated based on the execution interface of the scheduled task, the identifier of the node where the scheduled task is required, the creation time of the execution contract, the status of the execution contract, and the authorized visitor information of the execution contract, the execution contract of the scheduled task may have the following format:

[0062]

[0063] Among them, Process is the execution contract of the scheduled task. The Process contract defines the execution function doAction1 of the scheduled task and also defines the following variables:

[0064] The address_owner variable is used to define the address of the node where the scheduled task is required;

[0065] uint64_createTime variable: used to define the creation time of the Process contract;

[0066] uint8_status variable, used to define the status of the Process contract;

[0067] The address[]_stakeHolders variable is used to define the addresses of smart contracts that are allowed to access the Process contract.

[0068] In order to ensure that only the address of the smart contract defined in the address[]_stakeHolders variable is allowed to access the Process contract, and to prevent other smart contracts from accessing the Process contract, a permission identification modifier can also be defined in the Process contract, as shown below:

[0069]

[0070] Among them, onlyStakeHolders is a permission identification modifier. The onlyStakeHolders modifier limits the access to the doAction1 execution interface to the address of the smart contract defined in the address[]_stakeHolders variable.

[0071] In one example, the execution contract of the scheduled task may also include a permission update interface, which is used to update the authorization information in the execution contract of the scheduled task. The update method may include adding one or more smart contract addresses to the authorization information, or deleting the original smart contract address in the authorization information, etc.

[0072] Among them, the permission update interface of the newly added smart contract address can be set as follows:

[0073] function addOwner(address owner)public returns(bool)onlyOwner{

[0074] ArrayUtils.put(_owners,owner);}

[0075] Among them, the addOwner permission update interface is used by the task publishing node or other authorized nodes to add the address of a new smart contract to the address_owner variable.

[0076] Step b: The task publishing node generates a contract deployment request based on the execution contract of the scheduled task, and sends the contract deployment request to the blockchain node to which the task publishing node is connected.

[0077] For ease of understanding, the process of deploying the execution contract of a scheduled task is described below by taking the task publishing node as the agent node 1012 as an example.

[0078] In a specific implementation, after receiving the execution contract of the scheduled task sent by the proxy node 1012, the blockchain node 101 can broadcast the execution contract of the scheduled task to other blockchain nodes in the blockchain network. In this way, each blockchain node in the blockchain network assigns a random contract address (such as 0X01) to the execution contract of the scheduled task through the consensus process. If the contract address consensus is successful, the blockchain node 101 can send the contract address 0X01 back to the proxy node 1012. In addition, in each blockchain node in the blockchain network, the execution contract of the scheduled task is stored at the contract address 0X01.

[0079] Step c: The task publishing node generates a task processing request based on the contract address corresponding to the execution contract of the scheduled task and the triggering condition of the scheduled task.

[0080] Among them, the trigger condition can be set by technical personnel in this field based on experience, or can also be set based on business needs, for example, it can be set as the execution period information of the scheduled task, or can be set as the execution block of the scheduled task, without limitation.

[0081] For example, the triggering condition of a scheduled task may be the earliest block height and the latest block height at which the scheduled task can be executed, or may be the earliest and latest timestamp at which the scheduled task can be executed, and so on.

[0082] In one example, if multiple interfaces (such as execution interface, permission authentication interface, permission update interface, etc.) are set in the execution contract of the scheduled task, the task publishing node can also generate a task processing request based on the contract address corresponding to the execution contract of the scheduled task, the identifier of the called contract interface, the contract interface parameters and the triggering conditions of the scheduled task.

[0083] In an embodiment of the present invention, a task update interface can also be set in the execution contract of the scheduled task. The task update interface can be used to update the published scheduled tasks. The update operations include advancing the trigger conditions or delaying the trigger conditions, canceling the scheduled tasks, modifying the execution interface of the scheduled tasks, etc.

[0084] Correspondingly, a corresponding authority node can also be set for the update interface. Only nodes with authority can modify the scheduled tasks based on the update interface. The authority node can be a blockchain node or a proxy node.

[0085] Moreover, if the execution contract of the scheduled task detects that the scheduled task has been modified, the execution contract of the scheduled task can also actively push the modification information to each blockchain node, so that each blockchain node can push it to each proxy node accordingly; accordingly, if the proxy node stores the log information corresponding to the scheduled task, the proxy node can modify the log information corresponding to the scheduled task according to the modification information.

[0086] Step 202: The task issuing node sends the task processing request of the scheduled task to the blockchain node connected to the task issuing node.

[0087] As a possible implementation method, a first smart contract can be deployed in the blockchain network. A creation log interface is set in the first smart contract. After the task publishing node generates a task processing request for a scheduled task, it can generate a call request based on the task processing request and the creation log interface of the first smart contract, and send the call request to the blockchain node to which the task publishing node is connected.

[0088] Correspondingly, if authorization information is set in the execution contract of the scheduled task, the task publisher node can also add the contract address of the first smart contract to the authorization information of the execution contract of the scheduled task (i.e., the address[]_stakeHolders variable), thereby ensuring that the blockchain node can call the execution contract of the scheduled task through the creation log interface of the first smart contract.

[0089] In an embodiment of the present invention, by limiting the authorization information in the execution contract of the scheduled task and authorizing the first smart contract in the authorization information, it is possible to limit the smart contract that accesses the execution contract of the scheduled task while ensuring that the first smart contract successfully accesses the execution contract of the scheduled task, thereby protecting the security of the execution contract.

[0090] In one example, the first smart contract (i.e., ScheduleTask shown below) may have the following format:

[0091] contract ScheduleTask{

[0092] event newScheduTask(address executeAddres, bytes32 methodName, stringparas, uint startBlockHeight, uint lastBlockHeight, address contractAddress);

[0093] / / Description: The newScheduTask interface is used to generate log information corresponding to a scheduled task; if the log information corresponding to a scheduled task is successfully generated in a blockchain node, each proxy node connected to the blockchain node can obtain the details of the scheduled task by monitoring and querying the log information;

[0094] modifier inTime(startBlockHeight,lastBlockHeight){

[0095] require(block.number>=startBlockHeight&&block.number<=

[0096] lastBlockHeight,"Only owner is authored");}

[0097] / / Description: The inTime modifier is used to limit the execution time of a scheduled task. The inTime modifier can determine whether the trigger conditions startBlockHeight and lastBlockHeight of the scheduled task are currently met. The inTime modifier allows the scheduled task to be executed only when the trigger conditions startBlockHeight and lastBlockHeight of the scheduled task are met.

[0098]

[0099] / / Description: The registerTask interface is used to obtain various parameters in the task processing request sent by the task publishing node, and based on the various parameters, the newScheduTask interface is called to generate the log information corresponding to the scheduled task;

[0100]

[0101] / / Description: The execute interface is the execution interface of the scheduled task. The task execution node can execute the scheduled task by calling the execute interface. After receiving the call request, the execute interface executes the scheduled task by internally calling the call interface process.doAction1(paras) in the execution contract of the scheduled task. At the same time, the inTime modifier defined in the smart contract ScheduleTask can ensure that the scheduled task is executed when the triggering conditions of the scheduled task are met, and the scheduled task is not executed when the triggering conditions of the scheduled task are not met.

[0102] In the specific implementation, after generating a task processing request, the task publishing node can first generate a call request based on the contract address executeAddres of the execution contract of the scheduled task in the task processing request, the identifier bytes32methodName of the called contract interface, the contract interface parameter string paras, the trigger conditions uint startBlockHeight and uint lastBlockHeight of the scheduled task, and the registerTask interface of the first smart contract ScheduleTask, and then send the call request to the blockchain node connected to the task publishing node.

[0103] As another possible implementation method, multiple smart contracts can also be deployed in the blockchain network. Each smart contract is provided with a creation log interface. After the task publishing node generates a task processing request for a scheduled task, it can first determine the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task in the task processing request, and then generate a call request according to the task processing request and the creation log interface of the smart contract corresponding to the scheduled task, and send the call request to the blockchain node connected to the task publishing node.

[0104] Among them, each smart contract is set with a corresponding trigger condition. The smart contract can only call the execution contract of the scheduled task of the corresponding trigger condition. The correspondence between the smart contract and the trigger condition can be set by technical personnel in this field based on experience, or it can be set according to business needs without limitation.

[0105] For example, in one possible correspondence, a corresponding smart contract can be deployed every N blocks, and the smart contract can be used to call the execution contract of the scheduled task whose trigger condition belongs to N blocks. For example, smart contract 1 is deployed for blocks 1 to 5, and smart contract 2 is deployed for blocks 6 to 10. If the trigger condition of the scheduled task is to execute the scheduled task on the data on the 7th block, the smart contract corresponding to the scheduled task is smart contract 2; in another possible correspondence, T smart contracts can be deployed, and each block can be divided into T smart contracts according to the remainder modulo T of the block height. For example, there are blocks 1 to 10 and smart contracts 1 to smart contracts 3, then blocks 1 to 3 and block 10 correspond to smart contract 1, blocks 4 to 6 correspond to smart contract 2, and blocks 7 to 9 correspond to smart contract 3; in other possible correspondences, the smart contract corresponding to each scheduled task can also be determined according to the execution time, the identifier of the blockchain node, and the type of the scheduled task. The determination method can be set with reference to the block height, which will not be repeated.

[0106] Step 203: The blockchain node generates log information corresponding to the scheduled task in the blockchain node according to the task processing request of the scheduled task.

[0107] In the specific implementation, when the blockchain node receives the call request sent by the task publishing node, it can call the registerTask interface of the first smart contract ScheduleTask according to the call request. After the registerTask interface is called, the newScheduTask interface of the first smart contract ScheduleTask will be called internally, thereby generating the log information corresponding to the scheduled task on the blockchain node. Among them, the log information corresponding to the scheduled task can include detailed information of the scheduled task, such as the contract address of the execution contract of the scheduled task, the triggering condition of the scheduled task, the called interface identifier, interface parameters, etc.

[0108] In an embodiment of the present invention, when a blockchain node receives a call request, it can first synchronize the call request to other blockchain nodes in the blockchain network, and then create log information corresponding to the scheduled task in the blockchain node according to the call request. It can also first create log information corresponding to the scheduled task in the blockchain node according to the call request, and then synchronize the call request to other blockchain nodes in the blockchain network, without specific limitation.

[0109] It should be noted that after receiving a call request, each blockchain node in the blockchain network can create log information corresponding to the scheduled task in the blockchain node according to the call request.

[0110] Step 204: After the task execution node detects that log information corresponding to the scheduled task is generated in the blockchain node encapsulated by the task execution node, it obtains the log information of the scheduled task.

[0111] In the specific implementation, for each proxy node encapsulated on each blockchain node, the proxy node can monitor whether the log information corresponding to the scheduled task is generated on the blockchain node in a variety of ways. For example, the proxy node can poll to obtain the latest block height on the blockchain node. When it is determined that the latest block height has changed, it can query whether there is newly generated log information from the blockchain node; or, the proxy node can also subscribe to the log information on the blockchain node through the event subscription function in the SDK component. When a new log information is generated on the blockchain node, the proxy node will receive the message notification sent by the SDK component. In this way, the proxy node can obtain the newly generated log information from the blockchain node each time it receives a message notification.

[0112] In an embodiment of the present invention, before obtaining the log information corresponding to the scheduled task, the proxy node can also determine whether it meets the execution conditions of the scheduled task, such as whether the type of the scheduled task matches the type of task that the proxy node can execute. If not, the proxy node may not process the scheduled task; if matched, the proxy node can act as a task execution node, and can add the log information corresponding to the scheduled task to the task processing queue of the proxy node, and execute each task in the task processing queue in turn.

[0113] Step 205: The task execution node determines the triggering condition of the scheduled task according to the log information of the scheduled task, and executes the scheduled task when the triggering condition of the scheduled task is met, and obtains the execution result of the scheduled task by the task execution node.

[0114] The following takes the smart contract ScheduleTask as an example to describe the specific implementation process of any task execution node executing a scheduled task.

[0115] In one example, after obtaining the log information corresponding to the scheduled task, the task execution node can poll and call the execute interface of the smart contract ScheduleTask. For each call, the execute interface will internally call the calling interface process.doAction1(paras) in the execution contract of the scheduled task to execute the scheduled task. At the same time, the inTime modifier of the smart contract ScheduleTask will detect whether the current time or the current block meets the triggering condition of the scheduled task. If so, the execute interface can be allowed to successfully call the calling interface process.doAction1(paras) in the execution contract of the scheduled task, thereby realizing the execution of the scheduled task when the triggering condition of the scheduled task is met. If not, the execute interface is not allowed to call the calling interface process.doAction1(paras) in the execution contract of the scheduled task, thereby realizing the refusal to execute the scheduled task when the triggering condition of the scheduled task is not met.

[0116] In the embodiment of the present invention, by setting the inTime modifier, it can be ensured that the scheduled task is executed under the set trigger conditions, and will not be executed in advance or timed out, thereby ensuring the accuracy of the execution of the scheduled task; and each proxy node that meets the execution conditions in the blockchain network can obtain and execute the scheduled task. Compared with the prior art method of only distributing the scheduled task to the corresponding node to execute the scheduled task, the flexibility of the scheduled task execution can be improved.

[0117] As a possible implementation method, in order to improve the enthusiasm of each task execution node, the task publishing node can also set the incentive rules corresponding to the scheduled task. The incentive rules corresponding to the scheduled task can be set in the execute interface of the smart contract ScheduleTask. The incentive rules corresponding to the scheduled task can be set by technical personnel in this field based on experience. For example, multiple different incentive values ​​can be set, and after each task execution node completes the scheduled task, the multiple different incentive values ​​are distributed to the multiple task execution nodes that have completed the execution first in the order of execution. Alternatively, only one incentive value can be set and distributed to the task execution node that has completed the execution first, etc. By setting the incentive rules, each proxy node in the blockchain network has the motivation to execute the scheduled task, so that the scheduled task can be executed by multiple proxy nodes, ensuring the redundancy of the nodes that execute the scheduled task, and ensuring that the scheduled task can be completed within the set time window.

[0118] Accordingly, the embodiments of the present invention may also set up an assessment mechanism for each blockchain node. For example, the assessment score of each blockchain node may be determined based on the execution of scheduled tasks by the proxy node encapsulated on each blockchain node within a set period of time, and rewards or punishments may be given based on the assessment scores of each blockchain node.

[0119] Step 206: The task execution node sends the execution result of the scheduled task by the task execution node to the blockchain node encapsulated by the task execution node.

[0120] In step 207, each blockchain node in the blockchain network reaches a consensus on the execution result of the scheduled task by each task execution node to obtain the execution result of the scheduled task.

[0121] Step 208, the blockchain node connected to the task issuing node sends the execution result of the scheduled task to the task issuing node.

[0122] In the above embodiment of the present invention, the task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task, sends the task processing request for the scheduled task to the blockchain node connected to the task issuing node, and receives the execution result of the scheduled task sent by the blockchain node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network. In the embodiment of the present invention, by encapsulating the task issuing node and the task execution node on the blockchain node, issuing the scheduled task based on the task issuing node, and executing the scheduled task based on the task execution node, the issuing and executing processes of the scheduled task are both executed on an external node independent of the blockchain network, so that the processing of the scheduled task will not affect the execution of the tasks within the blockchain node, and at the same time, by decoupling the scheduled task from the tasks within the blockchain node, task blocking can also be avoided, thereby improving the execution efficiency of the tasks within the blockchain node.

[0123] In view of the above method flow, an embodiment of the present invention also provides a task processing device based on a blockchain network, and the specific content of the device can be implemented with reference to the above method.

[0124] Figure 3 A schematic diagram of a task processing device based on a blockchain network provided in an embodiment of the present invention, the device comprising:

[0125] A generating module 301, configured to generate a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task;

[0126] The transceiver module 302 is used to send the task processing request of the scheduled task to the blockchain node connected to the task issuing node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network;

[0127] The transceiver module 302 is also used to receive the execution result of the scheduled task sent by the blockchain node.

[0128] Optionally, the generating module 301 is further used to: generate an execution contract of the scheduled task according to the scheduled task;

[0129] The transceiver module 302 is also used to: send the execution contract of the scheduled task to the blockchain node, and the blockchain node is also used to deploy the execution contract of the scheduled task in the blockchain network, and obtain the contract address of the execution contract of the scheduled task; and receive the contract address of the execution contract of the scheduled task sent by the blockchain node;

[0130] The generation module 301 is also used to generate a task processing request for the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0131] Optionally, the transceiver module 302 is specifically used for:

[0132] Determine the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task; the smart contract corresponding to the scheduled task is deployed in each blockchain node of the blockchain network;

[0133] According to the task processing request of the scheduled task, the first interface of the smart contract corresponding to the scheduled task is called to generate log information corresponding to the scheduled task in the blockchain node; the log information corresponding to the scheduled task is used for each task execution node encapsulated in the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

[0134] Optionally, the execution contract of the scheduled task includes authorization information, and the authorization information is the contract address of each smart contract that is allowed to access the execution contract of the scheduled task;

[0135] Before the transceiver module 302 calls the first interface of the smart contract corresponding to the scheduled task, it is also used to:

[0136] Determine that the contract address of the smart contract corresponding to the scheduled task is located in the authorization information.

[0137] Figure 4 A schematic diagram of the structure of another task processing device based on a blockchain network provided in an embodiment of the present invention, the device includes:

[0138] The acquisition module 401 is used to acquire the log information of the scheduled task after detecting that the log information corresponding to the scheduled task is generated in the blockchain node encapsulated by the task execution node;

[0139] The processing module 402 is used to determine the triggering condition of the scheduled task according to the log information of the scheduled task, and execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task by the task execution node; the execution result of the scheduled task by the task execution node is used for the consensus of the blockchain node and other blockchain nodes in the blockchain network to obtain the execution result of the scheduled task.

[0140] Optionally, the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task;

[0141] The processing module 402 is specifically used for:

[0142] The second interface of the smart contract corresponding to the scheduled task is called according to the log information of the scheduled task. The second interface is used to call the contract interface of the execution contract of the scheduled task to execute the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, and the contract parameters when the triggering condition of the scheduled task is met.

[0143] It can be seen from the above content that: in the above embodiment of the present invention, the task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task, sends the task processing request for the scheduled task to the blockchain node connected to the task issuing node, and receives the execution result of the scheduled task sent by the blockchain node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network. In the embodiment of the present invention, by encapsulating the task issuing node and the task execution node on the blockchain node, issuing the scheduled task based on the task issuing node, and executing the scheduled task based on the task execution node, the issuing and executing processes of the scheduled task are both executed on an external node independent of the blockchain network, so that the processing of the scheduled task will not affect the execution of the in-chain tasks of the blockchain node. At the same time, by decoupling the scheduled task from the in-chain tasks of the blockchain node, task blocking can also be avoided, thereby improving the execution efficiency of the in-chain tasks of the blockchain node.

[0144] Based on the same inventive concept, an embodiment of the present invention further provides a computing device, such as Figure 5 As shown, it includes at least one processor 501 and a memory 502 connected to the at least one processor. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present invention. Figure 5 For example, the processor 501 and the memory 502 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0145] In an embodiment of the present invention, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the steps included in the aforementioned task processing method based on the blockchain network by executing the instructions stored in the memory 502.

[0146] Among them, the processor 501 is the control center of the computing device, and can use various interfaces and lines to connect various parts of the computing device, and realize data processing by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes instructions issued by operation and maintenance personnel. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0147] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of task processing based on a blockchain network may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0148] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present invention can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0149] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program executable by a computing device. When the program is executed on the computing device, the processor executes the above Figure 2 Any of the task processing methods based on blockchain network.

[0150] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0151] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0152] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0154] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0155] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A task processing method based on a blockchain network, characterized in that: The method comprises: The task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task; The task issuing node sends the task processing request of the scheduled task to the blockchain node connected to the task issuing node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network; The task issuing node receives the execution result of the scheduled task sent by the blockchain node; The task publishing node is an agent node for publishing scheduled tasks, and the task execution node is an agent node for executing tasks published by the task publishing node; The proxy node is a software tool development kit component deployed in the blockchain node, or a device independent of the blockchain node, which communicates with the blockchain node through a remote procedure call protocol; the application running on the proxy node is independent of the application running on the blockchain node, the application running on the blockchain node is used to participate in transaction execution and consensus in the blockchain network, and the application running on the proxy node is used to publish scheduled tasks or execute scheduled tasks.

2. The method according to claim 1, characterized in that The task issuing node generates a task processing request for the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task, including: The task issuing node generates an execution contract of the scheduled task according to the scheduled task; The task publishing node sends the execution contract of the scheduled task to the blockchain node, and the blockchain node is also used to deploy the execution contract of the scheduled task in the blockchain network to obtain the contract address of the execution contract of the scheduled task; The task issuing node receives the contract address of the execution contract of the scheduled task sent by the blockchain node; The task publishing node generates a task processing request for the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

3. The method according to claim 2, characterized in that The task issuing node sends the task processing request of the scheduled task to the blockchain node connected to the task issuing node, including: The task issuing node determines the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task; the smart contract corresponding to the scheduled task is deployed in each blockchain node of the blockchain network; The task publishing node calls the first interface of the smart contract corresponding to the scheduled task according to the task processing request of the scheduled task, so as to generate log information corresponding to the scheduled task in the blockchain node; the log information corresponding to the scheduled task is used for each task execution node encapsulated in the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

4. The method according to claim 3, characterized in that The execution contract of the scheduled task includes authorization information, and the authorization information is the contract address of each smart contract that is allowed to access the execution contract of the scheduled task; Before the task publishing node calls the first interface of the smart contract corresponding to the scheduled task, it also includes: Determine that the contract address of the smart contract corresponding to the scheduled task is located in the authorization information.

5. A task processing method based on a blockchain network, characterized in that: The method comprises: After the task execution node detects that log information corresponding to the scheduled task is generated in the blockchain node encapsulated by the task execution node, the task execution node obtains the log information of the scheduled task; The task execution node determines the triggering condition of the scheduled task according to the log information of the scheduled task, and executes the scheduled task when the triggering condition of the scheduled task is met, and obtains the execution result of the scheduled task by the task execution node; the execution result of the scheduled task by the task execution node is used for the consensus of the blockchain node and other blockchain nodes in the blockchain network to obtain the execution result of the scheduled task; The task publishing node is an agent node for publishing scheduled tasks, and the task execution node is an agent node for executing tasks published by the task publishing node; The proxy node is a software tool development kit component deployed in the blockchain node, or a device independent of the blockchain node, which communicates with the blockchain node through a remote procedure call protocol; the application running on the proxy node is independent of the application running on the blockchain node, the application running on the blockchain node is used to participate in transaction execution and consensus in the blockchain network, and the application running on the proxy node is used to publish scheduled tasks or execute scheduled tasks.

6. The method according to claim 5, characterized in that The log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task; The task execution node determines the triggering condition of the scheduled task according to the log information of the scheduled task, and executes the scheduled task when the triggering condition of the scheduled task is met, including: The task execution node calls the second interface of the smart contract corresponding to the scheduled task according to the log information of the scheduled task. The second interface is used to call the contract interface of the execution contract of the scheduled task to execute the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, and the contract parameters when the triggering condition of the scheduled task is met.

7. A task processing device based on a blockchain network, characterized in that: The device comprises: A generating module, used for generating a task processing request of the scheduled task according to the scheduled task to be processed and the triggering condition of the scheduled task; A transceiver module is used to send the task processing request of the scheduled task to the blockchain node connected to the task publishing node; the blockchain node is used to call each task execution node encapsulated by the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task through consensus with other blockchain nodes in the blockchain network; The transceiver module is further used to receive the execution result of the scheduled task sent by the blockchain node; The task publishing node is an agent node for publishing scheduled tasks, and the task execution node is an agent node for executing tasks published by the task publishing node; The proxy node is a software tool development kit component deployed in the blockchain node, or a device independent of the blockchain node, which communicates with the blockchain node through a remote procedure call protocol; the application running on the proxy node is independent of the application running on the blockchain node, the application running on the blockchain node is used to participate in transaction execution and consensus in the blockchain network, and the application running on the proxy node is used to publish scheduled tasks or execute scheduled tasks.

8. The device according to claim 7, characterized in that The generating module is further used to: generate an execution contract of the scheduled task according to the scheduled task; The transceiver module is further used to: send the execution contract of the scheduled task to the blockchain node, and the blockchain node is further used to deploy the execution contract of the scheduled task in the blockchain network, and obtain the contract address of the execution contract of the scheduled task; and receive the contract address of the execution contract of the scheduled task sent by the blockchain node; The generation module is also used to generate a task processing request for the scheduled task based on the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

9. The device according to claim 7, characterized in that The transceiver module is specifically used for: Determine the smart contract corresponding to the scheduled task according to the triggering condition of the scheduled task; the smart contract corresponding to the scheduled task is deployed in each blockchain node of the blockchain network; According to the task processing request of the scheduled task, the first interface of the smart contract corresponding to the scheduled task is called to generate log information corresponding to the scheduled task in the blockchain node; the log information corresponding to the scheduled task is used for each task execution node encapsulated in the blockchain node to execute the scheduled task when the triggering condition of the scheduled task is met, and the log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task.

10. The device according to claim 9, characterized in that The execution contract of the scheduled task includes authorization information, and the authorization information is the contract address of each smart contract that is allowed to access the execution contract of the scheduled task; Before the transceiver module calls the first interface of the smart contract corresponding to the scheduled task, it is also used to: Determine that the contract address of the smart contract corresponding to the scheduled task is located in the authorization information.

11. A task processing device based on a blockchain network, characterized in that: The device comprises: An acquisition module is used to acquire the log information of the scheduled task after detecting that the log information corresponding to the scheduled task is generated in the blockchain node encapsulated by the task execution node; A processing module, used to determine the triggering condition of the scheduled task according to the log information of the scheduled task, and execute the scheduled task when the triggering condition of the scheduled task is met, and obtain the execution result of the scheduled task by the task execution node; the execution result of the scheduled task by the task execution node is used for the consensus of the blockchain node and other blockchain nodes in the blockchain network to obtain the execution result of the scheduled task; The task publishing node is an agent node for publishing scheduled tasks, and the task execution node is an agent node for executing tasks published by the task publishing node; The proxy node is a software tool development kit component deployed in the blockchain node, or a device independent of the blockchain node, which communicates with the blockchain node through a remote procedure call protocol; the application running on the proxy node is independent of the application running on the blockchain node, the application running on the blockchain node is used to participate in transaction execution and consensus in the blockchain network, and the application running on the proxy node is used to publish scheduled tasks or execute scheduled tasks.

12. The device according to claim 11, characterized in that The log information corresponding to the scheduled task includes the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, the contract parameters and the triggering condition of the scheduled task; The processing module is specifically used for: The second interface of the smart contract corresponding to the scheduled task is called according to the log information of the scheduled task. The second interface is used to call the contract interface of the execution contract of the scheduled task to execute the scheduled task according to the contract address of the execution contract of the scheduled task, the contract interface required to be called by the scheduled task, and the contract parameters when the triggering condition of the scheduled task is met.

13. A computing device, characterized in that: The method comprises at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the method of any one of claims 1 to 4 or 5 and 6.

14. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computing device. When the program is run on the computing device, the computing device executes the method of any one of claims 1 to 4 or 5 and 6.

Citation Information

Patent Citations

  • Public invitation task processing method, system and device and storage medium

    CN109583857A

  • Task cooperation method based on an intelligent contract

    CN109658064A