Blockchain-based task processing method, apparatus, device, medium, and product

By setting up multiple task queues in the task processing device and processing data sharing tasks according to priority scheduling rules, the problem of long waiting time for urgent tasks was solved, and efficient task execution was achieved.

CN122437889APending Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2025-01-20
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

When sharing data on a blockchain, urgent data sharing tasks may take a long time, resulting in low execution efficiency.

Method used

By setting up multiple task queues in the task processing device, each with a different queue priority, and scheduling execution according to the scheduling rules of task priority and queue priority, it is ensured that tasks with high urgency are processed first.

Benefits of technology

It improves the execution efficiency of urgent data sharing tasks, reduces waiting time, and enhances the overall efficiency of task processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437889A_ABST
    Figure CN122437889A_ABST
Patent Text Reader

Abstract

The application provides a task processing method and device based on a blockchain, equipment, a medium and a product. Published data sharing tasks on the blockchain are executed by a task processing device. The task processing device includes a plurality of task queues. The method is executed by the task processing device. The method includes: obtaining a queue priority of each task queue, the queue priority being used to indicate a scheduling order of the corresponding task queue; each task queue being used to store a data sharing task whose task priority matches the corresponding queue priority, the task priority being used to indicate an urgency of the corresponding data sharing task; obtaining scheduling information, the scheduling information being used to indicate a scheduling rule between the plurality of task queues based on the queue priority; and scheduling and executing the data sharing tasks in the plurality of task queues according to the scheduling information and the queue priority of each task queue. The application can improve the execution efficiency of data sharing tasks with high urgency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to the field of blockchain technology, specifically to a blockchain-based task processing method, a blockchain-based task processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] Data sharing refers to sharing data provided by a data provider with data users. In decentralized data sharing using blockchain, data sharing tasks can be published on the blockchain, and data sharing is achieved by executing these tasks. If there are many data sharing tasks, they may queue up, and some urgent tasks may have to wait a long time before being executed, resulting in low execution efficiency for these urgent tasks. Summary of the Invention

[0003] This application provides a blockchain-based task processing method, apparatus, device, medium, and product that can improve the execution efficiency of data sharing tasks with high urgency.

[0004] On one hand, this application provides a blockchain-based task processing method. Data sharing tasks published on the blockchain are scheduled and executed by a task processing device. The task processing device includes multiple task queues, each storing data sharing tasks to be scheduled for execution. This blockchain-based task processing method is executed by the task processing device. The blockchain-based task processing method includes:

[0005] Get the queue priority of each task queue. The queue priority is used to indicate the scheduling order of the corresponding task queue. Each task queue is used to store data sharing tasks whose task priority matches the priority of the corresponding queue. The task priority is used to indicate the urgency of the corresponding data sharing task.

[0006] Obtain scheduling information, which indicates the scheduling rules based on queue priority among multiple task queues;

[0007] Based on the scheduling information and the queue priority of each task queue, data-sharing tasks in multiple task queues are scheduled for execution.

[0008] Accordingly, this application provides a blockchain-based task processing device. Data sharing tasks published on the blockchain are scheduled and executed by the task processing device. The task processing device includes multiple task queues, each queue storing data sharing tasks to be scheduled and executed. The blockchain-based task processing device is disposed within the task processing device. The blockchain-based task processing device includes:

[0009] The acquisition unit is used to acquire the queue priority of each task queue, which indicates the scheduling order of the corresponding task queue; each task queue is used to store data sharing tasks whose task priority matches the priority of the corresponding queue, and the task priority indicates the urgency of the corresponding data sharing task.

[0010] The acquisition unit is also used to acquire scheduling information, which is used to indicate the scheduling rules based on queue priority among multiple task queues;

[0011] The processing unit is used to schedule and execute data-sharing tasks in multiple task queues according to scheduling information and the queue priority of each task queue.

[0012] In one implementation, the scheduling information includes scheduling control information corresponding to the priority of each queue; the processing unit, used to schedule and execute data-sharing tasks in multiple task queues according to the scheduling information and the queue priority of each task queue, specifically performs the following steps:

[0013] According to the scheduling order of each task queue, the data sharing tasks in the corresponding task queue are scheduled and executed sequentially based on the scheduling control information corresponding to the queue priority of each task queue.

[0014] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to the first queue priority includes execution interruption conditions, and the scheduling control information corresponding to the second queue priority includes preemption execution conditions and preemption interruption conditions.

[0015] The processing unit, used to schedule and execute data sharing tasks in the corresponding task queue according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue, specifically performs the following steps:

[0016] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0017] When the data sharing task in the first task queue is executed to the point where the execution interruption condition is met, the scheduling of the data sharing task in the first task queue is stopped, and the second task queue is preempted according to the preemption execution condition.

[0018] If the preemption check result indicates that there is a data sharing task in the second task queue that meets the preemption execution conditions, then the data sharing task in the second task queue that meets the preemption execution conditions will be scheduled for execution.

[0019] When a data sharing task in the second task queue that meets the preemptive execution condition is executed until the preemptive interruption condition is met, the scheduling of data sharing tasks in the second task queue is stopped, and the scheduling of data sharing tasks in the first task queue continues.

[0020] In one implementation, the preemption execution condition includes a waiting threshold; the processing unit, when performing a preemption check on the second task queue according to the preemption execution condition, specifically performs the following steps:

[0021] Based on the current time of the task processing device and the time when the data sharing task in the second task queue was stored in the second task queue, determine the waiting time of the data sharing task in the second task queue;

[0022] If there is a target data sharing task in the second task queue whose corresponding waiting time is greater than the waiting threshold, a preemption check result is generated; the preemption check result indicates that the target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions.

[0023] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to each queue priority includes execution interruption conditions.

[0024] The processing unit, used to schedule and execute data sharing tasks in the corresponding task queue according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue, specifically performs the following steps:

[0025] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0026] When a data sharing task in the first task queue is executed to the point where the execution interruption condition corresponding to the priority of the first queue is met, the scheduling of data sharing tasks in the first task queue is stopped, and data sharing tasks in the second task queue are scheduled to be executed.

[0027] When the execution of a data sharing task in the second task queue reaches the execution interruption condition corresponding to the priority of the second queue, the scheduling of the data sharing task in the second task queue is stopped, and the data sharing task in the first task queue is scheduled to be executed.

[0028] In one implementation, the execution interruption condition for a data sharing task in the first task queue to meet the priority of the first queue includes: the execution time of the data sharing task in the first task queue reaches a first specified time, or the number of data sharing tasks executed in the first task queue reaches a first specified number; the execution interruption condition for a data sharing task in the second task queue to meet the priority of the second queue includes: the execution time of the data sharing task in the second task queue reaches a second specified time, or the number of data sharing tasks executed in the second task queue reaches a second specified number; the first specified time is greater than the second specified time, and the first specified number is greater than the second execution number;

[0029] Alternatively, the execution interruption condition for the data sharing tasks in the first task queue to meet the priority of the first queue includes: the number of remaining data sharing tasks in the first task queue is a preset number; the execution interruption condition for the data sharing tasks in the second task queue to meet the priority of the second queue includes: the number of remaining data sharing tasks in the second task queue is a preset number.

[0030] In one implementation, any one of the data sharing tasks stored in multiple task queues is represented as the first data sharing task. The first data sharing task is published to the blockchain by the first data user object. The first data sharing task is used to request the first shared data from the first data provider object, which is a service object of the task processing device. The task data of the first data sharing task includes: the first directory information of the first shared data, the object information of the first data provider object, and the encryption key of the first data user object.

[0031] The execution process of the first data sharing task includes:

[0032] Based on the object information and directory information of the first data provider, first shared data is retrieved from the database of the first data provider object;

[0033] Based on the encryption key of the first data object, the first shared data is encrypted to obtain the first encrypted data;

[0034] Send the first encrypted data to the first data user.

[0035] In one implementation, the service objects of the task processing device include a second data user, which publishes a second data sharing task to the blockchain through the task processing device; the processing unit is also used to perform the following steps:

[0036] Receive the second encrypted data obtained from the execution of the second data sharing task;

[0037] The second encrypted data is decrypted using the decryption key of the second data object to obtain the second shared data;

[0038] Store the second shared data in the database of the second data user object.

[0039] In one implementation, a third data-sharing task published on the blockchain is used to request data from a second data-providing object; the processing unit is also used to perform the following steps:

[0040] Obtain the third-party data sharing task and its approval results from the blockchain;

[0041] If the approval result of the third data sharing task indicates that the approval is successful, then a service license check is performed on the second data provider.

[0042] If the service license check indicates that the second data provider is a service object of the task processing device, then the third data sharing task is stored in multiple task queues, with the queue priority matching the task priority of the third data sharing task.

[0043] In one implementation, a fourth data-sharing task published on the blockchain is used to request data from a third data provider object; the processing unit is also used to perform the following steps:

[0044] Obtain the fourth data sharing task from the blockchain;

[0045] Perform service license checks on third-party data providers;

[0046] If the service license check results indicate that the third data provider is a service object of the task processing device, then an approval notice for the fourth data sharing task is generated and sent to the third data provider.

[0047] Receive the approval results of the third data provider for the fourth data sharing task, and publish the approval results of the fourth data sharing task to the blockchain.

[0048] In one implementation, the service objects of the task processing device include third-party data users; the processing unit is further configured to perform the following steps:

[0049] Receive task data sent by the third data object. The task data includes directory information of the shared data requested by the fourth data provider object, object information of the fourth data provider object, encryption key of the third data provider object, and set task priority.

[0050] Create a data sharing task for the third data user object based on the task data of the third data user object;

[0051] Publish the data sharing task of the third-party data user to the blockchain.

[0052] Accordingly, embodiments of this application provide a computer device, which includes:

[0053] A processor is a tool for implementing computer programs.

[0054] A computer-readable storage medium storing a computer program adapted for loading and execution by a processor of the aforementioned blockchain-based task processing method.

[0055] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program. When the computer program is read and executed by the processor of a computer device, the computer device performs the aforementioned blockchain-based task processing method.

[0056] Accordingly, this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned blockchain-based task processing method.

[0057] In this embodiment, data sharing tasks published on the blockchain are assigned task priorities, which indicate the urgency of the corresponding data sharing task. The task processing device may include multiple task queues, each with a queue priority indicating its scheduling order. Each task queue stores data sharing tasks whose priorities match the corresponding queue priorities. Scheduling information indicates scheduling rules based on queue priorities among multiple task queues. Data sharing tasks in multiple task queues can be scheduled and executed according to the scheduling information and the queue priority of each task queue. In this way, high-urgency data sharing tasks can be stored in the task queue with the highest scheduling order, allowing them to be prioritized for execution. This reduces the execution waiting time for high-urgency data sharing tasks and improves their execution efficiency. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.

[0059] Figure 1 This is a schematic diagram of the architecture of a task processing system provided in an embodiment of this application;

[0060] Figure 2 This is a business scenario diagram of a task processing method provided in an embodiment of this application;

[0061] Figure 3 This is a flowchart illustrating a blockchain-based task processing method provided in an embodiment of this application;

[0062] Figure 4 This is a schematic diagram illustrating the scheduling and execution of a data sharing task provided in an embodiment of this application;

[0063] Figure 5 This is a flowchart illustrating a data publishing stage provided in an embodiment of this application;

[0064] Figure 6 This is a flowchart illustrating the creation phase of a data sharing task provided in an embodiment of this application;

[0065] Figure 7 This is a flowchart illustrating the approval stage of a data sharing task provided in an embodiment of this application;

[0066] Figure 8 This is a flowchart illustrating the execution phase of a data sharing task provided in an embodiment of this application;

[0067] Figure 9 This is a schematic diagram of the structure of a blockchain-based task processing device provided in an embodiment of this application;

[0068] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0069] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0070] To better understand the technical solutions provided in the embodiments of this application, the technical terms used in the embodiments of this application will be introduced first:

[0071] I. Data Sharing Task:

[0072] A data sharing task can refer to a task used to request shared data. A task is a basic unit of work that can be executed. Data sharing tasks can be assigned a priority, which indicates the urgency of the corresponding data sharing task. The higher the urgency of the data sharing task, the higher its priority can be set, and vice versa.

[0073] The urgency of a data sharing task can be used to characterize the real-time requirements of that task; the higher the real-time requirements, the higher the urgency, and vice versa. Alternatively, the urgency of a data sharing task can be used to characterize the amount of data requested to be shared; the smaller the amount of data requested, the higher the urgency, and vice versa.

[0074] The participants involved in a data sharing task can include data users (also known as data providers) and data providers. A data provider is the participant that owns and provides data; data users can only obtain data approved by the data provider. A data user is the participant who wants to use the data provided by the data provider. When a data user needs data, they apply to the data provider, and only after approval can they obtain the data. A data sharing task can be generated in response to a data request from a data user. The data sharing task specifies the requesting data provider, the requested data directory, and the task priority. By executing the data sharing task, the data requested by the data user can be shared from the data provider to the data user.

[0075] II. Blockchain:

[0076] Blockchain is a decentralized, distributed database that combines technologies such as distributed storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. It records data through a continuously growing chain of blocks, ensuring data security and transparency. In this embodiment, data sharing tasks, their priorities, approval results, and execution results can all be recorded on the blockchain. This ensures the traceability of the entire data sharing task processing flow, improving its reliability.

[0077] III. Task Queue:

[0078] A task queue can refer to a queue used to store data-sharing tasks to be scheduled for execution. The data-sharing tasks in the task queue are the queue elements. A queue is a first-in-first-out (FIFO) linear data structure that allows insertion operations on one end of the queue and deletion operations on the other end. The insertion end is called the rear, and the deletion end is called the front.

[0079] Task queues can be assigned queue priorities, which indicate the scheduling order of the corresponding task queues. The scheduling order of a task queue refers to the order in which data-sharing tasks within the queue are scheduled for execution. The relationship between queue priority and scheduling order can be as follows: the higher the queue priority, the earlier the corresponding task queue is scheduled, and the earlier the data-sharing tasks within that queue are scheduled for execution; conversely, the lower the queue priority, the later the corresponding task queue is scheduled, and the later the data-sharing tasks within that queue are scheduled for execution.

[0080] For example, the first task queue corresponds to the first queue priority, the second task queue to the second queue priority, and the third task queue to the third queue priority. The first queue priority is higher than the second queue priority, and the second queue priority is higher than the third queue priority. In other words, the first task queue is a high-priority queue, the second task queue is a medium-priority queue, and the third task queue is a low-priority queue. In this case, the scheduling order of the first task queue is before that of the second task queue, and the scheduling order of the second task queue is before that of the third task queue. That is, data sharing tasks in the first task queue are scheduled and executed first, followed by data sharing tasks in the second task queue, and then data sharing tasks in the third task queue.

[0081] Based on the above description of technical terms such as data sharing tasks, blockchain, and task queues, this application provides a blockchain-based task processing method. In this method, data users can set different task priorities for trusted data sharing tasks, and data providers can reliably approve the set task priorities. Data sharing tasks can be stored in multiple task queues, with the queue priority matching the task priority. Data sharing tasks in task queues with higher queue priorities can be scheduled for execution first. That is, if a data sharing task is urgent, its task priority can be set to high priority, and the high-priority data sharing task can be stored in a task queue with a high queue priority, thus improving the execution efficiency of urgent data sharing tasks.

[0082] In addition, to prevent data sharing tasks in the medium-priority and low-priority queues from being unable to be executed for a long time, a time threshold can be set for the medium-priority and low-priority queues. After the data sharing tasks in the high-priority queue have been executing for a certain period of time, it is possible to check whether there are any data sharing tasks in the medium-priority and low-priority queues whose waiting time has exceeded the time threshold. If so, the execution of the data sharing tasks in the current high-priority queue can be paused, and the data sharing tasks in the medium-priority and low-priority queues can be executed first.

[0083] Alternatively, to prevent data sharing tasks in the medium-priority and low-priority queues from being unable to be executed for extended periods, the execution of data sharing tasks in the high-priority queue can be paused after a certain period of execution, and data sharing tasks in the medium-priority queue can be scheduled for execution. Similarly, the execution of data sharing tasks in the medium-priority queue can be paused after a certain period of execution, and data sharing tasks in the low-priority queue can be scheduled for execution. Furthermore, the execution time (or number of tasks) of data sharing tasks in the high-priority queue can be set to be greater than that of the medium-priority queue, and the execution time (or number of tasks) of data sharing tasks in the medium-priority queue can be set to be greater than that of the low-priority queue.

[0084] Next, we will introduce the task processing system to which the blockchain-based task processing method is applicable.

[0085] Task processing systems can combine blockchain technology with a trusted execution environment to provide trusted data sharing services. These systems aim to achieve trusted data sharing and collaborative computation among multiple participants while ensuring data security and privacy protection. For example... Figure 1 As shown, the task processing system may include a blockchain network 101 and at least one task processing device 102. Wherein:

[0086] (1) Blockchain Network 101:

[0087] The blockchain network 101 may include multiple blockchain nodes 1011, which can jointly maintain a blockchain in a decentralized manner. This application embodiment does not limit the type of blockchain; the blockchain can be any of a public blockchain, a private blockchain, or a consortium blockchain. The task processing device 102 is not part of the blockchain network 101; it is a device outside the blockchain network 101. The task processing device 102 communicates with the blockchain nodes 1011 in the blockchain network 101 to obtain data from the blockchain and publish data to the blockchain.

[0088] (2) Task processing equipment 102:

[0089] Any task processing device 102 may include a task control console 1021 and at least one task agent device 1022 maintained by the task control console 1021. The control console administrator of the task control console 1021 can create agent gateways for the service objects of the task control console 1021 on the task control console 1021. An agent gateway is a program module that provides agent services, which may include task agent execution services for data sharing tasks and data agent reception services after the data sharing tasks are executed. Service objects of the task control console 1021 can download agent gateways from the task control console 1021 and deploy them to devices close to the data storage. The device with the deployed agent gateway is the task agent device 1022, thus enabling the task agent device 1022 to provide agent services.

[0090] Among them, the service objects of Task Control Console 1021 refer to the objects that have successfully registered in Task Control Console 1021. The service objects of Task Control Console 1021 can be divided into two categories according to their roles in the data sharing process: data users and data providers.

[0091] The service recipients of Task Management Console 1021 can use the management services provided by Task Management Console 1021. These management services may include data publishing services, task creation services, and task approval services. Specifically, the data publishing service refers to Task Management Console 1021's ability to publish data catalog information to its data providers. Data catalog information can refer to metadata information of the data catalog, which may include configuration and description information. Configuration information can indicate the configuration of the data catalog, such as its structure, naming, permissions, and access settings. Description information can describe the specific content of the data catalog. The task creation service refers to Task Management Console 1021's ability to create data sharing tasks for its data users and publish these tasks on the blockchain. The task approval service refers to Task Management Console 1021's ability to retrieve data sharing tasks related to its data providers from the blockchain, notify the data providers to approve the data sharing tasks, and publish the approval results on the blockchain. Data sharing tasks related to data providers refer to data sharing tasks where the specified data provider is a data provider provided by Task Management Console.

[0092] The service objects of task agent device 1022 refer to the objects assigned to task agent device 1022 by task control console 1021. These service objects can be categorized into data users and data providers based on their roles in the data sharing process. Task agent device 1022 can provide task proxy execution services to the data providers it serves. This service involves proxying the execution of data sharing tasks. Specifically, task agent device 1022 can retrieve data requested by the data sharing task from the database of the data provider and send the retrieved data to the data user who requested the data through the data sharing task. Furthermore, task agent device 1022 can schedule and execute data sharing tasks with different priorities using task queues with different priorities to ensure that high-priority (i.e., more urgent) data sharing tasks are scheduled and executed first. Task agent device 1022 can also provide data proxy receiving services to the data users it serves. This service involves task agent device 1022 receiving the execution results of the data sharing task (i.e., the requested data) and storing the requested data in the database of the data user.

[0093] exist Figure 1In the task processing system shown, blockchain nodes can be terminals or servers. The task management console can be a server, and its service recipients can access it through a client (e.g., a web client, a mini-program client, or an application client). Task agent devices can be terminals or servers. In this embodiment, terminal devices can include, but are not limited to, any of the following: smartphones, tablets, laptops, desktop computers, smartwatches, smart home appliances, smart vehicle terminals, and aircraft. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.

[0094] Figure 1 The task processing system shown is intended to more clearly illustrate the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0095] The following section, using a task processing system as an example, introduces the business scenarios applicable to blockchain-based task processing methods.

[0096] The blockchain-based task processing method provided in this application can be applied to business scenarios involving trusted data sharing between different organizations. Each organization has its own task management device, and members of each organization can participate in data sharing through their respective task management devices. Figure 2 For example, the task processing system may include task management devices of organization 1, task management devices of organization 2, task processing devices of organization 3, task processing devices of organization 4, and a blockchain network; the blockchain network may include blockchain node 1, blockchain node 2, blockchain node 3, and blockchain node 4.

[0097] The following example, using Organization 1, illustrates the creation, registration, and deployment process of a proxy gateway:

[0098] Organization 1's task management devices may include Task Control Console 1. The console administrator within Organization 1 can create proxy gateways on Task Control Console 1. After creation, Task Control Console 1 can register the proxy gateway's chain identity certificate on the blockchain, thereby marking the proxy gateway on the blockchain. Organization members of Organization 1 can download the proxy gateway from Task Control Console 1 and deploy it to a device close to the data storage. This device with the deployed proxy gateway 1 is Organization 1's task proxy device 1.

[0099] The following uses Organization 3 and Organization 4 as examples to illustrate the data sharing process:

[0100] ①The members of Organization 3 may include Data Provider 1, which can submit data catalog information to Task Control Console 3 in the task management device of Organization 3; Task Control Console 3 can send the data catalog information to Blockchain Node 3 in the blockchain network, and Blockchain Node 3 will publish the data catalog information to the blockchain.

[0101] ② The task management console 4 in the task processing device of organization 4 can obtain the data catalog information submitted by data provider 1 from the blockchain through blockchain node 4, and display the data catalog information to the organization members of organization 4. The organization members of organization 4 may include data user 1. Data user 1 can request the creation of a data sharing task on the task management console 4 according to its own data usage needs. In the creation request, data user 1 can specify the catalog information of the data to be shared, the task priority (for example, a high-urgency data sharing task can be set as a high-priority task), and the data provider of the data sharing task as data provider 1 in organization 3. The task management console 4 can respond to the creation request of data user 1 for the data sharing task, create and send the data sharing task to blockchain node 4 in the blockchain network, and blockchain node 4 publishes the data sharing task to the blockchain.

[0102] ③ The task management console 3 of organization 3 can synchronize data on the blockchain from blockchain node 3. When it detects that the data provider specified in the published data sharing task on the blockchain is data provider object 1 in organization 3 (i.e., the service object of task management console 3), it can generate an approval notice for the data sharing task and send the approval notice to data provider object 1. Data provider object 1 can approve the data sharing task in the client of task management console 3. Task management console 3 can send the approval result of the data sharing task to blockchain node 3 in the blockchain network, and blockchain node 3 will publish the approval result of the data sharing task on the blockchain.

[0103] ④ The task agent device 3 of organization 3 can synchronize data on the blockchain from the blockchain node 3. When it is detected that the data provider object specified in the data sharing task that has been approved on the blockchain is the service object of the task agent device 3 in organization 3, the task agent device 3 can store the data sharing task in the task queue whose priority matches the task priority according to the task priority of the data sharing task. When the data sharing task is scheduled to be executed, the data sharing task can be executed. The execution process of the data sharing task is to pull the data requested by the data user object 1 from the database of the data provider object 1, encrypt the pulled data using the encryption key of the data user object 1 (for example, the public key of the data user object 1), and send the encrypted data to the task agent device 4 of organization 4.

[0104] ⑤ After receiving the encrypted data, the task agent device 4 of organization 4 can use the decryption key of data user 1 (for example, the private key of data user 1) to decrypt the encrypted data, obtain the data requested by data user 1, and store the data requested by data user 1 in the database of data user 1.

[0105] For the data sharing process described above, the smart contract on the blockchain will create multiple task queues for each task agent device. Specifically, multiple task queues are registered on the blockchain, and these queues are actually created within the task agent device. These task queues function when the task agent device acts as a data provider. The task agent device can store data sharing tasks related to the data provider it serves (where "related" means the data provider specified in the data sharing task is the data provider served by the task agent device) according to task priority, placing them into task queues whose priorities match the corresponding queue priorities. The task agent device can then schedule and execute the data sharing tasks in each task queue according to their priority order. This ensures that high-priority data sharing tasks, i.e., high-urgency data sharing tasks, are stored in high-priority task queues, allowing them to be scheduled and executed first. In other words, high-priority data sharing tasks are prioritized for execution, thus improving the efficiency of high-urgency data sharing tasks.

[0106] It's easy to imagine that in real-world business scenarios, organizational members are geographically dispersed. For example, a company might have subsidiaries in three different locations, forming three clusters of organizational members. To address this dispersed nature, the task management console in the task processing device can maintain multiple task proxy devices. Each task proxy device provides services to one organizational member cluster. These proxy devices can be deployed near the data storage location of the cluster they serve, facilitating regionalized proxy services. For instance, separate task proxy devices can be deployed for the three clusters in different locations, providing task execution and data reception services respectively. This approach helps distribute task execution pressure, and the proximity of the proxy devices to data storage allows for faster data retrieval, improving task execution efficiency. Furthermore, it allows for maintaining task execution capacity by increasing the number of proxy devices as the organization expands, and conserving hardware resources by reducing the number of proxy devices as the organization shrinks.

[0107] It is worth noting that, in the above Figure 1 and Figure 2 In this embodiment, the task processing device includes a task management console and a task agent device, which are independent devices. This is merely an example in this application. The advantage of their independence is that it separates the task management flow from the task execution flow, which is beneficial for the maintenance of the task processing device and the large-scale management of the task agent device. Optionally, the task management console and the task agent device can be integrated into the same task processing device. That is, the task management console and the task agent device can be integrated into the task processing device as functional modules, which can save hardware resources.

[0108] This application does not limit the communication method between devices. For example, a task agent device can access the database of a data provider or data user through the TLS (Transport Layer Security) protocol, retrieve data from the database of the data provider, or store data in the database of the data user. Communication between task agent devices, or between a task agent device and a blockchain node, can be achieved through GRPC (Google Remote Procedure Call).

[0109] The following is a detailed description of the blockchain-based task processing method provided in the embodiments of this application.

[0110] This application provides a blockchain-based task processing method, which includes: a scheduling method among multiple task queues with different priorities in a task processing device; an execution method for data-sharing tasks; a creation and publishing process for data-sharing tasks; and an approval process for data-sharing tasks. This blockchain-based task processing method can be executed by a computer device, which can be, for example, any task processing device in the aforementioned task processing system. Figure 3 As shown, the blockchain-based task processing method may include, but is not limited to, the following steps S301-S303:

[0111] S301, obtain the queue priority of each task queue in multiple task queues. The queue priority is used to indicate the scheduling order of the corresponding task queue. Each task queue is used to store data sharing tasks whose task priority matches the corresponding queue priority. The task priority is used to indicate the urgency of the corresponding data sharing task.

[0112] In step S301, the task management device may include multiple task queues. The queue priority of each task queue can be obtained, and the queue priority can be used to indicate the scheduling order of the corresponding task queues. A higher queue priority results in a higher scheduling order for the corresponding task queue, and vice versa. For example, the multiple task queues may include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority; therefore, the scheduling order of the first task queue precedes the scheduling order of the second task queue.

[0113] Each task queue can be used to store data-sharing tasks whose priority matches the priority of their corresponding queue. "Matching" here can mean identical, meaning each task queue can store data-sharing tasks with the same priority as their corresponding queue. The task priority of a data-sharing task indicates its urgency; higher urgency means higher priority, and vice versa. For example, if the first data-sharing task corresponds to the first task priority, and the second data-sharing task corresponds to the second task priority, and the first task priority is the same as the first queue priority, and the second task priority is the same as the second queue priority, then the first data-sharing task can be stored in the first task queue, and the second data-sharing task can be stored in the second task queue.

[0114] Optionally, the data sharing tasks stored in the task queue are approved data sharing tasks. The following example, using any approved data sharing task published on the blockchain (which can be represented as a third data sharing task), illustrates the process of storing a data sharing task in the task queue. The third data sharing task published on the blockchain can be used to request data from a second data provider. The task processing device (specifically, the task agent device within the task processing device) can obtain the third data sharing task and its approval result from the blockchain. If the approval result of the third data sharing task indicates approval, a service license check can be performed on the second data provider. This service license check can be used to check whether the second data provider is a service object of the task processing device. If the service license check result indicates that the second data provider is a service object of the task processing device, the third data sharing task can be stored in multiple task queues, corresponding to task queues whose priority matches the task priority of the third data sharing task. If the service license check result indicates that the second data provider is not a service object of the task processing device, the third data sharing task can be deleted.

[0115] S302, Obtain scheduling information. The scheduling information is used to indicate the scheduling rules based on queue priority among multiple task queues.

[0116] In step S302, the scheduling information can be used to indicate scheduling rules based on queue priorities among multiple task queues. The scheduling information may include scheduling control information corresponding to each queue priority. The scheduling control information corresponding to each queue priority can be used to control the execution of data-sharing tasks in the task queues of the corresponding queue priority. For example, execution control may include controlling the task execution time or controlling the number of tasks to be executed.

[0117] S303 schedules and executes data-sharing tasks in multiple task queues according to scheduling information and the queue priority of each task queue.

[0118] In step S303, the process of scheduling and executing data sharing tasks in multiple task queues according to the scheduling control information corresponding to the priority of each queue in the scheduling information and the queue priority of each task queue may include: scheduling and executing the data sharing tasks in the corresponding task queues in turn according to the scheduling order of each task queue and the scheduling control information corresponding to the queue priority of each task queue.

[0119] Furthermore, the overall scheduling and execution principle for data-sharing tasks in multiple task queues is as follows: data-sharing tasks in task queues with higher priority are scheduled and executed before data-sharing tasks in task queues with lower priority. Moreover, the scheduling and execution of data-sharing tasks in each task queue with a specific priority is controlled by the scheduling control information corresponding to that priority. For example... Figure 4 As shown, multiple task queues can include high-priority task queues, medium-priority task queues, and low-priority task queues. High-priority task queues can be used to store high-priority data sharing tasks, medium-priority task queues can be used to store medium-priority data sharing tasks, and low-priority task queues can be used to store low-priority data sharing tasks. High-priority data sharing tasks in high-priority task queues are scheduled and executed first, followed by medium-priority data sharing tasks in medium-priority task queues, and then low-priority data sharing tasks in low-priority task queues.

[0120] Specifically, the scheduling and execution methods for data-sharing tasks in multiple task queues can include any one of preemptive, alternating, and round-robin scheduling. Among these:

[0121] (1) Method of seizure:

[0122] The preemption method refers to the following: multiple task queues are scheduled in the order indicated by the queue priority. The data sharing task in the task queue with the highest queue priority is scheduled first. After a certain time or a certain number of tasks are executed, the remaining task queues (excluding the task queue with the highest queue priority) are checked to see if there are any data sharing tasks with long waiting times. If so, the execution of the data sharing task in the task queue with the highest queue priority is paused, and the data sharing task with the long waiting time is executed. After the data sharing task with the long waiting time is executed for a certain time or a certain number of tasks, the execution of the data sharing task with the long waiting time is paused, and the data sharing task in the task queue with the highest queue priority is resumed.

[0123] Specifically, multiple task queues may include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to the first queue priority may include execution interruption conditions, and the scheduling control information corresponding to the second queue priority may include preemption execution conditions and preemption interruption conditions. Based on this, in the preemptive mode, the scheduling and execution process of data sharing tasks in multiple task queues may include: prioritizing the scheduling and execution of data sharing tasks in the first task queue; when a data sharing task in the first task queue reaches the point where the execution interruption condition is met, the scheduling and execution of data sharing tasks in the first task queue is stopped, and a preemption check is performed on the second task queue according to the preemption execution conditions; if the check result indicates that there is a data sharing task in the second task queue that meets the preemption execution conditions, then the data sharing task in the second task queue that meets the preemption execution conditions is scheduled and executed; when a data sharing task in the second task queue that meets the preemption execution conditions reaches the point where the preemption interruption condition is met, the scheduling and execution of data sharing tasks in the second task queue is stopped, and the scheduling and execution of data sharing tasks in the first task queue continues.

[0124] During the scheduling and execution of data-sharing tasks in multiple task queues under the above preemption method:

[0125] ① The execution interruption condition may include a third specified time (which may be set based on empirical values). In this case, the execution of data sharing tasks in the first task queue until the execution interruption condition is met means that the task execution time of the data sharing tasks in the first task queue reaches the third specified time. Alternatively, the execution interruption condition may include a third specified quantity (which may be set based on empirical values). In this case, the execution of data sharing tasks in the first task queue until the execution interruption condition is met means that the number of data sharing tasks executed in the first task queue reaches the third specified quantity.

[0126] ② The preemption execution conditions may include a waiting threshold. The preemption check process may include: determining the waiting time of the data sharing tasks in the second task queue based on the current time of the task processing device and the time when the data sharing tasks in the second task queue were stored in the second task queue (the waiting time may be equal to the current time of the task processing device minus the time when the data sharing tasks in the second task queue were stored in the second task queue); if there is a target data sharing task in the second task queue with a corresponding waiting time greater than the waiting threshold, a preemption check result (the check result here refers to the first check result) can be generated, which can indicate that the target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions; if the waiting times of all data sharing tasks in the second task queue are less than or equal to the waiting threshold, a preemption check result (the check result here refers to the second check result) can be generated, which can indicate that there is no data sharing task in the second task queue that meets the preemption execution conditions.

[0127] Optionally, the number of second task queues may include multiple queues. For example, the second task queues may include second task queue 1 and second task queue 2. Second task queue 1 corresponds to second queue priority 1, and second task queue 2 corresponds to second queue priority 2. Second queue priority 1 is higher than second queue priority 2, and the scheduling order of second task queue 1 is higher than the scheduling order of second task queue 2. In this case, the waiting threshold may include waiting threshold 1 and waiting threshold 2. Waiting threshold 1 can be used to perform preemption checks on data sharing tasks in second task queue 1, and waiting threshold 2 can be used to perform preemption checks on data sharing tasks in second task queue 2. Furthermore, waiting threshold 1 is less than waiting threshold 2.

[0128] Based on this, the preemption check process may include: determining the waiting time of the data sharing task in the second task queue 1 based on the current time of the task processing device and the time when the data sharing task in the second task queue 1 was stored in the second task queue 1; determining the waiting time of the data sharing task in the second task queue 2 based on the current time of the task processing device and the time when the data sharing task in the second task queue 2 was stored in the second task queue 2; if there is a first target data sharing task in the second task queue 1 with a corresponding waiting time greater than waiting threshold 1, and / or, there is a second target data sharing task in the second task queue 2 with a corresponding waiting time greater than waiting threshold 2, then... The preemption check result (here, the check result refers to the first check result) can indicate that the first target data sharing task and / or the second target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions; if the waiting time of all data sharing tasks in the second task queue 1 is less than or equal to the waiting threshold 1, and the waiting time of all data sharing tasks in the second task queue 2 is less than or equal to the waiting threshold 2, then the preemption check result (here, the check result refers to the second check result) can be generated, which can indicate that there is no data sharing task in the second task queue that meets the preemption execution conditions.

[0129] It is easy to see that, according to the storage principle of data sharing tasks, the urgency of data sharing tasks in the second task queue 1 is higher than that of data sharing tasks in the second task queue 2. Therefore, the waiting threshold 1 for preemption checks on the second task queue 1 can be set to be lower than the waiting threshold 2 for preemption checks on the second task queue 2. This ensures that data sharing tasks with higher urgency can meet the preemption execution conditions first, so that data sharing tasks with higher urgency can be preempted and executed first.

[0130] ③ The preemption interruption condition may include a fourth specified time (which may be set based on empirical values). In this case, the execution of data-sharing tasks in the second task queue that meet the preemption execution condition until the preemption interruption condition is met means that the execution time of the data-sharing tasks in the second task queue that meet the preemption execution condition reaches the fourth specified time. Alternatively, the preemption interruption condition may include a fourth specified number (which may be set based on empirical values). In this case, the execution of data-sharing tasks in the second task queue that meet the preemption execution condition until the preemption interruption condition is met means that the number of data-sharing tasks in the second task queue that meet the preemption execution condition reaches the fourth specified number.

[0131] For the preemptive method, for example, the first task queue is a high-priority task queue (which can be simply referred to as the high-priority queue), the second task queue 1 is a medium-priority task queue (which can be simply referred to as the medium-priority queue), and the second task queue 3 is a low-priority task queue (which can be simply referred to as the low-priority queue). Data sharing tasks in the high-priority queue can be scheduled for execution first. After 10 seconds of execution of data sharing tasks in the high-priority queue, it can be checked whether there are any data sharing tasks in the medium-priority queue with a waiting time exceeding 6 seconds, and whether there are any data sharing tasks in the low-priority queue with a waiting time exceeding 8 seconds. If so, the execution of data sharing tasks in the high-priority queue can be temporarily suspended, and data sharing tasks in the medium-priority queue and / or low-priority queue can be executed first. After three data sharing tasks in the medium-priority queue and / or low-priority queue have been executed, the execution of data sharing tasks in the medium-priority queue and / or low-priority queue is paused, and the execution of data sharing tasks in the high-priority queue resumes.

[0132] (2) Alternating method:

[0133] Alternating mode refers to the following: multiple task queues execute data-sharing tasks in multiple task queues in an alternating manner according to the scheduling order indicated by the queue priority; and the higher the queue priority, the longer the task execution time or the greater the number of tasks to be executed in the corresponding task queue.

[0134] Specifically, the multiple task queues may include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to each queue priority includes execution interruption conditions. Based on this, the scheduling and execution process of data sharing tasks in multiple task queues in the alternating mode may include: prioritizing the scheduling and execution of data sharing tasks in the first task queue; when the execution of a data sharing task in the first task queue reaches the execution interruption condition corresponding to the first queue priority, stopping the scheduling and execution of data sharing tasks in the first task queue, and scheduling and execution of data sharing tasks in the second task queue; when the execution of a data sharing task in the second task queue reaches the execution interruption condition corresponding to the second queue priority, stopping the scheduling and execution of data sharing tasks in the second task queue, and scheduling and execution of data sharing tasks in the first task queue.

[0135] During the scheduling and execution of data-sharing tasks in multiple task queues under the above alternating method:

[0136] ① The execution interruption condition corresponding to the priority of the first queue may include a first specified time (the first specified time may be set based on empirical values). In this case, the execution of data sharing tasks in the first task queue until the execution interruption condition is met means that the task execution time of the data sharing tasks in the first task queue reaches the first specified time. Alternatively, the execution interruption condition may include a first specified quantity (the first specified quantity may be set based on empirical values). In this case, the execution of data sharing tasks in the first task queue until the execution interruption condition is met means that the number of data sharing tasks executed in the first task queue reaches the first specified quantity.

[0137] Furthermore, the execution interruption condition corresponding to the second queue priority may include a second specified time (the second specified time may be set based on empirical values). In this case, the execution of data sharing tasks in the second task queue until the execution interruption condition is met means that the task execution time of the data sharing tasks in the second task queue reaches the second specified time. Alternatively, the execution interruption condition may include a second specified quantity (the second specified quantity may be set based on empirical values). In this case, the execution of data sharing tasks in the second task queue until the execution interruption condition is met means that the number of tasks executed in the second task queue reaches the second specified quantity.

[0138] Furthermore, the first specified time is greater than the second specified time, and the first specified quantity is greater than the second execution quantity. With this setting, the higher the priority of the task queue, the longer the execution time or the higher the number of data-sharing tasks in the task queue. Conversely, the higher the priority of the task queue, the higher the urgency of the data-sharing tasks in the task queue, thus allowing tasks with high urgency to be scheduled and executed first.

[0139] ② The number of second task queues can be multiple. For example, the second task queues can include second task queue 1 and second task queue 2. Second task queue 1 corresponds to second queue priority 1, and second task queue 2 corresponds to second queue priority 2. Second queue priority 1 is higher than second queue priority 2, and the scheduling order of second task queue 1 is before the scheduling order of second task queue 2. In this case, when a data sharing task in the first task queue is executed to the point where the execution interruption condition corresponding to the first queue priority is met, the scheduling of data sharing tasks in the first task queue can be stopped, and data sharing tasks in the second task queue 1 can be scheduled for execution. When a data sharing task in the second task queue 1 is executed to the point where the execution interruption condition corresponding to the second queue priority 1 is met, the scheduling of data sharing tasks in the second task queue 1 can be stopped, and data sharing tasks in the second task queue 2 can be scheduled for execution. When a data sharing task in the second task queue 2 is executed to the point where the execution interruption condition corresponding to the second queue priority 2 is met, the scheduling of data sharing tasks in the second task queue 2 can be stopped, and data sharing tasks in the first task queue can be scheduled for execution.

[0140] The execution interruption condition corresponding to the second queue priority 1 may include a second specified time 1 or a second specified quantity 1; the execution of data sharing tasks in the second task queue 1 until the execution interruption condition corresponding to the second queue priority 1 is met may include: the task execution time of the data sharing tasks in the second task queue 1 reaches the second specified time 1, or the number of tasks executed in the second task queue 1 reaches the second specified quantity 1. The execution interruption condition corresponding to the second queue priority 2 may include a second specified time 2 or a second specified quantity 2; the execution of data sharing tasks in the second task queue 2 until the execution interruption condition corresponding to the second queue priority 2 is met may include: the task execution time of the data sharing tasks in the second task queue 2 reaches the second specified time 2, or the number of tasks executed in the second task queue 2 reaches the second specified quantity 2.

[0141] For an alternating approach, for example, multiple task queues can include a high-priority task queue (which can be simply called a high-priority queue), a medium-priority task queue (which can be simply called a medium-priority queue), and a low-priority task queue (which can be simply called a low-priority queue). Data-sharing tasks in the high-priority queue can be scheduled for execution first. After 10 seconds of execution, execution of data-sharing tasks in the high-priority queue is paused, and execution of data-sharing tasks in the medium-priority queue begins. After 5 seconds of execution, execution of data-sharing tasks in the medium-high priority queue is paused, and execution of data-sharing tasks in the low-priority queue begins. After 2 seconds of execution, execution of data-sharing tasks in the low-high priority queue is paused, and execution of data-sharing tasks in the high-priority queue begins.

[0142] (3) Rotation method:

[0143] The rotation method refers to the following: multiple task queues are scheduled in the order indicated by the queue priority. The data sharing task in the task queue with the highest queue priority is scheduled for execution first. After the data sharing task in the task queue with the highest queue priority is completed, the data sharing task in the task queue with the next queue priority is scheduled for execution, and so on, until the data sharing task in the task queue with the lowest queue priority among the multiple task queues is scheduled for execution.

[0144] The scheduling and execution process of data-sharing tasks in multiple task queues under the round-robin method is similar to that under the alternating method, the difference being the execution interruption condition corresponding to the priority of each queue. Specifically, under the round-robin method, the execution of data-sharing tasks in the first task queue until the execution interruption condition corresponding to the priority of the first queue can include: the number of remaining data-sharing tasks in the first task queue is a preset number, such as 0, meaning that the data-sharing tasks in the first task queue have been completed; under the round-robin method, the execution of data-sharing tasks in the second task queue until the execution interruption condition corresponding to the priority of the second queue can include: the number of remaining data-sharing tasks in the second task queue is a preset number, such as 0, meaning that the data-sharing tasks in the second task queue have been completed.

[0145] The number of second task queues can be multiple. For example, the second task queues can include second task queue 1 and second task queue 2. In this case, the difference between the alternation method and the rotation method is as follows: the execution of data sharing tasks in second task queue 1 until the execution interruption condition corresponding to the priority 1 of the second queue is met can include: the number of remaining data sharing tasks in second task queue 1 reaches a preset number; the execution of data sharing tasks in second task queue 2 until the execution interruption condition corresponding to the priority 2 of the second queue is met can include: the number of remaining data sharing tasks in second task queue 2 is a preset number.

[0146] For a rotation method, for example, multiple task queues can include a high-priority task queue (which can be simply called a high-priority queue), a medium-priority task queue (which can be simply called a medium-priority queue), and a low-priority task queue (which can be simply called a low-priority queue). Data sharing tasks in the high-priority queue can be scheduled for execution first. After the data sharing tasks in the high-priority queue are completed, data sharing tasks in the medium-priority queue are scheduled for execution. After the data sharing tasks in the medium-high priority queue are completed, data sharing tasks in the low-priority queue are scheduled for execution. If a new data sharing task is stored in the high-priority queue after the data sharing tasks in the low-priority queue are completed, then the data sharing task in the high-priority queue is scheduled for execution.

[0147] The above (1)-(3) introduce three scheduling execution methods among multiple task queues. It is not difficult to find that in the three scheduling execution methods, data sharing tasks in the task queue with high queue priority are all scheduled for execution first. The data sharing tasks in the task queue with high queue priority are data sharing tasks with high urgency, so that data sharing tasks with high urgency can be executed first. The first scheduling execution method, through preemption check, allows data sharing tasks with lower urgency and longer waiting time to be preempted under the premise of ensuring that data sharing tasks with high urgency are executed first, thus avoiding excessively long waiting time for data sharing tasks with lower urgency. The second scheduling execution method controls the number of tasks executed in the task queue with high queue priority to be greater than the number of tasks executed in the task queue with low queue priority, or controls the execution time of tasks in the task queue with high queue priority to be greater than the execution time of tasks in the task queue with low queue priority, so that data sharing tasks with high urgency in the task queue with high queue priority can be executed more and faster.

[0148] Optionally, based on the amount of data-sharing tasks obtained by the task agent device from the blockchain, a scheduling execution method matching the task amount can be determined. The data-sharing tasks in multiple task queues are then scheduled and executed according to the scheduling information under the matching scheduling execution method and the queue priority of each task queue. For example, when the amount of data-sharing tasks obtained by the task processing device (specifically, the task agent device) from the blockchain exceeds a first quantity threshold, the scheduling execution method matching the task amount can be determined as a preemptive method; when the amount of data-sharing tasks obtained by the task agent device from the blockchain is less than or equal to the first quantity threshold but greater than or equal to a second quantity threshold, the scheduling execution method matching the task amount can be determined as an alternating method; and when the amount of data-sharing tasks obtained by the task agent device from the blockchain is less than the second quantity threshold, the scheduling execution method matching the task amount can be determined as a round-robin method. In this way, the scheduling and execution methods among multiple task queues can be adapted to the task volume. When the task volume is large, the preemption strategy can prioritize the execution of a large number of data sharing tasks with high urgency. When the task volume is small, some data sharing tasks with lower urgency can be executed appropriately without affecting the execution efficiency of data sharing tasks with high urgency, making the scheduling and execution of data sharing tasks more reasonable.

[0149] The above step S303 details the scheduling and execution method of data sharing tasks in multiple task queues. The following section uses any one of the data sharing tasks stored in multiple task queues (this data sharing task can be represented as the first data sharing task) as an example to describe the execution process of a data sharing task. The first data sharing task can be published to the blockchain by a first data user object. The first data sharing task requests the first shared data from a first data provider object, which is the service object of the task processing device (here, the task processing device refers to the task agent device). The task data of the first data sharing task can include: the first directory information of the first shared data, the object information of the first data provider object, and the encryption key of the first data user object. Based on this, the execution process of the first data sharing task by the task processing device can include: retrieving the first shared data from the database of the first data provider object based on the object information and first directory information of the first data provider object; encrypting the first shared data according to the encryption key of the first data user object (e.g., the public key of the first data user object) to obtain the first encrypted data; and sending the first encrypted data to the first data user object, specifically to the task agent device that serves the first data user object.

[0150] Optionally, in addition to providing task proxy execution services to the data providers it serves, the task processing device can also provide approval services for data sharing tasks to the data providers it serves. Specifically, a fourth data sharing task published on the blockchain can be used to request data from a third data provider; the task processing device (specifically, the task management console) can obtain the fourth data sharing task from the blockchain; a service license check is performed on the third data provider to verify whether it is a service object of the task processing device; if the service license check indicates that the third data provider is a service object of the task processing device, an approval notification for the fourth data sharing task can be generated and sent to the third data provider; the device can receive the third data provider's approval result for the fourth data sharing task and publish the approval result on the blockchain; if the service license check indicates that the third data provider is not a service object of the task processing device, the fourth data sharing task can be deleted.

[0151] Optionally, in addition to providing services to the data providers it serves, the task processing device (specifically referring to the task control console) can also provide task creation services to the data users it serves. Specifically, the service targets of the task processing device can include third-party data users. The task processing device (specifically referring to the task control console within the task processing device) can receive task data sent by the third-party data users. This task data can include directory information of the shared data requested from the fourth data provider, object information of the fourth data provider, encryption keys of the third-party data users, and set task priorities. It can create data-sharing tasks for the third-party data users based on their task data and publish these tasks to the blockchain.

[0152] Optionally, in addition to providing services to the data providers it serves, the task processing device (specifically, the task agent device) can also provide data proxy receiving services to the data users it serves. Specifically, the service targets of the task processing device can include second data users who publish second data sharing tasks to the blockchain through the task processing device. The task processing device can receive the second encrypted data obtained from the execution of the second data sharing task; it can decrypt the second encrypted data using the decryption key of the second data user to obtain the second shared data; and it can store the second shared data in the database of the second data user.

[0153] In this embodiment of the application, by setting different task priorities for data sharing tasks with different urgency on the blockchain, and by leveraging the scheduling order between task queues with different queue priorities, differentiated scheduling of data sharing tasks is achieved, so that data sharing tasks with high urgency can be scheduled and executed first, thereby improving the execution efficiency of data sharing tasks with high urgency.

[0154] This application provides a blockchain-based task processing method, which includes a data sharing process between a data provider and a data user. This data sharing process may include a data catalog publishing stage, a data sharing task creation stage, a data sharing task approval stage, and a data sharing task execution stage. Specifically, data provider 1 belongs to data source 1 (e.g., data source 1 is the organization 1 to which data provider 1 belongs), and data source 1 corresponds to a first task processing device, which may include a first task control console and a first task agent device. Data user 1 belongs to data source 2 (e.g., data source 2 is the organization 2 to which data user 1 belongs), and data source 2 corresponds to a second task processing device, which may include a second task control console and a second task agent device.

[0155] like Figure 5 As shown, the data catalog publishing phase may include, but is not limited to, the following steps S501-S506:

[0156] S501, the first task control console receives data catalog information published by data provider object 1.

[0157] Data provider object 1 is the service object of the first task control console.

[0158] S502, First task control console creates data directory information.

[0159] The creation here refers to the process by which the first task management console converts the data directory information published by the first data provider into data directory information that conforms to the specified data directory format on the blockchain. The data directory format refers to the standard format of the data directory, and the conversion is conducive to the standardization of the format of data directory information on the blockchain.

[0160] S503, the first task control console encrypts the data.

[0161] Data encryption here refers to the encryption of private data in the data directory information by the first task control console to ensure the security of the private data. This private data in the data directory information may include, for example, the database address (database IP) of the data provider, and the login account and password of the data provider.

[0162] S504, the first task control console stores and uploads the data directory information to the blockchain.

[0163] On-chain storage refers to the process where the first task management console publishes data catalog information to the blockchain for storage. More specifically, the first task management console sends the data catalog information to blockchain nodes in the blockchain network, and the blockchain nodes then publish the data catalog information to the blockchain for storage.

[0164] S505, the first task control console receives the uplink result of the data directory information.

[0165] The on-chain result can include successful on-chain or failed on-chain. This application example illustrates the case of successful on-chain.

[0166] S506, the first task control console returns the results of uploading the data catalog information to the data provider object 1.

[0167] like Figure 6 As shown, the creation phase of a data sharing task may include, but is not limited to, the following steps S601-S608:

[0168] S601, Data User 1 requests the creation of a data sharing task on the second task control console.

[0169] The request includes the following information: data source information of the data source 1 requesting shared data, object information of the data provider object 1 requesting shared data, encryption key of the data using object 1 (e.g., the private key of the data using object), and task priority.

[0170] S602, the second task control console responds to the request from data user 1 by specifying the data source in the created data sharing task.

[0171] S603, the second task control console uses the object's encryption key to upload data in the created data sharing task.

[0172] S604, the second task control console sets the data provider object in the created data sharing task.

[0173] S605, the second task control console sets the data user in the created data sharing task.

[0174] S606, the second task control console sets the task priority in the created data sharing task.

[0175] S607, the second task control console publishes data sharing tasks to the blockchain.

[0176] "Publishing on-chain" refers to the second task management platform publishing the data sharing task to the blockchain for storage. More specifically, the second task management platform sends the data sharing task to blockchain nodes in the blockchain network, and the blockchain nodes then publish the data sharing task to the blockchain for storage.

[0177] S608, the second task control console receives the on-chain results of the data sharing task.

[0178] like Figure 7 As shown, the approval stage of a data sharing task may include, but is not limited to, the following steps S701-S709:

[0179] S701, the first task control console subscribes to data sharing tasks on the blockchain.

[0180] The subscription here refers to the fact that the first task management console can detect data updates on the blockchain. When the first task management console detects that a data sharing task has been updated and published on the blockchain, it can obtain the data sharing task from the blockchain.

[0181] S702, if the data provider specified in the data sharing task is not the service object of the first task control console, then discard the data sharing task.

[0182] S703, if the data provider specified in the data sharing task is a service object of the first task control console, then the data sharing task will be locally stored in the database.

[0183] Local storage refers to the process by which the first task management console stores the data sharing task in its storage space. In this embodiment, the data provider specified in the data sharing task is data provider object 1, which is a service object of the first task management console. Therefore, the first task management console can store the data sharing task locally.

[0184] S704, the first task control console generates an approval notice for the data sharing task and sends the approval notice for the data sharing task to data provider 1.

[0185] S705, Data Provider 1 approves the data sharing task on the first task management console.

[0186] S706, the first task control console responds to the approval operation of data provider 1 and generates an approval result of approval or disapproval.

[0187] S707, the first task control console will publish the approval results of the data sharing task on the blockchain.

[0188] S708, the first task control console, receives the on-chain results of the data sharing task.

[0189] S709, the first task control console returns the on-chain result to data provider object 1.

[0190] like Figure 8 As shown, the execution flow of the data sharing task may include the following steps S801-S807:

[0191] S801, the first task agent device obtains the approved data sharing task from the blockchain.

[0192] S802, the first task agent device receives the approved data sharing task returned by the blockchain.

[0193] The data sharing task specifies that the data provider is data provider object 1. Since data provider object 1 is included in the service objects of the first task agent device, the first task agent device can execute the data sharing task. If data provider object 1 is not included in the service objects of the first task agent device, the first task agent device can discard the data sharing task.

[0194] S803, the first task agent device pulls data from the database of data provider object 1.

[0195] S804, the first task agent device uses the encryption key of object 1 to encrypt the retrieved data to obtain encrypted data.

[0196] S805, the first task agent device sends encrypted data to the second task agent device.

[0197] The service objects of the second task agent device include data user object 1; therefore, encrypted data is sent to the second task agent device.

[0198] S806, the second task agent device uses the decryption key of object 1 to decrypt the encrypted data.

[0199] S807, the second task agent device stores the decrypted data into the database of data user object 1.

[0200] In this embodiment of the application, data sharing is based on blockchain, which allows the entire process of data sharing to be recorded by the blockchain. Based on the traceability and immutability of blockchain, the security and reliability of data sharing are improved.

[0201] The methods of the embodiments of this application have been described in detail above. In order to facilitate better implementation of the above solutions of the embodiments of this application, the apparatus of the embodiments of this application is provided below.

[0202] Please see Figure 9 , Figure 9This is a schematic diagram of a blockchain-based task processing device provided in an embodiment of this application. This blockchain-based task processing device can be installed in the computer equipment provided in this embodiment, which can be the task processing device mentioned above. Data sharing tasks published on the blockchain are scheduled and executed by the task processing device. The task processing device includes multiple task queues, each used to store data sharing tasks to be scheduled and executed. Figure 9 The blockchain-based task processing device shown can be a computer program running on a computer device, which can be used to execute... Figure 3 , Figure 5 , Figure 6 , Figure 7 or Figure 8 Some or all of the steps in the method embodiments shown. Please refer to [link / reference]. Figure 9 The blockchain-based task processing device may include the following units:

[0203] The acquisition unit 901 is used to acquire the queue priority of each task queue, which is used to indicate the scheduling order of the corresponding task queue; each task queue is used to store data sharing tasks whose task priority matches the priority of the corresponding queue, and the task priority is used to indicate the urgency of the corresponding data sharing task.

[0204] The acquisition unit 901 is also used to acquire scheduling information, which is used to indicate the scheduling rules based on queue priority among multiple task queues;

[0205] The processing unit 902 is used to schedule and execute data-sharing tasks in multiple task queues according to scheduling information and the queue priority of each task queue.

[0206] In one implementation, the scheduling information includes scheduling control information corresponding to the priority of each queue; the processing unit 902, when scheduling and executing data-sharing tasks in multiple task queues according to the scheduling information and the queue priority of each task queue, specifically performs the following steps:

[0207] According to the scheduling order of each task queue, the data sharing tasks in the corresponding task queue are scheduled and executed sequentially based on the scheduling control information corresponding to the queue priority of each task queue.

[0208] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to the first queue priority includes execution interruption conditions, and the scheduling control information corresponding to the second queue priority includes preemption execution conditions and preemption interruption conditions.

[0209] Processing unit 902 is used to schedule and execute data sharing tasks in the corresponding task queue according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue. Specifically, it performs the following steps:

[0210] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0211] When the data sharing task in the first task queue is executed to the point where the execution interruption condition is met, the scheduling of the data sharing task in the first task queue is stopped, and the second task queue is preempted according to the preemption execution condition.

[0212] If the preemption check result indicates that there is a data sharing task in the second task queue that meets the preemption execution conditions, then the data sharing task in the second task queue that meets the preemption execution conditions will be scheduled for execution.

[0213] When a data sharing task in the second task queue that meets the preemptive execution condition is executed until the preemptive interruption condition is met, the scheduling of data sharing tasks in the second task queue is stopped, and the scheduling of data sharing tasks in the first task queue continues.

[0214] In one implementation, the preemption execution condition includes a waiting threshold; the processing unit 902, when performing a preemption check on the second task queue according to the preemption execution condition, specifically performs the following steps:

[0215] Based on the current time of the task processing device and the time when the data sharing task in the second task queue was stored in the second task queue, determine the waiting time of the data sharing task in the second task queue;

[0216] If there is a target data sharing task in the second task queue whose corresponding waiting time is greater than the waiting threshold, a preemption check result is generated; the preemption check result indicates that the target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions.

[0217] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to each queue priority includes execution interruption conditions.

[0218] Processing unit 902 is used to schedule and execute data sharing tasks in the corresponding task queue according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue. Specifically, it performs the following steps:

[0219] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0220] When a data sharing task in the first task queue is executed to the point where the execution interruption condition corresponding to the priority of the first queue is met, the scheduling of data sharing tasks in the first task queue is stopped, and data sharing tasks in the second task queue are scheduled to be executed.

[0221] When the execution of a data sharing task in the second task queue reaches the execution interruption condition corresponding to the priority of the second queue, the scheduling of the data sharing task in the second task queue is stopped, and the data sharing task in the first task queue is scheduled to be executed.

[0222] In one implementation, the execution interruption condition for a data sharing task in the first task queue to meet the priority of the first queue includes: the execution time of the data sharing task in the first task queue reaches a first specified time, or the number of data sharing tasks executed in the first task queue reaches a first specified number; the execution interruption condition for a data sharing task in the second task queue to meet the priority of the second queue includes: the execution time of the data sharing task in the second task queue reaches a second specified time, or the number of data sharing tasks executed in the second task queue reaches a second specified number; the first specified time is greater than the second specified time, and the first specified number is greater than the second execution number;

[0223] Alternatively, the execution interruption condition for the data sharing tasks in the first task queue to meet the priority of the first queue includes: the number of remaining data sharing tasks in the first task queue is a preset number; the execution interruption condition for the data sharing tasks in the second task queue to meet the priority of the second queue includes: the number of remaining data sharing tasks in the second task queue is a preset number.

[0224] In one implementation, any one of the data sharing tasks stored in multiple task queues is represented as the first data sharing task. The first data sharing task is published to the blockchain by the first data user object. The first data sharing task is used to request the first shared data from the first data provider object, which is a service object of the task processing device. The task data of the first data sharing task includes: the first directory information of the first shared data, the object information of the first data provider object, and the encryption key of the first data user object.

[0225] The execution process of the first data sharing task includes:

[0226] Based on the object information and directory information of the first data provider, first shared data is retrieved from the database of the first data provider object;

[0227] Based on the encryption key of the first data object, the first shared data is encrypted to obtain the first encrypted data;

[0228] Send the first encrypted data to the first data user.

[0229] In one implementation, the service objects of the task processing device include a second data user, which publishes a second data sharing task to the blockchain through the task processing device; the processing unit 902 is also used to perform the following steps:

[0230] Receive the second encrypted data obtained from the execution of the second data sharing task;

[0231] The second encrypted data is decrypted using the decryption key of the second data object to obtain the second shared data;

[0232] Store the second shared data in the database of the second data user object.

[0233] In one implementation, a third data-sharing task published on the blockchain is used to request data from a second data-providing object; processing unit 902 is also used to perform the following steps:

[0234] Obtain the third-party data sharing task and its approval results from the blockchain;

[0235] If the approval result of the third data sharing task indicates that the approval is successful, then a service license check is performed on the second data provider.

[0236] If the service license check indicates that the second data provider is a service object of the task processing device, then the third data sharing task is stored in multiple task queues, with the queue priority matching the task priority of the third data sharing task.

[0237] In one implementation, a fourth data-sharing task published on the blockchain is used to request data from a third data provider object; processing unit 902 is also used to perform the following steps:

[0238] Obtain the fourth data sharing task from the blockchain;

[0239] Perform service license checks on third-party data providers;

[0240] If the service license check results indicate that the third data provider is a service object of the task processing device, then an approval notice for the fourth data sharing task is generated and sent to the third data provider.

[0241] Receive the approval results of the third data provider for the fourth data sharing task, and publish the approval results of the fourth data sharing task to the blockchain.

[0242] In one implementation, the service objects of the task processing device include third-party data users; the processing unit 902 is further configured to perform the following steps:

[0243] Receive task data sent by the third data object. The task data includes directory information of the shared data requested by the fourth data provider object, object information of the fourth data provider object, encryption key of the third data provider object, and set task priority.

[0244] Create a data sharing task for the third data user object based on the task data of the third data user object;

[0245] Publish the data sharing task of the third-party data user to the blockchain.

[0246] According to one embodiment of this application, Figure 9 The units in the blockchain-based task processing device shown can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the blockchain-based task processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0247] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 3 , Figure 5 , Figure 6 , Figure 7 or Figure 8 Computer programs for the steps involved in some or all of the methods shown, to construct, for example... Figure 9 The diagram illustrates a blockchain-based task processing apparatus and a blockchain-based task processing method for implementing embodiments of this application. Computer programs may be recorded on, for example, a computer-readable storage medium, loaded onto the aforementioned computing device via the computer-readable storage medium, and run therein.

[0248] In this embodiment, data sharing tasks published on the blockchain are assigned task priorities, which indicate the urgency of the corresponding data sharing task. The task processing device may include multiple task queues, each with a queue priority indicating its scheduling order. Each task queue stores data sharing tasks whose priorities match the corresponding queue priorities. Scheduling information indicates scheduling rules based on queue priorities among multiple task queues. Data sharing tasks in multiple task queues can be scheduled and executed according to the scheduling information and the queue priority of each task queue. In this way, high-urgency data sharing tasks can be stored in the task queue with the highest scheduling order, allowing them to be prioritized for execution. This reduces the execution waiting time for high-urgency data sharing tasks and improves their execution efficiency.

[0249] Based on the above methods and apparatus embodiments, this application provides a computer device. Please refer to... Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10 The computer device shown includes at least a processor 1001, an input interface 1002, an output interface 1003, and a computer-readable storage medium 1004. The processor 1001, input interface 1002, output interface 1003, and computer-readable storage medium 1004 can be connected via a bus or other means.

[0250] The computer-readable storage medium 1004 can be stored in the memory of a computer device. The computer-readable storage medium 1004 is used to store computer programs, which include computer instructions. The processor 1001 is used to execute the computer program stored in the computer-readable storage medium 1004. The processor 1001 (or CPU (Central Processing Unit)) is the computing and control core of the computer device. It is suitable for implementing computer programs, specifically for loading and executing computer programs to achieve corresponding methods or functions.

[0251] This application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space for storing the operating system of the computer device. Furthermore, the storage space also stores computer programs suitable for loading and execution by a processor. It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.

[0252] The computer device can be the task processing device mentioned earlier. Data sharing tasks published on the blockchain are scheduled and executed by the task processing device. The task processing device includes multiple task queues, each storing data sharing tasks to be scheduled for execution. Specifically, the processor 1001 can load and execute the computer program stored in the computer-readable storage medium 1004 to achieve the aforementioned... Figure 3 , Figure 5 , Figure 6 , Figure 7 or Figure 8 The corresponding steps in the method shown. In a specific implementation, the computer program in the computer-readable storage medium 1004 is loaded by the processor 1001 and executed as follows:

[0253] Get the queue priority of each task queue. The queue priority is used to indicate the scheduling order of the corresponding task queue. Each task queue is used to store data sharing tasks whose task priority matches the priority of the corresponding queue. The task priority is used to indicate the urgency of the corresponding data sharing task.

[0254] Obtain scheduling information, which indicates the scheduling rules based on queue priority among multiple task queues;

[0255] Based on the scheduling information and the queue priority of each task queue, data-sharing tasks in multiple task queues are scheduled for execution.

[0256] In one implementation, the scheduling information includes scheduling control information corresponding to the priority of each queue; when the computer program in the computer-readable storage medium 1004 is loaded and executed by the processor 1001 to schedule and execute data-sharing tasks in multiple task queues according to the scheduling information and the queue priority of each task queue, it is specifically used to perform the following steps:

[0257] According to the scheduling order of each task queue, the data sharing tasks in the corresponding task queue are scheduled and executed sequentially based on the scheduling control information corresponding to the queue priority of each task queue.

[0258] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to the first queue priority includes execution interruption conditions, and the scheduling control information corresponding to the second queue priority includes preemption execution conditions and preemption interruption conditions.

[0259] The computer program in the computer-readable storage medium 1004 is loaded and executed by the processor 1001. When scheduling and executing data-sharing tasks in the corresponding task queues according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue, the program specifically performs the following steps:

[0260] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0261] When the data sharing task in the first task queue is executed to the point where the execution interruption condition is met, the scheduling of the data sharing task in the first task queue is stopped, and the second task queue is preempted according to the preemption execution condition.

[0262] If the preemption check result indicates that there is a data sharing task in the second task queue that meets the preemption execution conditions, then the data sharing task in the second task queue that meets the preemption execution conditions will be scheduled for execution.

[0263] When a data sharing task in the second task queue that meets the preemptive execution condition is executed until the preemptive interruption condition is met, the scheduling of data sharing tasks in the second task queue is stopped, and the scheduling of data sharing tasks in the first task queue continues.

[0264] In one implementation, the preemption execution condition includes a waiting threshold; when the computer program in the computer-readable storage medium 1004 is loaded and executed by the processor 1001 to perform a preemption check on the second task queue according to the preemption execution condition, it is specifically used to perform the following steps:

[0265] Based on the current time of the task processing device and the time when the data sharing task in the second task queue was stored in the second task queue, determine the waiting time of the data sharing task in the second task queue;

[0266] If there is a target data sharing task in the second task queue whose corresponding waiting time is greater than the waiting threshold, a preemption check result is generated; the preemption check result indicates that the target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions.

[0267] In one implementation, multiple task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is before the scheduling order of the second task queue. The scheduling control information corresponding to each queue priority includes execution interruption conditions.

[0268] The computer program in the computer-readable storage medium 1004 is loaded and executed by the processor 1001. When scheduling and executing data-sharing tasks in the corresponding task queues according to the scheduling order of each task queue and based on the scheduling control information corresponding to the queue priority of each task queue, the program specifically performs the following steps:

[0269] Prioritize scheduling and executing data-sharing tasks in the first task queue;

[0270] When a data sharing task in the first task queue is executed to the point where the execution interruption condition corresponding to the priority of the first queue is met, the scheduling of data sharing tasks in the first task queue is stopped, and data sharing tasks in the second task queue are scheduled to be executed.

[0271] When the execution of a data sharing task in the second task queue reaches the execution interruption condition corresponding to the priority of the second queue, the scheduling of the data sharing task in the second task queue is stopped, and the data sharing task in the first task queue is scheduled to be executed.

[0272] In one implementation, the execution interruption condition for a data sharing task in the first task queue to meet the priority of the first queue includes: the execution time of the data sharing task in the first task queue reaches a first specified time, or the number of data sharing tasks executed in the first task queue reaches a first specified number; the execution interruption condition for a data sharing task in the second task queue to meet the priority of the second queue includes: the execution time of the data sharing task in the second task queue reaches a second specified time, or the number of data sharing tasks executed in the second task queue reaches a second specified number; the first specified time is greater than the second specified time, and the first specified number is greater than the second execution number;

[0273] Alternatively, the execution interruption condition for the data sharing tasks in the first task queue to meet the priority of the first queue includes: the number of remaining data sharing tasks in the first task queue is a preset number; the execution interruption condition for the data sharing tasks in the second task queue to meet the priority of the second queue includes: the number of remaining data sharing tasks in the second task queue is a preset number.

[0274] In one implementation, any one of the data sharing tasks stored in multiple task queues is represented as the first data sharing task. The first data sharing task is published to the blockchain by the first data user object. The first data sharing task is used to request the first shared data from the first data provider object, which is a service object of the task processing device. The task data of the first data sharing task includes: the first directory information of the first shared data, the object information of the first data provider object, and the encryption key of the first data user object.

[0275] The execution process of the first data sharing task includes:

[0276] Based on the object information and directory information of the first data provider, first shared data is retrieved from the database of the first data provider object;

[0277] Based on the encryption key of the first data object, the first shared data is encrypted to obtain the first encrypted data;

[0278] Send the first encrypted data to the first data user.

[0279] In one implementation, the service objects of the task processing device include a second data user, which publishes a second data sharing task to the blockchain through the task processing device; the computer program in the computer-readable storage medium 1004 is loaded by the processor 1001 and is also used to perform the following steps:

[0280] Receive the second encrypted data obtained from the execution of the second data sharing task;

[0281] The second encrypted data is decrypted using the decryption key of the second data object to obtain the second shared data;

[0282] Store the second shared data in the database of the second data user object.

[0283] In one implementation, a third data-sharing task published on the blockchain is used to request data from a second data-providing object; a computer program in computer-readable storage medium 1004 is loaded by processor 1001 and is also used to perform the following steps:

[0284] Obtain the third-party data sharing task and its approval results from the blockchain;

[0285] If the approval result of the third data sharing task indicates that the approval is successful, then a service license check is performed on the second data provider.

[0286] If the service license check indicates that the second data provider is a service object of the task processing device, then the third data sharing task is stored in multiple task queues, with the queue priority matching the task priority of the third data sharing task.

[0287] In one implementation, a fourth data-sharing task published on the blockchain is used to request data from a third data provider object; the computer program in the computer-readable storage medium 1004 is loaded by the processor 1001 and is also used to perform the following steps:

[0288] Obtain the fourth data sharing task from the blockchain;

[0289] Perform service license checks on third-party data providers;

[0290] If the service license check results indicate that the third data provider is a service object of the task processing device, then an approval notice for the fourth data sharing task is generated and sent to the third data provider.

[0291] Receive the approval results of the third data provider for the fourth data sharing task, and publish the approval results of the fourth data sharing task to the blockchain.

[0292] In one implementation, the service objects of the task processing device include third-party data users; the computer program in the computer-readable storage medium 1004 is loaded by the processor 1001 and is also used to perform the following steps:

[0293] Receive task data sent by the third data object. The task data includes directory information of the shared data requested by the fourth data provider object, object information of the fourth data provider object, encryption key of the third data provider object, and set task priority.

[0294] Create a data sharing task for the third data user object based on the task data of the third data user object;

[0295] Publish the data sharing task of the third-party data user to the blockchain.

[0296] In this embodiment, data sharing tasks published on the blockchain are assigned task priorities, which indicate the urgency of the corresponding data sharing task. The task processing device may include multiple task queues, each with a queue priority indicating its scheduling order. Each task queue stores data sharing tasks whose priorities match the corresponding queue priorities. Scheduling information indicates scheduling rules based on queue priorities among multiple task queues. Data sharing tasks in multiple task queues can be scheduled and executed according to the scheduling information and the queue priority of each task queue. In this way, high-urgency data sharing tasks can be stored in the task queue with the highest scheduling order, allowing them to be prioritized for execution. This reduces the execution waiting time for high-urgency data sharing tasks and improves their execution efficiency.

[0297] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned blockchain-based task processing method.

[0298] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0299] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0300] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0301] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A task processing method based on blockchain, characterized in that, The data sharing tasks published on the blockchain are scheduled and executed by a task processing device. The task processing device includes multiple task queues, each queue storing data sharing tasks to be scheduled and executed. The method is executed by the task processing device and includes: Obtain the queue priority of each task queue, the queue priority being used to indicate the scheduling order of the corresponding task queue; each task queue is used to store data sharing tasks whose task priorities match the corresponding queue priorities, the task priority being used to indicate the urgency of the corresponding data sharing task; Obtain scheduling information, which is used to indicate the scheduling rules among the multiple task queues based on the queue priority; According to the scheduling information and the queue priority of each task queue, the data sharing tasks in the multiple task queues are scheduled for execution.

2. The method as described in claim 1, characterized in that, The scheduling information includes scheduling control information corresponding to the priority of each queue; the step of scheduling and executing data-sharing tasks in the plurality of task queues according to the scheduling information and the queue priority of each task queue includes: According to the scheduling order of each task queue, the data sharing tasks in the corresponding task queues are scheduled and executed sequentially based on the scheduling control information corresponding to the queue priority of each task queue.

3. The method as described in claim 2, characterized in that, The plurality of task queues includes a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is earlier than the scheduling order of the second task queue. The scheduling control information corresponding to the first queue priority includes execution interruption conditions, and the scheduling control information corresponding to the second queue priority includes preemption execution conditions and preemption interruption conditions. The step of scheduling and executing data sharing tasks in the corresponding task queues according to their scheduling order and based on the scheduling control information corresponding to the queue priority of each task queue includes: Prioritize scheduling and executing data-sharing tasks in the first task queue; When the data sharing task in the first task queue is executed to the point where the execution interruption condition is met, the scheduling of the data sharing task in the first task queue is stopped, and the second task queue is preempted according to the preemption execution condition. If the preemption check result indicates that there is a data sharing task in the second task queue that meets the preemption execution conditions, then the data sharing task in the second task queue that meets the preemption execution conditions is scheduled for execution. When a data sharing task in the second task queue that meets the preemptive execution condition is executed until the preemptive interruption condition is met, the scheduling of data sharing tasks in the second task queue is stopped, and the scheduling of data sharing tasks in the first task queue continues.

4. The method as described in claim 3, characterized in that, The preemption execution conditions include a waiting threshold; the preemption check on the second task queue based on the preemption execution conditions includes: Based on the current time of the task processing device and the time when the data sharing task in the second task queue was stored in the second task queue, the waiting time of the data sharing task in the second task queue is determined; If there is a target data sharing task in the second task queue with a corresponding waiting time greater than the waiting threshold, then the preemption check result is generated; the preemption check result indicates that the target data sharing task is a data sharing task in the second task queue that meets the preemption execution conditions.

5. The method as described in claim 2, characterized in that, The plurality of task queues include a first task queue and a second task queue. The first task queue corresponds to a first queue priority, and the second task queue corresponds to a second queue priority. The first queue priority is higher than the second queue priority, and the scheduling order of the first task queue is earlier than the scheduling order of the second task queue. The scheduling control information corresponding to each queue priority includes execution interruption conditions. The step of scheduling and executing data sharing tasks in the corresponding task queues according to their scheduling order and based on the scheduling control information corresponding to the queue priority of each task queue includes: Prioritize scheduling and executing data-sharing tasks in the first task queue; When a data sharing task in the first task queue is executed to the point where the execution interruption condition corresponding to the priority of the first queue is met, the scheduling of the data sharing task in the first task queue is stopped, and the data sharing task in the second task queue is scheduled to be executed. When a data sharing task in the second task queue is executed to the point where the execution interruption condition corresponding to the priority of the second queue is met, the scheduling of the data sharing task in the second task queue is stopped, and the data sharing task in the first task queue is scheduled to be executed.

6. The method as described in claim 2, characterized in that, The execution interruption condition for a data sharing task in the first task queue to meet the priority of the first queue includes: the execution time of the data sharing task in the first task queue reaches a first specified time, or the number of data sharing tasks executed in the first task queue reaches a first specified number; the execution interruption condition for a data sharing task in the second task queue to meet the priority of the second queue includes: the execution time of the data sharing task in the second task queue reaches a second specified time, or the number of data sharing tasks executed in the second task queue reaches a second specified number; the first specified time is greater than the second specified time, and the first specified number is greater than the second execution number; Alternatively, the execution of data sharing tasks in the first task queue until the execution interruption condition corresponding to the priority of the first queue is met includes: the number of remaining data sharing tasks in the first task queue is a preset number; the execution of data sharing tasks in the second task queue until the execution interruption condition corresponding to the priority of the second queue is met includes: the number of remaining data sharing tasks in the second task queue is the preset number.

7. The method as described in claim 1, characterized in that, Any data sharing task stored in the plurality of task queues is referred to as the first data sharing task. The first data sharing task is published to the blockchain by the first data user object. The first data sharing task is used to request the first shared data from the first data provider object, which is the service object of the task processing device. The task data of the first data sharing task includes: the first directory information of the first shared data, the object information of the first data providing object, and the encryption key of the first data using object; The execution process of the first data sharing task includes: Based on the object information and the first directory information of the first data provider, the first shared data is retrieved from the database of the first data provider. Based on the encryption key of the object using the first data, the first shared data is encrypted to obtain the first encrypted data; Send the first encrypted data to the first data user.

8. The method as described in claim 1, characterized in that, The service targets of the task processing device include a second data user, who publishes a second data sharing task to the blockchain through the task processing device; the method further includes: Receive the second encrypted data obtained from the execution of the second data sharing task; The second encrypted data is decrypted using the object's decryption key to obtain the second shared data; The second shared data is stored in the database of the second data user object.

9. The method as described in claim 1, characterized in that, The third data sharing task published on the blockchain is used to request data from the second data provider object; the method further includes: Obtain the third data sharing task and its approval result from the blockchain; If the approval result of the third data sharing task indicates that the approval is successful, then a service license check is performed on the second data provider. If the service license check result indicates that the second data provider is a service object of the task processing device, then the third data sharing task is stored in the plurality of task queues, in the task queue whose priority matches the task priority of the third data sharing task.

10. The method as described in claim 1, characterized in that, The fourth data sharing task published on the blockchain is used to request data acquisition from a third data provider object; the method further includes: Obtain the fourth data sharing task from the blockchain; Perform a service license check on the third data provider. If the service license check result indicates that the third data provider is a service object of the task processing device, then an approval notice for the fourth data sharing task is generated and sent to the third data provider. The system receives the approval result of the third data provider for the fourth data sharing task and publishes the approval result of the fourth data sharing task to the blockchain.

11. The method as described in claim 1, characterized in that, The service targets of the task processing device include third-party data users; the method further includes: The system receives task data sent by the third data object, the task data including directory information of shared data requested by the fourth data provider object, object information of the fourth data provider object, encryption key of the third data object, and set task priority. Create a data sharing task for the third data user object based on the task data of the third data user object; The data sharing task of the third data user is published to the blockchain.

12. A blockchain-based task processing device, characterized in that, The data sharing tasks published on the blockchain are scheduled and executed by a task processing device. The task processing device includes multiple task queues, each task queue storing data sharing tasks to be scheduled and executed. The apparatus is disposed within the task processing device and includes: The acquisition unit is used to acquire the queue priority of each task queue, the queue priority being used to indicate the scheduling order of the corresponding task queue; each task queue is used to store data sharing tasks whose task priorities match the corresponding queue priorities, the task priority being used to indicate the urgency of the corresponding data sharing task; The acquisition unit is further configured to acquire scheduling information, which is used to indicate the scheduling rules among the plurality of task queues based on the queue priority; The processing unit is configured to schedule and execute data-sharing tasks in the plurality of task queues according to the scheduling information and the queue priority of each task queue.

13. A computer device, characterized in that, The computer device includes: A processor is a tool for implementing computer programs. A computer-readable storage medium storing a computer program adapted to be loaded by the processor and executed as described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed by the blockchain-based task processing method as described in any one of claims 1-11.

15. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the blockchain-based task processing method as described in any one of claims 1-11.