Method and apparatus for performing a collaborative task, blockchain network
By introducing a collaboration engine into the blockchain network, offline collaborative computing tasks are executed collaboratively and task description information is stored, solving the management problem of computing service components and improving security and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
- Filing Date
- 2024-08-30
- Publication Date
- 2026-04-17
AI Technical Summary
The management of computing service components in existing blockchain networks is difficult to control effectively, resulting in security risks, poor service stability, and centralized management, which affects the normal operation of computing services.
By introducing first and second collaborative engines into the blockchain network, the target computing engine is determined from the computing engines of the first and second nodes respectively, and they jointly participate in the execution of offline collaborative computing tasks. The task description information is stored in the blockchain ledger, and the execution results are generated for the deployment of computing service components.
It enables effective control over logical data and computing service components, reduces security risks, improves the stability and distributed deployment capabilities of computing services, and avoids the shortcomings of centralized management.
Smart Images

Figure CN118972395B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification belong to the field of blockchain technology, and particularly relate to a method and apparatus for executing collaborative tasks and a blockchain network. Background Technology
[0002] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. In a blockchain network, data blocks are sequentially linked together in a chain-like data structure, and a distributed ledger is cryptographically guaranteed to be immutable and unforgeable.
[0003] Users can participate in collaborative computing and other related transactions on the blockchain through blockchain nodes. For example, multiple blockchain nodes corresponding to different users can each deploy computing services to perform secure multi-party computation (SMPC) or federated learning (FL) based on privacy technologies such as homomorphic encryption and zero-knowledge proofs. The implementation of such collaborative computing depends on the computing service components deployed by the blockchain nodes, and the computing logic of the computing service components is determined by the logical data such as the models used when deploying the components.
[0004] In related technologies, computing service components are typically deployed uniformly on blockchain nodes by management nodes based on logical data uploaded by the administrator or tenant. However, since the logical data comes from the administrator or tenant, it is difficult to effectively control the logical data and the functionality of the computing service components, which may pose certain security risks. On the other hand, the management of computing service components is relatively centralized, and if the management node fails, it will affect the normal operation of the computing service, resulting in poor service stability. Summary of the Invention
[0005] The purpose of this invention is to provide a method and apparatus for performing collaborative tasks, and a blockchain network.
[0006] According to a first aspect of one or more embodiments of this specification, a method for executing a collaborative task is proposed, applied to a first node and a second node in a blockchain network, wherein the first node includes a first collaborative engine and at least one first computing engine, and the second node includes a second collaborative engine and at least one second computing engine, the method comprising:
[0007] The first collaborative engine obtains task description information for the offline collaborative computing task; and sends the task description information to a first target computing engine participating in the offline collaborative computing task, determined from the at least one first computing engine based on the information, and submits the task description information to the blockchain ledger maintained by the blockchain network.
[0008] The second collaborative engine obtains the submitted task description information; and determines, based on the task description information, a second target computing engine among the at least one second computing engines that participates in the offline collaborative computing task, and sends the task description information to the second target computing engine.
[0009] The first target computing engine and the second target computing engine jointly participate in executing the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0010] According to a second aspect of one or more embodiments of this specification, an execution apparatus for a collaborative task is provided, applied to a first node and a second node in a blockchain network, wherein the first node includes a first collaborative engine and at least one first computing engine, and the second node includes a second collaborative engine and at least one second computing engine, the apparatus comprising:
[0011] The information sending and submitting unit is used to enable the first collaboration engine to obtain task description information of the offline collaborative computing task; and to send the task description information to the first target computing engine participating in the offline collaborative computing task determined from the at least one first computing engine according to the information, and submit the task description information to the blockchain ledger maintained by the blockchain network.
[0012] An information acquisition and transmission unit is configured to enable the second collaborative engine to acquire the submitted task description information; and to determine, based on the task description information, a second target computing engine among the at least one second computing engines that participates in the offline collaborative computing task, and to send the task description information to the second target computing engine.
[0013] An offline collaborative computing unit is used to enable the first target computing engine and the second target computing engine to jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0014] According to a third aspect of one or more embodiments of this specification, a blockchain network is proposed, the blockchain network including a first node and a second node, the first node including a first collaboration engine and at least one first computing engine, the second node including a second collaboration engine and at least one second computing engine, wherein:
[0015] The first collaboration engine is used to determine the first target computing engine among the at least one first computing engines that participates in the offline collaborative computing task based on the task description information of the offline collaborative computing task; and to send the task description information to the first target computing engine and submit the task description information to the blockchain ledger maintained by the blockchain network.
[0016] The second collaboration engine is used to obtain the submitted task description information; and to determine the second target computing engine among the at least one second computing engines that participates in the offline collaborative computing task based on the task description information, and to send the task description information to the second target computing engine.
[0017] The first target computing engine and the second target computing engine are used to jointly execute the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0018] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, comprising:
[0019] A processor; a memory for storing processor-executable instructions; wherein the processor implements the method as described in any one of the first aspects by executing the executable instructions.
[0020] According to a fifth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in any of the first aspects.
[0021] According to a sixth aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program and / or instructions that, when executed by a processor, implement the steps of the method as described in any of the first aspects.
[0022] In the aforementioned embodiments, after determining the first target computing engine to participate in the offline collaborative computing task, the first collaborative engine sends the task description information to the first target computing engine and submits the information to the blockchain ledger maintained by the blockchain network. After obtaining the submitted task description information, the second collaborative engine determines the second target computing engine to participate in the offline collaborative computing task based on the information and sends the information to that engine. Finally, the first and second target computing engines jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information, and the corresponding execution results are used to deploy computing service components in the blockchain network.
[0023] As can be seen, this solution involves the joint execution of offline collaborative computing tasks by both the first and second target computing engines. Execution results are generated on-chain through multi-party joint computation, and corresponding computing service components are deployed based on these results. This solution uses the execution results as logical data for deploying computing service components. It is understandable that, on the one hand, since the execution results are obtained through multi-party joint computation rather than being specified by a single party, and the task description information involved in the computation process is immutably stored in the blockchain ledger, effective control over the logical data and the functionality of the corresponding computing service components can be achieved, thereby reducing corresponding security risks. On the other hand, the generation of logical data and the deployment of computing service components require the joint participation of multiple nodes (i.e., the execution results are obtained by multiple computing engines from multiple nodes jointly executing offline collaborative computing tasks and are used to deploy corresponding computing service components in the blockchain network), realizing distributed deployment and operation of computing services without the need for a centralized management node, which helps improve service stability. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the structure of a blockchain network provided in an exemplary embodiment.
[0026] Figure 2 This is a flowchart of an exemplary embodiment of a method for executing a collaborative task.
[0027] Figure 3 This is a flowchart of another method for performing a collaborative task, provided in an exemplary embodiment.
[0028] Figure 4 This is a schematic diagram of the structure of a device provided in an exemplary embodiment.
[0029] Figure 5 This is a block diagram of an execution device for a collaborative task provided in an exemplary embodiment. Detailed Implementation
[0030] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0031] To address the aforementioned problems in related technologies, this specification proposes a method for executing collaborative tasks. This method involves the collaborative computing engines of multiple nodes jointly executing offline collaborative computing tasks to obtain execution results for deploying computing service components in a blockchain network. The solution is described in detail below with reference to the accompanying drawings.
[0032] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a blockchain network provided in an exemplary embodiment. For example... Figure 1 As shown, the blockchain network includes multiple blockchain nodes (hereinafter referred to as nodes), such as net1 including nodes A to E. Furthermore, each node in the blockchain network can contain multiple functional components, such as a collaboration engine, a computing engine, and a business layer. For example, node A in net1 contains a collaboration engine a and multiple computing engines (i.e., computing engines a1 to a3), and node B contains a collaboration engine b and one computing engine (i.e., computing engine b1). Of course, nodes A and B also contain other functional components, which will not be elaborated further. The "functional component" in any node described in the embodiments of this specification should be understood as a logical-level functional module, which can be deployed in a container in the form of microservices (such as deployment under a Kubernetes microservice architecture) and constitute a blockchain node at the logical level through service calls.
[0033] In addition, any node in the blockchain network can also connect to the corresponding tenant (or user). Figure 1(Not shown in the diagram), such as the blockchain client used by the tenant. Any two nodes can correspond to the same or different tenants. For example, node A connects to blockchain client A used by tenant A, node B connects to blockchain client B used by tenant B, and so on. The tenants can interact with the corresponding nodes through their blockchain clients to access the blockchain network.
[0034] This specification provides an embodiment of a blockchain network, which includes a first node and a second node. The first node includes a first collaboration engine and at least one first computing engine, and the second node includes a second collaboration engine and at least one second computing engine, wherein:
[0035] The first collaboration engine is used to determine the first target computing engine among the at least one first computing engines that participates in the offline collaborative computing task based on the task description information of the offline collaborative computing task; and to send the task description information to the first target computing engine and submit the task description information to the blockchain ledger maintained by the blockchain network.
[0036] The second collaboration engine is used to obtain the submitted task description information; and to determine the second target computing engine among the at least one second computing engines that participates in the offline collaborative computing task based on the task description information, and to send the task description information to the second target computing engine.
[0037] The first target computing engine and the second target computing engine are used to jointly execute the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0038] In one embodiment, the online collaborative task to be executed is initiated by a first node and jointly executed by a first computing engine in the first node and a second computing engine in the second node. Alternatively, it can be viewed as being executed jointly by the first node and the second node.
[0039] In the embodiments described in this specification, the first node is both the task initiator and participant, while the second node is only a task participant; both are distinct blockchain nodes within the same blockchain network. There is one first node and one or more second nodes. Correspondingly, each computing engine in the first node is called a first computing engine, with the one initiating and participating in the online collaborative task being called the first target computing engine, and there is one of these. Similarly, each computing engine in the second node is called a second computing engine, with the one participating in the online collaborative task being called the second target computing engine, and there can be one or more of these.
[0040] Given that multiple computing engines of the same or different types may be deployed within the same blockchain node, multiple computing engines may participate in executing online collaborative tasks within any given node. In the case where multiple computing engines participate in executing online collaborative tasks within a first node, these engines include not only the first target computing engine but also other first computing engines. In this situation, only the first target computing engine needs to send the task description information to the second computing engine and submit this information to the blockchain ledger, without requiring the other first computing engines to send and submit it. This avoids excessive duplicate interaction messages in the network caused by sending and submitting the same task description information separately.
[0041] Multi-party data collaboration scenarios are generally divided into two categories. One category involves multi-party computation processing of batch data, characterized by large data volumes, high computational demands, and low timeliness requirements; these are generally referred to as "offline" computing tasks, such as model training and large-scale data analysis. The other category directly connects to platforms or systems, providing real-time access interfaces. User requests arrive at the online service according to a certain distribution granularity, and are sensitive to interface response delays, with small data volumes per computation; these are generally referred to as "online" computing tasks. The offline collaborative computing tasks described in the embodiments of this specification belong to the aforementioned offline computing tasks; while the online collaborative computing tasks described belong to the aforementioned online computing tasks. This is hereby stated.
[0042] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for executing a collaborative task, as provided in an exemplary embodiment. Figure 2 As shown, the method includes steps 202-206.
[0043] Step 202: The first collaborative engine obtains task description information of the offline collaborative computing task; and sends the task description information to the first target computing engine participating in the offline collaborative computing task, which is determined from the at least one first computing engine based on the information, and submits the task description information to the blockchain ledger maintained by the blockchain network.
[0044] The first collaborative engine in the first node that initiates the offline collaborative computing task needs to first obtain the task description information of the task, and based on the information, determine which of the at least one computing engine in the first node is the first target computing engine to participate in the task.
[0045] In one embodiment, the first node may further include a first business layer, which is a functional component in the first node used to implement business processing logic. In this case, the first business layer can send the offline collaborative computing tasks it has obtained to the first collaboration engine. For example, upon receiving an offline collaboration request, the first business layer can parse the request to obtain the task description information of the offline collaborative computing task; and then send the information to the first collaboration engine.
[0046] The first business layer can interface with the blockchain client corresponding to the first node. In this case, the first business layer can receive offline collaboration requests sent by tenants through the blockchain client. If a tenant corresponding to the first node has a collaborative computing need, it can initiate the aforementioned offline collaboration request to the first business layer through its blockchain client, triggering the first node to initiate an offline collaborative computing task. Alternatively, based on the transaction execution function of the first node, the first business layer can also listen for offline collaboration requests generated by the first node executing blockchain transactions. For example, the first business layer can use a listening mechanism to monitor events generated when the first node executes smart contracts called by transactions and identify the aforementioned offline collaboration requests. After receiving an online collaboration request in the above manner, the first business layer can parse the request and extract the task description information of the offline collaborative computing task.
[0047] In another embodiment, when the first node includes a first transaction execution component, this component can generate task description information for offline collaborative computing tasks during the execution of blockchain transactions and send this information to the first collaboration engine. In other words, the first collaboration engine can directly receive the task description information sent by the first transaction execution component, which is generated by the first transaction execution component during the execution of blockchain transactions. In this way, the first node can generate task description information for offline collaborative computing tasks during the execution of blockchain transactions, and the first transaction execution component can proactively provide this information to the first collaboration engine to automatically trigger subsequent processing flows for the offline collaborative computing tasks.
[0048] The task description information for the offline collaborative computing tasks described in the embodiments of this specification can include two categories: participant information and execution information. The participant information indicates the various computing service components participating in the execution of the task. For example, it may include node information (such as the node identifier of the node where the computing service component resides, the network identifier of the blockchain network to which the node belongs, etc.), computing engine identifiers (i.e., the names / IDs of the target computing engines participating in the execution of the task), and in some embodiments, it may also include service deployment related information (the source code, computing model, etc. required to deploy the computing service components). The execution information indicates the specific method / process by which each participant executes the task. For example, it may include workflow description information (describing the order in which each participant executes the task, the data interaction process, etc.) and data information (such as the raw data required by each participant to execute the task and / or its access address, etc.).
[0049] In one embodiment, the first collaboration engine can also be used to deploy and launch computing engines. For example, the first business layer can instruct the first collaboration engine to deploy at least one first computing engine belonging to the first node before receiving the offline collaboration request. In this way, the first collaboration engine can deploy at least one computing engine in advance (before the initiator initiates the offline collaborative computing task) so that it can be called during subsequent task execution, which helps to shorten the overall execution time of the task. For another example, after parsing the task description information from the received offline collaboration request, the first business layer can also instruct the first collaboration engine to deploy the first computing engines participating in the task based on the service deployment information therein. Of course, if other first computing engines are also participating in the task in the first node besides the first target computing engine, the first business layer can also instruct the first collaboration engine to deploy the other first computing engines, that is, instruct the engine to deploy each computing engine participating in the task. In this way, the first collaboration engine only temporarily generates the corresponding first target computing engine when it needs to execute the offline collaborative computing task (i.e., when there is an offline collaboration requirement), which helps to avoid the situation where the deployed computing engines are not used for a long time, thereby reducing the ineffective occupation of the first node's resources and improving its resource utilization to a certain extent.
[0050] After obtaining the task description information of the offline collaborative computing task through the aforementioned method, the first collaborative engine can, on the one hand, determine the first target computing engine participating in the offline collaborative computing task from the at least one first computing engine based on the information, and send the task description information to that engine; on the other hand, it can submit the task description information to the blockchain ledger maintained by the blockchain network.
[0051] In one embodiment, when the first collaborative engine determines the first target computing engine based on the task description information, it can determine the target computing engine identifier based on the participant information in the task description information, and determine the first computing engine among the at least one first computing engines whose engine identifier is the target computing engine identifier as the first target computing engine participating in the offline collaborative computing task. For example, the first collaborative engine can maintain or access an engine identifier set, which records the computing engine identifier of each computing engine in the first node. Thus, the first collaborative engine can determine the target computing engine identifier based on the participant information in the task description information (e.g., the identifier can be directly extracted from the participant information, or generated based on information such as the computing engine type in the participant information), query the target computing engine identifier in the aforementioned engine identifier set, and then determine the first computing engine represented by the queried identifier as the first target computing engine participating in the offline collaborative computing task.
[0052] For example, the first collaborative engine can also determine the first computing engine among the at least one first computing engines that matches the offline collaborative computing task as the first target computing engine to participate in the execution of the offline collaborative computing task. If the task description information includes a task type, the first computing engine among the at least one computing engine that supports that task type (i.e. can execute computing tasks of that type) can be determined as the first target computing engine. In this way, it can be ensured that the determined first target computing engine can meet the computing type requirements of the offline collaborative computing task, which helps the subsequent offline collaborative computing task to be executed smoothly.
[0053] Step 204: The second collaborative engine obtains the submitted task description information; and, based on the task description information, determines the second target computing engine among the at least one second computing engine that participates in the offline collaborative computing task, and sends the task description information to the second target computing engine.
[0054] In one embodiment, the first collaborative engine can synchronize task description information to the second target computing engine by submitting a smart contract. For example, when the first collaborative engine submits the task description information to the blockchain ledger maintained by the blockchain network, it can deploy a smart contract containing the task description information in the blockchain network. For instance, a contract deployment transaction can be initiated in the network, and after the transaction is executed, the smart contract containing the task description information can be deployed in the network. Based on the basic characteristics of blockchain networks and smart contracts, it is known that after the smart contract is deployed, the second node can obtain and execute the contract. Therefore, when the second collaborative engine obtains the task description information, it can obtain the task description information by listening to the events generated by executing the smart contract. In this way, the first collaborative engine deploys the smart contract, the second collaborative engine executes the contract, and the task description information is revealed through events. This not only ensures that the second collaborative engines in each second node obtain the same task description information, but also stores the task description information and the execution records of its related smart contracts on the blockchain, facilitating the monitoring and traceability of the task description information transmission process.
[0055] Of course, besides submitting the task description information through smart contract deployment, the first collaboration engine can also record this information in its submitted blockchain transaction. The second collaboration engine can then parse the transaction after synchronizing it from other nodes to obtain the task description information; alternatively, it can execute the transaction after consensus is reached to obtain the task description information. This method also effectively preserves the information, and will not be elaborated further.
[0056] After obtaining the task description information submitted by the first collaborative engine, the second collaborative engine can determine the second target computing engine based on the information and send the information to that computing engine.
[0057] In one embodiment, similar to how the first collaborative engine determines the first target computing engine, the second collaborative engine can also determine the target computing engine identifier based on the participant information in the task description information, and identify the second computing engine among the at least one second computing engines whose engine identifier is the target computing engine identifier as the second target computing engine participating in the offline collaborative computing task. For example, the second collaborative engine can maintain or access an engine identifier set, which records the computing engine identifier of each computing engine in the second node. Thus, the second collaborative engine can determine the target computing engine identifier based on the participant information in the task description information (e.g., the identifier can be directly extracted from the participant information, or generated based on information such as the computing engine type in the participant information), query the target computing engine identifier in the aforementioned engine identifier set, and then identify the second computing engine represented by the queried identifier as the second target computing engine participating in the offline collaborative computing task.
[0058] For example, the second collaborative engine can also determine the second computing engine among the at least one second computing engines that matches the offline collaborative computing task as the second target computing engine to participate in the execution of the offline collaborative computing task. If the task description information includes a task type, the second computing engine among the at least one computing engine that supports that task type (i.e., can execute computing tasks of that type) can be determined as the second target computing engine. In this way, it can be ensured that the determined second target computing engine can meet the computing type requirements of the offline collaborative computing task, which helps the subsequent offline collaborative computing task to be executed smoothly.
[0059] Step 206: The first target computing engine and the second target computing engine jointly participate in executing the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0060] At this point, both the first and second target computing engines have obtained the task description information for the offline collaborative computing task. They can then jointly participate in executing the task based on this information, achieving "offline collaboration" between multiple nodes. During the execution of this task, each computing engine can process its corresponding task-related data according to the workflow described above. For example, the task-related data corresponding to any target computing engine belonging to any node can be maintained by that node or its corresponding tenant, and that computing engine can process this data according to any form of data processing logic, such as preset formulas, algorithms, models, and rules. For example... Figure 1The task-related data corresponding to computing engine a1 can be private data A owned by tenant A, while the task-related data corresponding to computing engine b1 can be private data B owned by tenant B. Thus, the two can collaborate in the above manner to achieve joint machine learning based on the aforementioned private data A and private data B. The execution result obtained by executing offline collaborative computing tasks is the model trained through joint machine learning, which can be used to realize functions such as data analysis and image processing.
[0061] It is understood that the execution result of the offline collaborative computing task is used to deploy computing service components, which can be used to execute online collaborative computing tasks to provide corresponding online computing services to tenants. The execution result can include various types. For example, if the online computing service is an online prediction service, the execution result can be a machine learning model generated through offline training. Deploying the first and second computing service components formed by this model is used to provide the online prediction service. If the online computing service is an online hidden query service, the execution result can be metadata pre-generated by offline collaborative computing, etc. Deploying the first and second computing service components formed by this model is used to provide the online hidden query service, which will not be elaborated further. It should be noted that the above-mentioned offline training and offline collaborative computing processes are the processes by which the first and second nodes in the embodiments of this specification cooperate to execute the offline collaborative computing task; and the provision of the online prediction service and online hidden query service externally is the process by which the first and second nodes in the embodiments of this specification cooperate to execute the online collaborative computing task.
[0062] In addition, during the process of the first target computing service component and the second target computing service component jointly executing the offline collaborative computing task, the two can store relevant data involved in the execution process (such as the intermediate results of the execution, the hash of the final result, etc.) in the aforementioned blockchain ledger, so as to realize the full-process traceability of the offline collaborative computing task execution process, thereby ensuring that the ownership of the execution products of the task, the final deployed computing service components, etc. is clear and the life cycle is clear.
[0063] Of course, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0064] In the aforementioned embodiments, after determining the first target computing engine to participate in the offline collaborative computing task, the first collaborative engine sends the task description information to the first target computing engine and submits the information to the blockchain ledger maintained by the blockchain network. After obtaining the submitted task description information, the second collaborative engine determines the second target computing engine to participate in the offline collaborative computing task based on the information and sends the information to that engine. Finally, the first and second target computing engines jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information, and the corresponding execution results are used to deploy computing service components in the blockchain network.
[0065] As can be seen, this solution involves the joint execution of offline collaborative computing tasks by both the first and second target computing engines. Execution results are generated on-chain through multi-party joint computation, and corresponding computing service components are deployed based on these results. This solution uses the execution results as logical data for deploying computing service components. It is understandable that, on the one hand, since the execution results are obtained through multi-party joint computation rather than being specified by a single party, and the task description information involved in the computation process is immutably stored in the blockchain ledger, effective control over the logical data and the functionality of the corresponding computing service components can be achieved, thereby reducing corresponding security risks. On the other hand, the generation of logical data and the deployment of computing service components require the joint participation of multiple nodes (i.e., the execution results are obtained by multiple computing engines from multiple nodes jointly executing offline collaborative computing tasks and are used to deploy corresponding computing service components in the blockchain network), realizing distributed deployment and operation of computing services without the need for a centralized management node, which helps improve service stability.
[0066] In one embodiment, the first and second target computing service components may need to interact with each other during the joint execution of an offline collaborative computing task. For example, the first target computing engine can send its intermediate computing results to the second target computing engine for processing. Correspondingly, the second target computing engine can send its intermediate computing results to the first target computing engine for processing. The specific form of the intermediate computing results and the specific method by which the first or second target computing engine processes them can be determined by the content of the offline collaborative computing task, the workflow, and the processing logic of the target computing engine itself. This embodiment does not limit these aspects.
[0067] Furthermore, as participants in the offline collaborative computing task, the first target computing engine can calculate and generate a first share of the computing result, and each second target computing engine can calculate and generate a corresponding second share of the computing result. Each second target computing engine can then send its own second share of the computing result to the first target computing engine. The first target computing engine can then generate the execution result of the offline collaborative computing task based on the first share of the computing result and the received second shares of the computing result, such as the aforementioned machine learning model or metadata. In this way, the first target computing engine, as the initiator (and also a participant), uniformly generates the task execution result based on the computing result shares calculated by each participant. This ensures that other participants can only obtain a limited share of the computing result, and not the complete execution result, thus helping to prevent the result from being leaked.
[0068] Of course, if the final calculation result needs to be confirmed by each participant, the first target calculation engine can also synchronize the result to each second target calculation engine and receive the confirmation result returned by the latter; even, each target calculation engine can broadcast its own share of the calculation result to other target calculation engines so that each target calculation engine can calculate the execution result separately, and if all or most of the execution results are the same, the result is determined as the execution result of the online collaborative calculation task, which will not be elaborated further.
[0069] After an offline collaborative computing task is completed, the results can be processed accordingly.
[0070] In one embodiment, either the first business layer or the second business layer can instruct the corresponding collaboration engine to deploy the corresponding computing service component based on the execution result. For example, the first business layer can instruct the first collaboration engine to deploy the first computing service component in the first node based on the execution result when it is determined that the offline collaborative computing task has been completed; and / or, the second business layer can instruct the second collaboration engine to deploy the second computing service component in the second node based on the execution result when it is determined that the offline collaborative computing task has been completed. In this way, the deployment of the first computing service component and / or the second computing service component can be completed. It is understood that the process of generating the corresponding execution result (i.e., the process of executing the offline collaborative computing task) is completed by the cooperation of the first and second nodes, and the first and second computing service components can be deployed in these two nodes respectively, thereby ensuring that the task execution and component deployment processes have the same participants, achieving the effect of small-scale consensus (i.e., the first node and each second computing service component) on computing service components within the blockchain network, which helps to meet the diverse needs of relevant tenants and ensures that relevant data (such as execution results and computing service components) are not excessively disclosed. In addition, to further enhance the limited public effect of small-scale consensus, usage permissions for the first and second computing service components can be set for the first and second nodes to ensure that the computing service components deployed based on the execution results generated by these nodes can only be used by these nodes and will not be abused by other nodes that did not participate in the above process.
[0071] In this system, either the first business layer or the second business layer can determine that the offline collaborative computing task has been completed in multiple ways. Taking the first business layer as an example, it can determine that the offline collaborative computing task has been completed upon receiving the execution result returned by the corresponding target computing engine. At this time, the first business layer can issue a component deployment instruction containing the execution result to the first collaboration engine, instructing the latter to deploy the first computing service component according to the execution result. Alternatively, the first business layer can also determine that the offline collaborative computing task has been completed upon receiving a completion notification message for the offline collaborative computing task returned by the corresponding target computing engine. At this time, the first business layer can send a deployment instruction for the execution result to the first collaboration engine; correspondingly, the first collaboration engine can obtain the execution result from the first target computing engine in response to the instruction, and then deploy the corresponding first computing service component based on the execution result. Through these methods, the first node can automatically deploy the corresponding first computing service component after the offline collaborative computing task is completed, thereby realizing an integrated process of execution result generation and component deployment.
[0072] Based on this, the first business layer can also inform the blockchain client it is connected to of the completion information of the offline collaborative computing task when it receives the aforementioned execution result or execution completion notification message returned by the first target computing engine, so that the tenant is aware of it; furthermore, upon receiving a component deployment instruction initiated by the tenant, it can instruct the first collaborative engine to deploy the first computing service component according to the execution result. In this way, the first node can respond to the tenant's instructions to carry out subsequent component deployment, so as to deploy the computing service component only when the tenant needs to deploy it, fully respecting the tenant's wishes to deploy components.
[0073] When deploying a computing service component based on the execution results of an offline collaborative computing task, the execution results can be deployed in a corresponding runtime environment to ensure its proper functioning. Furthermore, access permissions for this computing service component can be set for other functional components within the blockchain node, allowing them to execute the execution results and form the computing service component when called upon by other functional components.
[0074] In one embodiment, the computing service component deployed based on the execution result can be used by a first node and a second node to execute online collaborative computing tasks. For example, the first computing service component can send the task description information of the online collaborative computing task to the second computing service component, and together with the second computing service component, participate in the execution of the online collaborative computing task according to the workflow described in the task description information.
[0075] In one embodiment, after the aforementioned computing service components have been used, these components can be destroyed as needed to achieve full lifecycle control over the components. For example, if a first computing service component is deployed in a first node, the first collaboration engine can destroy the first computing service component in response to a destruction command for the first computing service component; and / or, if a second computing service component is deployed in a second node, the second collaboration engine can destroy the second computing service component in response to a destruction command for the second computing service component. The destruction command can be issued by the corresponding tenant through a blockchain client, or it can be generated by the corresponding node executing a blockchain transaction or executing the aforementioned online collaborative computing task. For example, if the first collaboration engine determines that the first computing service component has finished executing the online collaborative task, it automatically generates a destruction command for that component and destroys the first computing service component in response to the command; further details are omitted here.
[0076] As mentioned above, multiple embodiments involve the need for communication between functional components in the first node and the second node, such as the first target computing engine and the second target computing engine sending intermediate computing results to each other, and the first computing service component sending task-related information of online collaborative computing tasks to the second computing service component. The first node and the second node can achieve data interaction through their respective gateways.
[0077] For example, a first node may include a first gateway, and the proxy domain names of functional components in the first node that require data interaction with external nodes are registered to the first gateway. Similarly, a second node may include a second gateway, and the proxy domain names of functional components in the second node that require data interaction with external nodes are registered to the second gateway. Based on this, any functional component in the first node can send interactive data to another functional component in the second node in the following manner: the functional component submits the interactive data to the first gateway; the first gateway determines the target proxy domain name of the other functional component and sends the interactive data to the second gateway according to the target proxy domain name, wherein the target proxy domain name is registered to the second gateway; the second gateway forwards the received interactive data to the other functional component. It is understood that this method realizes the interaction between computing service components based on the proxy capabilities of the gateway in the node, so there is no need to expose the service ports of computing service components or even node devices, which avoids complex port management problems and has high device / system security.
[0078] The following is based on Figure 1 Taking node A and node B in net1 as the first and second nodes respectively as an example, combined with... Figure 3 The process of the two working together to perform offline collaborative computing tasks is described. Figure 3 This is a flowchart of another collaborative task execution method provided in an exemplary embodiment, such as... Figure 3 As shown, the method includes steps 301-312.
[0079] Step 301: Tenant A initiates an offline collaboration request to business layer a; and Tenant B initiates an offline collaboration request to business layer b.
[0080] Tenant A and Tenant B can negotiate in advance, through off-chain methods (such as offline channels or online platforms associated with the blockchain network), to determine the relevant information of each computing engine in Node A and Node B that participates in executing the task. After reaching an agreement, they can each initiate an offline collaboration request for the offline collaborative computing task to the business layer of the corresponding node through their own blockchain client.
[0081] Step 302: Business layer a sends an execution instruction to collaboration engine a for the offline collaborative computing task; and business layer b sends an execution instruction to collaboration engine b for the offline collaborative computing task.
[0082] The execution instructions sent by the first business layer may include task description information for the offline collaborative computing task.
[0083] Step 303: Collaboration engine a submits the task description information to the blockchain ledger.
[0084] Step 304: Collaboration engine b retrieves the task description information submitted from the blockchain ledger.
[0085] Step 305: Collaboration engine a determines computing engine a1 as the first target computing engine based on the task description information and sends the task description information to computing engine a1; and collaboration engine b determines computing engine b1 as the second target computing engine based on the task description information.
[0086] Step 306: Computing engine a1 and computing engine b1 jointly participate in the execution of offline collaborative computing tasks based on the task description information they have acquired. Data interaction may be involved during the execution process. The specific interaction process can be implemented through the first gateway and the second gateway (not shown in the figure).
[0087] Step 307: The computing engine a1 returns the execution result obtained from the task to the business layer a; and the computing engine b1 returns the execution result to the business layer b.
[0088] The execution results obtained by computing engine a1 and computing engine a2 may be the same or different. This determines whether the first computing service component deployed on the first node and the second computing service component deployed on the second node have the same or different functions. Furthermore, business layer a can notify tenant A that the offline collaborative computing task has been completed; similarly, business layer b can notify tenant B that the task has been completed.
[0089] Step 308: Tenant A issues a component deployment instruction to business layer a; and Tenant B issues a component deployment instruction to business layer b.
[0090] Step 309: Business layer A instructs collaboration engine a to deploy computing service component a1 in node A; and business layer B instructs collaboration engine b to deploy computing service component b1 in node B.
[0091] Understandably, step 308 is an optional step, and the business layer can directly instruct the collaboration engine to deploy the corresponding computing service components after confirming that the task has been completed. Furthermore, steps 308 and 309 can also be optional steps, meaning the collaboration engine can also directly deploy the corresponding computing service components after confirming that the task has been completed.
[0092] Step 310: Collaboration engine a deploys computing service component a1 belonging to node A; and collaboration engine b deploys computing service component b1 belonging to node B.
[0093] Step 311: Business layer a calls computing service component a1 to execute an online collaborative computing task; and business layer b calls computing service component b1 to execute the online collaborative computing task.
[0094] Step 312: Computing service component a1 and computing service component b1 jointly participate in executing the task based on the workflow of the online collaborative computing task.
[0095] Figure 4 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, memory 408, and non-volatile memory 410, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 402 reads the corresponding computer program from the non-volatile memory 410 into memory 408 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0096] like Figure 5 As shown, Figure 5 This is a block diagram of an execution apparatus for a collaborative task provided in this specification according to an exemplary embodiment. This apparatus can be applied to, for example... Figure 4 The device shown is used to implement the technical solution of this specification. This device is applied to a first node and a second node in a blockchain network. The first node includes a first collaboration engine and at least one first computing engine, and the second node includes a second collaboration engine and at least one second computing engine. The device includes:
[0097] The information sending and submitting unit 501 is used to enable the first collaboration engine to obtain task description information of the offline collaborative computing task; and to send the task description information to the first target computing engine participating in the offline collaborative computing task determined from the at least one first computing engine according to the information, and submit the task description information to the blockchain ledger maintained by the blockchain network.
[0098] The information acquisition and sending unit 502 is used to enable the second collaborative engine to acquire the submitted task description information; and to determine the second target computing engine among the at least one second computing engine that participates in the offline collaborative computing task based on the task description information, and to send the task description information to the second target computing engine.
[0099] The offline collaborative computing unit 503 is used to enable the first target computing engine and the second target computing engine to jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is used to deploy computing service components in the blockchain network.
[0100] Optionally, the first node further includes a first service layer, and the information sending and submitting unit 501 is specifically used for:
[0101] The first collaboration engine receives the task description information sent by the first business layer, which is obtained by the first business layer by parsing the offline collaboration request.
[0102] Optionally, the information sending and submitting unit 501 is specifically used for:
[0103] Enables the first business layer to receive offline collaboration requests sent by tenants via the blockchain client; or,
[0104] Enables the first business layer to listen for offline collaboration requests generated by the first node executing blockchain transactions.
[0105] Optionally, the first node further includes a first transaction execution component, wherein the information sending and submitting unit 501 is specifically used for:
[0106] The first collaboration engine receives the task description information sent by the first transaction execution component, which is generated by the first transaction execution component when executing a blockchain transaction.
[0107] Optional,
[0108] The information sending and submitting unit 501 is specifically used to: enable the first collaboration engine to deploy a smart contract containing the task description information in the blockchain network;
[0109] The information acquisition and sending unit 502 is specifically used to: enable the second collaboration engine to acquire the task description information by listening to the events generated by the execution of the smart contract.
[0110] Optional,
[0111] The information sending and submitting unit 501 is specifically used to: enable the first collaborative engine to determine the target computing engine identifier based on the participant information in the task description information, and determine the first computing engine whose engine identifier is the target computing engine identifier among the at least one first computing engines as the first target computing engine participating in the offline collaborative computing task; and / or
[0112] The information acquisition and sending unit 502 is specifically used to: enable the second collaborative engine to determine the target computing engine identifier based on the participant information in the task description information, and determine the second computing engine whose engine identifier is the target computing engine identifier among the at least one second computing engines as the second target computing engine participating in the offline collaborative computing task.
[0113] Optionally, the offline collaborative computing unit 503 is specifically used for at least one of the following:
[0114] The first target computing engine sends the intermediate calculation results generated by its own calculations to the second target computing engine for processing.
[0115] The second target computing engine sends the intermediate calculation results generated by its own calculations to the first target computing engine for processing.
[0116] The first target computing engine receives the second computing result shares generated by each of the second target computing engines, and generates the execution result based on the first computing result share it generates and the received second computing result shares.
[0117] Optionally, a deployment instruction unit 504 is also included, for:
[0118] Upon determining that the offline collaborative computing task has been completed, the first business layer instructs the first collaboration engine to deploy the first computing service component in the first node based on the execution result; and / or,
[0119] When the second business layer determines that the offline collaborative computing task has been completed, it instructs the second collaborative engine to deploy the second computing service component in the second node based on the execution result.
[0120] Optionally, the deployment instruction unit 504 is specifically used for:
[0121] Upon receiving the execution result returned by the corresponding target computing engine, it is determined that the offline collaborative computing task has been completed; or,
[0122] Upon receiving a notification message from the corresponding target computing engine indicating that the offline collaborative computing task has been completed, it is determined that the offline collaborative computing task has been completed.
[0123] Optionally, a destruction instruction unit 505 is also included, for:
[0124] If a first computing service component is deployed in the first node, the first collaboration engine, in response to a destruction command for the first computing service component, destroys the first computing service component; and / or,
[0125] If a second computing service component is deployed in the second node, the second collaboration engine responds to a destruction command for the second computing service component and destroys the second computing service component.
[0126] Optionally, if a first computing service component is deployed in the first node and a second computing service component is deployed in the second node, the apparatus further includes an online collaborative computing unit 506, used for:
[0127] The first computing service component sends the task description information of the online collaborative computing task to the second computing service component, and the two components jointly execute the online collaborative computing task according to the workflow described in the task description information.
[0128] Optionally, the first node further includes a first gateway, and the second node further includes a second gateway. The device also includes a gateway interaction unit, which enables any functional component in the first node to send interactive data to another functional component in the second node, specifically for:
[0129] The functional component shall submit the interactive data to the first gateway.
[0130] The first gateway determines the target proxy domain name of the other functional component and sends the interactive data to the second gateway according to the target proxy domain name, wherein the target proxy domain name is registered to the second gateway;
[0131] The second gateway forwards the received interactive data to the other functional component.
[0132] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0133] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
Claims
1. A method for executing a collaborative task, applied to a first node and at least one second node in a blockchain network, wherein the first node includes a first collaborative engine and at least one first computing engine, and each second node includes a second collaborative engine and at least one second computing engine, the method comprising: The first collaboration engine obtains task description information for offline collaborative computing tasks; In addition, the task description information is sent to the first target computing engine participating in the offline collaborative computing task, which is determined from the at least one first computing engine based on the information, and the task description information is submitted to the blockchain ledger maintained by the blockchain network. The second collaboration engine in each second node obtains the task description information submitted; Furthermore, for at least one second computing engine included in the second node, a second target computing engine participating in the offline collaborative computing task is determined based on the task description information, and the task description information is sent to the second target computing engine. The first target computing engine and each of the second target computing engines jointly participate in executing the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is generated based on the share of computing results calculated by each of the first target computing engine and the second target computing engine, and is used to deploy computing service components in the blockchain network.
2. The method according to claim 1, wherein the first node further comprises a first business layer, and the first collaboration engine obtains task description information of the offline collaborative computing task, including: The first collaboration engine receives the task description information sent by the first business layer, which is obtained by the first business layer by parsing the offline collaboration request.
3. The method according to claim 2, wherein the first business layer obtains the offline collaboration request, comprising: The first business layer receives offline collaboration requests sent by tenants through the blockchain client; or, The first business layer listens for offline collaboration requests generated by the first node executing blockchain transactions.
4. The method according to claim 1, wherein the first node further comprises a first transaction execution component, and the first collaboration engine obtains task description information of the offline collaborative computing task, including: The first collaboration engine receives the task description information sent by the first transaction execution component, which is generated by the first transaction execution component when executing a blockchain transaction.
5. The method according to claim 1, The first collaboration engine submits the task description information to the blockchain ledger maintained by the blockchain network, including: The first collaboration engine deploys a smart contract containing the task description information in the blockchain network; The second collaboration engine obtains the submitted task description information by listening to events generated during the execution of the smart contract.
6. The method according to claim 1, The first collaborative engine determines the first target computing engine based on the task description information, including: The first collaborative engine determines the target computing engine identifier based on the participant information in the task description information, and identifies the first computing engine whose engine identifier is the target computing engine identifier among the at least one first computing engines as the first target computing engine participating in the offline collaborative computing task. And / or, The second collaborative engine determines the second target computing engine based on the task description information, including: the second collaborative engine determines the target computing engine identifier based on the participant information in the task description information, and determines the second computing engine whose engine identifier is the target computing engine identifier among the at least one second computing engines as the second target computing engine participating in the offline collaborative computing task.
7. The method according to claim 1, wherein the first target computing engine and the second target computing engine jointly participate in executing the offline collaborative computing task according to the workflow described in the task description information, including at least one of the following: The first target computing engine sends the intermediate computing results generated by its own calculations to the second target computing engine for processing. The second target computing engine sends the intermediate computing results generated by its own calculations to the first target computing engine for processing. The first target calculation engine receives the second calculation result shares generated by each of the second target calculation engines, and generates the execution result based on the first calculation result share generated by itself and the received second calculation result shares.
8. The method according to claim 1, further comprising: Upon determining that the offline collaborative computing task has been completed, the first business layer instructs the first collaboration engine to deploy the first computing service component in the first node based on the execution result; and / or, When the second business layer determines that the offline collaborative computing task has been completed, it instructs the second collaborative engine to deploy the second computing service component in the second node based on the execution result.
9. The method according to claim 8, wherein determining that the offline collaborative computing task has been completed by any one of the first business layer and the second business layer includes: Upon receiving the execution result returned by the corresponding target computing engine, it is determined that the offline collaborative computing task has been completed. or, Upon receiving a notification message from the corresponding target computing engine indicating that the offline collaborative computing task has been completed, it is determined that the offline collaborative computing task has been completed.
10. The method of claim 8, further comprising: If a first computing service component is deployed in the first node, the first collaboration engine, in response to a destruction command for the first computing service component, destroys the first computing service component; and / or, If a second computing service component is deployed in the second node, the second collaboration engine responds to a destruction command for the second computing service component and destroys the second computing service component.
11. The method according to claim 1, wherein when a first computing service component is deployed in the first node and a second computing service component is deployed in the second node, the method further comprises: The first computing service component sends the task description information of the online collaborative computing task to the second computing service component, and together with the second computing service component, they jointly execute the online collaborative computing task according to the workflow described in the task description information.
12. The method according to any one of claims 1-11, wherein the first node further includes a first gateway, the second node further includes a second gateway, and any functional component in the first node sends interactive data to another functional component in the second node, including: Each of the functional components submits the interactive data to the first gateway; The first gateway determines the target proxy domain name of the other functional component and sends the interactive data to the second gateway according to the target proxy domain name, wherein the target proxy domain name is registered with the second gateway; The second gateway forwards the received interactive data to the other functional component.
13. An execution apparatus for a collaborative task, applied to a first node and at least one second node in a blockchain network, the first node comprising a first collaborative engine and at least one first computing engine, each second node comprising a second collaborative engine and at least one second computing engine, the apparatus comprising: The information sending and submitting unit is used to enable the first collaboration engine to obtain the task description information of the offline collaborative computing task. In addition, the task description information is sent to the first target computing engine participating in the offline collaborative computing task, which is determined from the at least one first computing engine based on the information, and the task description information is submitted to the blockchain ledger maintained by the blockchain network. The information acquisition and transmission unit is used to enable the second collaboration engine in each second node to acquire the submitted task description information; Furthermore, for at least one second computing engine included in the second node, a second target computing engine participating in the offline collaborative computing task is determined based on the task description information, and the task description information is sent to the second target computing engine. An offline collaborative computing unit is used to enable the first target computing engine and each of the second target computing engines to jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is generated based on the share of computing results calculated by each of the first target computing engine and the second target computing engine, and is used to deploy computing service components in the blockchain network.
14. A blockchain network comprising a first node and at least one second node, the first node comprising a first collaboration engine and at least one first computing engine, each second node comprising a second collaboration engine and at least one second computing engine, wherein: The first collaboration engine is used to determine the first target computing engine among the at least one first computing engines that participates in the offline collaborative computing task based on the task description information of the offline collaborative computing task; and to send the task description information to the first target computing engine and submit the task description information to the blockchain ledger maintained by the blockchain network. The second collaboration engine in each second node is used to obtain the task description information submitted; Furthermore, for at least one second computing engine included in the second node, a second target computing engine participating in the offline collaborative computing task is determined based on the task description information, and the task description information is sent to the second target computing engine. The first target computing engine and each of the second target computing engines are used to jointly participate in the execution of the offline collaborative computing task according to the workflow described in the task description information. The execution result of the offline collaborative computing task is generated based on the share of computing results calculated by each of the first target computing engine and the second target computing engine, and is used to deploy computing service components in the blockchain network.
15. An electronic device comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the method as described in any one of claims 1-12 by executing the executable instructions.
16. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-12.
17. A computer program product comprising a computer program and / or instructions, wherein the computer program and / or instructions, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-12.
Citation Information
Patent Citations
Multi-party computing method and system based on block chain system
CN114707141A
Data processing method and device, electronic equipment and storage medium
CN116244062A