On-chain and off-chain task collaborative resource scheduling method and system based on block chain

By adopting a task collaborative resource scheduling method combined with blockchain chain on and off the chain in high-frequency task scenarios, the contradiction between efficiency and security in the existing technology is solved, and efficient and secure task scheduling is achieved.

CN119988012APending Publication Date: 2025-05-13BEIJING MICROCHIP EDGE COMPUTING RES INST

Patent Information

Application Number
CN202510064600.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art is difficult to take into account both safety and efficiency in high-frequency task scenarios, resulting in low task scheduling efficiency and increased delays, which cannot meet user needs.

Method used

The blockchain-based off-chain task collaborative resource scheduling method is adopted. Through smart contracts, the off-chain scheduler is responsible for resource reservation and task execution, and the task scheduling mechanism that combines on-chain and off-chain is realized.

Benefits of technology

It improves the scheduling efficiency of high-frequency tasks, reduces latency, meets the users' high-frequency tasks needs, and ensures the security and credibility of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988012A_ABST
    Figure CN119988012A_ABST
Patent Text Reader

Abstract

The invention discloses an on-chain and off-chain task collaborative resource scheduling method and system based on a block chain, the method comprises on-chain scheduling and off-chain scheduling, and the on-chain scheduling comprises obtaining new task information from an intelligent contract; the new task information is obtained after the task initiator registers on the block chain through the smart contract and is confirmed by each participant; the under-chain scheduling comprises the following steps: receiving a high-frequency task request initiated by a user, and generating a task according to the high-frequency task request and new task information; calculating the resource demand of each participant for the task according to the public resource allocation function, and reserving the required resource in the resource set of each participant; and executing the task by utilizing the resources reserved in the resource set, and updating the own state to obtain a task execution result. According to the method, an on-chain and off-chain combined task scheduling mechanism is adopted, the security of the block chain and the high efficiency of off-chain scheduling are brought into full play, and the contradiction between the efficiency and the security in high-frequency task scheduling is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of resource scheduling, and specifically to a method and system for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain. Background Art

[0002] Multi-server cluster computing (also known as distributed computing or cluster computing) is a technology that uses multiple computer nodes (servers) to cooperate to complete computing tasks. It is widely used in big data processing, cloud computing, scientific computing and other fields, and has the advantages of high performance, high scalability and strong fault tolerance. In a multi-server cluster, task scheduling and state management are crucial, which involves the entire process of computing task allocation, execution, monitoring and result verification.

[0003] The patent document with publication number: CN117785414A discloses a multi-party secure computing task scheduling method based on blockchain, which uses blockchain as a storage and sharing platform for computing task status and manages the status flow of computing tasks with the help of smart contracts. The specific implementation method includes task status storage and sharing, smart contract management, local scheduling engine, and status synchronization and collaborative scheduling.

[0004] Among them, task status storage and sharing records and updates the task status of computing tasks through the blockchain, including each stage of the task (waiting, initialization, establishment and completion) and the execution status of the task; smart contract management is an automatically executed program on the chain, which is used to manage task status changes and task execution processes. Each participant can synchronize task status and execution results by calling the smart contract interface; local scheduling engine, each computing participant coordinates the execution of tasks through the local scheduling engine, and schedules computing resources in the local Kubernetes (K8s) cluster to execute computing tasks; state synchronization and collaborative scheduling, after the execution status is synchronized to the blockchain, the smart contract manages the change of task status, realizes multi-participant collaborative scheduling across K8s clusters, and ensures that the computing process is reliable and the entire link is traceable.

[0005] The main process includes: task registration and review, scheduler polling task status, task execution, task advancement, and status update and evidence storage. Among them, task registration and review: one participant acts as the registrant and uploads the task status to the blockchain. All participants review the task and record the task status through the blockchain; scheduler polling task status: the scheduler continuously polls the task status from the blockchain. If the task is approved by all participants and not executed, the task is executed; task execution: the scheduler selects the task execution method according to the task status, determines whether it is a streaming task, and creates the corresponding service or Pod through K8s to execute the task; task advancement: when a task of a certain stage is completed by multiple participants (that is, after the blockchain smart contract receives a request from each participant to enter the next stage of the task), the smart contract task state machine pushes the task status into the next execution stage; status update and evidence storage: after the task is executed, the result is saved in Redis, the scheduler reads the result and calls the smart contract, and uploads the execution result to the blockchain for evidence storage.

[0006] However, the existing method (Patent document with publication number: CN117785414A) has the following defects:

[0007] 1. The entire process relies on blockchain, which is inefficient: First, the task status update and the task result evidence storage need to be processed through the blockchain. Affected by the blockchain transaction confirmation time, the task scheduling and status update efficiency are inefficient; secondly, the throughput of the blockchain is limited and cannot meet the needs of a large number of concurrent task status updates, which also leads to inefficiency.

[0008] 2. Resource reservation is complex, resulting in the need for multiple rounds of synchronization mechanisms: First, because the scheduler needs to notify other participants of port information and resource allocation through the blockchain, each participant needs to actively reserve resources and synchronize them to the blockchain; second, each task involving more than two participants requires four stages (waiting, initialization, establishment, and completion), among which the initialization stage and establishment stage are used to upload resource reservations and synchronize the resource reservations of other participants, respectively.

[0009] 3. The enthusiasm of the participants is uncertain and the reliability of the task is reduced: If the participants do not actively invest resources, it may lead to insufficient resource reservation and the task cannot be smoothly executed. The system is overly dependent on the initiative of the participants and lacks centralized control. In addition, the reliability of task execution is affected by individual participants, which reduces the stability of the system.

[0010] The above shortcomings are particularly evident when users frequently submit similar computing tasks (same task information, only some user input data is different) (hereinafter referred to as high-frequency tasks). High-frequency tasks are limited by the blockchain transaction confirmation time and throughput, resulting in low task scheduling efficiency, increased latency, and failure to meet user needs. Summary of the invention

[0011] To this end, the present application provides a blockchain-based on-chain and off-chain task collaborative resource scheduling method and system to solve the problem that the existing technology is difficult to balance safety and efficiency in high-frequency task scenarios.

[0012] In order to achieve the above objectives, this application provides the following technical solutions:

[0013] In a first aspect, a blockchain-based on-chain and off-chain task collaborative resource scheduling method is provided, wherein the method is applied to a task initiator and comprises:

[0014] Acquire new task information from the smart contract; the new task information is registered on the blockchain by the task initiator through the smart contract and obtained after confirmation by all participants; the new task information includes the resource set of each participant and the public resource allocation function;

[0015] Receiving a high-frequency task request initiated by a user, and generating a task according to the high-frequency task request and the newly created task information;

[0016] Calculating the resource requirements of each participant for the task according to the common resource allocation function, and reserving the required resources in the resource set of each participant;

[0017] The task is executed using the resources reserved in the resource set, and its own state is updated to obtain the task execution result.

[0018] Preferably, the newly created task information is obtained from the smart contract by polling or event monitoring.

[0019] Preferably, the user initiates high-frequency task requests through public key encryption technology.

[0020] Preferably, when reserving the required resources from the resource set of each participant, if the resource reservation is successful, the task status will be updated from WAITING to READY.

[0021] Preferably, a digital signature is required when updating the own status.

[0022] As a preference, it also includes:

[0023] Receive the task execution results returned by all participants, update the task status according to the task execution results of all participants, release the resources reserved in the resource set of each participant, and then save the task execution results of all participants to the database.

[0024] As a preferred embodiment, it also includes: each participant can collect information on the task initiator's violation of the agreement and report it afterwards.

[0025] In the second aspect, a blockchain-based on-chain and off-chain task collaborative resource scheduling system includes:

[0026] The scheduler is used to obtain new task information from the smart contract; the new task information includes the resource set of each participant and the public resource allocation function;

[0027] The off-chain task manager is used to receive high-frequency task requests initiated by users and generate tasks according to the high-frequency task requests and the newly created task information;

[0028] and calculating the resource requirements of each participant for the task according to the common resource allocation function, and reserving the required resources in the resource set of each participant;

[0029] The off-chain scheduler is used to use the resources reserved in the resource set to execute the task, update its own status, and obtain the task execution result.

[0030] As a preference, it also includes:

[0031] The task approval module is used by the task initiator to register the newly created task information on the blockchain by calling the smart contract; and by each participant to confirm the newly created task information through the smart contract.

[0032] Preferably, the off-chain task manager adopts the Raft consensus protocol.

[0033] Compared with the prior art, this application has at least the following beneficial effects:

[0034] This application provides a method and system for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain, including on-chain scheduling and off-chain scheduling. On-chain scheduling includes obtaining new task information from smart contracts; the new task information is registered on the blockchain by the task initiator through a smart contract and obtained after confirmation by all participants; the new task information includes the resource set of each participant and the public resource allocation function; off-chain scheduling includes: receiving high-frequency task requests initiated by users, and generating tasks based on high-frequency task requests and new task information; calculating the resource requirements of each participant for the task according to the public resource allocation function, and reserving the required resources in the resource set of each participant; using the resources reserved in the resource set to execute the task, and updating its own status to obtain the task execution result. This application adopts a task scheduling mechanism that combines on-chain and off-chain, giving full play to the security of blockchain and the high efficiency of off-chain scheduling, solving the contradiction between efficiency and security in high-frequency task scheduling, and ensuring security while meeting the efficiency requirements of high-frequency tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing the present application; for example, those skilled in the art are capable of easily making conventional adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components) based on the technical concepts and exemplary drawings disclosed in the present application.

[0036] Figure 1 A flowchart of a method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain provided in Example 1 of the present application;

[0037] Figure 2 A schematic diagram of the structure of a blockchain-based on-chain and off-chain task collaborative resource scheduling method provided in Example 1 of the present application. DETAILED DESCRIPTION

[0038] The present application is further described below in detail through specific embodiments in conjunction with the accompanying drawings.

[0039] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).

[0040] The terms such as "upper", "lower", "left", "right", "middle", etc. cited in this application are usually used to indicate the general relative position relationship for the purpose of intuitive understanding by referring to the drawings, and are not absolute limitations on the position relationship in the actual product.

[0041] Embodiment 1

[0042] See also Figure 1 , this embodiment provides a blockchain-based on-chain and off-chain task collaborative resource scheduling method, which is applied to the task initiator and includes on-chain scheduling and off-chain scheduling.

[0043] On-chain scheduling:

[0044] S1: Obtain new task information from the smart contract; the new task information is registered on the blockchain by the task initiator through the smart contract and obtained after confirmation by all participants; the new task information includes the resource set of each participant and the public resource allocation function;

[0045] See also Figure 2 , on-chain scheduling specifically includes:

[0046] S101: The initiator creates a new task: The task approval module of the task initiator registers the new task information tinfo on the blockchain by calling the smart contract. This step is represented by the arrow from the task approval module to the smart contract, numbered 1;

[0047] S102: Participants approve tasks: After receiving the newly created task information, the task approval module of each participant reviews and approves the task information through the smart contract to reach an initial consensus. This step is represented by the arrow from the task approval module to the smart contract, numbered 2;

[0048] S103: The initiator's scheduler obtains the newly created task: The smart contract notifies the initiator's scheduler that there is a new task to be processed. The initiator's scheduler obtains the newly created task information from the smart contract through polling or event monitoring. This step is represented by the arrow from the smart contract to the scheduler, numbered 3.

[0049] Steps 101 to 103 in the above on-chain scheduling process are basically the same as the prior art, and their main purpose is for each participant to confirm the subsequent computing tasks on the chain. In addition to the original functions, when each participant approves the task, each party is also required to confirm the resource set R for the subsequent off-chain tasks. i and a public resource allocation function Ψ so that the off-chain task manager can allocate resources in subsequent steps. The open ports of the off-chain task manager and the ports used to communicate with the off-chain scheduler are also confirmed in step 102.

[0050] It should be noted that each participant P i Both have resource set R i = {r i1 ,r i2 ,...,r ik}, maintained by the off-chain task manager, the resource collection reflects the computing power, storage space, network bandwidth and other resource information of the participants. The public resource allocation function Ψ defines the resource requirements and allocation strategy of the task, and the formula is: Ψ: Task×P→ResourceRequirement. The off-chain task manager will calculate the resource requirements of each participant Ψ(t,P for task t) according to Ψ. i ).

[0051] After the on-chain scheduling is completed, the scheduler of each participant needs to start an off-chain scheduler. It should be noted that the scheduler of the task initiator also needs to start the off-chain task manager, which is responsible for global task management, resource allocation and coordination. This step is in Figure 2 The arrow from the scheduler to the off-chain task manager is represented by 4.

[0052] Off-chain scheduling:

[0053] S2: Receive high-frequency task requests initiated by users, and generate tasks based on high-frequency task requests and new task information;

[0054] Continue reading Figure 2 , the step specifically includes:

[0055] S201: User initiates task request: The user initiates a high-frequency task request to the off-chain task manager of the task initiator by providing task input information and tracking ID;

[0056] S202: After receiving the task request from the user, the off-chain task manager of the task initiator generates a task t based on the user input and the approved task information tinfo on the chain, and stores it persistently. A unique task t can be obtained using the tracking ID. This step is represented by the arrow from the user to the off-chain task manager, numbered 5.

[0057] S3: Calculate the resource requirements of each participant for the task according to the common resource allocation function, and reserve the required resources in the resource set of each participant;

[0058] Specifically, the off-chain task manager of the task initiator calculates the resource requirements of each participant for task t according to the public resource allocation function Ψ(t, P i ), and in the resource set R of each participant iIf all participants successfully reserve resources, the task status is updated from WAITING to READY, indicating that the task is ready; if any participant has insufficient resources, the task status is updated from WAITING to FAILED; after the resource reservation is successful, the off-chain scheduler of each participant is notified to indicate that the task is ready, or each off-chain scheduler regularly polls all its tasks in the READY state from the off-chain task manager.

[0059] It should be noted that the off-chain task manager maintains the resource set R of all participants. i , the task state G is initialized to WAITING.

[0060] S4: Use the resources reserved in the resource set to execute the task, update its own status, and obtain the task execution result.

[0061] Specifically, each participant uses the resources reserved in the resource set to perform tasks. After the task is completed, the off-chain scheduler updates its own status S i The task is either SUCCESS or FAILED, and the task execution result is reported to the initiator's off-chain task manager.

[0062] The off-chain task manager of the task initiator collects the status S of the off-chain schedulers of all participants i If all S i is SUCCESS, the task status G is updated to SUCCESS; if any S i is FAILED, the task status G is updated to FAILED.

[0063] It should be noted that the state transfer is led by the initiator's off-chain task manager, which uniformly manages the transfer of task states, avoids excessive reliance on the initiative of the off-chain scheduler, and improves the reliability of task startup and execution.

[0064] After the task is completed, the off-chain task manager of the task initiator releases the reserved resources and saves the task results to the database (such as Redis) for the scheduler to read and store evidence. Steps S3 and S4 are the process of distributing tasks and executing them. Figure 2 The arrow from the off-chain task manager to the off-chain scheduler is represented by 6.

[0065] The blockchain-based on-chain and off-chain task collaborative resource scheduling method provided in this embodiment can improve security by introducing the following two cryptographic technologies.

[0066] (1) Through public key encryption technology, the input entered by the user when initiating a task request can be encrypted using the public key of the corresponding target participant, preventing the original information from being obtained by the off-chain task manager.

[0067] (2) Through digital signature technology, each participant signs its status update message and the off-chain task manager signs the task message. Support other participants to collect information on the task initiator's violation of the agreement and report it afterwards. The post-event reporting function can be implemented by a separate smart contract. The details are as follows:

[0068] 1) Incorrect status update: Participants can initiate disputes for incorrect status updates. If they fail to provide a corresponding status update with the participant's signature within the specified time for the disputed status, it will be deemed as an incorrect status update.

[0069] 2) Wrong resource allocation: the resource set R of off-chain tasks i , as well as the resource allocation function Ψ and task information are all publicly verifiable information on the chain.

[0070] 3) For the same task, different information is sent to different participants: If the off-chain task manager sends conflicting task information to the off-chain schedulers of different participants, it can be considered malicious behavior. This different task information can be collected and reported by relevant participants.

[0071] 4) Sending the wrong task: Task information tinfo is publicly verifiable information on the chain. Based on task information tinfo, it can be verified whether the task part of task t to be executed is correct. For the input part of task t, a dispute can be initiated. If the off-chain task manager cannot provide an off-chain task submission message with the user's digital signature within the specified time, and the input and tracking ID in the submission message are consistent with those in task t, it is deemed that it has sent an incorrect task to the off-chain scheduler of the participant.

[0072] The blockchain-based on-chain and off-chain task collaborative resource scheduling method provided in this embodiment has the following advantages:

[0073] (1) Balancing safety and efficiency

[0074] 1) On-chain operations in the initial stage to ensure security and credibility: When a task is first created and resources are allocated, blockchain smart contracts are used to allocate resources and manage status on the chain to ensure that all participants recognize the task and allocate resources legally, thus ensuring the security and credibility of the system.

[0075] 2) Subsequent high-frequency tasks are operated off-chain to improve efficiency: For tasks frequently initiated by users, resources are allocated and status managed off-chain, so that it can support more user tasks concurrently, avoiding performance bottlenecks caused by blockchain transaction confirmation time and throughput limitations, improving the response speed of task scheduling, and meeting the needs of high-frequency tasks.

[0076] (2) Simplify the task state machine and reduce the number of state synchronization rounds

[0077] By moving the state synchronization of the initialization and establishment phases of the task to the off-chain, the task state machine is simplified, the number of state synchronization rounds is reduced, and the task scheduling speed is accelerated.

[0078] (3) Improve the reliability of task execution

[0079] 1) In the initial stage, resource allocation and status management of tasks are completed on the chain, ensuring the recognition of tasks by participants and the legal allocation of resources.

[0080] 2) Subsequent tasks are efficiently executed off-chain, and the off-chain task manager leads the transfer of task status. Even if some participants are not active, it can coordinate resources to ensure the smooth completion of the task.

[0081] In summary, the blockchain-based on-chain and off-chain task collaborative resource scheduling method provided in this embodiment adopts a task scheduling mechanism that combines on-chain and off-chain, giving full play to the security of blockchain and the efficiency of off-chain scheduling, and solving the contradiction between efficiency and security in high-frequency task scheduling. The initial resource allocation and state management are completed on the chain to ensure the legitimacy and credibility of the task; and the subsequent high-frequency task execution and resource management are carried out efficiently off the chain, which improves the response speed and scalability. It not only ensures its security, but also meets the efficiency requirements of high-frequency tasks.

[0082] Embodiment 2

[0083] This embodiment provides a blockchain-based on-chain and off-chain task collaborative resource scheduling system, including:

[0084] The scheduler is used to obtain new task information from the smart contract; the new task information includes the resource collection of each participant and the public resource allocation function;

[0085] The off-chain task manager is used to receive high-frequency task requests initiated by users and generate tasks based on high-frequency task requests and new task information;

[0086] and calculating the resource requirements of each participant for the task based on the common resource allocation function, and reserving the required resources from the resource set of each participant;

[0087] The off-chain scheduler is used to execute tasks using the resources reserved in the resource collection, and update its own status to obtain the task execution results.

[0088] Specifically, the off-chain task manager is also used to maintain the global cluster state, including the task list, task status, and resource information of each participant; implement the task state machine, update the global state of the task according to the status update of each off-chain scheduler; uniformly maintain the resource set R of each off-chain scheduler i , and independently reserve and allocate resources; receive submissions of new tasks, status updates and heartbeat information from all participants; lead the transfer of task status and resource management to ensure the reliability of task execution.

[0089] The off-chain scheduler is also used to periodically synchronize the latest cluster status (task list and task status) from the off-chain task manager; execute the tasks assigned to it, and use the reserved resources Ψ(t,P i ); Send task execution status (success or failure) and heartbeat information to the off-chain task manager.

[0090] The present embodiment provides a blockchain-based on-chain and off-chain task collaborative resource scheduling system, which also includes:

[0091] The task approval module is used by the task initiator to register the newly created task information on the blockchain by calling the smart contract; and by each participant to confirm the newly created task information through the smart contract.

[0092] In the blockchain-based on-chain and off-chain task collaborative resource scheduling system provided in this embodiment, the off-chain task manager assumes the responsibilities of maintaining, updating and allocating resources for the off-chain task status, and its security (see Example 1 for security solutions) and reliability are crucial to the normal operation of the system. In order to enhance the reliability of the off-chain task manager, the Raft consensus protocol can be used to implement distributed task state machines and global cluster state management. The following provides specific methods and analysis for improving reliability:

[0093] The off-chain task manager can use the Raft consensus protocol to expand itself into a distributed system consisting of multiple nodes. Through the Raft protocol, multiple nodes of the off-chain task manager can maintain consistency in log replication, leader election, and safety, thereby achieving high availability and fault tolerance.

[0094] (1) Management of task state machine and global cluster state

[0095] 1) Task state machine: The off-chain task manager maintains the task state machine, which is used to track the state transition process of all tasks (such as WAITING, READY, SUCCESS, FAILED). Changes in task status are recorded as log entries and replicated between nodes in the cluster through the Raft protocol to ensure that all nodes have a consistent task state machine.

[0096] 2) Global cluster state: The global cluster state includes the resource set R of all participants. i , resource allocation function Ψ, task information, and the execution status S of each off-chain scheduler i Through consistent log replication and state machine application, each node of the off-chain task manager can synchronously update the global cluster status, ensuring that the global status seen by each node is consistent.

[0097] (2) Message numbering and snapshot mechanism

[0098] 1) Message numbering: The off-chain task manager uniquely numbers the received messages (including off-chain task submission messages from users and each valid task status update message from participants). Each number corresponds to a log entry in Raft and also corresponds to a unique global cluster state. This mechanism ensures that at any time, the task status and resource allocation of the entire network are traceable and consistent.

[0099] 2) Snapshot mechanism: In order to prevent the log from growing indefinitely, the off-chain task manager generates a system snapshot at an appropriate time to save the current task state machine and global cluster state. This mechanism helps newly added nodes quickly synchronize the current state and also improves the system's recovery speed.

[0100] (3) Ensuring task status consistency

[0101] 1) Consistency of task status updates: Through the Raft protocol, the off-chain task manager cluster ensures the consistency of task status updates among nodes. Any change in task status is considered submitted and effective only after confirmation by the majority of nodes in the cluster.

[0102] 2) Prevent inconsistent snapshot sending: Since all nodes follow the Raft protocol, the off-chain task manager cluster leader node will not send inconsistent global cluster states (i.e. snapshots) to the off-chain task manager cluster participant nodes. If a network partition or node failure occurs, the Raft protocol can prevent brain splits and ensure system security. In a cluster consisting of 2N+1 nodes, the Raft protocol can tolerate N node failures without affecting the normal operation of the system. Assuming that the number of failed nodes of the off-chain task manager is less than N, it can be inferred that the off-chain task manager cluster has a consistent system snapshot.

[0103] For the specific implementation content of each module in a blockchain-based on-chain and off-chain task collaborative resource scheduling system, please refer to the above definition of a blockchain-based on-chain and off-chain task collaborative resource scheduling method, which will not be repeated here.

[0104] The technical features of the above embodiments may be arbitrarily combined (as long as there is no contradiction in the combination of these technical features). To make the description concise, not all possible combinations of the technical features in the above embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope of this specification.

Claims

1. A blockchain-based collaborative resource scheduling method for on-chain and off-chain tasks, characterized in that: The method is applied to a task initiator, and includes: Acquire new task information from the smart contract; the new task information is registered on the blockchain by the task initiator through the smart contract and obtained after confirmation by all participants; the new task information includes the resource set of each participant and the public resource allocation function; Receiving a high-frequency task request initiated by a user, and generating a task according to the high-frequency task request and the newly created task information; Calculating the resource requirements of each participant for the task according to the common resource allocation function, and reserving the required resources in the resource set of each participant; The task is executed using the resources reserved in the resource set, and its own state is updated to obtain the task execution result.

2. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: The new task information is obtained from the smart contract by polling or event monitoring.

3. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: Users initiate high-frequency task requests through public key encryption technology.

4. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: When reserving the required resources in the resource set of each participant, if the resource reservation is successful, the task status will be updated from WAITING to READY.

5. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: A digital signature is required when updating the own status.

6. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: Also includes: Receive the task execution results returned by all participants, update the task status according to the task execution results of all participants, release the resources reserved in the resource set of each participant, and then save the task execution results of all participants to the database.

7. The method for collaborative resource scheduling of on-chain and off-chain tasks based on blockchain according to claim 1 is characterized in that: Also includes: Each participant can collect information on the task initiator's violation of the agreement and report it afterwards.

8. A blockchain-based on-chain and off-chain task collaborative resource scheduling system, characterized in that: include: Scheduler, used to obtain new task information from smart contracts; The newly created task information includes resource sets of each participant and a public resource allocation function; The off-chain task manager is used to receive high-frequency task requests initiated by users and generate tasks according to the high-frequency task requests and the newly created task information; and calculating the resource requirements of each participant for the task according to the common resource allocation function, and reserving the required resources in the resource set of each participant; The off-chain scheduler is used to use the resources reserved in the resource set to execute the task, update its own status, and obtain the task execution result.

9. The blockchain-based on-chain and off-chain task collaborative resource scheduling system according to claim 8 is characterized in that: Also includes: The task approval module is used by the task initiator to register the new task information on the blockchain by calling the smart contract; It is also used for all participants to confirm the new task information through smart contracts.

10. The blockchain-based on-chain and off-chain task collaborative resource scheduling system according to claim 8, characterized in that: The off-chain task manager adopts the Raft consensus protocol.

Citation Information

Patent Citations

  • Multi-party security computing task scheduling method based on block chain

    CN117785414A

Cited By

  • Data storage protection system based on block chain and secure multi-party computing

    CN121071942A

  • Data storage protection system based on blockchain and secure multi-party computation

    CN121071942B