Methods, apparatus, storage media, and electronic devices for executing blockchain tasks

By introducing start and end times for tasks into the blockchain task system, the execution of tasks is automatically controlled, solving the problem of autonomous iterative tasks being unable to terminate, and improving the resource utilization and security of the blockchain network.

CN114356523BActive Publication Date: 2026-03-06ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, blockchain task systems cannot stop autonomously iterating tasks, resulting in tasks being unable to terminate.

Method used

By including the start and end times of the task in the target block, the task execution node executes the task when the start time arrives and ends the task when the end time arrives, thus automatically stopping the iterative task.

Benefits of technology

It enables the automatic termination of autonomous iterative tasks in the blockchain network, solving the problem of being unable to stop iterative tasks and improving the resource utilization efficiency and security of the blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356523B_ABST
    Figure CN114356523B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, storage medium, and electronic device for executing blockchain tasks. The method includes: receiving a target block published by a task publishing node in a target blockchain task system, wherein the target block includes a task description of the target task, a start time, and an end time; executing the target task according to the task execution method included in the task description when the start time arrives, and ending the execution of the target task when the end time arrives. This invention solves the problem in related technologies where it is impossible to stop autonomous iterative tasks, achieving the effect of proactively and securely stopping iterative tasks running in the blockchain network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of blockchain, and more specifically, to a method, apparatus, storage medium, and electronic device for executing blockchain tasks. Background Technology

[0002] In related technologies, blockchain-based task systems can only execute one-time tasks and cannot run autonomous iterative tasks. This is because iterative tasks would run indefinitely within the blockchain system.

[0003] This indicates that the relevant technologies suffer from the problem of being unable to stop the autonomous iterative task.

[0004] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention

[0005] This invention provides a method, apparatus, storage medium, and electronic device for executing blockchain tasks, to at least solve the problem of the inability to stop autonomous iterative tasks in related technologies.

[0006] According to an embodiment of the present invention, a method for executing a blockchain task is provided, comprising: receiving a target block published by a task publishing node included in a target blockchain task system, wherein the target block includes a task description of the target task, and a start execution time and an end execution time of the target task; executing the target task according to the task execution method included in the task description when the start execution time arrives, and ending the execution of the target task when the end execution time arrives.

[0007] According to another embodiment of the present invention, a blockchain task execution device is provided, comprising: a receiving module, configured to receive a target block published by a task publishing node included in a target blockchain task system, wherein the target block includes a task description of the target task, and a start execution time and an end execution time of the target task; and an execution module, configured to execute the target task according to the task execution method included in the task description when the start execution time arrives, and to terminate the execution of the target task when the end execution time arrives.

[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0009] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0010] This invention receives target blocks published by task publishing nodes within a target blockchain task system. Each target block includes a task description, a start time, and an end time. Upon the start time, the target task is executed according to the execution method specified in the task description. Upon the end time, the task is terminated. Because the start and end times are indicated in the target block, the task can be terminated automatically upon the end time, thus achieving automatic termination of the autonomous iterative task. Therefore, this invention solves the problem of being unable to stop autonomous iterative tasks in related technologies, achieving the effect of proactively and securely stopping iterative tasks running in the blockchain network. Attached Figure Description

[0011] Figure 1 This is a hardware structure block diagram of a mobile terminal for executing a blockchain task according to an embodiment of the present invention.

[0012] Figure 2 This is a flowchart of a blockchain task execution method according to an embodiment of the present invention;

[0013] Figure 3 This is a schematic diagram of the structure of the target blockchain task system according to an exemplary embodiment of the present invention;

[0014] Figure 4 This is a flowchart of a blockchain task execution method according to a specific embodiment of the present invention;

[0015] Figure 5 This is a structural block diagram of a blockchain task execution device according to an embodiment of the present invention. Detailed Implementation

[0016] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.

[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0018] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1This is a hardware structure block diagram of a mobile terminal for executing a blockchain task according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0019] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the blockchain task execution method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0020] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0021] This embodiment provides a method for executing blockchain tasks. Figure 2 This is a flowchart of a blockchain task execution method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0022] Step S202: Receive the target block published by the task publishing node included in the target blockchain task system, wherein the target block includes a task description of the target task, as well as the start time and end time of the target task;

[0023] Step S204: When the start execution time arrives, execute the target task according to the task execution method included in the task description, and when the end execution time arrives, terminate the execution of the target task.

[0024] In the above embodiments, the target blockchain task system may include multiple task publishing nodes and multiple task execution nodes. The task publishing nodes can publish target blocks in the target blockchain task system to instruct the task execution nodes to execute the target tasks in the target blocks according to their own resource availability. The target tasks can be autonomous iterative tasks or other types of tasks.

[0025] In the above embodiments, when the task publishing node publishes the target block for the first time, the target block is a genesis block; that is, initially, the task publishing node publishes a genesis block to the network. After the target task executes for one task time cycle, the target block can be updated to include the latest target block containing the task execution results. The target block may include: the digest value of the task public key, the task ID, the task start time, the task end time, the single task iteration execution cycle time, the task priority, the task description (task priority, task execution method description, execution result qualification standard description, execution result quality judgment standard description), and the private key signature of the above information. After receiving the target block, the task execution node can execute the target task according to the task execution method (i.e., the task execution method description) included in the task description when the start execution time included in the target block arrives. Before the end execution time arrives, the target task can be repeatedly executed according to the single task iteration execution cycle time. When the end execution time arrives, the target task is received and executed. The "task start time" and "task end time" contained in the target block ensure that there are no permanent tasks. Even if some task execution nodes leave the blockchain network, they can still stop executing their tasks at a future time based on the "task end time," thereby freeing up resources. This enables iterative tasks running in network silos to be gradually stopped.

[0026] Optionally, the entity performing the above steps can be a task execution node, but is not limited to this.

[0027] This invention receives target blocks published by task publishing nodes within a target blockchain task system. Each target block includes a task description, a start time, and an end time. Upon the start time, the target task is executed according to the execution method specified in the task description. Upon the end time, the task is terminated. Because the start and end times are indicated in the target block, the task can be terminated automatically upon the end time, thus achieving automatic termination of the autonomous iterative task. Therefore, this invention solves the problem of being unable to stop autonomous iterative tasks in related technologies, achieving the effect of proactively and securely stopping iterative tasks running in the blockchain network.

[0028] In an exemplary embodiment, receiving a target block published by a task publishing node included in the target blockchain task system includes at least one of the following: receiving one target block published by one task publishing node included in the target blockchain task system; receiving multiple target blocks published by one task publishing node included in the target blockchain task system; or receiving multiple target blocks published by multiple task publishing nodes included in the target blockchain task system. In this embodiment, a schematic diagram of the target blockchain task system can be found in the appendix. Figure 3 ,like Figure 3 As shown, the entire task system contains two types of nodes: task publishing nodes and task execution nodes. These nodes are connected in a network, forming the basic network of the blockchain. Each task publishing node contains a pair of asymmetric public and private keys, with the public key pre-installed in the corresponding task execution node. The private key is stored in the task publishing node. Subsequent information published by the task publishing node will be signed and encrypted using its private key. Only the task execution node with the corresponding public key can verify the signature, decrypt it, and execute the corresponding task. This ensures the security of task execution. A task publishing node can connect to multiple task execution nodes; that is, a task publishing node can publish target blocks to multiple task execution nodes, and a task publishing node can also publish multiple target blocks. A task execution node can also connect to multiple task publishing nodes; that is, a task execution node can simultaneously execute the target tasks indicated in multiple target blocks published by multiple task publishing nodes. These multiple target blocks can be blocks of different types and priorities. This enables the dynamic simultaneous execution of multiple types and priorities of tasks within the blockchain network, maximizing the utilization of all network resources.

[0029] In the above embodiments, after a task execution node executes the target task and obtains the target result, it can determine whether the result meets the standard based on the "execution result qualification standard description" in the target block. If the execution result meets the standard, it is made into a new block and published to the blockchain network. When other task execution nodes in the blockchain network receive the result block of the target task, they find the optimal result based on the "execution result quality judgment standard description" in the target block and acknowledge this optimal result. This completes the consensus mechanism for task results.

[0030] In the above embodiments, the task issuing node can view the execution result of the target task at any time; that is, the task issuing node can access the blockchain network at any time and obtain the complete blockchain of the corresponding task. The sequential blocks on the chain are the results of the target task being executed iteratively in chronological order.

[0031] In an exemplary embodiment, executing the target task according to the task execution method included in the task description includes: determining the start execution time and the end execution time of each target task; executing the target tasks sequentially according to the start execution time order, when the start execution time is reached, according to the task execution method included in the task description; and sequentially ending the execution of the target tasks sequentially according to the end execution time order, when the end execution time is reached. In this embodiment, after the task execution node receives the target block, the start execution time and the end execution time of each target block can be determined. The target tasks are executed sequentially according to the start execution time order, when the start execution time is reached, according to the task execution method included in the task description; and sequentially ending the execution of the target tasks sequentially according to the end execution time order, when the end execution time is reached.

[0032] In the above embodiments, when executing a target task, the priority of the target task can also be determined according to the target block. When the resources of the task execution node are not sufficient to execute multiple target tasks at the same time, the task with the higher priority can be executed according to the priority of the task.

[0033] In an exemplary embodiment, the method further includes: receiving a task destruction block published by the task publishing node, wherein the task destruction block is used to indicate the cessation of execution of the task to be destroyed corresponding to the task identifier information included in the task destruction block; verifying the legality of the task destruction block to obtain a first verification result; and stopping the execution of the task to be destroyed if the first verification result indicates that the task destruction block is legal. In this embodiment, the task publishing node can also publish a task destruction block. When the task publishing node believes that the task does not need to be executed, it can publish the task destruction block to the blockchain network. The destruction block may include: a digest value of the task public key, a task ID, a task destruction description, and a private key signature of the above information. When a task execution node receives the target destruction block for the corresponding task, it verifies the validity of the destruction block using its own stored public key. Then, it will no longer execute all tasks under this task ID and delete all information of this task stored by this node. The task publishing node can gradually stop the execution of tasks across all execution nodes in the entire blockchain network by publishing task destruction blocks.

[0034] In the above embodiments, the task publishing node can publish the target block that needs to continue execution, as well as the task destruction block to be destroyed. This means that the task node can autonomously choose the task function to be executed, and the task publishing node can maintain the task, enabling the entire blockchain network to execute multiple tasks simultaneously. Furthermore, this can be dynamically adjusted according to priority, thereby improving the overall efficiency of the blockchain network.

[0035] In one exemplary embodiment, after receiving the task destruction block published by the task publishing node, the method further includes: sending the task destruction block non-repeatingly to other execution nodes to instruct the other execution nodes to stop executing the task to be destroyed based on the task destruction block. In this embodiment, after receiving the task destruction block, the task execution node can send this task destruction block non-repeatingly to surrounding task execution nodes. This continues until all task execution nodes in the entire blockchain network have stopped executing the task to be destroyed and deleted all information about the task to be destroyed. At this point, the task to be destroyed ends in the entire blockchain.

[0036] In an exemplary embodiment, receiving the target block published by the task publishing node in the target blockchain task system includes: receiving the latest target block corresponding to the target task sent by the task publishing node at predetermined time intervals. In this embodiment, the task execution node has the right to choose whether to execute the corresponding task. When the corresponding task is not executed, the information of the target task on this node will be cleared. To prevent all task execution nodes in the entire blockchain network from clearing all information of the target task, thus making the target task unexecutable, the task publishing node can send the latest block of the target task to the blockchain network at intervals of several task execution cycles to keep the target task from disappearing in the entire blockchain network. When the task execution node finishes processing other tasks, or while executing other tasks, it can choose to execute the target task.

[0037] In the above embodiments, after the target task is executed within a single task iteration execution cycle, an execution result can be obtained. The target block can then be updated based on the execution result to obtain the latest target block corresponding to the target task. In the next single task iteration execution cycle, after obtaining the execution result again, the target block will continue to be updated to obtain the latest target block.

[0038] In an exemplary embodiment, executing the target task according to the task execution method included in the task description includes: verifying the first identification information of the task public key included in the target block; verifying the legality of the target block and obtaining a second verification result if the first identification information matches the pre-stored second identification information; determining the current remaining resources and the resource consumption required to execute the target task if the second verification result indicates that the target block is legal; and executing the target task according to the task execution method included in the task description if the current remaining resources are greater than or equal to the resource consumption. In this embodiment, after receiving the target block, the task execution node can determine the task public key digest value stored in the target block, i.e., the first identification information, and compare it with its own stored public key (i.e., the second identification information). If they match, it indicates that it has the right to execute the target block, and then verifies and decrypts the target block to ensure its legality; otherwise, the target task is not executed. Based on the "task description" in the target block and combined with the resource status of its own node, it determines whether to execute the task. If execution is performed, it is determined that the latest block is not a task destruction block. Next, the content of the target block is parsed to obtain its "task start time" and "task end time". If the current time is determined to be within its task execution time, the task is executed according to the "task execution method description" in the genesis block.

[0039] The execution method of blockchain tasks will be explained below with reference to specific implementation methods:

[0040] Figure 4Figure 4 shows a flowchart of a blockchain task execution method according to a specific embodiment of the present invention. The process includes:

[0041] Step S402: The task publishing node publishes the task (genesis block, corresponding to the target block mentioned above).

[0042] In step S404, the task execution node receives the blockchain and verifies its own right to execute the task based on its public key.

[0043] Step S406: Determine whether the task execution node should execute the task based on its own situation and task priority. If the determination result is yes, proceed to step S408; if the determination result is no, proceed to step S412.

[0044] In step S408, the task execution node determines whether the latest block is a task-destroyed block. If the determination result is yes, proceed to step S412; if the determination result is no, proceed to step S410.

[0045] Step S410: The task execution node determines whether the task end time has been reached. If the result is yes, proceed to step S412; if the result is no, proceed to step S414.

[0046] Step S412: Clear the stored information related to this task and prepare to receive new tasks.

[0047] Step S414: Complete one iteration of the task within the task cycle time, create a new block from the result, and publish it on the network.

[0048] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0049] This embodiment also provides a blockchain task execution device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0050] Figure 5 Figure 5 is a structural block diagram of a blockchain task execution device according to an embodiment of the present invention. The device includes:

[0051] The receiving module 52 is used to receive a target block published by a task publishing node included in the target blockchain task system, wherein the target block includes a task description of the target task, as well as the start time and end time of the target task;

[0052] The execution module 54 is configured to execute the target task according to the task execution method included in the task description when the start execution time arrives, and to terminate the execution of the target task when the end execution time arrives.

[0053] In an exemplary embodiment, the receiving module 52 may receive a target block published by a task publishing node included in the target blockchain task system through at least one of the following: receiving one target block published by a task publishing node included in the target blockchain task system; receiving multiple target blocks published by a task publishing node included in the target blockchain task system; or receiving multiple target blocks published by multiple task publishing nodes included in the target blockchain task system.

[0054] In an exemplary embodiment, the execution module 54 may execute the target task according to the task execution method included in the task description in the following manner: determining the start execution time and the end execution time of each target task; executing the target task in the order of the start execution time of each target task, in accordance with the task execution method included in the task description when the start execution time is reached, and ending the execution of the target task in the order of the end execution time of each target task when the end execution time is reached.

[0055] In an exemplary embodiment, the apparatus may be configured to receive a task destruction block published by the task publishing node, wherein the task destruction block is used to indicate the cessation of execution of the task to be destroyed corresponding to the task identification information included in the task destruction block; verify the legality of the task destruction block to obtain a first verification result; and stop the execution of the task to be destroyed if the first verification result indicates that the task destruction block is legal.

[0056] In an exemplary embodiment, the apparatus may be configured to, after receiving a task destruction block published by the task publishing node, send the task destruction block non-repeatingly to other execution nodes, so as to instruct the other execution nodes to stop executing the task to be destroyed based on the task destruction block.

[0057] In an exemplary embodiment, the receiving module 52 can receive the target block published by the task publishing node included in the target blockchain task system in the following manner: receiving the latest target block corresponding to the target task sent by the task publishing node at a predetermined time interval.

[0058] In an exemplary embodiment, the execution module 54 may execute the target task according to the task execution method included in the task description in the following manner: verifying the first identification information of the task public key included in the target block; verifying the legality of the target block and obtaining a second verification result if the first identification information matches the pre-stored second identification information; determining the current remaining resources and the resource consumption required to execute the target task if the second verification result indicates that the target block is legal; and executing the target task according to the task execution method included in the task description if the current remaining resources are greater than or equal to the resource consumption.

[0059] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0060] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0061] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0062] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0063] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0064] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0065] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0066] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for executing a blockchain task, characterized in that, The method comprises: receiving a target block published by a task publishing node included in a target blockchain task system, wherein the target block includes a task description of a target task, a start execution time of the target task, and an end execution time of the target task, the target block includes a single task iteration execution period time, the task description includes a task priority, an execution result qualification standard description, and an execution result merit judgment standard description, the task priority is used to determine whether to execute the target task, the execution result qualification standard description is used to determine whether a target result obtained by executing the target task is standard, and the execution result merit judgment standard description is used to determine an optimal result included in a result block of the target task generated based on the target result; when the start execution time is reached, executing the target task according to a task execution mode included in the task description, repeatedly executing the target task according to the single task iteration execution period time before the end execution time is reached, and ending execution of the target task when the end execution time is reached; The method further comprises: receiving a task destruction block published by the task publishing node, wherein the task destruction block is used to instruct to stop executing a to-be-destroyed task corresponding to task identification information included in the task destruction block, and the task destruction block includes a digest value of a public key of the to-be-destroyed task and a to-be-destroyed task ID; After receiving the task destruction block published by the task publishing node, the method further comprises: non-repetitively sending the task destruction block to other execution nodes to instruct the other execution nodes to stop executing the to-be-destroyed task based on the task destruction block, wherein the target blockchain task system includes a plurality of task publishing nodes and a plurality of task execution nodes, and the other execution nodes are also used to non-repetitively send the task destruction block to execution nodes around the other execution nodes, until all the task execution nodes included in the target blockchain task system stop executing the to-be-destroyed task.

2. The method of claim 1, wherein, Receiving a target block published by a task publishing node included in a target blockchain task system comprises at least one of: receiving one target block published by one task publishing node included in the target blockchain task system; receiving a plurality of target blocks published by one task publishing node included in the target blockchain task system; receiving a plurality of target blocks published by a plurality of task publishing nodes included in the target blockchain task system.

3. The method of claim 2, wherein, Executing the target task according to the task execution mode included in the task description comprises: determining the start execution time and the end execution time of each target task; in order, when the start execution time is reached, executing the target task according to the task execution mode included in the task description according to the start execution time of each target task, and in order, when the end execution time is reached, ending execution of the target task according to the end execution time of each target task.

4. The method of claim 1, wherein, The method further includes: verifying legality of the task destruction block to obtain a first verification result; stopping execution of the task to be destroyed in a case where the first verification result indicates that the task destruction block is legal.

5. The method of claim 1, wherein, Receiving a target block published by a task publishing node included in a target blockchain task system includes: Receiving the latest target block corresponding to the target task sent by the task publishing node at a predetermined time interval.

6. The method of claim 1, wherein, Executing the target task according to the task execution mode included in the task description includes: verifying the first identification information of the task public key included in the target block; In a case where the first identification information matches the second identification information stored in advance, verifying the legality of the target block to obtain a second verification result; In a case where the second verification result indicates that the target block is legal, determining a current resource remaining amount and a resource occupation amount required for executing the target task; In a case where the current resource remaining amount is greater than or equal to the resource occupation amount, executing the target task according to the task execution mode included in the task description. 7.A device for execution of a blockchain task, characterized in that, includes: a receiving module, configured to receive a target block published by a task publishing node included in a target blockchain task system, wherein the target block includes a task description of a target task, and a start execution time and an end execution time of the target task, the target block includes a single task iteration execution period time, the task description includes a task priority, an execution result standard description, and an execution result judgment standard description, the task priority is used to determine whether to execute the target task, the execution result standard description is used to determine whether a target result obtained by executing the target task is standard, and the execution result judgment standard description is used to determine an optimal result included in a result block of the target task based on the target result; an execution module, configured to execute the target task according to a task execution mode included in the task description when the start execution time arrives, repeatedly execute the target task according to the single task iteration execution period time before the end execution time arrives, and end execution of the target task when the end execution time arrives; The device is also used to receive a task destruction block published by the task publishing node, wherein the task destruction block is used to indicate that a task to be destroyed corresponding to task identification information included in the task destruction block is stopped, and the task destruction block includes a digest value of the task to be destroyed and a task ID. The device is also used to send the task destruction block non-repetitively to other execution nodes after receiving the task destruction block published by the task publishing node, so as to instruct the other execution nodes to stop executing the task to be destroyed based on the task destruction block, wherein the target blockchain task system comprises a plurality of task publishing nodes and a plurality of task execution nodes, and the other execution nodes are also used to send the task destruction block non-repetitively to execution nodes around the other execution nodes, so that all the task execution nodes included in the target blockchain task system stop executing the task to be destroyed.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to execute the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Timed task scheduling method and device based on block chain

    CN112988751A