Task processing method and device, equipment and storage medium

By mapping tasks into a directed acyclic graph and executing subtasks in parallel with verified nodes, the method addresses credibility and resource utilization issues in large task processing, enhancing efficiency and reducing waiting times.

CN119109987AActive Publication Date: 2024-12-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202310674366.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-07
Publication Date
2024-12-10
Estimated Expiration
2043-06-07

AI Technical Summary

Technical Problem

Existing blockchain solutions fail to efficiently process very large tasks while ensuring credibility and resource utilization, leading to prolonged waiting times and underutilization of resources due to reliance on external service providers and consensus mechanisms.

Method used

The method involves mapping a large task into a target directed acyclic graph, selecting verified processing nodes, and executing subtasks in parallel to ensure credibility and reduce waiting times, allowing asynchronous operations for resource utilization.

Benefits of technology

This approach reduces output result waiting times and improves resource utilization by ensuring credibility through parallel execution and consensus verification, enabling efficient task processing without unnecessary delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109987A_ABST
    Figure CN119109987A_ABST
Patent Text Reader

Abstract

The invention discloses a task processing method and device, equipment and a storage medium, and relates to a block chain technology and a task processing technology. On the basis of ensuring the task processing credibility, the waiting time of task output results is reduced, and the resource utilization rate is improved. The block chain scheduling node receives a task processing request sent by a task initiating end; based on task information in the task processing request, mapping a target task corresponding to the task processing request into a target directed acyclic graph; the target directed acyclic graph meets simplification conditions and comprises at least two target graph nodes, and each target graph node represents a target sub-task obtained after the target task is split; selecting a specified number of target processing nodes from the candidate processing nodes; after the selected target processing node passes verification, transmitting at least one target subtask in the target directed acyclic graph to different target processing nodes; and receiving a task processing result fed back by the target processing node, and feeding back the task processing result to the task initiating end.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] For very large tasks, clustering solutions are usually used, that is, the execution process of very large tasks is realized through multiple nodes in the cluster. At this time, the biggest problem faced is the trust issue, that is, the task initiator cannot guarantee the credibility of the task processing process and task processing results.

[0003] With the development of blockchain technology, the scheme of using blockchain to execute super-large tasks has been proposed. Since the blockchain adopts a multi-node consensus mechanism, the consensus mechanism is essentially a mathematical algorithm for establishing trust and obtaining rights between different nodes in the blockchain system. Therefore, through the consensus mechanism in the blockchain, the blockchain nodes maintain a trust relationship among multiple parties and solve the trust problem. However, blockchain nodes need to carry out tasks, consensus, storage and other functions. Therefore, with the increase of nodes, the time consumption of consensus will continue to increase, and the blockchain resources cannot be reasonably expanded. The task processing that blockchain nodes can support is extremely limited. Therefore, an external service provider is specified in the contract, and the task processing is performed through the external service provider. The blockchain signs and authenticates the task processing results fed back by the external service provider, and reaches a consensus on the task processing results to ensure the credibility of the task processing results. However, when reaching a consensus on the task processing results, each blockchain node has to wait for the external service provider to return the task processing results, resulting in slow blockchain block generation and long waiting time. In addition, during the time waiting for the task processing results to be returned, the resources of the blockchain nodes cannot be fully utilized.

[0004] Therefore, on the basis of ensuring the credibility of task processing, how to reduce the waiting time for output results and improve resource utilization is a technical problem that needs to be solved at present. Summary of the invention

[0005] The embodiments of the present application provide a task processing method, apparatus, device and storage medium, which are used to reduce the waiting time for outputting results and improve resource utilization while ensuring the credibility of task processing.

[0006] In a first aspect, an embodiment of the present application provides a task processing method, which is applied to a blockchain scheduling node, and the method includes:

[0007] Receiving a task processing request sent by a task initiator; wherein the task processing request at least includes task information;

[0008] Based on the task information, the target task corresponding to the task processing request is mapped into a target directed acyclic graph; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, and each target graph node represents: a target subtask obtained after splitting the target task;

[0009] Select a specified number of target processing nodes from the candidate processing nodes that meet the preset active conditions, and verify the selected target processing nodes based on the consensus mechanism;

[0010] After verification, at least one target subtask in the target directed acyclic graph is transmitted to different target processing nodes;

[0011] Receive the task processing results fed back by the target processing node, and feed back the task processing results to the task initiator when the feedback conditions are met.

[0012] In a second aspect, an embodiment of the present application provides a task processing method, which is applied to a target processing node, and the method includes:

[0013] Receive the target subtask sent by the blockchain scheduling node;

[0014] Process the target subtask to obtain the task processing result corresponding to the target subtask;

[0015] The task processing results are fed back to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing results to the task initiator.

[0016] In a third aspect, an embodiment of the present application provides a task processing method, which is applied to a task initiator, and the method includes:

[0017] Sending a task processing request to the blockchain scheduling node; wherein the task processing request includes at least task information;

[0018] Receive the task processing results fed back by the blockchain scheduling node; the task processing results are fed back by the blockchain scheduling node after receiving the task processing results fed back by the target processing node.

[0019] In a fourth aspect, an embodiment of the present application provides a task processing device, which is applied to a blockchain scheduling node, and the device includes:

[0020] A first receiving unit is used to receive a task processing request sent by a task initiator; wherein the task processing request at least includes task information;

[0021] A mapping unit is used to map the target task corresponding to the task processing request into a target directed acyclic graph based on the task information; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, each of which represents: a target subtask obtained after splitting the target task;

[0022] A selection unit, used to select a specified number of target processing nodes from candidate processing nodes that meet preset active conditions, and verify the selected target processing nodes based on a consensus mechanism;

[0023] A transmission unit, used to transmit at least one target subtask in the target directed acyclic graph to different target processing nodes after verification;

[0024] The first feedback unit is used to receive the task processing result fed back by the target processing node, and feed back the task processing result to the task initiator.

[0025] In a possible implementation manner, the task information includes at least code information; and the mapping unit is specifically used for:

[0026] Based on the code information, determine the mutual reference relationship between the codes, and based on the mutual reference relationship, map the target task into an initial directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each of which represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split;

[0027] Based on the preset induction rules, the initial subtasks in the initial directed acyclic graph are summarized to obtain the target directed acyclic graph.

[0028] In a possible implementation manner, the mapping unit is specifically used to:

[0029] Based on the connection relationship between the initial graph nodes in the initial directed acyclic graph, determining at least two initial graph nodes in the initial directed acyclic graph that have an associated relationship;

[0030] Based on the task complexity of the initial subtask, at least two initial graph nodes with an associated relationship are summarized according to the preset concurrency and the preset execution complexity until the initial graph nodes cannot be summarized, and the target directed acyclic graph is obtained.

[0031] In a possible implementation, the association relationship includes: a parent-child relationship and a brother-sister relationship;

[0032] The parent-child relationship means: of the two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge, and the outgoing edge and the incoming edge are the same edge;

[0033] A sibling relationship means: among at least two initial graph nodes, all initial graph nodes have only one outgoing edge, the outgoing edge points to the same initial graph node, and at least one initial graph node has no incoming edge; or the outgoing edges of all initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes point to the same initial node.

[0034] In a possible implementation, after receiving the task processing request sent by the task initiator, and before mapping the target task corresponding to the task processing request to the target directed acyclic graph based on the task information, the first receiving unit is further configured to:

[0035] Based on the operation permissions and signature authentication, determine that the task processing request meets the authentication conditions;

[0036] Based on the target task timestamp and parameter information, it is determined that the target task verification has passed;

[0037] It is determined that no task processing result corresponding to the target task is stored in the cache.

[0038] In a possible implementation, the selection unit is specifically used for:

[0039] Determine a selection factor according to the random number, and select a specified number of target processing nodes from the candidate processing nodes according to the selection factor;

[0040] The random number and the specified number are sent by the task initiator.

[0041] In a possible implementation, the selection unit is specifically used for:

[0042] If the first target number of processing nodes is selected, a random number is used as the selection factor;

[0043] If a number of processing nodes other than the first target is selected, the selection factor is re-determined based on the previous selection factor and the block hash value.

[0044] In a possible implementation manner, the transmission unit is specifically configured to:

[0045] Based on the task redundancy number indicated by the task initiator, each target subtask in the target directed acyclic graph is copied;

[0046] Among the multiple target subtasks after the replication process, the target subtasks representing the same task are transmitted to different target processing nodes.

[0047] In a possible implementation manner, the first feedback unit is specifically configured to:

[0048] After determining that all target subtasks associated with the target directed acyclic graph have been executed, all received task processing results are fed back to the task initiator.

[0049] In a fifth aspect, an embodiment of the present application provides a task processing device, applied to a target processing node, the device comprising:

[0050] A second receiving unit is used to receive a target subtask sent by a blockchain scheduling node;

[0051] A processing unit, used to process the target subtask and obtain a task processing result corresponding to the target subtask;

[0052] The second feedback unit is used to feed back the task processing result to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing result to the task initiator.

[0053] In a possible implementation, after receiving the target subtask sent by the blockchain scheduling node and before processing the target subtask, the second receiving unit is further used to:

[0054] The target subtask is authenticated and after it is determined that the authentication is passed, the target subtask is added to the task queue according to the priority, so as to be processed according to the order of tasks in the task queue.

[0055] In a sixth aspect, an embodiment of the present application provides a task processing device, which is applied to a task initiator, and the device includes:

[0056] A sending unit, used to send a task processing request to a blockchain scheduling node; wherein the task processing request includes at least task information;

[0057] The third receiving unit is used to receive the task processing result fed back by the blockchain scheduling node; the task processing result is fed back by the blockchain scheduling node after receiving the task processing result fed back by the target processing node.

[0058] In a possible implementation, the task processing result includes at least processing node information;

[0059] After receiving the task processing result fed back by the blockchain scheduling node, the third receiving unit is further used to:

[0060] Signature verification of task processing results; and

[0061] Perform random number verification on processing node information.

[0062] In a seventh aspect, an embodiment of the present application provides a computing device, comprising: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the steps of the task processing method provided in the embodiment of the present application.

[0063] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the task processing method provided by the embodiment of the present application are implemented.

[0064] In the ninth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when the processor of the computing device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the computing device performs the steps of the task processing method provided in the embodiment of the present application.

[0065] The beneficial effects of this application are as follows:

[0066] The embodiments of the present application provide a task processing method, device, equipment and storage medium, which relate to the field of task processing technology and the field of blockchain technology. In the present application, the blockchain scheduling node first maps the target task corresponding to the task processing request to a target directed acyclic graph based on the task information carried in the received task processing request; the target directed acyclic graph meets the simplification conditions and includes at least two target graph nodes, each target graph node represents a target subtask obtained after splitting the target task; the target task is split into multiple subtasks so that multiple processing nodes can execute concurrently, and the target directed acyclic graph meets the simplification conditions, that is, the target subtasks represented by each graph node in the target directed acyclic graph cannot be further merged, so as to avoid the situation where the task amount of each target subtask is too small, reduce communication efficiency, and improve execution efficiency; then, among the candidate processing nodes that meet the preset active conditions, a specified number of target processing nodes are selected, and the selected target processing nodes are verified based on the consensus mechanism to ensure the credibility of the selected target processing nodes, and further ensure the credibility of the target processing nodes for task processing; and after the verification is passed, at least one target in the target directed acyclic graph is Subtasks are transmitted to different target processing nodes; they are executed in parallel by multiple target processing nodes, and the same target subtask is transmitted to different target processing nodes for execution, and the task processing results of multiple target processing nodes for the same subtask are obtained, so as to realize multi-party comparison to avoid the problem of external processing services doing evil and ensure the accuracy of task processing results; finally, the task processing results fed back by the target processing node are received, and the task processing results are fed back to the task initiator. Since the target processing node has been subjected to consensus authentication to ensure the credibility of the target processing node, after receiving the task processing results fed back by the target processing result, there is no need to perform consensus authentication, and the processing results can be fed back to the task initiator, which reduces the time for consensus authentication of the task processing results, that is, reduces the waiting time for the output results, and in the blockchain, the blockchain scheduling node performs each task asynchronously, that is, while waiting for the processing node to feedback the task processing results, it can perform directed target acyclic graph mapping, processing node selection, subtask scheduling, etc. for other tasks, thereby improving resource utilization.

[0067] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0069] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0070] Figure 2 A schematic diagram of the structure of a blockchain scheduling node provided in an embodiment of the present application;

[0071] Figure 3 A schematic diagram of the structure of a processing node provided in an embodiment of the present application;

[0072] Figure 4 A flowchart of a specific implementation method of task processing provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of an initial directed acyclic graph provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of a directed acyclic graph in which two nodes are in a parent-child relationship provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of a first directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application;

[0076] Figure 8 A schematic diagram of a second directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application;

[0077] Fig. 9 A schematic diagram of a third directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of the first type of inductive processing based on sibling relationships provided in an embodiment of the present application;

[0079] Fig.11 A schematic diagram of an inductive processing based on a parent-child relationship provided in an embodiment of the present application;

[0080] Fig.12 A schematic diagram of a second method of summarizing based on sibling relationships provided in an embodiment of the present application;

[0081] Fig.13 A flowchart of another specific implementation method of task processing provided in an embodiment of the present application;

[0082] Fig.14 A schematic diagram of a task processing architecture provided in an embodiment of the present application;

[0083] Fig.15 A flowchart of a method for blockchain scheduling nodes to perform task processing provided in an embodiment of the present application;

[0084] Fig.16 A flowchart of a method for performing task processing on a processing node provided in an embodiment of the present application;

[0085] Fig.17 A flowchart of a method for performing task processing on a task initiator provided in an embodiment of the present application;

[0086] Fig.18 A structural diagram of a first task processing device provided in an embodiment of the present application;

[0087] Fig.19 A structural diagram of a second task processing device provided in an embodiment of the present application;

[0088] Fig. 20 A structural diagram of a third task processing device provided in an embodiment of the present application;

[0089] Fig.21 A structural diagram of a computing device provided in an embodiment of the present application;

[0090] Fig. 22 A structural diagram of another computing device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0091] In order to make the purpose, technical solution and beneficial effects of this application clearer, the technical solution in the embodiment of this application will be clearly and completely described below in conjunction with the drawings in the embodiment of this application. Obviously, the described embodiment is only a part of the embodiment of this application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0092] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0093] Directed Acyclic Graph (DAG) is a graph structure consisting of nodes and directed edges. In this graph, if you select a node and start from the selected node, you can find a path along the ordered edges, but you cannot return to the original node, that is, it will not form a loop. That is, the nodes in the DAG have a sequence and can have forks, but they will not form a loop. Due to the serialization characteristics of DAG, it can be used to represent the dependencies between events and the scheduling between management tasks. It is a commonly used data structure in the computer field, so DAG is often used in data processing, transaction planning, optimal path search and other fields.

[0094] Super large tasks are tasks that are computationally intensive and complex.

[0095] Blockchain is a distributed ledger technology in the field of information technology. It is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission (P2P transmission), consensus mechanism, transaction blocks, cryptographic identity security, etc. Because the ledger is distributed and the blocks are consensus-based, it has the characteristics of being tamper-proof, traceable, and jointly maintained. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block.

[0096] Load balancing is a method of evenly distributing network traffic across a pool of resources that support an application. Modern applications must handle data for millions of objects (e.g., users or their corresponding accounts) simultaneously and return the correct text, video, image, and other data to each object in a fast and reliable manner. To handle such high traffic, most applications have many resource servers that contain a lot of duplicate data between them. Load balancers are used to ensure that all resource servers are used equally.

[0097] A certificate, also known as a digital certificate, is an electronic file that uniquely identifies a resource on the Internet. Certificates enable secure and confidential communications between two entities. There are many types of certificates, such as personal certificates used by individuals and server certificates, where server certificates are used to establish secure sessions between servers and clients using Secure Sockets Layer (SSL) technology.

[0098] A signature, also known as a digital signature or a public key digital signature, is a string of numbers generated by the sender of information that cannot be forged by others. This string of numbers is also a valid proof of the authenticity of the information sent by the sender. Signature authentication is when the receiver needs to confirm whether the ciphertext file it receives is really sent by the sender, and whether it has been tampered with in the middle.

[0099] A process is a running activity of a program in a computer on a certain data set. It is the basic unit for resource allocation in the system and the foundation of the operating system structure. In the early computer structure designed for processes, processes are the basic execution entities of programs; in the contemporary computer structure designed for threads, processes are the containers of threads. A program is a description of instructions, data and their organizational forms, and a process is the entity of a program.

[0100] Coroutines are not system-level threads. Often, coroutines are called "lightweight threads", "microthreads", "fibers", etc. In simple terms, coroutines can be considered different functions in threads, and these functions can be quickly switched between each other. Coroutines are very similar to user-mode threads. Switching between user-mode threads does not require trapping into the kernel, but in some operating systems, switching between user-mode threads requires the assistance of kernel-mode threads.

[0101] The following is a brief introduction to the design concept of the embodiments of the present application.

[0102] For very large tasks, clustering solutions are usually used, that is, the execution process of very large tasks is realized through multiple nodes in the cluster. At this time, the biggest problem faced is the trust issue, that is, the task initiator cannot guarantee the credibility of the task processing process and task processing results.

[0103] With the development of blockchain technology, the scheme of using blockchain to execute super-large tasks has been proposed. Since the blockchain adopts a multi-node consensus mechanism, the consensus mechanism is essentially a mathematical algorithm for establishing trust and obtaining rights between different nodes in the blockchain system. Therefore, through the consensus mechanism in the blockchain, the blockchain nodes maintain a trust relationship among multiple parties and solve the trust problem. However, blockchain nodes need to carry out tasks, consensus, storage and other functions. Therefore, with the increase of nodes, the time consumption of consensus will continue to increase, and the blockchain resources cannot be reasonably expanded. The task processing that blockchain nodes can support is extremely limited. Therefore, an external service provider is specified in the contract, and the task processing is performed through the external service provider. The blockchain signs and authenticates the task processing results fed back by the external service provider, and reaches a consensus on the task processing results to ensure the credibility of the task processing results. However, when reaching a consensus on the task processing results, each blockchain node has to wait for the external service provider to return the task processing results, resulting in slow blockchain block generation and long waiting time. In addition, during the time waiting for the task processing results to be returned, the resources of the blockchain nodes cannot be fully utilized.

[0104] Therefore, on the basis of ensuring the credibility of task processing, how to reduce the waiting time for output results and improve resource utilization is a technical problem that needs to be solved at present.

[0105] In view of this, the embodiments of the present application provide a task processing method, device, equipment and storage medium, and in particular provide a very large task processing method based on blockchain, which relates to the field of task processing technology and the field of blockchain technology, and is used to reduce the waiting time for output results on the basis of ensuring the credibility of task processing, realize resource expansion, and improve resource utilization.

[0106] First, in the embodiment of the present application, it is proposed to perform task mapping processing on the super-large task corresponding to the task processing request based on the task information carried in the task processing request, and the task mapping process includes disassembly service and induction service; specifically, the super-large task is first split into an initial directed acyclic graph composed of subtasks, so as to facilitate the concurrent execution of multiple processing nodes. At the same time, in order to avoid the task volume being too small and reduce the number of communications, the subtasks in the initial directed acyclic graph are summarized after disassembly to obtain the target directed acyclic graph. At this time, the target directed acyclic graph meets the simplification conditions and includes at least two target graph nodes. Each target graph node represents: a target subtask obtained after splitting the super-large task, which reduces the number of subtasks and improves the execution efficiency.

[0107] Next, a specified number of target processing nodes are selected from the candidate processing nodes that meet the preset active conditions, and the selected target processing nodes are verified based on the consensus mechanism. After the verification is passed, at least one target subtask of the target directed acyclic graph is transmitted to different target processing nodes; it is ensured that the selected target processing nodes have sufficient resources for task processing, and can perform task processing normally to improve processing efficiency, and consensus is reached on the selected target processing nodes to ensure the credibility of the selected target processing nodes, and further ensure the credibility of the target processing nodes in processing tasks. At the same time, a target subtask is transmitted to different target processing nodes for processing, that is, multiple target processing nodes process the same target subtask, and output task processing results respectively, so that multiple task processing results of the same target subtask can be compared, and multiple comparisons can be used to avoid the problem of processing nodes doing evil.

[0108] Finally, the task processing results fed back by the target processing node are received, and the task processing results are fed back to the task initiator. Since the target processing node has been consensus-authenticated to ensure the credibility of the target processing node, after receiving the task processing results fed back by the target processing result, there is no need to perform consensus authentication, and the processing results can be fed back to the task initiator, which reduces the time for consensus authentication of the task processing results, that is, reduces the waiting time for the output results, and further avoids the problem that the blockchain resources cannot be fully utilized when waiting for the result feedback for consensus; and in the blockchain, the blockchain scheduling node performs asynchronous operations for each task, that is, while waiting for the processing node to feedback the task processing results, it can perform directed target acyclic graph mapping, processing node selection, task scheduling, etc. for other tasks, so as to achieve resource expansion and improve resource utilization.

[0109] After introducing the design concept of the embodiment of the present application, the application scenario set in the present application is briefly described below. It should be noted that the following scenario is only used to illustrate the embodiment of the present application and is not limited. In the specific implementation, the technical solution provided by the embodiment of the present application can be flexibly applied according to actual needs.

[0110] See also Figure 1 , Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application, the application scenario includes: a task initiator 100, a blockchain scheduling node 110 and a processing node 120; wherein the task initiator 100, the blockchain scheduling node 110 and the processing node 120 can communicate with each other through a communication network.

[0111] In an optional embodiment, the communication network may be a wired network or a wireless network. Exemplarily, the task initiator 100 and the blockchain scheduling node 110 may be directly or indirectly connected via wired or wireless communication. For example, the task initiator 100 may be indirectly connected to the blockchain scheduling node 110 via a wireless access point, or the task initiator 100 may be directly connected to the blockchain scheduling node 110 via the Internet, and this application does not limit this.

[0112] In the embodiment of the present application, the task initiator 100 is a terminal device; the blockchain scheduling node 110 is a server for processing node selection, processing node status maintenance and task scheduling; the processing node 120 is a server for task processing;

[0113] Among them, terminal devices include but are not limited to mobile phones, tablet computers, laptops, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, car terminals and other devices;

[0114] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0115] In a possible implementation, the blockchain scheduling node 110 includes at least: a network module 1100, an authentication module 1110, a task DAG group module 1120, a load balancing module 1130 and a storage module 1140; see Figure 2 , Figure 2 A schematic diagram of the structure of a blockchain scheduling node provided in an embodiment of the present application; wherein:

[0116] The network module 1100 is used to communicate with other blockchain scheduling nodes, task initiators and processing nodes, receive task processing requests sent by the task initiators, receive target processing node information sent by other blockchain scheduling nodes, and receive task processing results fed back by the processing nodes, and node status information of each processing node.

[0117] The authentication module 1110 is used to store the certificates of the processing node, the task initiator and the blockchain scheduling node; to verify the legitimacy of the identity of the processing node, the task initiator and the blockchain scheduling node; wherein the authentication module 1110 includes: a certificate and private key storage submodule 1111 and an authentication algorithm submodule 1112;

[0118] The certificate and private key storage submodule 1111 is used to store the certificates of various roles (such as processing nodes, task initiators, and other blockchain scheduling nodes) and their own private keys;

[0119] The authentication algorithm submodule 1112 is used to store the authentication algorithm for verifying the correctness of the signature and the legitimacy of the certificate, so as to authenticate each role based on the authentication algorithm.

[0120] The task DAG group module 1120 is used to disassemble, summarize and distribute the super-large tasks, etc.; wherein the task DAG group module 1120 includes: a task verification submodule 1121, a task disassembly submodule 1122, a task summary submodule 1123, a task maintenance submodule 1124, a task selection submodule 1125, and a task distribution submodule 1126;

[0121] The task verification submodule 1121 is used to verify the legitimacy of the super-large task;

[0122] The task decomposition submodule 1122 is used to decompose a super large task into a DAG consisting of multiple subtasks;

[0123] The task summarization submodule 1123 is used to summarize and merge the subtasks obtained after the task decomposition submodule 1122 decomposes the super-large task;

[0124] The task maintenance submodule 1124 is used to maintain all subtasks;

[0125] The task selection submodule 1125 is used to select tasks when packaging blocks before generating blocks;

[0126] The task distribution submodule 1126 is used to distribute subtasks to each processing node.

[0127] The load balancing module 1130 is used to maintain the processing node status table, select the target processing node according to the processing node status table, and perform subtask scheduling; wherein the load balancing module 1130 includes: a node status maintenance submodule 1131 and a processing node selection submodule 1132;

[0128] The node status maintenance submodule 1131 is used to maintain the status of all processing nodes.

[0129] The processing node selection submodule 1132 is used to select a processing node according to a random number provided by the task initiator.

[0130] The storage module 1140 is used to store the processing results of all super-large tasks and the task information of the super-large tasks, etc. The task information at least includes data and codes; wherein the storage module 1140 includes: a result cache submodule 1141 and a task information storage submodule 1142;

[0131] The result cache submodule 1141 is used to cache the processing results of each super-large task so that the result can be directly returned when the same task is received;

[0132] The task information storage submodule 1142 is used to cache codes and data when executing tasks, so as to avoid the task initiator from sending codes and data every time it processes the same task.

[0133] In a possible implementation, the processing node 120 includes a network module 1200, an authentication module 1210, a subtask queue module 1220, an execution module 1230, and a detection module 1240; see Figure 3 , Figure 3 A schematic diagram of a processing node structure provided in an embodiment of the present application; wherein:

[0134] The network module 1200 is used to communicate with the blockchain scheduling node, receive and return task processing results from the blockchain scheduling node subtask, and share the processing node status.

[0135] The authentication module 1210 is used to store the certificate of the blockchain scheduling node and verify the legitimacy of the blockchain scheduling node identity; wherein the authentication module 1210 includes: a certificate and private key storage submodule 1211 and an authentication algorithm submodule 1212;

[0136] The certificate and private key storage submodule 1211 is used to store the blockchain scheduling node's certificate and its own private key;

[0137] The authentication algorithm submodule 1212 is used to store the authentication algorithm for verifying the correctness of the signature and the legitimacy of the certificate, so as to authenticate the blockchain scheduling node based on the authentication algorithm.

[0138] The subtask queue module 1220 is used to temporarily store all subtasks to be executed in a queue manner; wherein the subtask queue module 1220 includes: a task storage submodule 1221 and a task sorting submodule 1222;

[0139] The task storage submodule 1221 is used to save all subtasks in a queue manner;

[0140] The task sorting submodule 1222 is used to sort the tasks in the task queue according to the set rules.

[0141] The execution module 1230 is used to process the subtasks; wherein the execution module 1230 includes: a resource scheduling submodule 1231 and a task processing submodule 1232;

[0142] The resource scheduling submodule 1231 is used to schedule tasks and process / coroutine resources used when processing tasks;

[0143] The task processing submodule 1232 is used to perform task processing using a process / coroutine, where a process / coroutine is an entity that processes a task.

[0144] The detection module 1240 is used to collect information and detect the status of the processing node resources; wherein the detection module 1240 includes: a status detection submodule 1241 and a resource information collection submodule 1242;

[0145] The state detection submodule 1241 is used to detect and display the state of the processing node;

[0146] The resource information collection submodule 1242 is used to collect resource information of the processing node.

[0147] Based on the above application scenarios, the task processing method provided by the exemplary embodiment of the present application is described below according to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard. In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.

[0148] In an embodiment of the present application, the task initiator triggers the target task and sends a task processing request to the blockchain; due to the characteristics of the blockchain, at least two blockchain scheduling nodes are set in the blockchain, so the task processing request sent by the task initiator is distributed to each blockchain scheduling node. At this time, each blockchain scheduling node performs task decomposition and induction, target processing node selection, target processing node consensus, and assigns the task to the target processing node for processing based on the information carried in the task processing request; then, the target processing node processes the task.

[0149] It can be seen that the operations performed by all blockchain scheduling nodes in the blockchain are consistent, and the target processing nodes are all used to process tasks. Therefore, the task processing method provided in the embodiment of the present application is described in detail below by taking the interaction between the task initiator and a blockchain scheduling node and the interaction between a blockchain scheduling node and a target processing node as an example.

[0150] See also Figure 4 , Figure 4 A specific implementation flow diagram of a task processing method provided in an embodiment of the present application includes the following steps:

[0151] Step S400: The task initiator sends a task processing request to the blockchain scheduling node.

[0152] In one possible implementation, the task processing request includes but is not limited to: task information, a random number r, a target processing node number k, and a task redundancy number v; wherein the task information includes code information and task data, and the target processing node number is greater than or equal to the task redundancy number.

[0153] Exemplarily, the task initiator performs a signature operation on the task information, the random number r, the number of target processing nodes k, and the task redundancy number v to obtain a task processing request, and then sends the task processing request to the blockchain scheduling node.

[0154] It should be noted that the random number r is randomly selected by the task initiator itself in the interval [0, max), and max is a positive integer much greater than 0.

[0155] Step S401: The blockchain scheduling node maps the target task corresponding to the task processing request into a target directed acyclic graph based on the task information carried in the task processing request.

[0156] In a possible implementation, after receiving the task processing request, the blockchain scheduling node executes the following steps A1 to A4 to map the target task to a target directed acyclic graph.

[0157] Step A1: Obtain code information in the task information, and determine the reference relationship between codes based on the code information.

[0158] For example, the blockchain calling node receives a transfer task processing request sent by the task initiator, obtains the task code of the transfer task, and analyzes the task code to determine that the transfer task code includes: payment account balance query, payment account transfer amount query, obtaining transfer amount from payment account for transfer processing, receiving account balance query, transfer to receiving account and other related task codes; because when obtaining the transfer amount from the payment account for transfer processing, it is necessary to determine the transfer amount of the payment account, so there is a reference relationship between the relevant code for payment account transfer amount query and the relevant code for obtaining the transfer amount from the payment account for transfer processing.

[0159] Therefore, the reference relationship between codes can be understood as when the output data of one set of codes is used as the input data of another set of codes, there is a reference relationship between the two sets of codes. Therefore, in the embodiment of the present application, after obtaining the task code of the target task, the task code is parsed to determine the task codes of all subtasks included in the task code, and the reference relationship between the task codes of the subtasks is determined.

[0160] Step A2: Based on the reference relationship between codes, the target task is mapped into an initial directed acyclic graph; the initial directed acyclic graph includes at least two initial graph nodes, each of which represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split.

[0161] When determining that there is a reference relationship between the task codes of two subtasks and mapping the target task to an initial directed acyclic graph, each subtask is taken as a graph node, and a directed edge is used to connect the two graph nodes with a reference relationship, wherein the input data of the subtask associated with a graph node pointed to by the directed edge is the output data of the subtask associated with another graph node connected by the directed edge; in this way, the target task can be mapped to an initial directed acyclic graph based on the reference relationship between the codes.

[0162] For example, see Figure 5 , Figure 5 A schematic diagram of an initial directed acyclic graph provided for this embodiment; Figure 5 It contains 11 initial graph nodes A1 to A11, each of which represents an initial subtask in the target task, and each initial subtask cannot be further split, and two initial graph nodes that are connected indicate that there is a reference relationship between the task codes of the initial subtasks represented by the two initial graph nodes; for example, there is a connection relationship between the initial graph node A1 and the initial graph node A2, which are connected by a directed edge, indicating that there is a reference relationship between the task code of the initial subtask associated with the initial graph node A1 and the task code of the initial subtask associated with the initial graph node A2, and the output data of the initial subtask associated with the initial graph node A1 serves as the input data of the task code of the initial subtask associated with the initial graph node A2.

[0163] Step A3: Based on the connection relationship of the initial graph nodes in the initial directed acyclic graph, determine at least two initial graph nodes in the initial directed acyclic graph that have an associated relationship.

[0164] In a possible implementation, setting the association relationship includes: a parent-child relationship and a brother relationship; wherein:

[0165] The parent-child relationship means that: of the two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge, and the outgoing edge and the incoming edge are the same edge; see Figure 6 , Figure 6 A schematic diagram of a directed acyclic graph in which two nodes are in a parent-child relationship is provided in an embodiment of the present application; Figure 6 It can be seen that the initial graph node A and the initial graph node B are connected by an edge C. Edge C is the outgoing edge of the initial graph node A and the incoming edge of the initial graph node B. At this time, it is determined that the initial graph node A and the initial graph node B have a parent-child relationship.

[0166] A sibling relationship means that among at least two initial graph nodes, all initial graph nodes have only one outgoing edge, both outgoing edges point to the same initial graph node, and at least one initial graph node has no incoming edge; see Figure 7 , Figure 7 A schematic diagram of a first directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application, from Figure 7 As can be seen, both the initial graph node A and the initial graph node B have only one outgoing edge, and these two outgoing edges point to Figure 1 The initial graph node is C, and both the initial graph node A and the initial graph node B have no incoming edges. In this case, it is determined that the initial graph node A and the initial graph node B have a sibling relationship; see Figure 8 , Figure 8A schematic diagram of a second directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application, from Figure 8 As can be seen, both the initial graph node A and the initial graph node B have only one outgoing edge, and these two outgoing edges point to Figure 1 The initial graph node is C, and the initial graph node A has an incoming edge, while the initial graph node B has no incoming edge. At this time, it is determined that the initial graph node A and the initial graph node B have a sibling relationship.

[0167] Or, the sibling relationship means: all outgoing edges of the initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes point to the same initial node. Fig. 9 , Fig. 9 A schematic diagram of a third directed acyclic graph in which two nodes are in a brother relationship provided in an embodiment of the present application; Fig. 9 As can be seen, the initial graph node A and the initial graph node B have only one outgoing edge and only one incoming edge. These two outgoing edges point to Figure 1 The initial graph node is C. The output graph nodes of these two input edges are the same initial graph node D. At this time, it is determined that the initial graph node A and the initial graph node B have a sibling relationship.

[0168] After determining how to identify the relationship between graph nodes, Figure 5 Taking the initial directed acyclic graph shown as an example, at least two initial graph nodes having an associated relationship are determined based on the connection relationship of the initial graph nodes in the initial directed acyclic graph. Figure 5 The initial graph node A2 and the initial graph node A3 are in a brother relationship, and the initial graph node A6, the initial graph node A7 and the initial graph node A8 are in a brother relationship.

[0169] Step A4: Based on the task complexity of the initial subtask, at least two initial graph nodes with an associated relationship are summarized according to the preset concurrency and preset execution complexity until the initial graph nodes cannot be summarized, and the target directed acyclic graph is obtained.

[0170] In one possible implementation, when summarizing the initial graph nodes, at least two graph nodes with an associated relationship are summarized in turn according to the directions of the directed edges in the initial directed acyclic graph, and during the summarizing process, the summarizing process is performed based on a preset execution complexity (i.e., the maximum subtask complexity that the processing node can accept) and a preset concurrency (i.e., the number of multiple subtasks that the processing node can process simultaneously) until the induction can no longer be continued, and the target directed acyclic graph is obtained.

[0171] Because the induction process involves the maximum subtask complexity that the processing node can accept, it is necessary to determine the task complexity of the initial subtask associated with each initial graph node in the initial directed acyclic graph, so that when the task is inducing, the task complexity of the inducible target subtask will not exceed the maximum subtask complexity that the processing node can accept.

[0172] In a possible implementation, the task complexity of the initial subtask is determined based on the amount of code of the task code of the initial subtask associated with each initial graph node; specifically, the larger the amount of code, the higher the task complexity.

[0173] In another implementation, a complexity identification model is used to determine the task complexity of the initial subtask associated with each initial graph node; wherein the complexity identification model is obtained based on the task code of the historical task and the associated task complexity training; that is, the input of the complexity identification model is the task code, and the output is the task complexity.

[0174] Therefore, Figure 5 Taking the initial directed acyclic graph shown in FIG. 1 as an example, at least one of the above implementation methods for determining task complexity is used to determine the task complexity associated with each initial graph node in the initial directed acyclic graph. For example, see Figure 5 , the task complexity of the initial graph node A1 is 3, the task complexity of the initial graph node A2 is 8, the task complexity of the initial graph node A3 is 3, the task complexity of the initial graph node A4 is 1, the task complexity of the initial graph node A5 is 4, and so on.

[0175] Below, take the preset execution complexity as 10 and the preset concurrency as 2 as an example. Figure 5 Based on the initial directed acyclic graph shown in FIG. 1 , the induction process of the initial graph nodes is described. It should be noted that the induction process of the initial graph nodes is to summarize the initial subtasks associated with the initial graph nodes.

[0176] from Figure 5 It can be seen from the initial directed acyclic graph shown that the initial directed acyclic graph includes two branches, the first branch is the initial graph nodes A1-A5, and the second branch is the initial graph nodes A6-A10. When induction is performed, induction processing is performed on each branch.

[0177] See also Fig.10 , Fig.10 A schematic diagram of the first method of summarizing based on brother relationships provided in the embodiment of the present application; Fig.10It can be seen that for the first branch, according to the direction of the directed edge, the initial graph node A2 and the initial graph node A3 are first determined to be brothers, which conforms to the induction rule. Since the parallelism is 2, the subtasks associated with the initial graph node A2 and the initial graph node A3 can be executed simultaneously. Therefore, the maximum value of the task complexity associated with the initial graph node A2 and the initial graph node A3 is used as the task complexity associated with the inductive graph node 23 after induction, that is, Fig.10 The task complexity of the induction graph node A23 shown in is 8.

[0178] See also Fig.11 , Fig.11 A schematic diagram of an inductive processing based on a parent-child relationship provided in an embodiment of the present application; Fig.11 It can be seen that for the first branch, Fig.10 On the basis of the directed acyclic graph obtained after induction, the initial graph node A1 and the induction graph node A23 are determined to be a parent-child relationship according to the direction of the directed edge, which conforms to the induction rule. Because it is a parent-child relationship, they need to be executed in sequence. When executing the subtasks associated with the initial graph node A1 and the subtasks associated with the initial graph node 23 in sequence, the task complexity should be determined in a summation manner, that is, the task complexity 3 associated with the initial graph node A1 and the task complexity 8 associated with the induction graph node A23 are summed. The task complexity after summation is 11, which exceeds the preset execution complexity of 10, so induction cannot be performed;

[0179] Similarly, it is determined that the induction graph node A23 and the initial graph node A4 are in a parent-child relationship, which complies with the induction rule, and the complexity of the task after induction is 9. Therefore, the induction graph node A23 and the initial graph node A4 can continue to be inducibly processed to obtain the induction graph node A234 after induction, and the complexity of the task associated with the induction graph node A234 is determined to be 9.

[0180] Afterwards, in Fig.11 Based on the directed acyclic graph obtained after induction, we continue to determine whether induction is possible. Fig.11 The directed acyclic graph obtained after induction contains graph nodes with parent-child relationships, but after the induction process, the task complexity is greater than the preset execution complexity, so the first branch cannot be further inducible.

[0181] See also Fig.12 , Fig.12 A schematic diagram of a second method of summarizing based on brother relationships provided in an embodiment of the present application; Fig.12 It can be seen that in Fig.11On the basis of the directed acyclic graph obtained after induction, for the second branch, according to the direction of the directed edge, it is first determined that the initial graph node A6, the initial graph node A7 and the initial graph node A8 are brothers, which meets the induction rule, and because the parallelism is 2, the subtasks associated with the initial graph node A6, the initial graph node A7 and the initial graph node A8 cannot be executed simultaneously. At this time, based on the task complexity of the subtasks associated with the initial graph nodes, the optimal method is to execute the initial graph node A7 and the subtasks associated with the initial graph node A7 in sequence while executing the subtask of the initial graph node A6. Since the task complexity is determined by summing when executing sequentially, and the task complexity is determined by selecting the maximum value when executing in parallel, it is first determined that the task complexity of the initial graph node A7 and the subtasks of the initial graph node A7 when executing sequentially is 6, and the task complexity associated with the initial graph node A6 is 5. Therefore, after the induction process, the task complexity of the induction node A678 obtained is 6.

[0182] Then, in Fig.12 Based on the directed acyclic graph obtained after induction, we continue to determine whether induction is possible. Fig.12 The directed acyclic graph obtained after induction contains graph nodes with parent-child relationships, but after the induction process, the task complexity is greater than the preset execution complexity, so the induction cannot be continued for the second branch.

[0183] based on Figure 10 to Figure 12 Content, complete Figure 5 The inductive processing of the initial graph nodes in , after which the target directed acyclic graph is obtained, see Fig.12 The directed acyclic graph obtained after induction.

[0184] In the present application, a specific implementation method of task decomposition and task induction is designed to obtain the target directed acyclic graph. First, the initial directed acyclic graph is constructed through the association relationship between the task codes of the initial subtasks. Then, the maximum complexity and the highest preset concurrency that a single processing node can accept are used as a benchmark. Based on the complexity of a single initial subtask, the subtasks are summarized and processed to obtain a target directed acyclic graph that meets the simplification conditions. The number of subtasks is reduced, so that when the subtasks are assigned to multiple processing nodes for execution, the number of communications is reduced, communication resources are saved, and execution efficiency is improved.

[0185] In step S402, the blockchain scheduling node selects a specified number of target processing nodes from the candidate processing nodes that meet the preset active conditions, and verifies the selected target processing nodes based on the consensus mechanism.

[0186] In the embodiment of the present application, the blockchain scheduling node maintains the status information of all processing nodes; wherein, the status information of the processing node includes at least: whether the processing node is currently idle, the amount of resources currently occupied by the processing node, and the amount of resources currently remaining in the processing node. It should be noted that the status information of the processing node is reported by the processing node to the blockchain scheduling node; the reporting method can be active reporting, that is, after the processing node determines that its own status has changed, it sends the status information to the blockchain scheduling node; the reporting method can also be passive reporting, that is, when receiving a status query instruction, the processing node reports its own status information to the blockchain scheduling node.

[0187] In one possible implementation, when a blockchain scheduling node receives a task processing request and determines that a target task corresponding to the task processing request needs to be processed by a processing node, the blockchain scheduling node executes the following steps B1 to B3 to determine the target processing node.

[0188] Step B1: Based on the maintained status information of all processing nodes, candidate processing nodes that meet a preset active condition are screened out from all processing nodes.

[0189] In a possible implementation, among all processing nodes, all idle processing nodes are screened out as candidate processing nodes that meet a preset active condition; that is, completely unoccupied processing nodes are screened out.

[0190] In a possible implementation, among all processing nodes, processing nodes whose currently occupied resource amount is less than a first threshold are screened out as candidate processing nodes that meet a preset active condition; that is, processing nodes that occupy less resource amount are screened out.

[0191] In another possible implementation, among all processing nodes, processing nodes whose current remaining resources are greater than the second threshold are screened out as candidate processing nodes that meet the preset active condition; that is, processing nodes with larger remaining resources are screened out.

[0192] In the present application, processing nodes with a large amount of remaining resources are screened out as candidate processing nodes to ensure that the target processing node selected from the candidate processing nodes has sufficient resources to process the task, thereby ensuring smooth processing of the task and improving task execution efficiency.

[0193] Step B2: Select a specified number of target processing nodes from the candidate processing nodes that meet the preset active condition.

[0194] In a possible implementation, according to the random number r carried in the task processing request, a target processing node that is consistent with the number k of processing nodes carried in the task processing request is selected from candidate processing nodes that meet a preset active condition.

[0195] Exemplarily, a selection factor p is determined according to a random number r, and according to the selection factor p, a target processing node is selected from all candidate processing nodes N. Specifically, the following steps C1 to C5 are executed to select the target processing node.

[0196] Step C1, the currently selected target processing node x=1, the random number r is used as the selection factor p, and the first target processing node is selected from all candidate processing nodes N in the manner of p%N.

[0197] Here, p%N means dividing the dividend P by the divisor N and taking the remainder.

[0198] Step C2, determine whether the selected target processing node x is greater than the number of processing nodes k, if so, execute step C5, otherwise execute step C3.

[0199] Step C3, updating the selection factor.

[0200] In a possible implementation, the selection factor is re-determined according to the previous selection factor and the block hash value. Exemplarily, the selection factor is re-determined by the following formula:

[0201] p=p′*hash(cx)

[0202] Among them, p is the updated selection factor, p′ is the previous selection factor. For example, if the second target processing node is to be selected, p′ is the selection factor used when selecting the first target processing node, hash() is the block hash value of a certain height, c is the latest block in the blockchain, and x is the number of selected target processing nodes.

[0203] Step C4, based on the updated selection factor, adopt the p%N method to select the target processing node from all the candidate processing nodes N, and update the number x of the selected target processing nodes, and then return to step C2.

[0204] Step C5, completing the selection of all target processing nodes.

[0205] Step B3: Based on the consensus mechanism, the selected target processing node is verified. After the verification is passed, it is determined that the target processing node is successfully selected.

[0206] In one possible implementation, after the blockchain scheduling node completes the selection of all target processing nodes, it transmits the node information of the selected target processing nodes to other blockchain scheduling nodes, and receives the node information of the selected target processing nodes sent by other blockchain scheduling nodes; so as to compare the selected node information with the node information sent by other blockchain scheduling nodes, achieve consensus, complete the verification of the selected target processing nodes, and when it is determined that the comparison results are consistent, the verification passes, and it is determined that the target processing node is selected successfully.

[0207] The node information of the target processing node includes: the target processing node number and other identification information for uniquely indicating the target processing node.

[0208] In one possible implementation, when consensus is reached between blockchain scheduling nodes, each blockchain scheduling node encapsulates and signs the task request information and target processing node submitted by the task initiator when sending the target processing node determined by itself to other blockchain scheduling nodes to ensure accuracy.

[0209] In this application, the processing node is selected by the random number and the number of processing nodes specified by the task initiator. A transparent algorithm is used to screen the processing nodes based on the random number to ensure that the task initiator has the right to participate in the selection of the processing node, ensure randomness, and prevent the processing node from tampering with the task processing results.

[0210] Step S403: After verification, the blockchain scheduling node transmits at least one target subtask in the target directed acyclic graph to different target processing nodes.

[0211] In one possible implementation, before transmitting the target subtasks in the target directed acyclic graph to different target processing nodes, each target subtask in the target directed acyclic graph is copied v-1 times based on the task redundancy number v carried in the task processing request; then, when transmitting the target subtasks in the target directed acyclic graph to the target processing nodes, the target subtasks representing the same task are transmitted to different target processing nodes, and at least two subtasks representing different tasks are transmitted to the same or different target processing nodes.

[0212] For example, Fig.12The target subtask corresponding to each target graph node in the target directed acyclic graph shown is copied v-1 copies, and at this time, the target subtask corresponding to the target graph node A1 is obtained, the target subtask corresponding to the target graph node A234 is obtained, the target subtask corresponding to the target graph node A5 is obtained, the target subtask corresponding to the target graph node A678 is obtained, the target subtask corresponding to the target graph node A9 is obtained, the target subtask corresponding to the target graph node A10 is obtained, and the target subtask corresponding to the target graph node A11 is obtained; then, the target subtask corresponding to the v copies of the target graph node A1 is transmitted to different target processing nodes, the target subtask corresponding to the v copies of the target graph node A234 is transmitted to different target processing nodes, and so on. However, at this time, a target processing node that processes the target subtask corresponding to the target graph node A1 can also be used to process the target subtasks corresponding to other target graph nodes, for example, the target subtask corresponding to the target graph node A678.

[0213] In the present application, the target subtask is copied and processed according to the task redundancy number specified by the task initiator. After each target subtask is copied and processed, the number of copies corresponding to the task redundancy number is obtained, and then each target subtask is transmitted to a non-duplicate processing node according to the task redundancy number. Multiple processing nodes process the same target subtask to achieve multi-party comparison, avoid the problem of malicious processing nodes, and ensure the accuracy of task processing results.

[0214] Step S404: The target processing node processes the target subtask sent by the blockchain scheduling node to obtain the task processing result corresponding to the target subtask.

[0215] In one possible implementation, the target processing node processes the target subtask sent by the blockchain scheduling node through a process / coroutine according to the priority of the target subtask.

[0216] Step S405: The target processing node feeds back the obtained task processing result to the blockchain scheduling node.

[0217] In a possible implementation, after the target processing node completes processing of a target subtask, it feeds back the obtained task processing results to the blockchain scheduling node; or after the target processing node completes processing of all target subtasks associated with the same target directed acyclic graph, it feeds back the obtained task processing results to the blockchain scheduling node.

[0218] Step S406: The blockchain scheduling node feeds back the received task processing result to the task initiator.

[0219] In one possible implementation, after receiving the task processing result, the blockchain scheduling node determines that all target subtasks associated with the target directed acyclic graph have been executed, and then feeds back all task processing results to the task initiator, thereby reducing the number of communications, saving resources, and ensuring that the task initiator does not have confusion in task processing results.

[0220] In the embodiment of the present application, in order to ensure the security and stability of the task processing process, steps such as authentication and result authentication are set during the interaction process. Fig.13 , Fig.13 A schematic diagram of a specific implementation flow of another task processing method provided in an embodiment of the present application includes the following steps:

[0221] Step S1300: The task initiator sends a task processing request to the blockchain scheduling node.

[0222] In step S1301, the blockchain scheduling node authenticates the task processing request based on operation authority and signature authentication.

[0223] Exemplarily, it is determined whether the task initiator has the operation authority for the target task corresponding to the task processing request, and the signature of the task initiator is authenticated to determine whether the signature of the task initiator is correct, so as to authenticate the task processing request.

[0224] Step S1302: The blockchain scheduling node determines that the task processing request authentication is successful, and verifies the target task based on the target task timestamp and parameter information.

[0225] In a possible implementation, when it is determined that the task initiator has the operation authority for the target task corresponding to the task processing request and the signature is correct, it is determined that the task processing request authentication is passed, and the target task is further verified;

[0226] When verifying the target task, the timestamp of the target task is matched with the current time to determine whether the target task has timed out and whether the parameter information of the target task is legal.

[0227] In another possible implementation, when it is determined that the task initiator does not have the operation authority for the target task corresponding to the task processing request, or the signature is incorrect, a prompt message indicating that the authentication failure has occurred is sent to the task initiator.

[0228] Step S1303, the blockchain scheduling node determines that the target task verification is passed, and determines whether the task processing result corresponding to the target task is stored in the cache. If so, execute step S1304, otherwise execute step S1305.

[0229] In one possible implementation, when the target task has not timed out and the parameter information is legal, it is determined that the target task verification has passed, and further inquiries are made as to whether the task processing result corresponding to the target task is stored in the cache; wherein the legal parameter information indicates that the parameter information of the target task carried in the task processing request is consistent with the parameter regulations; for example, if data A is specified to be a positive number and the data A is a positive number in the carried parameter information, then it is determined that data A is legal.

[0230] In another possible implementation, when the target task times out or the parameter information is illegal, it is determined that the verification of the target task has failed, and prompt information indicating that the verification of the task has failed is sent to the task initiator.

[0231] Step S1304: the blockchain scheduling node feeds back the task processing result corresponding to the target task stored in the cache to the task initiator.

[0232] When the task processing result corresponding to the target task is stored in the cache, the task processing result is directly fed back to the task initiator, which reduces the waiting time of the task initiator and saves processing resources.

[0233] Step S1305, the blockchain scheduling node obtains the code information in the task information, determines the reference relationship between the codes based on the code information, and maps the target task into an initial directed acyclic graph based on the reference relationship between the codes.

[0234] Step S1306: The blockchain scheduling node determines at least two initial graph nodes having an associated relationship in the initial directed acyclic graph based on the connection relationship among the initial graph nodes in the initial directed acyclic graph.

[0235] Step S1307: Based on the task complexity of the initial subtask, the blockchain scheduling node summarizes at least two initial graph nodes with an associated relationship according to the preset concurrency and the preset execution complexity until the initial graph nodes cannot be summarized, and the target directed acyclic graph is obtained.

[0236] Step S1308: The blockchain scheduling node selects candidate processing nodes that meet preset active conditions from all processing nodes based on the status information of all processing nodes maintained.

[0237] Step S1309: The blockchain scheduling node selects a specified number of target processing nodes from the candidate processing nodes that meet the preset active conditions according to the random number carried in the task processing request.

[0238] In step S1310, the blockchain scheduling node verifies the selected target processing node based on the consensus mechanism.

[0239] Step S1311, after verification, the blockchain scheduling node transmits at least one target subtask in the target directed acyclic graph to different target processing nodes.

[0240] In one possible implementation, when the blockchain scheduling node transmits the target subtask in the target directed acyclic graph to the target processing node, the subscription port can be started to notify the target processing node to obtain the target subtask in the target directed acyclic graph; accordingly, the target processing node subscribes to the subtask of the target task to be executed, but ensures that the same subtask is not executed repeatedly.

[0241] Step S1312: The target processing node authenticates the target subtask sent by the blockchain scheduling node.

[0242] The target processing node authenticates the identity of the blockchain scheduling node and verifies the target subtask.

[0243] Step S1313: The target processing node determines that the target subtask is authenticated and places the target subtask into a task queue in order of priority.

[0244] In one possible implementation, the target processing node authenticates the identity of the blockchain scheduling node and verifies the target subtask. After the blockchain scheduling node identity authentication is passed and the target subtask verification is passed, it is determined that the target subtask authentication is passed, and then the target subtask is placed in the task queue in order of priority.

[0245] In another possible implementation, when the target processing node fails to authenticate the blockchain scheduling node or the target subtask fails to be verified, a prompt message indicating verification failure is sent to the task initiator.

[0246] Step S1314, when the target processing node determines that there are processing resources, it obtains the target task from the task queue, and executes the target subtask through the process / coroutine to obtain the task processing result.

[0247] Step S1315: The target processing node feeds back the task processing result to the blockchain scheduling node.

[0248] Step S1316: The blockchain scheduling node feeds back the received task processing results to the task initiator.

[0249] Step S1317: The task initiator verifies the task processing result.

[0250] In an embodiment of the present application, the task processing result sent by the blockchain scheduling node to the task initiator, in addition to the result information, also carries the processing node information that obtained the task processing result. The processing node information is information used to uniquely identify the processing node, such as the processing node number information.

[0251] Therefore, after receiving the task processing result, the task initiator performs signature verification on the task processing result and random number verification on the processing node information. The random number verification is based on the random number sent to the blockchain scheduling node, and the processing node is re-determined by selecting the target processing node with the blockchain scheduling node to determine whether the re-determined processing node matches the received processing node information.

[0252] In a possible implementation, if the task processing result passes the signature verification and the processing node information random number verification, the received task processing result is determined to be correct; otherwise, the received task processing result is determined to be incorrect and the task processing result is discarded.

[0253] In the present application, the task initiator verifies the received task processing result to further ensure the accuracy of the task processing result.

[0254] based on Fig.13 The task processing interaction process shown in the embodiment of the present application involves a task processing structure; see Fig.14 , Fig.14 A schematic diagram of a task processing architecture provided in an embodiment of the present application.

[0255] from Fig.14 It can be seen that:

[0256] The blockchain scheduling node receives the task processing request sent by the task initiator through the network module, and then sends the task processing request to the authentication module for authentication. After determining that the authentication is passed, the task verification is performed through the task DAG group module. After the task verification is passed, it is queried whether the storage module stores the task processing result. If the storage module stores the task processing result of the target task, the task processing result is obtained from the storage module, and the task processing result is fed back to the task initiator through the network module; if the storage module does not store the task processing result of the target task, the task DAG group module is used to perform task decomposition and induction, task replication and maintenance, etc.; at the same time, the load balancing module selects a processing node based on the processing node status information. After determining the processing node, the load balancing module selects a subtask from the task DAG cluster and assigns the subtask to the processing node through the network module; finally, after receiving the task processing feedback from the processing node through the network module, the task processing result is fed back to the task initiator; wherein, the processing node status information stored in the load balancing module is stored after being received by the network module; the task processing result stored in the storage module is stored after receiving the processing node feedback for the first time.

[0257] Correspondingly, after the processing node receives the subtask sent by the blockchain scheduling node through the network module, it authenticates the subtask. After determining that the authentication verification is passed, it executes the subtask through the execution module to obtain the task processing result, and transmits the task processing result to the blockchain scheduling node through the network module, so that the blockchain scheduling node feeds back the task processing request to the task initiator.

[0258] The above describes the task processing system architecture for multi-party processing of super-large tasks based on blockchain. The task processing system is the operating basis of super-large tasks. In the task processing system, the full life cycle process of multi-party processing of super-large tasks based on blockchain is designed, including: task upload process (the task initiator generates random numbers and uploads super-large tasks to the blockchain for processing node screening, super-large task disassembly, sub-task DAG construction, sub-task DAG induction, etc.), task execution and verification process (processes such as processing nodes obtaining sub-tasks from sub-task DAG for execution and verification of legitimacy); through the design of these processes, the stable and efficient operation of the full life cycle of multi-party processing of super-large tasks based on blockchain can be guaranteed.

[0259] Moreover, the modules in the task processing system cooperate with each other to ensure that super-large tasks are executed concurrently in multiple nodes, and the task volume of each node is moderate, which improves the efficiency of parallel execution and ensures the credibility of task processing, that is, the random number generation algorithm is transparent, the random number is generated by the task initiator itself, and each subtask will be redundantly executed and verified; it can ensure unlimited expansion of computing power, and the tasks in the blockchain are asynchronous, without waiting for the execution results, and can be expanded infinitely. Finally, the public and private key certificate mechanism between the various devices of the task processing system ensures the security and stability of the entire system, which can be widely reused in the industry.

[0260] See also Fig.15 , Fig.15 A flowchart of a method for blockchain scheduling nodes to perform task processing provided in an embodiment of the present application includes the following steps:

[0261] Step S1500, receiving a task processing request sent by a task initiator; wherein the task processing request at least includes task information;

[0262] Step S1501, based on the task information, mapping the target task corresponding to the task processing request into a target directed acyclic graph; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, each of which represents: a target subtask obtained after splitting the target task;

[0263] Step S1502, selecting a specified number of target processing nodes from the candidate processing nodes that meet the preset active condition, and verifying the selected target processing nodes based on the consensus mechanism;

[0264] Step S1503, after verification, at least one target subtask in the target directed acyclic graph is transmitted to different target processing nodes;

[0265] Step S1504: receiving the task processing result fed back by the target processing node, and feeding back the task processing result to the task initiator.

[0266] In a possible implementation, the task information includes at least code information;

[0267] Based on the task information, the target task corresponding to the task processing request is mapped into a target directed acyclic graph, including:

[0268] Based on the code information, determine the mutual reference relationship between the codes, and based on the mutual reference relationship, map the target task into an initial directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each of which represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split;

[0269] Based on the preset induction rules, the initial subtasks in the initial directed acyclic graph are summarized to obtain the target directed acyclic graph.

[0270] In a possible implementation, based on a preset induction rule, the initial subtasks in the initial directed acyclic graph are summarized to obtain a target directed acyclic graph, including:

[0271] Based on the connection relationship between the initial graph nodes in the initial directed acyclic graph, determining at least two initial graph nodes in the initial directed acyclic graph that have an associated relationship;

[0272] Based on the task complexity of the initial subtask, at least two initial graph nodes with an associated relationship are summarized according to the preset concurrency and the preset execution complexity until the initial graph nodes cannot be summarized, and the target directed acyclic graph is obtained.

[0273] In a possible implementation, the association relationship includes: a parent-child relationship and a brother-sister relationship;

[0274] The parent-child relationship means: of the two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge, and the outgoing edge and the incoming edge are the same edge;

[0275] A sibling relationship means: among at least two initial graph nodes, all initial graph nodes have only one outgoing edge, the outgoing edge points to the same initial graph node, and at least one initial graph node has no incoming edge; or the outgoing edges of all initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes point to the same initial node.

[0276] In a possible implementation, after receiving the task processing request sent by the task initiator, and before mapping the target task corresponding to the task processing request to a target directed acyclic graph based on the task information, the method further includes:

[0277] Based on the operation permissions and signature authentication, determine that the task processing request meets the authentication conditions;

[0278] Based on the target task timestamp and parameter information, it is determined that the target task verification has passed;

[0279] It is determined that no task processing result corresponding to the target task is stored in the cache.

[0280] In a possible implementation, selecting a specified number of target processing nodes from candidate processing nodes that meet a preset active condition includes:

[0281] Determine a selection factor according to the random number, and select a specified number of target processing nodes from the candidate processing nodes according to the selection factor;

[0282] The random number and the specified number are sent by the task initiator.

[0283] In a possible implementation, determining a selection factor according to a random number includes:

[0284] If the first target number of processing nodes is selected, a random number is used as the selection factor;

[0285] If a number of processing nodes other than the first target is selected, the selection factor is re-determined based on the previous selection factor and the block hash value.

[0286] In a possible implementation, transmitting at least one target subtask in the target directed acyclic graph to different target processing nodes includes:

[0287] Based on the task redundancy number indicated by the task initiator, each target subtask in the target directed acyclic graph is copied;

[0288] Among the multiple target subtasks after the replication process, the target subtasks representing the same task are transmitted to different target processing nodes.

[0289] In a possible implementation, feeding back the task processing result to the task initiator includes:

[0290] After determining that all target subtasks associated with the target directed acyclic graph have been executed, all received task processing results are fed back to the task initiator.

[0291] See also Fig.16 , Fig.16A flowchart of a method for performing task processing on a processing node provided in an embodiment of the present application includes the following steps:

[0292] Step S1600, receiving the target subtask sent by the blockchain scheduling node;

[0293] Step S1601, processing the target subtask to obtain the task processing result corresponding to the target subtask;

[0294] Step S1602, feeding back the task processing result to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing result to the task initiator.

[0295] In a possible implementation, after receiving the target subtask sent by the blockchain scheduling node and before processing the target subtask, the following steps are further included:

[0296] The target subtask is authenticated and after it is determined that the authentication is passed, the target subtask is added to the task queue according to the priority, so as to be processed according to the order of tasks in the task queue.

[0297] See also Fig.17 , Fig.17 A flowchart of a method for performing task processing on a task initiator provided in an embodiment of the present application includes the following steps:

[0298] Step S1700, sending a task processing request to a blockchain scheduling node; wherein the task processing request includes at least task information;

[0299] Step S1701, receiving the task processing result fed back by the blockchain scheduling node; the task processing result is fed back by the blockchain scheduling node after receiving the task processing result fed back by the target processing node.

[0300] In a possible implementation, the task processing result includes at least processing node information;

[0301] After receiving the task processing results fed back by the blockchain scheduling node, it also includes:

[0302] Signature verification of task processing results; and

[0303] Perform random number verification on processing node information.

[0304] In the present application, the blockchain scheduling node first maps the target task corresponding to the task processing request to a target directed acyclic graph based on the task information carried in the received task processing request; the target directed acyclic graph meets the simplification condition and includes at least two target graph nodes, each target graph node represents a target subtask obtained after splitting the target task; the target task is split into multiple subtasks so that multiple processing nodes can execute concurrently, and at the same time the target directed acyclic graph meets the simplification condition, that is, the target subtasks represented by each graph node in the target directed acyclic graph cannot be further merged, so as to avoid the situation where the task amount of each target subtask is too small, reduce communication efficiency, and improve execution efficiency; then, a specified number of target processing nodes are selected from the candidate processing nodes that meet the preset active conditions, and the selected target processing nodes are verified based on the consensus mechanism to ensure the credibility of the selected target processing nodes, and further ensure the credibility of the target processing nodes for task processing; and after the verification is passed, at least one target in the target directed acyclic graph is Subtasks are transmitted to different target processing nodes; they are executed in parallel by multiple target processing nodes, and the same target subtask is transmitted to different target processing nodes for execution, and the task processing results of multiple target processing nodes for the same subtask are obtained, so as to realize multi-party comparison to avoid the problem of external processing services doing evil and ensure the accuracy of task processing results; finally, the task processing results fed back by the target processing node are received, and the task processing results are fed back to the task initiator. Since the target processing node has been subjected to consensus authentication to ensure the credibility of the target processing node, after receiving the task processing results fed back by the target processing result, there is no need to perform consensus authentication, and the processing results can be fed back to the task initiator, which reduces the time for consensus authentication of the task processing results, that is, reduces the waiting time for the output results, and in the blockchain, the blockchain scheduling node performs each task asynchronously, that is, while waiting for the processing node to feedback the task processing results, it can perform directed target acyclic graph mapping, processing node selection, subtask scheduling, etc. for other tasks, thereby improving resource utilization.

[0305] In addition, it should be noted that in the specific implementation of this application, user-related data is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0306] Based on the same inventive concept, the embodiment of the present application also provides a task processing device applied to a blockchain scheduling node; Fig.18 As shown, the task processing device 1800 includes:

[0307] The first receiving unit 1801 is used to receive a task processing request sent by a task initiator; wherein the task processing request at least includes task information;

[0308] A mapping unit 1802 is used to map the target task corresponding to the task processing request into a target directed acyclic graph based on the task information; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, each of which represents: a target subtask obtained after splitting the target task;

[0309] The selection unit 1803 is used to select a specified number of target processing nodes from the candidate processing nodes that meet the preset active condition, and verify the selected target processing nodes based on the consensus mechanism;

[0310] A transmission unit 1804 is used to transmit at least one target subtask in the target directed acyclic graph to different target processing nodes after verification;

[0311] The first feedback unit 1805 is used to receive the task processing result fed back by the target processing node, and feed back the task processing result to the task initiator.

[0312] In a possible implementation, the task information includes at least code information; the mapping unit 1802 is specifically configured to:

[0313] Based on the code information, determine the mutual reference relationship between the codes, and based on the mutual reference relationship, map the target task into an initial directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each of which represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split;

[0314] Based on the preset induction rules, the initial subtasks in the initial directed acyclic graph are summarized to obtain the target directed acyclic graph.

[0315] In a possible implementation, the mapping unit 1802 is specifically configured to:

[0316] Based on the connection relationship between the initial graph nodes in the initial directed acyclic graph, determining at least two initial graph nodes in the initial directed acyclic graph that have an associated relationship;

[0317] Based on the task complexity of the initial subtask, at least two initial graph nodes with an associated relationship are summarized according to the preset concurrency and the preset execution complexity until the initial graph nodes cannot be summarized, and the target directed acyclic graph is obtained.

[0318] In a possible implementation, the association relationship includes: a parent-child relationship and a brother-sister relationship;

[0319] The parent-child relationship means: of the two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge, and the outgoing edge and the incoming edge are the same edge;

[0320] A sibling relationship means: among at least two initial graph nodes, all initial graph nodes have only one outgoing edge, the outgoing edge points to the same initial graph node, and at least one initial graph node has no incoming edge; or the outgoing edges of all initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes point to the same initial node.

[0321] In a possible implementation, after receiving the task processing request sent by the task initiator, and before mapping the target task corresponding to the task processing request to the target directed acyclic graph based on the task information, the first receiving unit 1801 is further configured to:

[0322] Based on the operation permissions and signature authentication, determine that the task processing request meets the authentication conditions;

[0323] Based on the target task timestamp and parameter information, it is determined that the target task verification has passed;

[0324] It is determined that no task processing result corresponding to the target task is stored in the cache.

[0325] In a possible implementation, the selection unit 1803 is specifically configured to:

[0326] Determine a selection factor according to the random number, and select a specified number of target processing nodes from the candidate processing nodes according to the selection factor;

[0327] The random number and the specified number are sent by the task initiator.

[0328] In a possible implementation, the selection unit 1803 is specifically configured to:

[0329] If the first target number of processing nodes is selected, a random number is used as the selection factor;

[0330] If a number of processing nodes other than the first target is selected, the selection factor is re-determined based on the previous selection factor and the block hash value.

[0331] In a possible implementation, the transmission unit 1804 is specifically configured to:

[0332] Based on the task redundancy number indicated by the task initiator, each target subtask in the target directed acyclic graph is copied;

[0333] Among the multiple target subtasks after the replication process, the target subtasks representing the same task are transmitted to different target processing nodes.

[0334] In a possible implementation, the first feedback unit 1805 is specifically configured to:

[0335] After determining that all target subtasks associated with the target directed acyclic graph have been executed, all received task processing results are fed back to the task initiator.

[0336] Based on the same inventive concept, the embodiment of the present application also provides a task processing device, which is applied to a target processing node; Fig.19 As shown, the task processing device 1900 includes:

[0337] The second receiving unit 1901 is used to receive the target subtask sent by the blockchain scheduling node;

[0338] The processing unit 1902 is used to process the target subtask and obtain the task processing result corresponding to the subtask;

[0339] The second feedback unit 1903 is used to feed back the task processing result to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing result to the task initiator.

[0340] In a possible implementation, after receiving the target subtask sent by the blockchain scheduling node and before processing the target subtask, the second receiving unit 1901 is further used to:

[0341] The target subtask is authenticated and after it is determined that the authentication is passed, the target subtask is added to the task queue according to the priority, so as to be processed according to the order of tasks in the task queue.

[0342] Based on the same inventive concept, the embodiment of the present application also provides a task processing device, which is applied to a processing node; Fig. 20 As shown, the task processing device 2000 includes:

[0343] The sending unit 2001 is used to send a task processing request to the blockchain scheduling node; wherein the task processing request at least includes task information;

[0344] The third receiving unit 2002 is used to receive the task processing result fed back by the blockchain scheduling node; the task processing result is fed back by the blockchain scheduling node after receiving the task processing result fed back by the target processing node.

[0345] In a possible implementation, the task processing result includes at least processing node information;

[0346] After receiving the task processing result fed back by the blockchain scheduling node, the third receiving unit 2002 is further used to:

[0347] Signature verification of task processing results; and

[0348] Perform random number verification on processing node information.

[0349] It should be noted that although several units (or modules) of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units (or modules) described above can be concretized in one unit (or module). Conversely, the features and functions of one unit (or module) described above can be further divided into multiple units (or modules) for concretization. Of course, when implementing the present application, the functions of each unit (or module) can also be implemented in the same one or more software or hardware.

[0350] After introducing the task processing method and apparatus according to an exemplary embodiment of the present application, another exemplary embodiment of the present application, a computing device, is introduced next.

[0351] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0352] Based on the same inventive concept as the above method embodiment, a computing device is also provided in the present application embodiment. In one embodiment, the computing device may be a server. In this embodiment, the structure of the computing device is as follows: Fig.21 As shown, it may include at least a memory 2101 , a communication module 2103 , and at least one processor 2102 .

[0353] The memory 2101 is used to store computer programs executed by the processor 2102. The memory 2101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0354] The memory 2101 may be a volatile memory, such as a random-access memory (RAM); the memory 2101 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 2101 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2101 may be a combination of the above memories.

[0355] The processor 2102 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 2102 is used to implement the above-mentioned task processing method when calling the computer program stored in the memory 2101 .

[0356] The communication module 2103 is used to communicate with terminal devices and other servers.

[0357] The specific connection medium between the memory 2101, the communication module 2103 and the processor 2102 is not limited in the embodiment of the present application. Fig.21 In the embodiment, the memory 2101 and the processor 2102 are connected via a bus 2104. The bus 2104 is connected to the processor 2102 via a bus 2104. Fig.21 The connections between the other components are only for illustration and are not intended to be limiting. The bus 2104 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.21 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0358] The memory 2101 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the task processing method of the embodiment of the present application. The processor 2102 is used to execute the above-mentioned task processing method.

[0359] In another embodiment, the computing device may also be other computing devices, such as a terminal device. In this embodiment, the structure of the computing device may be as follows: Fig. 22 As shown, it includes: a communication component 2210, a memory 2220, a display unit 2230, a camera 2240, a sensor 2250, an audio circuit 2260, a Bluetooth module 2270, a processor 2280 and other components.

[0360] The communication component 2210 is used to communicate with the server. In some embodiments, a circuit wireless fidelity (Wireless Fidelity, WiFi) module may be included.

[0361] The memory 2220 can be used to store software programs and data. The processor 2280 executes various functions and data processing of the terminal device by running the software programs or data stored in the memory 2220. The memory 2220 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 2220 stores an operating system that enables the terminal device to run. In the present application, the memory 2220 can store an operating system and various application programs, and can also store a computer program for executing the task processing method of the embodiment of the present application.

[0362] The display unit 2230 can also be used to display information input by the object or information provided to the object and a graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 2230 may include a display screen 2232 disposed on the front of the terminal device. The display screen 2232 may be configured in the form of a liquid crystal display, a light emitting diode, etc.

[0363] The display unit 2230 can also be used to receive input digital or character information and generate signal input related to the object setting and function control of the terminal device. Specifically, the display unit 2230 may include a touch screen 2231 arranged on the front of the terminal device, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.

[0364] The touch screen 2231 may be covered on the display screen 2232, or the touch screen 2231 and the display screen 2232 may be integrated to realize the input and output functions of the terminal device, and the integrated touch screen may be referred to as a touch display screen.

[0365] The camera 2240 can be used to capture static images, and the object can publish the image taken by the camera 2240 through the application. The camera 2240 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 2280 to convert it into a digital image signal.

[0366] The terminal device may further include at least one sensor 2250, such as an acceleration sensor 2251, a distance sensor 2252, a fingerprint sensor 2253, and a temperature sensor 2254. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0367] The audio circuit 2260, the speaker 2261, and the microphone 2262 can provide an audio interface between the object and the terminal device. The audio circuit 2260 can transmit the electrical signal converted from the received audio data to the speaker 2261, which is converted into a sound signal for output. The terminal device can also be equipped with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 2262 converts the collected sound signal into an electrical signal, which is received by the audio circuit 2260 and converted into audio data, and then the audio data is output to the communication component 2210 to be sent to, for example, another terminal device, or the audio data is output to the memory 2220 for further processing.

[0368] The Bluetooth module 2220 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 2220 to exchange data.

[0369] The processor 2280 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 2220 and calling data stored in the memory 2220. In some embodiments, the processor 2280 may include one or more processing units; the processor 2280 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 2280. In the present application, the processor 2280 can run the operating system, application programs, user interface display and touch response, as well as the task processing method of the embodiment of the present application. In addition, the processor 2280 is coupled to the display unit 2230.

[0370] In some possible implementations, various aspects of the task processing method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computing device, the program code is used to enable the computing device to execute the steps of the task processing method according to various exemplary implementations of the present application described above in this specification.

[0371] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0372] The program product of the task processing of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or device.

[0373] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0374] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0375] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user equipment, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0376] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0377] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the commands executed by the processor of the computer or other programmable device generate commands 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.

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

[0379] These computer program commands can also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the 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.

[0380] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional 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 falling within the scope of the present application.

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

Claims

1. A task processing method, characterized in that: Applied to a blockchain scheduling node, the method includes: Receiving a task processing request sent by a task initiator; wherein the task processing request at least includes task information; Based on the task information, the target task corresponding to the task processing request is mapped into a target directed acyclic graph; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, each of which represents: a target subtask obtained after splitting the target task; Select a specified number of target processing nodes from the candidate processing nodes that meet the preset active conditions, and verify the selected target processing nodes based on the consensus mechanism; After verification, at least one target subtask in the target directed acyclic graph is transmitted to different target processing nodes; The task processing result fed back by the target processing node is received, and the task processing result is fed back to the task initiator.

2. The method according to claim 1, characterized in that The task information at least includes code information; The mapping of the target task corresponding to the task processing request to a target directed acyclic graph based on the task information includes: Based on the code information, determine the mutual reference relationship between the codes, and based on the mutual reference relationship, map the target task into an initial directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each of which represents: an initial subtask obtained after splitting the target task, and each of which meets the condition that the task cannot be split; Based on a preset induction rule, the initial subtasks in the initial directed acyclic graph are summarized to obtain the target directed acyclic graph.

3. The method according to claim 2, characterized in that The step of summarizing the initial subtasks in the initial directed acyclic graph based on a preset induction rule to obtain the target directed acyclic graph includes: Based on the connection relationship between the initial graph nodes in the initial directed acyclic graph, determining at least two initial graph nodes in the initial directed acyclic graph that have an association relationship; Based on the task complexity of the initial subtask, at least two initial graph nodes with an associated relationship are summarized according to a preset concurrency and a preset execution complexity until the initial graph nodes cannot be summarized, thereby obtaining the target directed acyclic graph.

4. The method according to claim 3, characterized in that The association relationships include: father-son relationship and brother relationship; The parent-child relationship indicates that: of the two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge, and the outgoing edge and the incoming edge are the same edge; The sibling relationship indicates that: among at least two initial graph nodes, all initial graph nodes have only one outgoing edge, the outgoing edge points to the same initial graph node, and at least one initial graph node has no incoming edge; or the outgoing edges of all initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes point to the same initial node.

5. The method according to claim 1 or 2, characterized in that: After receiving the task processing request sent by the task initiator, and before mapping the target task corresponding to the task processing request to a target directed acyclic graph based on the task information, the method further includes: Based on the operation authority and signature authentication, determining that the task processing request meets the authentication conditions; Based on the target task timestamp and parameter information, determining that the target task verification is passed; It is determined that no task processing result corresponding to the target task is stored in the cache.

6. The method according to claim 1, characterized in that The step of selecting a specified number of target processing nodes from candidate processing nodes that meet a preset active condition includes: Determine a selection factor according to the random number, and select a specified number of target processing nodes from the candidate processing nodes according to the selection factor; The random number and the specified number are sent by the task initiator.

7. The method according to claim 6, characterized in that Determining the selection factor according to the random number includes: If the first target number of processing nodes is selected, the random number is used as the selection factor; If a number other than the first target processing node number is selected, the selection factor is re-determined based on the previous selection factor and the block hash value.

8. The method according to claim 1, characterized in that The transmitting at least one target subtask in the target directed acyclic graph to different target processing nodes includes: Based on the task redundancy number indicated by the task initiator, copy each target subtask in the target directed acyclic graph; Among the multiple target subtasks after the replication process, the target subtasks representing the same task are transmitted to different target processing nodes.

9. The method according to claim 1, characterized in that Feeding back the task processing result to the task initiator includes: After determining that all target subtasks associated with the target directed acyclic graph have been executed, all received task processing results are fed back to the task initiator.

10. A task processing method, characterized in that: Applied to a target processing node, the method comprises: Receive the target subtask sent by the blockchain scheduling node; Processing the target subtask to obtain a task processing result corresponding to the target subtask; The task processing result is fed back to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing result to the task initiator.

11. The method according to claim 10, characterized in that After receiving the target subtask sent by the blockchain scheduling node and before processing the target subtask, the method further includes: The target subtask is authenticated and after it is determined that the authentication is passed, the target subtask is added to the task queue according to the priority, so as to be processed according to the task order in the task queue.

12. A task processing method, characterized in that: Applied to the task initiator, the method includes: Sending a task processing request to a blockchain scheduling node; wherein the task processing request includes at least task information; Receive the task processing result fed back by the blockchain scheduling node; the task processing result is fed back by the blockchain scheduling node after receiving the task processing result fed back by the target processing node.

13. The method according to claim 12, characterized in that The task processing result at least includes processing node information; After receiving the task processing result fed back by the blockchain scheduling node, the method further includes: Performing signature verification on the task processing result; and A random number verification is performed on the processing node information.

14. A task processing device, characterized in that: Applied to a blockchain scheduling node, the device comprises: A first receiving unit, configured to receive a task processing request sent by a task initiator; wherein the task processing request at least includes task information; A mapping unit, configured to map the target task corresponding to the task processing request to a target directed acyclic graph based on the task information; wherein the target directed acyclic graph meets the simplification condition, and the target directed acyclic graph includes at least two target graph nodes, each of which represents: a target subtask obtained after splitting the target task; A selection unit, used to select a specified number of target processing nodes from candidate processing nodes that meet preset active conditions, and verify the selected target processing nodes based on a consensus mechanism; A transmission unit, used to transmit at least one target subtask in the target directed acyclic graph to different target processing nodes after verification; The first feedback unit is used to receive the task processing result fed back by the target processing node, and feed back the task processing result to the task initiator.

15. A task processing device, characterized in that: Applied to a target processing node, the device comprises: A second receiving unit is used to receive a target subtask sent by a blockchain scheduling node; A processing unit, used to process the target subtask and obtain a task processing result corresponding to the target subtask; The second feedback unit is used to feed back the task processing result to the blockchain scheduling node, so that the blockchain scheduling node feeds back the task processing result to the task initiator.

16. A task processing device, characterized in that: Applied to a task initiator, the device comprises: A sending unit, configured to send a task processing request to a blockchain scheduling node; wherein the task processing request includes at least task information; The third receiving unit is used to receive the task processing result fed back by the blockchain scheduling node; the task processing result is fed back by the blockchain scheduling node after receiving the task processing result fed back by the target processing node.

17. A computing device, characterized in that The computing device comprises: a processor and a memory, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to implement the method described in any one of claims 1 to 9, or to implement the method described in any one of claims 10 to 11, or to implement the method described in any one of claims 12 to 13.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method described in any one of claims 1 to 9 is implemented, or the method described in any one of claims 10 to 11 is implemented, or the method described in any one of claims 12 to 13 is implemented.

19. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 9, or implements the method described in any one of claims 10 to 11, or implements the method described in any one of claims 12 to 13.

Citation Information

Patent Citations

  • Method and apparatus for processing streaming data task

    CN106713944A

  • Load balancing method and system based on block chain and edge computing

    CN113114790A

  • Task scheduling method and device based on directed acyclic graph, equipment and medium

    CN114281552A

  • Clustering scheduling method and device based on copying and redundancy elimination

    CN115168015A

  • Self-organizing distributed task coordination for ad-hoc computing environment

    US10448454B1

Cited By

  • Template-based resource rendering method and apparatus, and computing device

    CN119865564A