A task processing method, apparatus, device, and storage medium

CN119109987BActive Publication Date: 2026-10-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

但是,对任务处理结果进行共识时,每个区块链节点均要等待外部服务商返回任务处理结果,导致区块链出块慢,等待时间长,且在等待返回任务处理结果的时间内,区块链节点的资源无法被充分利用

Benefits of technology

[0066]本申请实施例提供一种任务处理方法、装置、设备及存储介质,涉及任务处理技术领域,涉及区块链技术领域。在本申请中,区块链调度节点,首先基于接收到的任务处理请求中携带的任务信息,将任务处理请求对应的目标任务映射为目标有向无环图;目标有向无环图符合简化条件,且包括至少两个目标图节点,每个目标图节点表征将目标任务拆分后获得的一个目标子任务;将目标任务拆解成多个子任务,以便多个处理节点并发执行,同时目标有向无换图符合简化条件,也就是说,目标有向无环图中各个图节点表征的目标子任务之间无法继续合并,避免每个目标子任务的任务量过小的情况,减少通信效率,提升执行效率;然后,在满足预设活跃条件的候选处理节点中,选取指定数量的目标处理节点,基于共识机制,对选取的目标处理节点进行验证,保证选取的目标处理节点的可信性,进一步保证目标处理节点对任务处理的可信性;且验证通过后,将目标有向无环图中的至少一个目标子任务,传输给不同的目标处理节点;由多个目标处理节点并行执行,且同一目标子任务传输给不同的目标处理节点执行,获取多个目标处理节点针对同一子任务的任务处理结果,实现多方对照避免外部处理服务作恶问题,保证任务处理结果的准确性;最后,接收目标处理节点反馈的任务处理结果,并将任务处理结果反馈给任务发起端,由于已对目标处理节点进行共识认证保证目标处理节点的可信性,因此在接收到目标处理结果反馈的任务处理结果后,无需进行共识认证,即可将处理结果反馈给任务发起端,减少了针对任务处理结果进行共识认证的时间,即减少输出结果的等待时间,且在区块链中,区块链调度节点针对各个任务异步进行,即在等待处理节点反馈任务处理结果的时候,可针对其他任务进行有向目标无环图映射、处理节点选取、子任务调度等,提升资源利用率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109987B_ABST
    Figure CN119109987B_ABST
Patent Text Reader

Abstract

A task processing method and device, equipment and storage medium, relate to blockchain technology and task processing technology; to ensure the credibility of task processing, reduce the waiting time of task output results, and improve resource utilization. The blockchain scheduling node receives the task processing request sent by the task initiator; based on the task information in the task processing request, the target task corresponding to the task processing request is mapped to a target directed acyclic graph; the target directed acyclic graph meets the simplification condition and includes at least two target graph nodes, and each target graph node represents a target subtask obtained after the target task is split; in the candidate processing node, a specified number of target processing nodes are selected; after the selected target processing nodes are verified, at least one target subtask in the target directed acyclic graph is transmitted to different target processing nodes; receiving the task processing result fed back by the target processing node, and feeding back the task processing result to the task initiator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of task processing technology, and in particular to a task processing method, apparatus, device and storage medium. Background Technology

[0002] For extremely large tasks, a clustered approach is typically used, where multiple nodes within a cluster execute the task. The biggest challenge here is trust; the task initiator cannot guarantee the reliability of the task processing and its results.

[0003] With the development of blockchain technology, solutions for executing ultra-large tasks using blockchain have been proposed. Blockchain employs a multi-node consensus mechanism; this consensus mechanism is essentially a mathematical algorithm that enables different nodes in the blockchain system to establish trust and acquire rights. Therefore, the consensus mechanism in blockchain enables multiple blockchain nodes to maintain trust relationships, solving the trust problem. However, blockchain nodes need to handle tasks, consensus, and storage. Therefore, as the number of nodes increases, the consensus time will continuously increase, and blockchain resources cannot be reasonably scaled. The task processing capacity of a blockchain node is extremely limited. Therefore, an external service provider is designated in the contract to handle tasks. The blockchain signs and authenticates the task processing results returned by the external service provider and reaches a consensus on the results to ensure their credibility. However, when reaching a consensus on task processing results, each blockchain node must wait for the external service provider to return the results, resulting in slow block production, long waiting times, and insufficient utilization of blockchain node resources during the waiting period.

[0004] Therefore, while ensuring the reliability 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. Summary of the Invention

[0005] This application provides a task processing method, apparatus, device, and storage medium to reduce the waiting time for output results and improve resource utilization while ensuring the reliability of task processing.

[0006] In a first aspect, embodiments of this application provide a task processing method applied to a blockchain scheduling node, the method comprising:

[0007] Receive a task processing request sent by the task initiator; the task processing request shall include at least task information.

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

[0009] 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.

[0010] After successful 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 from the target processing node, and when the feedback conditions are met, send the task processing results back to the task initiator.

[0012] Secondly, embodiments of this application provide a task processing method applied to a target processing node, the method comprising:

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

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

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

[0016] Thirdly, embodiments of this application provide a task processing method applied at a task initiating end, the method comprising:

[0017] Send a task processing request to the blockchain scheduling node; the task processing request shall include at least task information.

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

[0019] Fourthly, embodiments of this application provide a task processing device applied to a blockchain scheduling node, the device comprising:

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

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

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

[0023] The transmission unit is 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 results from the target processing node and then feed the results back to the task initiator.

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

[0026] Based on the code information, the mutual reference relationships between the code are determined, and based on the mutual reference relationships, the target task is mapped to an initial directed acyclic graph; wherein, the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node 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 preset induction rules, the initial subtasks in the initial directed acyclic graph are inductively processed to obtain the target directed acyclic graph.

[0028] In one possible implementation, the mapping unit is specifically used for:

[0029] Based on the connection relationships 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 association relationship;

[0030] Based on the task complexity of the initial subtask, at least two initial graph nodes with related relationships are summarized according to the preset concurrency and preset execution complexity until the initial graph nodes can no longer be summarized, thus obtaining the target directed acyclic graph.

[0031] In one possible implementation, the relationships include: parent-child relationships and sibling relationships;

[0032] Parent-child relationship means that in 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] Sibling relationship means that in at least two initial graph nodes, all initial graph nodes have only one outgoing edge pointing to the same initial graph node, and at least one initial graph node has no incoming edges; or all outgoing edges of the initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes are pointed to by the same initial graph node.

[0034] In one 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 first receiving unit is further configured to:

[0035] Based on operation permissions and signature authentication, it is determined 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 has passed verification;

[0037] It was determined that the cache did not contain the task processing result corresponding to the target task.

[0038] In one possible implementation, the selected unit is specifically used for:

[0039] The selection factor is determined based on the random number, and a specified number of target processing nodes are selected from the candidate processing nodes based on the selection factor.

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

[0041] In one possible implementation, the selected unit is specifically used for:

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

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

[0044] In one possible implementation, the transmission unit is specifically used for:

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

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

[0047] In one possible implementation, the first feedback unit is specifically used for:

[0048] After all target subtasks associated with the target in the directed acyclic graph have been completed, the results of all task processing received will be fed back to the task initiator.

[0049] Fifthly, embodiments of this application provide a task processing apparatus applied to a target processing node, the apparatus comprising:

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

[0051] The processing unit is used to process the target subtask and obtain the task processing result corresponding to the target subtask.

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

[0053] In one 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 configured to:

[0054] The target subtask is authenticated. Once the authentication is successful, the target subtask is added to the task queue according to its priority, so that it can be processed in the order of the tasks in the task queue.

[0055] Sixthly, embodiments of this application provide a task processing apparatus applied at a task initiation end, the apparatus comprising:

[0056] The sending unit is used to send a task processing request to the 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 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.

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

[0059] After receiving the task processing results from the blockchain scheduling node, the third receiving unit is also used for:

[0060] Perform signature verification on the task processing results; and

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

[0062] In a seventh aspect, embodiments of this application provide a computing device, including: 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 embodiments of this application.

[0063] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the task processing method provided in embodiments of this application.

[0064] Ninthly, embodiments of this application provide a computer program product, which includes a computer program stored in a computer-readable storage medium; when a processor of a computing device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the computing device to perform the steps of the task processing method provided in embodiments of this application.

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

[0066] This application provides a task processing method, apparatus, device, and storage medium, relating to the field of task processing technology and blockchain technology. In this application, a blockchain scheduling node first maps the target task corresponding to the received task processing request into a target directed acyclic graph (DAG) based on the task information carried in the request. The DAG meets simplification conditions and includes at least two target graph nodes, each representing a sub-task obtained after splitting the target task. The target task is decomposed into multiple sub-tasks so that multiple processing nodes can execute them concurrently. Simultaneously, the DAG meets simplification conditions, meaning that the sub-tasks represented by the graph nodes in the DAG cannot be merged further, avoiding situations where the workload of each sub-task is too small, reducing communication efficiency, and improving execution efficiency. Then, from candidate processing nodes that meet preset activity conditions, a specified number of target processing nodes are selected. Based on a consensus mechanism, the selected target processing nodes are verified to ensure their credibility, further ensuring the credibility of the target processing nodes in task processing. After successful verification, at least one target task in the DAG is... Subtasks are transmitted to different target processing nodes; multiple target processing nodes execute them in parallel, with the same target subtask transmitted to different target processing nodes for execution. The task processing results of the same subtask from multiple target processing nodes are obtained, enabling multi-party comparison to avoid malicious external processing services and ensuring the accuracy of task processing results. Finally, the task processing results fed back from the target processing nodes are received and fed back to the task initiator. Since the target processing nodes have undergone consensus authentication to ensure their trustworthiness, no consensus authentication is required after receiving the task processing results from the target processing nodes; the processing results can be fed back to the task initiator immediately, reducing the time spent on consensus authentication of task processing results, i.e., reducing the waiting time for output results. Furthermore, in the blockchain, the blockchain scheduling node operates asynchronously for each task; that is, while waiting for the processing node to feed back the task processing results, other tasks can be mapped to a directed target acyclic graph, processing node selection, subtask scheduling, etc., improving resource utilization.

[0067] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0069] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0070] Figure 2 This application provides a schematic diagram of the structure of a blockchain scheduling node.

[0071] Figure 3 This is a schematic diagram of the structure of a processing node provided in an embodiment of this application;

[0072] Figure 4 A flowchart illustrating a specific implementation of task processing provided in this application embodiment;

[0073] Figure 5 A schematic diagram of an initial directed acyclic graph provided for an embodiment of this application;

[0074] Figure 6 This is a schematic diagram illustrating a parent-child relationship between two nodes in a directed acyclic graph, as provided in an embodiment of this application.

[0075] Figure 7 A schematic diagram illustrating a first type of directed acyclic graph in which two nodes are siblings, provided for an embodiment of this application;

[0076] Figure 8 This is a schematic diagram illustrating a second type of directed acyclic graph in which two nodes are siblings, provided as an embodiment of this application.

[0077] Figure 9 A schematic diagram illustrating a third type of directed acyclic graph in which two nodes are siblings, provided as an embodiment of this application;

[0078] Figure 10 A schematic diagram illustrating the first inductive processing based on sibling relationships provided in this application embodiment;

[0079] Figure 11 This is a schematic diagram illustrating a generalization process based on parent-child relationships, provided as an embodiment of this application.

[0080] Figure 12 This is a schematic diagram illustrating a second type of inductive processing based on sibling relationships, provided in an embodiment of this application.

[0081] Figure 13 A flowchart illustrating another specific implementation of task processing provided in this application embodiment;

[0082] Figure 14 This application provides a schematic diagram of a task processing architecture.

[0083] Figure 15 A flowchart illustrating a method for task processing by a blockchain scheduling node, as provided in this application embodiment;

[0084] Figure 16 A flowchart illustrating a method for task processing by a processing node, as provided in an embodiment of this application;

[0085] Figure 17 A flowchart illustrating a method for task initiation at an embodiment of this application;

[0086] Figure 18 A structural diagram of the first task processing apparatus provided in the embodiments of this application;

[0087] Figure 19 A structural diagram of the second task processing device provided in the embodiments of this application;

[0088] Figure 20 A structural diagram of the third task processing device provided in the embodiments of this application;

[0089] Figure 21 A structural diagram of a computing device provided in an embodiment of this application;

[0090] Figure 22 This is another structural diagram of a computing device provided in an embodiment of this application. Detailed Implementation

[0091] To make the objectives, technical solutions, and beneficial effects of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0092] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0093] A Directed Acyclic Graph (DAG) is a graph structure consisting of nodes and directed edges. In this graph, if a node is selected, and a path is found starting from that node along the ordered edges, it is impossible to return to the original node; that is, no cycle is formed. In other words, the nodes in a DAG have a sequential order and can branch, but they will not form a cycle. Because of its serializable properties, DAG can be used to represent dependencies between events and manage task scheduling. It is a commonly used data structure in computer science, and therefore frequently used in data processing, transaction planning, and optimal path finding.

[0094] Ultra-large tasks are those with large computational demands and complex calculations.

[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 (P2P) transmission, consensus mechanisms, transaction blocks, and cryptographic identity security. Because the ledger is stored in a distributed manner and the blocks are agreed upon, it has characteristics such as immutability, traceability, and joint maintenance. Essentially, blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block.

[0096] Load balancing is a method of distributing network traffic evenly across a pool of resources supporting an application. Modern applications must process data from millions of objects (such as users or their corresponding accounts) simultaneously and return the correct text, video, images, and other data to each object quickly and reliably. To handle such high traffic, most applications have numerous resource servers, which contain a lot of duplicate data. 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 communication between two entities. There are many types of certificates; for example, personal certificates for individual use and server certificates. 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 public-key digital signature, is a unique digital string generated by the sender that cannot be forged by others. This string also serves as valid proof of the authenticity of the information sent by the sender. Signature authentication is used by the receiver to verify whether the encrypted file received was indeed sent by the sender and to confirm whether it has been tampered with.

[0099] A process is a single execution of a program on a specific set of data in a computer. It is the basic unit for resource allocation in a system and the foundation of the operating system architecture. In early process-oriented computer architectures, the process was the fundamental execution entity of a program; in contemporary thread-oriented computer architectures, the process is a container for threads. A program is a description of instructions, data, and their organization; a process is the entity within a program.

[0100] Coroutines are not system-level threads; they are often referred to as "lightweight threads," "microthreads," or "fibers." Simply put, a coroutine can be thought of as different functions within a thread, and these functions can be switched between each other quickly. Coroutines are very similar to user-mode threads; switching between user-mode threads does not require entering the kernel, but in some operating systems, switching between user-mode threads requires the assistance of kernel-mode threads.

[0101] The design concept of the embodiments of this application will be briefly introduced below.

[0102] For extremely large tasks, a clustered approach is typically used, where multiple nodes within a cluster execute the task. The biggest challenge here is trust; the task initiator cannot guarantee the reliability of the task processing and its results.

[0103] With the development of blockchain technology, solutions for executing ultra-large tasks using blockchain have been proposed. Blockchain employs a multi-node consensus mechanism; this consensus mechanism is essentially a mathematical algorithm that enables different nodes in the blockchain system to establish trust and acquire rights. Therefore, the consensus mechanism in blockchain enables multiple blockchain nodes to maintain trust relationships, solving the trust problem. However, blockchain nodes need to handle tasks, consensus, and storage. Therefore, as the number of nodes increases, the consensus time will continuously increase, and blockchain resources cannot be reasonably scaled. The task processing capacity of a blockchain node is extremely limited. Therefore, an external service provider is designated in the contract to handle tasks. The blockchain signs and authenticates the task processing results returned by the external service provider and reaches a consensus on the results to ensure their credibility. However, when reaching a consensus on task processing results, each blockchain node must wait for the external service provider to return the results, resulting in slow block production, long waiting times, and insufficient utilization of blockchain node resources during the waiting period.

[0104] Therefore, while ensuring the reliability 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.

[0105] In view of this, embodiments of this application provide a task processing method, apparatus, device, and storage medium, and in particular, a blockchain-based method for processing large-scale tasks, relating to the field of task processing technology and the field of blockchain technology, to reduce the waiting time for output results, achieve resource expansion, and improve resource utilization while ensuring the credibility of task processing.

[0106] First, this application proposes a task mapping process for ultra-large tasks corresponding to task processing requests based on task information carried in the task processing request. The task mapping process includes decomposition and summarization services. Specifically, the ultra-large task is first decomposed into an initial directed acyclic graph (DAG) composed of subtasks, facilitating concurrent execution by multiple processing nodes. Simultaneously, to avoid excessively small task sizes and reduce communication frequency, the subtasks in the initial DAG are summarized after decomposition to obtain a target DAG. This target DAG meets the simplification conditions and includes at least two target graph nodes. Each target graph node represents a target subtask obtained after decomposing the ultra-large task, reducing the number of subtasks and improving execution efficiency.

[0107] Next, among the candidate processing nodes that meet the preset activity conditions, a specified number of target processing nodes are selected. Based on a consensus mechanism, the selected target processing nodes are verified. After verification, at least one target subtask of the target directed acyclic graph is transmitted to different target processing nodes. This ensures that the selected target processing nodes have sufficient resources for task processing and can perform task processing normally, thereby improving processing efficiency. Furthermore, consensus is reached on the selected target processing nodes to ensure their trustworthiness and further guarantee the trustworthiness of the task processing by the target processing nodes. Simultaneously, a target subtask is transmitted to different target processing nodes for processing, meaning that multiple target processing nodes process the same target subtask and output task processing results separately. This allows for comparison of multiple task processing results for the same target subtask, and multi-party comparison helps prevent malicious behavior by processing nodes.

[0108] Finally, the task processing results are received from the target processing node and then fed back to the task initiator. Since the target processing node has undergone consensus authentication to ensure its trustworthiness, no consensus authentication is required after receiving the task processing results from the target processing node. The results can be fed back to the task initiator immediately, reducing the time spent on consensus authentication of the task processing results and thus reducing the waiting time for output results. This further avoids the problem of underutilization of blockchain resources caused by waiting for consensus feedback. Moreover, in the blockchain, the blockchain scheduling node operates asynchronously for each task. That is, while waiting for the processing node to feed back the task processing results, other tasks can be mapped to a directed acyclic graph, processing nodes can be selected, and tasks can be scheduled, thereby expanding resources and improving resource utilization.

[0109] After introducing the design concept of the embodiments of this application, the application scenarios set by this application are briefly described below. It should be noted that the following scenarios are only used to illustrate the embodiments of this application and are not intended to limit it. In specific implementation, the technical solutions provided by the embodiments of this application can be flexibly applied according to actual needs.

[0110] See Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this 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 one alternative implementation, the communication network can be a wired network or a wireless network. For example, the task initiator 100 and the blockchain scheduling node 110 can be directly or indirectly connected via wired or wireless communication. For instance, the task initiator 100 can be indirectly connected to the blockchain scheduling node 110 via a wireless access point, or the task initiator 100 can be directly connected to the blockchain scheduling node 110 via the Internet; this application does not impose any limitations on this.

[0112] In this embodiment, the task initiator 100 is a terminal device; the blockchain scheduling node 110 is a server used for selecting processing nodes, maintaining the status of processing nodes, and scheduling tasks; and the processing node 120 is a server used for task processing.

[0113] Terminal devices include, but are not limited to, mobile phones, tablets, laptops, desktop computers, e-book readers, smart voice interaction devices, smart home appliances, and in-vehicle terminals.

[0114] A server can be a standalone physical server, a server cluster or distributed system consisting 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 communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0115] In one 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 also Figure 2 , Figure 2 This application provides a schematic diagram of the structure of a blockchain scheduling node; wherein:

[0116] The network module 1100 is used to communicate with other blockchain scheduling nodes, task initiators, and processing nodes. It receives task processing requests sent by task initiators, target processing node information sent by other blockchain scheduling nodes, task processing results fed back by 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 identities 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 each role (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 legality of the certificate, so as to perform authentication and authorization for each role based on the authentication algorithm.

[0120] The task DAG group module 1120 is used for decomposing, summarizing, and distributing extremely large tasks; the task DAG group module 1120 includes: task verification submodule 1121, task decomposition submodule 1122, task summarization submodule 1123, task maintenance submodule 1124, task selection submodule 1125, and task distribution submodule 1126.

[0121] The task verification submodule 1121 is used to verify the legality of extremely large tasks;

[0122] Task decomposition submodule 1122 is used to decompose a very 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] 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 block production.

[0126] The task distribution submodule 1126 is used to distribute subtasks to various processing nodes.

[0127] The load balancing module 1130 is used to maintain a processing node status table, select a 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 based on a random number provided by the task initiator.

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

[0131] The result caching submodule 1141 is used to cache the processing results of various large tasks, so that the results can be returned directly when the same task is received.

[0132] The task information storage submodule 1142 is used to cache code and data when executing a task, so as to avoid the task initiator having to send code and data every time it processes the same task.

[0133] In one 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 also Figure 3 , Figure 3 This application provides a schematic diagram of the structure of a processing node according to an embodiment; wherein:

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

[0135] The authentication module 1210 is used to store the certificates of the blockchain scheduling nodes and to verify the legitimacy of the blockchain scheduling node's 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 certificate of the blockchain scheduling node 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 legality 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; wherein, the subtask queue module 1220 includes: a task storage submodule 1221 and a task sorting submodule 1222;

[0139] Task storage submodule 1221 is used to store all subtasks in a queue.

[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 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 the process / coroutine resources used when processing tasks.

[0143] The task processing submodule 1232 is used to process tasks using processes / coroutines, where processes / coroutines are the entities that process tasks.

[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 status detection submodule 1241 is used to detect and display the status of the processing nodes;

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

[0147] Based on the above application scenarios, the task processing method provided by exemplary embodiments of this application is described below with reference 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 this application, and the embodiments of this application are not limited in any way. Furthermore, although the operations of the method of this application are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the shown operations must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0148] In this embodiment, 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 up in the blockchain. Therefore, 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 summarization, target processing node selection, target processing node consensus, and task allocation to target processing nodes for processing based on the information carried in the task processing request. Then, the target processing node processes the task.

[0149] As can be seen, all blockchain scheduling nodes in the blockchain perform the same operations, and the target processing nodes are all used to process tasks. Therefore, the task processing method provided in this application embodiment will be described in detail below, 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 examples.

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

[0151] In 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, random number r, target number of processing nodes k, and task redundancy number v; wherein, the task information includes code information and task data, and the target number of processing nodes is greater than or equal to the task redundancy number.

[0153] For example, the task initiator performs a signature operation on the task information, random number r, target number of processing nodes k, and 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 within the interval [0, max), where max is a positive integer much greater than 0.

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

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

[0157] Step A1: Obtain the code information from the task information and determine the reference relationships between the code based on the code information.

[0158] For example, when a blockchain retrieval node receives a transfer task processing request from the task initiator, it obtains the task code for the transfer task and analyzes it. The analysis reveals that the transfer task code includes related task codes such as: payment account balance query, payment account transfer amount query, obtaining transfer amount from the payment account for transfer processing, receiving account balance query, and transferring funds to the receiving account. Since obtaining transfer amount from the payment account for transfer processing requires determining the transfer amount of the payment account, there is a reference relationship between the code related to payment account transfer amount query and the code related to obtaining transfer amount from the payment account for transfer processing.

[0159] Therefore, the reference relationship between codes can be understood as a relationship existing between two sets of codes when the output data of one set of codes is used as the input data of another set of codes. Thus, in this embodiment, 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 relationships between the task codes of the subtasks are determined.

[0160] Step A2: Based on the reference relationships between the code, map the target task into an initial directed acyclic graph; the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node 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 treated as a graph node. Two graph nodes with a reference relationship are connected by a directed edge. The input data of the subtask associated with one graph node pointed to by the directed edge is the output data of the subtask associated with the other graph node connected by the same 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 This is a schematic diagram of an initial directed acyclic graph provided in this embodiment; Figure 5 It contains 11 initial graph nodes, A1 to A11. Each initial graph node represents an initial subtask in the target task, and each initial subtask cannot be further subdivided. Two initial graph nodes that are connected indicate that there is a reference relationship between the task codes of the initial subtasks represented by these two initial graph nodes. For example, if there is a connection between initial graph nodes A1 and A2 through a directed edge, it means that there is a reference relationship between the task codes of the initial subtasks associated with initial graph node A1 and the task codes of the initial subtasks associated with initial graph node A2. The output data of the initial subtask associated with initial graph node A1 serves as the input data for the task code of the initial subtask associated with initial graph node A2.

[0163] Step A3: Based on the connection relationships 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 association relationship.

[0164] In one possible implementation, the relationships to be set include: parent-child relationships and sibling relationships; wherein:

[0165] Parent-child relationship representation: In two initial graph nodes, one initial graph node has only one outgoing edge, and the other graph node has only one incoming edge; the outgoing edge and the incoming edge are the same edge; see also Figure 6 , Figure 6 This application provides a schematic diagram of a directed acyclic graph where two nodes have a parent-child relationship; from Figure 6 As can be seen from the diagram, 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 point, it is determined that the initial graph node A and the initial graph node B have a parent-child relationship.

[0166] Sibling relationship means that in at least two initial graph nodes, all initial graph nodes have only one outgoing edge pointing to the same initial graph node, and at least one initial graph node has no incoming edges; see also Figure 7 , Figure 7 This is a schematic diagram illustrating a first type of directed acyclic graph where two nodes are siblings, provided in an embodiment of this application. Figure 7 As can be seen from the graph, both initial graph node A and initial graph node B have only one outgoing edge, and these two outgoing edges point to... Figure 1 Given an initial graph node C, and initial graph nodes A and B having no incoming edges, it is determined that initial graph nodes A and B are siblings; see [link to relevant documentation]. Figure 8 , Figure 8This is a schematic diagram illustrating a second type of directed acyclic graph where two nodes are siblings, provided in an embodiment of this application. Figure 8 As can be seen from the graph, both initial graph node A and initial graph node B have only one outgoing edge, and these two outgoing edges point to... Figure 1 If the initial graph node is C, and the initial graph node A has one incoming edge while the initial graph node B has no incoming edge, then it is determined that the initial graph node A and the initial graph node B are siblings.

[0167] Alternatively, a sibling relationship means that all outgoing edges of the initial graph nodes point to the same initial graph node, and incoming edges of the initial graph nodes point to the same initial graph node. See also Figure 9 , Figure 9 This is a schematic diagram illustrating a third type of directed acyclic graph where two nodes are siblings, provided in the embodiments of this application; from Figure 9 As can be seen from the graph, both initial graph node A and initial graph node B have only one outgoing edge and only one incoming edge, and these two outgoing edges point to... Figure 1 The initial graph node C, and the output graph nodes of these two incoming edges are the same initial graph node D. At this point, 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 relationships between graph nodes, Figure 5 Taking the initial directed acyclic graph (DAG) as an example, based on the connection relationships between the initial graph nodes in the initial DAG, at least two initial graph nodes with an association relationship are determined. For example, Figure 5 Initial graph node A2 and initial graph node A3 are siblings, and initial graph nodes A6, A7 and A8 are siblings.

[0169] Step A4: Based on the task complexity of the initial subtask, at least two initial graph nodes with related relationships are summarized according to the preset concurrency and preset execution complexity until the initial graph nodes can no longer be summarized, thus obtaining the target directed acyclic graph.

[0170] In one possible implementation, when performing induction processing on the initial graph nodes, at least two graph nodes with an association relationship are sequentially induced according to the direction of the directed edges in the initial directed acyclic graph. During the induction process, induction processing 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 induction can no longer be performed, thus obtaining the target directed acyclic graph.

[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 the task complexity of the inducible target subtask will not exceed the maximum subtask complexity that the processing node can accept during task induction.

[0172] In one possible implementation, the task complexity of the initial subtask is determined based on the amount of code in 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. The complexity identification model is trained based on the task codes of historical tasks and the associated task complexities. That is, the input of the complexity identification model is the task code, and the output is the task complexity.

[0174] Therefore, with Figure 5 Taking the initial directed acyclic graph shown as an example, at least one of the above-described 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 [link to example]. 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, taking a preset execution complexity of 10 and a preset concurrency of 2 as an example, in Figure 5 Based on the initial directed acyclic graph shown, the process of summarizing the initial graph nodes is explained. It should be noted that summarizing the initial graph nodes means summarizing the initial subtasks associated with the initial graph nodes.

[0176] from Figure 5 As shown in the initial directed acyclic graph, it includes two branches: the first branch consists of nodes A1 to A5, and the second branch consists of nodes A6 to A10. During the induction process, induction is performed on each branch.

[0177] See Figure 10 , Figure 10 This is a schematic diagram illustrating the first type of inductive processing based on sibling relationships provided in this application embodiment; from Figure 10As can be seen from the diagram, for the first branch, based on the direction of the directed edges, the initial graph nodes A2 and A3 are first determined to be siblings, which conforms to the induction rule. Since the parallelism is 2, the subtasks associated with the initial graph nodes A2 and A3 can be executed simultaneously. Therefore, the maximum value of the task complexities associated with the initial graph nodes A2 and A3 is taken as the task complexity associated with the inductive graph node 23, i.e. Figure 10 The task complexity of node A23 in the inductive graph shown is 8.

[0178] See Figure 11 , Figure 11 This application provides a schematic diagram illustrating inductive processing based on parent-child relationships in an embodiment of the present application; from Figure 11 As can be seen from this, for the first branch, in Figure 10 Based on the directed acyclic graph obtained after induction, the initial graph node A1 and the induction graph node A23 are determined to be parent and child according to the direction of the directed edges, which conforms to the induction rule. Since they are parent and child, they need to be executed sequentially. When executing the subtasks associated with the initial graph node A1 and the subtasks associated with the initial graph node A23 in sequence, the task complexity should be determined by summation. 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 summed task complexity is 11, which exceeds the preset execution complexity of 10. Therefore, 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 conforms to 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 inductively processed to obtain the induction graph node A234, and the complexity of the task associated with the induction graph node A234 is determined to be 9.

[0180] After that, Figure 11 Based on the directed acyclic graph obtained after induction, we further determine whether induction can be performed, although... Figure 11 The resulting directed acyclic graph contains nodes with parent-child relationships. However, after induction, the task complexity is greater than the preset execution complexity, so it is impossible to continue induction for the first branch.

[0181] See Figure 12 , Figure 12 This is a schematic diagram illustrating a second type of inductive processing based on sibling relationships provided in an embodiment of this application; from Figure 12 From this, we can see that, Figure 11Based on the directed acyclic graph obtained after induction, for the second branch, according to the direction of the directed edges, the initial graph nodes A6, A7, and A8 are first determined to be siblings, which conforms to the induction rule. Since the parallelism is 2, the subtasks associated with the initial graph nodes A6, A7, and 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 subtasks associated with the initial graph nodes A7 and A8 sequentially while executing the subtasks of the initial graph node A6. Since the task complexity is determined by summation when executing sequentially and by selecting the maximum value when executing in parallel, the task complexity of the initial graph nodes A7 and A8's subtasks is determined to be 6 when executing sequentially, while the task complexity associated with the initial graph node A6 is 5. Therefore, after induction, the task complexity of the inductive node A678 is 6.

[0182] Then, in Figure 12 Based on the directed acyclic graph obtained after induction, we further determine whether induction can be performed, although... Figure 12 The resulting directed acyclic graph contains nodes with parent-child relationships, but the task complexity after induction is greater than the preset execution complexity. Therefore, it is impossible to continue induction for the second branch.

[0183] based on Figures 10-12 Complete the content. Figure 5 The initial graph nodes are processed in a generalized manner, and the resulting directed acyclic graph is obtained after the generalized processing. (See [link to original text]). Figure 12 The directed acyclic graph obtained after induction.

[0184] In this application, a specific implementation method for obtaining a target directed acyclic graph (DAG) is designed, which involves task decomposition and task summarization. First, an initial DAG is constructed based on the relationship between the task codes of the initial subtasks. Then, based on the maximum complexity and the highest preset concurrency that a single processing node can accept, the subtasks are summarized according to the complexity of a single initial subtask to obtain a target DAG that meets the simplification conditions. This reduces the number of subtasks, thereby reducing the number of communication times, saving communication resources, and improving execution efficiency when subtasks are assigned to multiple processing nodes for execution.

[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 this embodiment, the blockchain scheduling node maintains the status information of all processing nodes. The status information of a 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 nodes is reported by the processing nodes to the blockchain scheduling node. The reporting method can be proactive, meaning that the processing node sends status information to the blockchain scheduling node after determining that its status has changed; or it can be reactive, meaning that the processing node reports its own status information to the blockchain scheduling node upon receiving a status query command.

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

[0188] Step B1: Based on the status information of all maintained processing nodes, select candidate processing nodes that meet the preset active conditions from all processing nodes.

[0189] In one possible implementation, all idle processing nodes are selected from all processing nodes as candidate processing nodes that meet the preset active conditions; that is, processing nodes that are completely unoccupied are selected.

[0190] In one possible implementation, among all processing nodes, processing nodes whose current resource usage is less than a first threshold are selected as candidate processing nodes that meet the preset activity conditions; that is, processing nodes with less resource usage are selected.

[0191] In another possible implementation, among all processing nodes, processing nodes with a current remaining resource amount greater than a second threshold are selected as candidate processing nodes that meet the preset activity conditions; that is, processing nodes with a larger remaining resource amount are selected.

[0192] In this application, processing nodes with larger remaining resources are selected as candidate processing nodes to ensure that the target processing node selected from the candidate processing nodes has sufficient resources to process the task, thus ensuring smooth task processing 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 conditions.

[0194] In one possible implementation, based on the random number r carried in the task processing request, a target processing node is selected from the candidate processing nodes that meet the preset active conditions, and the number of processing nodes k carried in the task processing request is the same.

[0195] For example, a selection factor p is determined based on a random number r, and a target processing node is selected from all candidate processing nodes N based on the selection factor p. Specifically, 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 using the p%N method.

[0197] Where p%N represents the remainder when the dividend P is divided by the divisor N.

[0198] Step C2: Determine whether the selected target processing node x is greater than the number of processing nodes k. If yes, proceed to step C5; otherwise, proceed to step C3.

[0199] Step C3: Update the selection factors.

[0200] In one possible implementation, the selection factor is re-determined based on the previous selection factor and the block hash value. For example, the selection factor is re-determined using the following formula:

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

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

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

[0204] Step C5: Complete the selection of all target processing nodes.

[0205] Step B3: Based on the consensus mechanism, verify the selected target processing node. If the verification is successful, the target processing node is determined to have been 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. This allows the selected node information to be compared with the node information sent by other blockchain scheduling nodes to achieve consensus and complete the verification of the selected target processing nodes. When the comparison results are consistent, the verification is successful, and the target processing node is determined to have been successfully selected.

[0207] The node information of the target processing node includes: the target processing node number and other identification information used to uniquely identify the target processing node.

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

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

[0210] In 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, 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, will Figure 12The target shown is to copy the target subtask corresponding to each target graph node in the directed acyclic graph v-1 times. At this time, v copies of the target subtask corresponding to target graph node A1 are obtained, as are v copies of the target subtask corresponding to target graph node A234, target graph node A5, target graph node A678, target graph node A9, target graph node A10, and target graph node A11. Then, the target subtask corresponding to target graph node A1 is transmitted to different target processing nodes, the target subtask corresponding to 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 target graph node A1 can also be used to process the target subtask corresponding to other target graph nodes, such as processing the target subtask corresponding to target graph node A678.

[0213] In this application, the target subtask is copied according to the task redundancy number specified by the task initiator. After each target subtask is copied, the number of copies corresponding to the task redundancy number is obtained. 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, realizing multi-party comparison, avoiding the problem of malicious processing nodes, and ensuring the accuracy of task processing results.

[0214] In step S404, the target processing node processes the target subtask sent by the blockchain scheduling node and obtains the task processing result corresponding to the target subtask.

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

[0216] In step S405, the target processing node feeds back the obtained task processing results to the blockchain scheduling node.

[0217] In one possible implementation, after processing each target subtask, the target processing node feeds back the task processing result to the blockchain scheduling node; or after processing all target subtasks associated with the same target directed acyclic graph, the target processing node feeds back the task processing results to the blockchain scheduling node together.

[0218] In step S406, the blockchain scheduling node feeds back the received task processing results to the task initiator.

[0219] In one possible implementation, after receiving the task processing results, 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. This reduces the number of communications, saves resources, and ensures that the task initiator does not experience problems with inconsistent task processing results.

[0220] In this embodiment of the application, to ensure the security and stability of the task processing, authentication and result verification steps are set during the interaction process. See also Figure 13 , Figure 13 A schematic diagram illustrating the specific implementation flow of another task processing method provided in this application embodiment includes the following steps:

[0221] In step S1300, the task initiator sends a task processing request to the blockchain scheduling node.

[0222] Step S1301: The blockchain scheduling node authenticates the task processing request based on operation permissions and signature authentication.

[0223] For example, it is determined whether the task initiator has the operation permission for the target task corresponding to the task processing request, and the task initiator is authenticated by signature to determine whether the signature of the task initiator is correct, so as to realize the authentication of the task processing request.

[0224] In step S1302, the blockchain scheduling node confirms that the task processing request authentication has passed and verifies the target task based on the target task timestamp and parameter information.

[0225] In one 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, the task processing request authentication is determined to be successful, 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 valid.

[0227] In another possible implementation, when it is determined that the task initiator does not have the authority to operate on the target task corresponding to the task processing request, or the signature is incorrect, an authentication failure message is sent to the task initiator.

[0228] In step S1303, the blockchain scheduling node determines that the target task has been verified and checks whether the task processing result corresponding to the target task is stored in the cache. If so, step S1304 is executed; otherwise, step S1305 is executed.

[0229] In one possible implementation, when the target task has not timed out and the parameter information is valid, the target task is determined to have passed verification, and the cache is further queried to see if the task processing result corresponding to the target task is stored. Here, the validity of the parameter information indicates that the parameter information of the target task carried in the task processing request is consistent with the parameter specification. For example, if the data A is specified to be a positive number, and the parameter information carried shows that the data A is a positive number, then the data A is determined to be valid.

[0230] In another possible implementation, when the target task times out or the parameter information is invalid, the target task verification is determined to have failed, and a task verification failure message is sent to the task initiator.

[0231] In step S1304, the blockchain scheduling node feeds back the task processing results corresponding to the target task stored in the cache to the task initiator.

[0232] When the cache contains the task processing results corresponding to the target task, the task processing results are directly fed back to the task initiator, reducing the waiting time of the task initiator and saving processing resources.

[0233] In step S1305, the blockchain scheduling node obtains the code information from the task information, determines the reference relationship between the code based on the code information, and maps the target task to an initial directed acyclic graph based on the reference relationship between the code.

[0234] Step S1306: Based on the connection relationship of the initial graph nodes in the initial directed acyclic graph, the blockchain scheduling node determines at least two initial graph nodes that have an association relationship in the initial directed acyclic graph.

[0235] In step S1307, the blockchain scheduling node, based on the task complexity of the initial subtask, summarizes at least two initial graph nodes that have a relationship according to a preset concurrency and preset execution complexity, until the initial graph nodes can no longer be summarized, and obtains the target directed acyclic graph.

[0236] In step S1308, the blockchain scheduling node selects candidate processing nodes that meet the preset active conditions from all processing nodes based on the status information of all processing nodes it maintains.

[0237] Step S1309: The blockchain scheduling node selects a specified number of target processing nodes from among the candidate processing nodes that meet the preset active conditions, based on 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] In 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, it can start a subscription port to notify the target processing node to obtain the target subtask in the target directed acyclic graph; correspondingly, the target processing node subscribes to the subtasks of the target task to be executed, but must ensure 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] In step S1313, the target processing node determines that the target subtask has passed authentication and puts the target subtask into the task queue according to 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's identity is successfully authenticated and the target subtask is successfully verified, the target subtask's authentication is confirmed, and then the target subtask is placed into the task queue according to priority.

[0245] In another possible implementation, if the target processing node fails to authenticate the blockchain scheduling node or fails to verify the target subtask, it sends a verification failure message to the task initiator.

[0246] In step S1314, when the target processing node determines that there are processing resources, it retrieves the target task from the task queue and executes the target sub-task through a process / coroutine to obtain the task processing result.

[0247] In step S1315, the target processing node feeds back the task processing result to the blockchain scheduling node.

[0248] In step S1316, the blockchain scheduling node feeds back the received task processing result to the task initiator.

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

[0250] In this embodiment of the application, the task processing result sent by the blockchain scheduling node to the task initiator includes, in addition to the result information, 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 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. Random number verification is based on the random number sent to the blockchain scheduling node, and the target processing node is selected by the blockchain scheduling node to re-determine the processing node and determine whether the re-determined processing node matches the received processing node information.

[0252] In one possible implementation, if the task processing result passes signature verification and the random number verification of the processing node information passes, then 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 this application, the task initiator verifies the received task processing results to further ensure the accuracy of the task processing results.

[0254] based on Figure 13 The task processing interaction flow shown in this application relates to a task processing structure; see also... Figure 14 , Figure 14 This is a schematic diagram of a task processing architecture provided in an embodiment of this application.

[0255] from Figure 14 From this, we can know that:

[0256] The blockchain scheduling node receives task processing requests from the task initiator via the network module, then sends the requests to the authentication module for authentication. After successful authentication, the task is verified via the task DAG group module. Upon successful verification, the node checks the storage module for the task's processing result. If the result is stored, it is retrieved and sent back to the task initiator via the network module. If the result is not stored, the task is broken down and summarized, and replicated and maintained via the task DAG group module. Simultaneously, the load balancing module selects processing nodes based on their status information. After selection, it chooses subtasks from the task DAG cluster and distributes them to the processing nodes via the network module. Finally, the node receives the processing results from the processing nodes via the network module and sends them back to the task initiator. The processing node status information in the load balancing module is stored after being received via the network module, while the processing results in the storage module are stored after the first feedback from the processing nodes.

[0257] Correspondingly, after receiving the subtask sent by the blockchain scheduling node through the network module, the processing node authenticates and verifies the subtask. Once the authentication and verification are successful, the processing node executes the subtask through the execution module, obtains 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 can feed back the task processing request to the task initiator.

[0258] The above describes the architecture of a blockchain-based multi-party processing system for ultra-large tasks, which forms the foundation for the operation of such tasks. The system incorporates a complete lifecycle process for blockchain-based multi-party processing of ultra-large tasks, including: a task upload process (where the task initiator generates a random number and uploads the ultra-large task to the blockchain for node selection, ultra-large task decomposition, subtask DAG construction, and subtask DAG summarization); and a task execution and verification process (where processing nodes retrieve subtasks from the subtask DAG for execution and verify legality). This design ensures the stable and efficient operation of the blockchain-based multi-party processing system throughout its entire lifecycle.

[0259] Furthermore, the various modules within the task processing system cooperate effectively, ensuring the concurrent execution of massive tasks across multiple nodes while maintaining a moderate workload on each node, thus improving the efficiency of parallel execution. This also guarantees the trustworthiness of task processing, as the random number generation algorithm is transparent, random numbers are generated by the task initiator itself, and each subtask is redundantly executed and verified. The system also ensures unlimited scalability of computing power, as tasks in the blockchain are asynchronous and do not require waiting for results, allowing for unlimited expansion. Finally, the public-private key certificate mechanism between the various devices in the task processing system ensures the security and stability of the entire system, enabling its widespread reuse across the industry.

[0260] See Figure 15 , Figure 15 A flowchart illustrating a method for task processing by a blockchain scheduling node, as provided in this application embodiment, includes the following steps:

[0261] Step S1500: Receive a task processing request sent by the task initiator; wherein the task processing request includes at least task information.

[0262] Step S1501: Based on the task information, map the target task corresponding to the task processing request into a target directed acyclic graph; wherein, the target directed acyclic graph meets the simplification conditions, and the target directed acyclic graph includes at least two target graph nodes, each target graph node representing: a target subtask obtained after splitting the target task;

[0263] Step S1502: 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.

[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: Receive the task processing result from the target processing node and send the task processing result back to the task initiator.

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

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

[0268] Based on the code information, the mutual reference relationships between the code are determined, and based on the mutual reference relationships, the target task is mapped to an initial directed acyclic graph; wherein, the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node 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 preset induction rules, the initial subtasks in the initial directed acyclic graph are inductively processed to obtain the target directed acyclic graph.

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

[0271] Based on the connection relationships 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 association relationship;

[0272] Based on the task complexity of the initial subtask, at least two initial graph nodes with related relationships are summarized according to the preset concurrency and preset execution complexity until the initial graph nodes can no longer be summarized, thus obtaining the target directed acyclic graph.

[0273] In one possible implementation, the relationships include: parent-child relationships and sibling relationships;

[0274] Parent-child relationship means that in 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] Sibling relationship means that in at least two initial graph nodes, all initial graph nodes have only one outgoing edge pointing to the same initial graph node, and at least one initial graph node has no incoming edges; or all outgoing edges of the initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes are pointed to by the same initial graph node.

[0276] In one 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 following steps are also included:

[0277] Based on operation permissions and signature authentication, it is determined 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 has passed verification;

[0279] It was determined that the cache did not contain the task processing result corresponding to the target task.

[0280] In one possible implementation, a specified number of target processing nodes are selected from candidate processing nodes that meet preset activity conditions, including:

[0281] The selection factor is determined based on the random number, and a specified number of target processing nodes are selected from the candidate processing nodes based on the selection factor.

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

[0283] In one possible implementation, the selection factor is determined based on a random number, including:

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

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

[0286] In one possible implementation, at least one target subtask in the directed acyclic graph is transmitted to different target processing nodes, including:

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

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

[0289] In one possible implementation, the task processing result is fed back to the task initiator, including:

[0290] After all target subtasks associated with the target in the directed acyclic graph have been completed, the results of all task processing received will be fed back to the task initiator.

[0291] See Figure 16 , Figure 16A flowchart of a method for task processing by a processing node provided in this application embodiment includes the following steps:

[0292] Step S1600: Receive the target subtask sent by the blockchain scheduling node;

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

[0294] Step S1602: Feedback the task processing result to the blockchain scheduling node, so that the blockchain scheduling node will feed back the task processing result to the task initiator.

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

[0296] The target subtask is authenticated. Once the authentication is successful, the target subtask is added to the task queue according to its priority, so that it can be processed in the order of the tasks in the task queue.

[0297] See Figure 17 , Figure 17 A flowchart illustrating a method for task initiation at a task initiator, as provided in this application embodiment, includes the following steps:

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

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

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

[0301] After receiving the task processing results from the blockchain scheduling node, the process also includes:

[0302] Perform signature verification on the task processing results; and

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

[0304] In this application, the blockchain scheduling node first maps the target task corresponding to the received task processing request into a target directed acyclic graph (DAG) based on the task information carried in the task processing request. The target DAG meets the simplification conditions and includes at least two target graph nodes, each representing a target subtask obtained after splitting the target task. The target task is decomposed into multiple subtasks so that multiple processing nodes can execute them concurrently. Simultaneously, the target DAG meets the simplification conditions, meaning that the target subtasks represented by the graph nodes in the target DAG cannot be further merged, avoiding situations where the workload of each target subtask is too small, reducing communication efficiency, and improving execution efficiency. Then, from the candidate processing nodes that meet the preset activity conditions, a specified number of target processing nodes are selected. Based on the consensus mechanism, the selected target processing nodes are verified to ensure their trustworthiness, further ensuring the trustworthiness of the target processing nodes in task processing. After successful verification, at least one target task in the target DAG is... Subtasks are transmitted to different target processing nodes; multiple target processing nodes execute them in parallel, with the same target subtask transmitted to different target processing nodes for execution. The task processing results of the same subtask from multiple target processing nodes are obtained, enabling multi-party comparison to avoid malicious external processing services and ensuring the accuracy of task processing results. Finally, the task processing results fed back from the target processing nodes are received and fed back to the task initiator. Since the target processing nodes have undergone consensus authentication to ensure their trustworthiness, no consensus authentication is required after receiving the task processing results from the target processing nodes; the processing results can be fed back to the task initiator immediately, reducing the time spent on consensus authentication of task processing results, i.e., reducing the waiting time for output results. Furthermore, in the blockchain, the blockchain scheduling node operates asynchronously for each task; that is, while waiting for the processing node to feed back the task processing results, other tasks can be mapped to a directed target acyclic graph, processing node selection, subtask scheduling, etc., improving resource utilization.

[0305] Furthermore, it should be noted that in the specific embodiments 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 related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0306] Based on the same inventive concept, embodiments of this application also provide a task processing device applied to a blockchain scheduling node; such as Figure 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 the task initiator; wherein the task processing request includes at least task information.

[0308] The mapping unit 1802 is used to map the target task corresponding to the task processing request into a target directed acyclic graph based on task information; wherein the target directed acyclic graph meets the simplification conditions and includes at least two target graph nodes, each target graph node representing: 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 conditions, and to verify the selected target processing nodes based on the consensus mechanism.

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

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

[0312] In one possible implementation, the task information includes at least code information; the mapping unit 1802 is specifically used for:

[0313] Based on the code information, the mutual reference relationships between the code are determined, and based on the mutual reference relationships, the target task is mapped to an initial directed acyclic graph; wherein, the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node 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 preset induction rules, the initial subtasks in the initial directed acyclic graph are inductively processed to obtain the target directed acyclic graph.

[0315] In one possible implementation, the mapping unit 1802 is specifically used for:

[0316] Based on the connection relationships 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 association relationship;

[0317] Based on the task complexity of the initial subtask, at least two initial graph nodes with related relationships are summarized according to the preset concurrency and preset execution complexity until the initial graph nodes can no longer be summarized, thus obtaining the target directed acyclic graph.

[0318] In one possible implementation, the relationships include: parent-child relationships and sibling relationships;

[0319] Parent-child relationship means that in 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] Sibling relationship means that in at least two initial graph nodes, all initial graph nodes have only one outgoing edge pointing to the same initial graph node, and at least one initial graph node has no incoming edges; or all outgoing edges of the initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes are pointed to by the same initial graph node.

[0321] In one 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 first receiving unit 1801 is further configured to:

[0322] Based on operation permissions and signature authentication, it is determined 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 has passed verification;

[0324] It was determined that the cache did not contain the task processing result corresponding to the target task.

[0325] In one possible implementation, unit 1803 is specifically used for:

[0326] The selection factor is determined based on the random number, and a specified number of target processing nodes are selected from the candidate processing nodes based on the selection factor.

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

[0328] In one possible implementation, unit 1803 is specifically used for:

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

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

[0331] In one possible implementation, the transmission unit 1804 is specifically used for:

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

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

[0334] In one possible implementation, the first feedback unit 1805 is specifically used for:

[0335] After all target subtasks associated with the target in the directed acyclic graph have been completed, the results of all task processing received will be fed back to the task initiator.

[0336] Based on the same inventive concept, embodiments of this application also provide a task processing device applied to a target processing node; such as Figure 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 can feed back the task processing result to the task initiator.

[0340] In one 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 configured to:

[0341] The target subtask is authenticated. Once the authentication is successful, the target subtask is added to the task queue according to its priority, so that it can be processed in the order of the tasks in the task queue.

[0342] Based on the same inventive concept, embodiments of this application also provide a task processing device applied to a processing node; such as Figure 20 As shown, the task processing device 2000 includes:

[0343] Sending unit 2001 is used to send a task processing request to the blockchain scheduling node; wherein the task processing request includes at least 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 one possible implementation, the task processing result includes at least the processing node information;

[0346] After receiving the task processing results from the blockchain scheduling node, the third receiving unit 2002 is also used for:

[0347] Perform signature verification on the task processing results; and

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

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

[0350] After introducing the task processing method and apparatus of exemplary embodiments of this application, another exemplary embodiment of this application, a computing device, will be introduced next.

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

[0352] Based on the same inventive concept as the above-described method embodiments, this application also provides a computing device. In one embodiment, the computing device may be a server. In this embodiment, the structure of the computing device is as follows: Figure 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. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0354] Memory 2101 may be volatile memory, such as random-access memory (RAM); memory 2101 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 2101 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 2101 may be a combination of the above-described memories.

[0355] Processor 2102 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 2102 is used to implement the above-described task processing method when calling computer programs stored in memory 2101.

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

[0357] This application embodiment does not limit the specific connection medium between the memory 2101, communication module 2103, and processor 2102. This application embodiment... Figure 21 The memory 2101 and the processor 2102 are connected via a bus 2104, and the bus 2104 is in Figure 21 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 2104 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 21 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.

[0358] The memory 2101 stores a computer storage medium, which stores computer-executable instructions for implementing the task processing method of this application embodiment. The processor 2102 is used to execute the above-described task processing method.

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

[0360] The communication component 2210 is used to communicate with the server. In some embodiments, it may include a Wireless Fidelity (WiFi) module.

[0361] The memory 2220 can be used to store software programs and data. The processor 2280 executes various functions of the terminal device and data processing by running the software programs or data stored in the memory 2220. The memory 2220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, 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 this application, the memory 2220 may store the operating system and various application programs, and may also store computer programs that execute the task processing methods of the embodiments of this application.

[0362] The display unit 2230 can also be used to display information input by an object or information provided to an object, as well as a graphical user interface (GUI) for 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 as a liquid crystal display, a light-emitting diode, or the like.

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

[0364] The touch screen 2231 can be placed on top of the display screen 2232, or the touch screen 2231 and the display screen 2232 can be integrated to realize the input and output functions of the terminal device. After integration, it can be referred to as a touch display screen.

[0365] Camera 2240 can be used to capture still images, and objects can publish images captured by camera 2240 through an application. There can be one or multiple cameras 2240. An object generates an optical image through a lens, which is projected onto a 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 light signal into an electrical signal, which is then transmitted to processor 2280 to be converted into a digital image signal.

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

[0367] Audio circuitry 2260, speaker 2261, and microphone 2262 provide an audio interface between the device and the terminal. Audio circuitry 2260 converts received audio data into an electrical signal, which is then transmitted to speaker 2261, where it is converted into a sound signal for output. The terminal device can also be equipped with volume buttons for adjusting the volume of the sound signal. Conversely, microphone 2262 converts the collected sound signal into an electrical signal, which is received by audio circuitry 2260, converted back into audio data, and then output to communication component 2210 for transmission to, for example, another terminal device, or to memory 2220 for further processing.

[0368] Bluetooth module 2220 is used to interact with other Bluetooth devices that also have Bluetooth modules via the Bluetooth protocol. For example, a terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smartwatch) that also has a Bluetooth module through Bluetooth module 2220, thereby exchanging data.

[0369] The processor 2280 is the control center of the terminal device, connecting various parts of the terminal through various interfaces and lines. It executes various functions 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 handles the operating system, user interface, and applications, and the baseband processor mainly handles wireless communication. It is understood that the baseband processor may not be integrated into the processor 2280. In this application, the processor 2280 can run the operating system, applications, user interface display and touch response, and the task processing method of the embodiments of this application. Furthermore, the processor 2280 is coupled to the display unit 2230.

[0370] In some possible implementations, various aspects of the task processing method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a computing device, causes the computing device to perform the steps in the task processing method according to the various exemplary embodiments of this application described above.

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

[0372] The task processing program product of the embodiments of this application can be a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a computing device. However, the program product of this application is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with a command execution system, apparatus, or device.

[0373] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with a command execution system, apparatus, or device.

[0374] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0375] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0376] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0377] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, produce a mechanism for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0378] These computer program commands may also be stored in a computer-readable storage medium that can direct a computer or other programmable device to function in a particular manner, such that the commands stored in the computer-readable storage medium produce an article of manufacture including command means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0379] These computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0380] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0381] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A task processing method, characterized in that, The method, applied to blockchain scheduling nodes, includes: Receive a task processing request sent by the task initiator; wherein the task processing request includes at least task information; Based on the task information, the target task corresponding to the task processing request is mapped to a target directed acyclic graph; wherein, the target directed acyclic graph meets the simplification conditions, 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; 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. After successful verification, at least one target subtask in the target directed acyclic graph is transmitted to different target processing nodes. Receive the task processing result from the target processing node and then feed the task processing result back to the task initiator. Wherein, mapping 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 in the task information, the mutual reference relationships between the code are determined, and the target task is mapped to an initial directed acyclic graph; wherein, the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split. The initial subtasks in the initial directed acyclic graph are inductively processed until the initial graph nodes can no longer be inductively processed, thus obtaining the target directed acyclic graph.

2. The method as described in claim 1, characterized in that, The process of inductively processing the initial subtasks in the initial directed acyclic graph until the initial graph nodes can no longer be inductively processed, to obtain the target directed acyclic graph, includes: Based on the connection relationships of the initial graph nodes in the initial directed acyclic graph, at least two initial graph nodes with associated relationships in the initial directed acyclic graph are determined. Based on the task complexity of the initial subtask, at least two initial graph nodes with related relationships are summarized according to a preset concurrency and preset execution complexity until the initial graph nodes can no longer be summarized, thus obtaining the target directed acyclic graph.

3. The method as described in claim 2, characterized in that, The relationships include: parent-child relationships and sibling relationships; The parent-child relationship means that in 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 is defined as follows: among at least two initial graph nodes, all initial graph nodes have only one outgoing edge pointing to the same initial graph node, and at least one initial graph node has no incoming edges; or all outgoing edges of the initial graph nodes point to the same initial graph node, and the incoming edges of the initial graph nodes are pointed to by the same initial graph node.

4. The method as described in claim 1, 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 operation permissions and signature authentication, it is determined that the task processing request meets the authentication conditions; Based on the target task timestamp and parameter information, it is determined that the target task has passed verification; It was determined that the cache did not contain the task processing result corresponding to the target task.

5. The method as described in claim 1, characterized in that, The step of selecting a specified number of target processing nodes from candidate processing nodes that meet preset activity conditions includes: A selection factor is determined based on a random number, and a specified number of target processing nodes are selected from the candidate processing nodes based on the selection factor. The random number and the specified quantity are sent by the task initiator.

6. The method as described in claim 5, characterized in that, The step of determining the selection factor based on random numbers includes: If the first target number of processing nodes is selected, then the random number is used as the selection factor; If the number of processing nodes is not the first target, then the selection factor is re-determined based on the previous selection factor and the block hash value.

7. The method as described in claim 1, characterized in that, The step of 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, each target subtask in the target directed acyclic graph is copied. In multiple target subtasks after replication processing, the target subtasks representing the same task are transmitted to different target processing nodes.

8. The method as described in claim 1, characterized in that, The step of feeding back the task processing result to the task initiator includes: After all target subtasks associated with the target directed acyclic graph have been completed, the received task processing results are fed back to the task initiator.

9. A task processing method, characterized in that, Applied to a target processing node, the method includes: The system receives target subtasks sent by a blockchain scheduling node. Each target subtask corresponds to a target graph node in a target directed acyclic graph (DAG). The DAG is determined by the blockchain scheduling node based on the code information in the task information sent by the task initiator, establishing mutual reference relationships between codes. After mapping the target task corresponding to the task processing request associated with the task information to an initial DAG, the system performs inductive processing on the initial subtasks in the initial DAG until the initial graph nodes cannot be inductively derived. The initial DAG includes at least two initial graph nodes, each representing an initial subtask obtained by splitting the target task, and each initial subtask meeting the condition that the task cannot be split. The target subtask is processed to obtain the 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 can feed back the task processing result to the task initiator.

10. The method as described in claim 9, characterized in that, After receiving the target subtask sent by the blockchain scheduling node, and before processing the target subtask, the process further includes: The target subtask is authenticated. Once the authentication is successful, the target subtask is added to the task queue according to its priority, so that it can be processed in the order of the tasks in the task queue.

11. A task processing method, characterized in that, Applied to the task initiator, the method includes: A task processing request is sent to a blockchain scheduling node; wherein the task processing request includes at least task information; the blockchain scheduling node, based on the code information in the task information sent by the task initiator, determines the mutual reference relationships between codes, maps the target task corresponding to the task processing request associated with the task information to an initial directed acyclic graph, and then performs inductive processing on the initial subtasks in the initial directed acyclic graph until the initial graph nodes cannot be inductively summarized, thereby obtaining a target directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node representing: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split; The task processing result is received from the blockchain scheduling node. The task processing result is fed back by the blockchain scheduling node after receiving the task processing result from the target processing node for at least one target subtask in the target directed acyclic graph.

12. The method as described in claim 11, characterized in that, The task processing result includes at least processing node information; After receiving the task processing result from the blockchain scheduling node, the process further includes: The task processing result is verified by signature; and The processing node information is verified using random numbers.

13. A task processing device, characterized in that, The device, used in blockchain scheduling nodes, includes: The first receiving unit is used to receive a task processing request sent by the task initiator; wherein the task processing request includes at least task information. The 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 conditions, 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; The selection unit is used to select a specified number of target processing nodes from candidate processing nodes that meet preset active conditions, and to verify the selected target processing nodes based on a consensus mechanism. The transmission unit is used to transmit at least one target subtask in the target directed acyclic graph to different target processing nodes after the verification is passed. The first feedback unit is used to receive the task processing result fed back by the target processing node and feed the task processing result back to the task initiator. Specifically, the mapping unit is used for: Based on the code information in the task information, the mutual reference relationships between the code are determined, and the target task is mapped to an initial directed acyclic graph; wherein, the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node represents: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split. The initial subtasks in the initial directed acyclic graph are inductively processed until the initial graph nodes can no longer be inductively processed, thus obtaining the target directed acyclic graph.

14. A task processing device, characterized in that, Applied to a target processing node, the device includes: The second receiving unit is used to receive target subtasks sent by the blockchain scheduling node. The target subtask corresponds to a target graph node in a target directed acyclic graph. The target directed acyclic graph is determined by the blockchain scheduling node based on the code information in the task information sent by the task initiator, which determines the mutual reference relationships between codes. After mapping the target task corresponding to the task processing request associated with the task information to an initial directed acyclic graph, the initial subtasks in the initial directed acyclic graph are summarized until the initial graph nodes cannot be summarized. 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. Each initial subtask meets the condition that the task cannot be split. The processing unit is used to process the target subtask and obtain the 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.

15. A task processing device, characterized in that, Applied to the task initiation end, the device includes: A sending unit is used to send a task processing request to a blockchain scheduling node; wherein the task processing request includes at least task information; so that the blockchain scheduling node, based on the code information in the task information sent by the task initiator, determines the mutual reference relationship between the code, maps the target task corresponding to the task processing request associated with the task information into an initial directed acyclic graph, and then performs inductive processing on the initial subtasks in the initial directed acyclic graph until the initial graph nodes cannot be inductively summarized, thereby obtaining a target directed acyclic graph; wherein the initial directed acyclic graph includes at least two initial graph nodes, each initial graph node representing: an initial subtask obtained after splitting the target task, and each initial subtask meets the condition that the task cannot be split; 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 for at least one target subtask in the target directed acyclic graph.

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

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 8, or the method according to any one of claims 9 to 10, or the method according to any one of claims 11 to 12.

18. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 8, or the method described in any one of claims 9 to 10, or the method described in any one of claims 11 to 12.

Citation Information

Patent Citations

  • 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