WO2023207078A1 - Data processing method and apparatus, electronic device, and storage medium - Google Patents

Data processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023207078A1
WO2023207078A1 PCT/CN2022/135229 CN2022135229W WO2023207078A1 WO 2023207078 A1 WO2023207078 A1 WO 2023207078A1 CN 2022135229 W CN2022135229 W CN 2022135229W WO 2023207078 A1 WO2023207078 A1 WO 2023207078A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
chain
computing
node
chain computing
Prior art date
Application number
PCT/CN2022/135229
Other languages
French (fr)
Chinese (zh)
Inventor
谢桂鲁
邓福喜
石柯
王毅飞
Original Assignee
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023207078A1 publication Critical patent/WO2023207078A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

A data processing method and apparatus, an electronic device, and a storage medium. The method is applied to a first node device that is deployed with a first blockchain node, and an off-chain calculation contract maintains the execution logic of a node device where each participant node corresponding to an off-chain calculation task is located in the off-chain calculation task. The method comprises: when an authorization application event generated by an off-chain calculation contract is monitored and it is determined that a first blockchain node belongs to first participant nodes, obtaining the first execution logic of a first node device in an off-chain calculation task; and examining and approving the first execution logic to generate a first authorization result corresponding to the off-chain calculation task, and initiating a first authorization transaction carrying the first authorization result to the off-chain calculation contract, wherein the off-chain calculation contract is used for: in response to an authorization transaction initiated by each participant node, when each authorization result corresponding to the off-chain calculation task is used for representing that authorization is passed, allowing the off-chain calculation contract to generate a task event related to the off-chain calculation task.

Description

一种数据处理方法、装置、电子设备和存储介质A data processing method, device, electronic equipment and storage medium 技术领域Technical field
本公开实施例属于区块链技术领域,尤其涉及一种数据处理方法、装置、电子设备和存储介质。The embodiments of the present disclosure belong to the field of blockchain technology, and in particular relate to a data processing method, device, electronic device and storage medium.
背景技术Background technique
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. In the blockchain system, data blocks are combined into a chained data structure in a chronological manner and are cryptographically guaranteed to be an untamperable and unforgeable distributed ledger. Due to the characteristics of blockchain, such as decentralization, non-tamperable information, and autonomy, blockchain has also received more and more attention and applications.
区块链网络可以承担基于智能合约定义的链下计算任务,此时区块链网络中各区块链节点分别所处的各节点设备会在智能合约生成的事件的指导下,调用本地部署的链下计算引擎以用于实现链下计算任务。对于协作计算任务即需要多个节点设备共同协作完成的链下计算任务而言,经常存在某一节点设备内的数据需要被另一外部节点设备中的链下计算引擎读取的需求,提供数据的节点设备往往需要对作为数据需求方的链下计算引擎进行身份确认与鉴权以确保只将数据提供给合法的链下计算引擎,然而,这种基于身份的鉴权机制使得被授权的链下计算引擎即使不在处理协作计算任务时也能获取到授权方节点设备内的数据,一方面无法控制被授权方获取数据的范围和时机,存在一定的安全风险;另一方面也无法区分同一链下计算引擎在不同链下计算任务中的数据访问权限,影响同一链下计算引擎在不同链下计算任务中的功能独立性。The blockchain network can undertake off-chain computing tasks based on smart contract definitions. At this time, each node device of each blockchain node in the blockchain network will call the locally deployed off-chain device under the guidance of events generated by the smart contract. The computing engine is used to implement off-chain computing tasks. For collaborative computing tasks, that is, off-chain computing tasks that require multiple node devices to work together, there is often a need for data in a certain node device to be read by an off-chain computing engine in another external node device to provide data. Node devices often need to perform identity confirmation and authentication on the off-chain computing engine as the data demander to ensure that data is only provided to legitimate off-chain computing engines. However, this identity-based authentication mechanism makes the authorized chain The lower computing engine can obtain the data in the authorizer's node device even when it is not processing collaborative computing tasks. On the one hand, it cannot control the scope and timing of the authorized party's acquisition of data, which poses certain security risks; on the other hand, it cannot distinguish the same chain. The data access rights of the off-chain computing engine in different off-chain computing tasks affect the functional independence of the same off-chain computing engine in different off-chain computing tasks.
发明内容Contents of the invention
本公开的目的在于提供一种数据处理方法、装置、电子设备和存储介质。The purpose of this disclosure is to provide a data processing method, device, electronic device and storage medium.
根据本说明书一个或多个实施例的第一方面,提出了一种数据处理方法,应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括:在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑;对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。According to a first aspect of one or more embodiments of this specification, a data processing method is proposed, which is applied to a first node device where a first blockchain node is deployed, and a blockchain network to which the first blockchain node belongs. An off-chain computing contract is deployed, and the off-chain computing contract maintains the execution logic of the node device where each participant node corresponding to the off-chain computing task is located in the off-chain computing task; the method includes: after monitoring When the authorization application event generated by the off-chain computing contract and it is determined that the first blockchain node belongs to the first participant node, obtain the first execution logic of the first node device in the off-chain computing task; An execution logic performs approval to generate the first authorization result corresponding to the off-chain computing task, and initiates the first authorization transaction carrying the first authorization result to the off-chain computing contract through the first blockchain node. The off-chain computing contract is used to allow the off-chain computing contract to be generated in response to the authorization transactions initiated by each participant node and when each authorization result corresponding to the off-chain computing task is used to represent the authorization. Task events related to the off-chain computing task; monitor the first task event generated by the off-chain computing contract, and the first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining the first blockchain When the node belongs to the computing provider node corresponding to the collaborative computing task, the off-chain computing engine deployed by the first node device is called to execute the collaborative computing task, and the off-chain computing engine is used to: perform the collaborative computing During the task, the data read from the second node device by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located is obtained.
根据本说明书一个或多个实施例的第二方面,提出了一种数据处理方法,应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括:在监听到所述链下计算合约生成的授 权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑;对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。According to the second aspect of one or more embodiments of this specification, a data processing method is proposed, which is applied to a second node device deployed with a second blockchain node, and a blockchain network to which the second blockchain node belongs. An off-chain computing contract is deployed, and the off-chain computing contract maintains the execution logic of the node device where each participant node corresponding to the off-chain computing task is located in the off-chain computing task; the method includes: after monitoring When the authorization application event generated by the off-chain computing contract and it is determined that the second blockchain node belongs to the second participant node, obtain the second execution logic of the second node device in the off-chain computing task; The second execution logic performs approval to generate a second authorization result corresponding to the off-chain computing task, and initiates a second authorization transaction carrying the second authorization result to the off-chain computing contract through the second blockchain node. The off-chain computing contract is used to allow the off-chain computing contract to be generated in response to the authorization transactions initiated by each participant node and when each authorization result corresponding to the off-chain computing task is used to represent the authorization. Task events related to the off-chain computing task; monitor the first task event generated by the off-chain computing contract, and the first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining the second blockchain When the node belongs to the data provider node corresponding to the collaborative computing task, the proxy access engine deployed on the second node device is called to execute the collaborative computing task, and the proxy access engine is used to: execute the collaborative computing task. During the process, the data read from the second node device is provided to an off-chain computing engine deployed on the first node device where the computing provider node corresponding to the collaborative computing task is located.
根据本说明书一个或多个实施例的第三方面,提出了一种数据处理装置,应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括:第一执行逻辑获取单元,用于在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑;第一授权交易发起单元,用于对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;数据获取单元,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。According to the third aspect of one or more embodiments of this specification, a data processing device is proposed, which is applied to a first node device where a first blockchain node is deployed, and a blockchain network to which the first blockchain node belongs. An off-chain computing contract is deployed, and the off-chain computing contract maintains the execution logic of the node equipment of each participant node corresponding to the off-chain computing task in the off-chain computing task; the device includes: a first execution A logical acquisition unit configured to acquire the off-chain computing tasks of the first node device when the authorization application event generated by the off-chain computing contract is monitored and the first blockchain node is determined to belong to the first participant node. The first execution logic in The off-chain computing contract initiates the first authorization transaction carrying the first authorization result. The off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, each authorization corresponding to the off-chain computing task The results are used to represent that when authorization is passed, the off-chain computing contract is allowed to generate task events related to the off-chain computing task; the data acquisition unit is used to monitor the first task event generated by the off-chain computing contract. A task event corresponds to a collaborative computing task related to the off-chain computing task; when it is determined that the first blockchain node belongs to the computing provider node corresponding to the collaborative computing task, the off-chain device deployed by the first node device is called. The computing engine executes the collaborative computing task, and the off-chain computing engine is configured to: during the process of executing the collaborative computing task, obtain the data provider node corresponding to the collaborative computing task and deploy it on the second node device. The proxy access engine reads the data from the second node device.
根据本说明书一个或多个实施例的第四方面,提出了一种数据处理装置应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括:第二执行逻辑获取单元,用于在监听到所述链下计算合约生成的授权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑;第二授权交易发起单元,用于对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;数据提供单元,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。According to the fourth aspect of one or more embodiments of this specification, it is proposed that a data processing device is applied to a second node device deployed with a second blockchain node, and the blockchain network to which the second blockchain node belongs is deployed There is an off-chain computing contract, and the off-chain computing contract maintains the execution logic of the node equipment of each participant node corresponding to the off-chain computing task in the off-chain computing task; the device includes: second execution logic An acquisition unit, configured to acquire the performance of the second node device in the off-chain computing task after monitoring the authorization application event generated by the off-chain computing contract and determining that the second blockchain node belongs to the second participant node. The second execution logic; the second authorized transaction initiating unit, used to approve the second execution logic to generate the second authorization result corresponding to the off-chain computing task, and send the off-chain information to the off-chain through the second blockchain node. The computing contract initiates a second authorization transaction carrying a second authorization result. The off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, calculate each authorization result corresponding to the off-chain computing task. Both are used to represent that when authorization is passed, the off-chain computing contract is allowed to generate task events related to the off-chain computing task; the data providing unit is used to monitor the first task event generated by the off-chain computing contract, the first The task event corresponds to the collaborative computing task related to the off-chain computing task; when it is determined that the second blockchain node belongs to the data provider node corresponding to the collaborative computing task, the proxy access engine deployed by the second node device is called Execute the collaborative computing task, and the proxy access engine is configured to: during the process of executing the collaborative computing task, provide data read from the second node device to the computing provider node corresponding to the collaborative computing task. The off-chain computing engine deployed on the first node device.
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第一方面或第二方面所述的方法。According to a fifth aspect of one or more embodiments of this specification, an electronic device is proposed, including: a processor; a memory for storing executable instructions by the processor; wherein the processor executes the executable instructions To implement the method described in the first aspect or the second aspect.
根据本说明书一个或多个实施例的第六方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面或第二方面所述方法的步骤。According to the sixth aspect of one or more embodiments of this specification, a computer-readable storage medium is proposed, which stores computer instructions. When the instructions are executed by a processor, the method described in the first or second aspect is implemented. A step of.
在本说明书实施例中,链下计算任务对应的各参与方节点所处的节点设备在监听到链下计算合约生成的授权申请事件后,将分别审核各自在链下计算任务中的执行逻辑以生成链下计算任务的授权结果,并向所述链下计算合约发起携带有各自授权结果的授权交易以完成对链下计算任务的授权,链下计算合约在完成对链下计算任务的授权后才会允许生成链下计算任务相关的任务事件,从而通过事件监听机制来指导各节点设备执行链下计算任务相关的协作计算任务,使得数据提供方节点所处的第二节点设备通过代理访问引擎将从第二节点设备读取到的数据提供至计算提供方节点所处的第一节点设备,从而将节点设备之间的数据交互限制在授权的链下计算任务的执行过程中,一方面将数据需求方获取数据的范围和时机限制在授权的链下计算任务的执行逻辑之内,降低了安全隐患;另一方面,同一链下计算引擎在不同链下计算任务中参与的执行逻辑可以不同,这意味着可以对同一链下计算引擎在不同链下计算任务中的数据访问权限进行不同的设计,因此能够实现同一链下计算引擎在不同协作计算任务中的功能独立性。In the embodiment of this specification, after listening to the authorization application event generated by the off-chain computing contract, the node device where each participant node corresponding to the off-chain computing task is located will separately review the execution logic of each off-chain computing task. Generate authorization results for off-chain computing tasks, and initiate authorization transactions carrying respective authorization results to the off-chain computing contract to complete the authorization of off-chain computing tasks. After completing the authorization of off-chain computing tasks, the off-chain computing contract Only then will it be allowed to generate task events related to off-chain computing tasks, thereby guiding each node device to perform collaborative computing tasks related to off-chain computing tasks through the event listening mechanism, so that the second node device where the data provider node is located can access the engine through the proxy The data read from the second node device is provided to the first node device where the computing provider node is located, thereby limiting data interaction between node devices to the execution of authorized off-chain computing tasks. On the one hand, The scope and timing of data acquisition by data demanders are limited to the execution logic of authorized off-chain computing tasks, reducing security risks; on the other hand, the same off-chain computing engine can participate in different execution logics in different off-chain computing tasks. , which means that the data access rights of the same off-chain computing engine in different off-chain computing tasks can be designed differently, so the functional independence of the same off-chain computing engine in different collaborative computing tasks can be achieved.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of this specification more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the embodiments recorded in this specification. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.
图1是一示例性实施例提供的一种数据处理方法的流程图。Figure 1 is a flow chart of a data processing method provided by an exemplary embodiment.
图2是一示例性实施例提供的另一种数据处理方法的流程图。Figure 2 is a flow chart of another data processing method provided by an exemplary embodiment.
图3是一示例性实施例提供的一种节点设备交互的场景示意图。Figure 3 is a schematic diagram of a node device interaction scenario provided by an exemplary embodiment.
图4是一示例性实施例提供的一种设备的结构示意图。Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
图5是一示例性实施例提供的一种数据处理装置的框图。Figure 5 is a block diagram of a data processing device provided in an exemplary embodiment.
图6是一示例性实施例提供的另一种数据处理装置的框图。FIG. 6 is a block diagram of another data processing device provided by an exemplary embodiment.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order 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 in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments of this specification, but not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of this specification.
图1是一示例性实施例提供的一种数据处理方法的流程图。该方法应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括S102至S106。Figure 1 is a flow chart of a data processing method provided by an exemplary embodiment. This method is applied to the first node device deployed with the first blockchain node. The blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains a corresponding off-chain computing task. The execution logic of the node device where each participant node is located in the off-chain computing task; the method includes S102 to S106.
S102:在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑。S102: After monitoring the authorization application event generated by the off-chain computing contract and determining that the first blockchain node belongs to the first participant node, obtain the first node device in the off-chain computing task. Execute logic.
本说明书实施例所涉及的数据处理方法具体应用于第一节点设备上部署的第一调用引擎,第一调用引擎承担了监听链下计算合约生成的事件、管理链下计算任务的有序进行、调用第一节点设备上的资源引擎以及向链下计算合约发起交易等功能,是连接链上 资源与链下资源之间的衔接器。The data processing method involved in the embodiments of this specification is specifically applied to the first calling engine deployed on the first node device. The first calling engine is responsible for monitoring events generated by off-chain computing contracts, managing the orderly progress of off-chain computing tasks, Functions such as calling the resource engine on the first node device and initiating transactions to off-chain computing contracts are the connectors between on-chain resources and off-chain resources.
在本说明书实施例中,授权申请事件中记录有所述链下计算任务对应的各参与方节点的描述信息,链下计算任务对应的各参与方节点是指涉及参与执行链下计算任务的各节点设备所在区块链网络中分别部署的各区块链节点,容易理解的是,不是区块链网络中的所有区块链节点都属于链下计算任务对应的参与方节点,但链下计算任务对应的各参与方节点一定属于区块链网络中的区块链节点。第一节点设备在监听到授权申请事件后,可以通过检查自身部署的第一区块链节点的标识信息是否包含于授权申请事件中记录的各参与方节点的描述信息中,来判断第一区块链节点是否属于链下计算任务对应的参与方节点。例如,当第一节点设备检查出第一区块链的标识信息与各参与方节点中第一参与方节点的描述信息相对应的情况下,将确定第一区块链节点属于第一参与方节点;而当检查出第一区块链的标识信息与各参与方节点中任一参与方节点的描述信息均不相对应的情况下,将确定第一区块链节点不属于链下计算任务对应的参与方节点。In the embodiment of this specification, the authorization application event records the description information of each participant node corresponding to the off-chain computing task. Each participant node corresponding to the off-chain computing task refers to each participant involved in executing the off-chain computing task. Each blockchain node is deployed separately in the blockchain network where the node device is located. It is easy to understand that not all blockchain nodes in the blockchain network belong to the participant nodes corresponding to the off-chain computing tasks, but the off-chain computing tasks The corresponding participant nodes must belong to the blockchain nodes in the blockchain network. After listening to the authorization application event, the first node device can determine the first zone by checking whether the identification information of the first blockchain node deployed by itself is included in the description information of each participant node recorded in the authorization application event. Whether the blockchain node is a participant node corresponding to the off-chain computing task. For example, when the first node device checks that the identification information of the first blockchain corresponds to the description information of the first participant node among the participant nodes, it will determine that the first blockchain node belongs to the first participant node; and when it is checked that the identification information of the first blockchain does not correspond to the description information of any of the participant nodes, it will be determined that the first blockchain node does not belong to the off-chain computing task The corresponding participant node.
在第一节点设备确定第一区块链节点属于第一参与方节点的情况下,第一节点设备判断自身接下来需要参与执行链下计算任务,为了能够预先知晓第一节点设备在后续执行链下计算任务的过程中所需执行的任务逻辑,第一节点设备会进一步获取第一节点设备在所述链下计算任务中的第一执行逻辑。本说明书实施例所涉及的第一执行逻辑包括:第一节点设备上部署的各资源引擎的被调用情况和/或所述各资源引擎与其他节点设备部署的其他资源引擎之间的数据交互情况。由于链下计算任务往往会涉及多个节点设备共同参与执行,因此每个参与执行的节点设备都会承担相对独立的任务执行逻辑,从而通过各节点设备的共同配合协作以最终完成链下计算任务,所以每个参与方节点设备(部署有链下计算任务对应的参与方节点的节点设备)在链下计算任务中的执行逻辑都可以看作是链下计算任务整体的执行逻辑的一部分。例如,第一节点设备在所述链下计算任务中的第一执行逻辑就包括,第一节点设备在监听到链下计算合约生成的链下计算任务相关的各类任务事件时,应该如何调用第一节点设备本地部署的各资源引擎(包括链下计算引擎、数据引擎等),以及在调用这些资源引擎时需要在对应的调用请求中携带怎样的数据交互指导信息,以指示本地的资源引擎与其他哪些节点设备上部署的哪些资源引擎之间进行针对何种数据的数据交互。第一节点设备通过了解自身在链下计算任务中的第一执行逻辑,就能够获知自身应该如何参与执行链下计算任务,以及在参与执行链下计算任务的过程中与其他节点设备之间的数据交互情况,从而给后续针对链下计算任务的审批提供了材料基础。When the first node device determines that the first blockchain node belongs to the first participant node, the first node device determines that it needs to participate in the execution of off-chain computing tasks in order to be able to know in advance the subsequent execution of the chain by the first node device. The first node device further acquires the first execution logic of the first node device in the off-chain computing task. The first execution logic involved in the embodiments of this specification includes: the calling status of each resource engine deployed on the first node device and/or the data interaction status between each resource engine and other resource engines deployed on other node devices. . Since off-chain computing tasks often involve multiple node devices participating in the execution, each node device participating in the execution will assume relatively independent task execution logic, so that the off-chain computing task can be completed through the cooperation of each node device. Therefore, the execution logic of each participant node device (node device with a participant node corresponding to the off-chain computing task) in the off-chain computing task can be regarded as part of the overall execution logic of the off-chain computing task. For example, the first execution logic of the first node device in the off-chain computing task includes how the first node device should call when it monitors various task events related to the off-chain computing task generated by the off-chain computing contract. Each resource engine (including off-chain computing engine, data engine, etc.) deployed locally on the first node device, and what kind of data interaction guidance information needs to be carried in the corresponding call request when calling these resource engines to instruct the local resource engine What kind of data is exchanged with which resource engines deployed on which other node devices? By understanding its first execution logic in the off-chain computing task, the first node device can learn how it should participate in the execution of the off-chain computing task, and the relationship between it and other node devices in the process of participating in the execution of the off-chain computing task. The data interaction situation provides a material basis for subsequent approval of off-chain computing tasks.
在本说明书实施例中,所述链下计算合约在部署成功的初始化阶段或响应于授权申请交易的情况下用于触发生成所述授权申请事件。在本说明书实施例中,当链下计算合约被成功部署于所述区块链网络中时,该链下计算合约会触发执行初始化程序,这其中就包括生成授权申请事件,从而使各节点的设备在监听到授权申请事件后通过交易回传机制返回针对链下计算任务的授权结果。另外,也可以通过向链下计算合约主动发起授权申请交易,使得链下计算合约响应于授权申请交易触发生成授权申请事件以被各节点设备所监听,从而可以在有授权需求的情况下对链下计算任务进行多次重复授权,以应对如新参与节点加入、链下计算任务发生更新等需要重新确定链下计算任务合法性的场合。In the embodiment of this specification, the off-chain computing contract is used to trigger the generation of the authorization application event during the initialization phase of successful deployment or in response to an authorization application transaction. In the embodiment of this specification, when the off-chain computing contract is successfully deployed in the blockchain network, the off-chain computing contract will trigger the execution of the initialization program, which includes generating an authorization application event, so that each node's After listening to the authorization application event, the device returns the authorization result for the off-chain computing task through the transaction callback mechanism. In addition, you can also actively initiate an authorization application transaction to the off-chain computing contract, so that the off-chain computing contract triggers and generates an authorization application event in response to the authorization application transaction to be monitored by each node device, so that the chain can be authorized when there is an authorization requirement. The off-chain computing tasks are authorized multiple times to deal with occasions where the legitimacy of the off-chain computing tasks needs to be re-determined, such as the addition of new participating nodes and the update of off-chain computing tasks.
在一实施例中,所述授权申请事件中包括所述各参与方节点所处节点设备在所述链下计算任务中的执行逻辑;所述获取第一节点设备在所述链下计算任务中的第一执行逻辑,包括:从所述授权申请事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑。In one embodiment, the authorization application event includes the execution logic of the node device where each participant node is located in the off-chain computing task; the acquisition of the first node device in the off-chain computing task The first execution logic includes: reading the first execution logic of the first node device in the off-chain computing task from the authorization application event.
在本说明书实施例中,授权申请事件中记录有涉及参与所述链下计算任务的所有参与方节点分别所处的各节点设备在所述链下计算任务中的各执行逻辑,具体而言,授权申请事件中记录有每个参与方节点的标识信息以及对应的执行逻辑,而每个参与方节点 设备通过自身部署的区块链节点的标识信息读取出自身对应的执行逻辑,例如第一节点设备可以根据第一区块链节点的标识信息来从授权申请事件中匹配得到第一区块链节点的标识信息对应的第一执行逻辑,从而将第一执行逻辑从授权申请事件中读取出来。In the embodiment of this specification, the authorization application event records the execution logic in the off-chain computing task of each node device where all the participant nodes participating in the off-chain computing task are respectively located. Specifically, The authorization application event records the identification information of each participant node and the corresponding execution logic, and each participant node device reads its own corresponding execution logic through the identification information of the blockchain node deployed by itself, such as the first The node device can match the first execution logic corresponding to the identification information of the first blockchain node from the authorization application event according to the identification information of the first blockchain node, thereby reading the first execution logic from the authorization application event. come out.
在另一实施例中,所述获取第一节点设备在所述链下计算任务中的第一执行逻辑,包括:向所述链下计算合约发起执行逻辑查询交易,监听所述链下计算合约响应于所述执行逻辑查询交易生成的执行逻辑查询事件,从所述执行逻辑查询事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑,所述执行逻辑查询事件记录有第一节点设备在所述链下计算任务中的第一执行逻辑或所述各参与方节点所处节点设备在所述链下计算任务中的执行逻辑。In another embodiment, obtaining the first execution logic of the first node device in the off-chain computing task includes: initiating an execution logic query transaction to the off-chain computing contract, and monitoring the off-chain computing contract. In response to the execution logic query event generated by the execution logic query transaction, the first execution logic of the first node device in the off-chain computing task is read from the execution logic query event, and the execution logic query event record There is the first execution logic of the first node device in the off-chain computing task or the execution logic of the node device where each participant node is located in the off-chain computing task.
在本说明书实施例中,授权申请事件并未记录任何有关链下计算任务的执行逻辑,第一节点设备在监听到授权申请事件后,将作为一种触发方式,将指示第一节点设备主动去获取自身在链下计算任务中的第一执行逻辑。第一节点设备可以通过向链下计算合约主动发起执行逻辑查询交易,以使链下计算合约响应于该执行逻辑查询交易生成执行逻辑查询事件,将链下计算合约维护的执行逻辑查询交易所请求获取的执行逻辑记录在执行逻辑查询事件中,以供第一节点设备监听并从中读取得到第一节点设备在所述链下计算任务中的第一执行逻辑。本说明书实施例中,执行逻辑查询交易所请求获取的执行逻辑可以为第一节点设备在所述链下计算任务中的第一执行逻辑,也可以为所有参与方节点设备在链下计算任务中的各执行逻辑。In the embodiment of this specification, the authorization application event does not record any execution logic related to the off-chain computing task. After listening to the authorization application event, the first node device will use it as a trigger method to instruct the first node device to actively Obtain its first execution logic in the off-chain computing task. The first node device can actively initiate an execution logic query transaction to the off-chain computing contract, so that the off-chain computing contract generates an execution logic query event in response to the execution logic query transaction, and sends the execution logic query exchange request maintained by the off-chain computing contract The obtained execution logic is recorded in the execution logic query event for the first node device to monitor and read therefrom to obtain the first execution logic of the first node device in the off-chain computing task. In the embodiment of this specification, the execution logic obtained by the execution logic query exchange request may be the first execution logic of the first node device in the off-chain computing task, or it may be the first execution logic of all participating node devices in the off-chain computing task. Each execution logic.
本说明书实施例所涉及的执行逻辑查询交易可以为共识交易或本地交易。在执行逻辑查询交易为共识交易的情况下,执行逻辑查询交易需要在区块链网络上进行共识,区块链网络中的所有区块链节点均会执行该交易并生成对应的执行逻辑查询事件,于是各节点设备均可以监听到该执行逻辑查询事件;而在执行逻辑查询交易为本地交易的情况下,执行逻辑查询交易不会在区块链网络上共识,即只有第一节点设备上部署的第一区块链节点会调用第一区块链节点维护的链下计算合约以执行该执行逻辑查询交易,其所生成的执行逻辑查询事件也只会由第一节点设备内部所监听,而不会被其他节点设备所监听。The execution logic query transaction involved in the embodiment of this specification may be a consensus transaction or a local transaction. When executing a logical query transaction is a consensus transaction, executing a logical query transaction requires consensus on the blockchain network. All blockchain nodes in the blockchain network will execute the transaction and generate corresponding execution logic query events. , so each node device can monitor the execution logical query event; and when the execution logical query transaction is a local transaction, the execution logical query transaction will not be agreed on the blockchain network, that is, only the first node device is deployed The first blockchain node will call the off-chain computing contract maintained by the first blockchain node to execute the execution logic query transaction, and the execution logic query event generated will only be monitored internally by the first node device, and It will not be monitored by other node devices.
在本说明书实施例中,链下计算合约会对执行逻辑查询交易的发起方身份进行验核,使得发起方节点设备只能请求获取自身在链下计算任务中的执行逻辑,而无法请求获取其他节点设备的执行逻辑,例如第一节点设备只能发起请求获取第一执行逻辑的执行逻辑查询交易。通过将执行逻辑查询交易设定为本地交易,同时应用本说明实施例所涉及的链下计算合约的身份验核和限制获取执行逻辑请求的机制,可以使每个参与方节点设备只能查询到自身在链下计算任务中的执行逻辑,而无法查询到自身以外的其他节点设备在链下计算任务中的执行逻辑,从而使得每个参与方节点设备都无法完全获悉链下计算任务的整体执行逻辑,通过这种信息隔离的方式起到了降低安全隐患的效果。In the embodiment of this specification, the off-chain computing contract will verify the identity of the initiator who executes the logic query transaction, so that the initiating node device can only request to obtain its own execution logic in the off-chain computing task, but cannot request to obtain other The execution logic of the node device, for example, the first node device can only initiate a request to obtain the execution logic query transaction of the first execution logic. By setting the execution logic query transaction as a local transaction, and applying the identity verification of the off-chain computing contract involved in the embodiment of this description and the mechanism to limit the acquisition of execution logic requests, each participant node device can only query Its own execution logic in off-chain computing tasks cannot be queried for the execution logic of other node devices other than itself in off-chain computing tasks, so that each participating node device cannot fully understand the overall execution of off-chain computing tasks. Logically, this information isolation method has the effect of reducing security risks.
S104:对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件。S104: Approval of the first execution logic to generate the first authorization result corresponding to the off-chain computing task, and initiate the first authorization carrying the first authorization result to the off-chain computing contract through the first blockchain node Transaction, the off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, and when each authorization result corresponding to the off-chain computing task is used to represent the authorization, allow the chain to The off-chain computing contract generates task events related to the off-chain computing task.
在本说明书实施例中,第一节点设备在获取到第一执行逻辑后,可以通过调用第一节点设备上部署的审批系统对第一执行逻辑进行审批以生成一个针对第一执行逻辑的第一授权结果来作为所述链下计算任务对应的第一授权结果。第一节点设备在对第一执行逻辑进行审批时,可以根据自身预先定义的数据保密策略和资源持有情况来判断第一节点设备是否支持执行第一执行逻辑,即在判断第一节点设备部署的资源引擎能够满足第一执行逻辑中涉及的各资源引擎的被调用情况,和/或第一节点设备的数据保密策略不与第一执行逻辑中涉及的第一节点设备上和/或所述各资源引擎与其他节点设备部署的 其他资源引擎之间的数据交互情况相冲突的情况下,第一节点设备生成的所述链下计算任务对应的第一授权结果用于表征第一节点设备对所述链下计算任务授权通过,否则第一授权结果用于表征第一节点设备对所述链下计算任务授权不通过。In the embodiment of this specification, after acquiring the first execution logic, the first node device can approve the first execution logic by calling the approval system deployed on the first node device to generate a first execution logic for the first execution logic. The authorization result is used as the first authorization result corresponding to the off-chain computing task. When the first node device approves the first execution logic, it can determine whether the first node device supports the execution of the first execution logic based on its predefined data confidentiality policy and resource holdings, that is, when determining the deployment of the first node device The resource engine can satisfy the calling situation of each resource engine involved in the first execution logic, and/or the data privacy policy of the first node device is not consistent with the first node device involved in the first execution logic and/or the When the data interaction between each resource engine and other resource engines deployed by other node devices conflicts, the first authorization result corresponding to the off-chain computing task generated by the first node device is used to represent the pair of the first node device. The off-chain computing task authorization is passed, otherwise the first authorization result is used to indicate that the first node device fails to authorize the off-chain computing task.
第一节点设备在获取到第一授权结果后,将进一步通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,除此之外,第一节点设备以外的其他参与方节点也会分别生成相应的授权结果,并各自向所述链下计算合约发起携带有所述链下计算任务对应的授权结果的授权交易。链下计算合约响应于各授权交易并维护这些授权交易所携带的各授权结果,当链下计算任务维护有来自链下计算任务对应的所有参与方节点分别所处的各参与方节点设备返回的所述链下计算任务对应的各授权结果、且这些授权结果均用于表征所述链下计算任务授权通过的情况下,将更新所述链下计算任务的状态为已授权,允许执行链下计算任务,这在合约层面上体现为允许所述链下计算合约生成所述链下计算任务相关的任务事件,具体而言:在所述链下计算任务的状态为未授权的情况下,即使链下计算合约被链下计算任务对应的交易所调用,链下计算合约也不会响应该交易以生成任何所述链下计算任务相关的任务事件;而在所述链下计算任务的状态为已授权的情况下,如果链下计算合约被链下计算任务对应的交易所调用,那么链下计算合约将正常响应该交易以生成所述链下计算任务相关的任务事件,从而通过事件监听机制指导各参与方节点设备执行链下计算任务。After obtaining the first authorization result, the first node device will further initiate a first authorization transaction carrying the first authorization result to the off-chain computing contract through the first blockchain node. In addition, the first node Other participating nodes other than the device will also generate corresponding authorization results respectively, and each initiate an authorization transaction carrying the authorization result corresponding to the off-chain computing task to the off-chain computing contract. The off-chain computing contract responds to each authorized transaction and maintains each authorization result carried by these authorized transactions. When the off-chain computing task maintains the data returned from each participant node device where all the participant nodes corresponding to the off-chain computing task are located, If each authorization result corresponding to the off-chain computing task is used to represent that the off-chain computing task is authorized, the status of the off-chain computing task will be updated to authorized, allowing off-chain execution Computing tasks, which is reflected at the contract level by allowing the off-chain computing contract to generate task events related to the off-chain computing tasks. Specifically: when the status of the off-chain computing tasks is unauthorized, even if The off-chain computing contract is called by the exchange corresponding to the off-chain computing task, and the off-chain computing contract will not respond to the transaction to generate any task events related to the off-chain computing task; and the status of the off-chain computing task is If authorized, if the off-chain computing contract is called by the exchange corresponding to the off-chain computing task, the off-chain computing contract will respond to the transaction normally to generate task events related to the off-chain computing task, thereby passing the event listening mechanism Guide each participant's node equipment to perform off-chain computing tasks.
在本说明书实施例中,每个参与方节点设备只审批涉及自身参与的链下计算任务中对应的那部分执行逻辑,而无需关注其他节点设备的执行逻辑,实现了一种针对涉及多个节点设备共同参与执行的链下计算任务的分布式审批授权,一方面减轻了各参与方节点设备的审批负担,另一方面也能实现信息隔离。由于链下计算任务被审批授权后才能够被执行,这使得各参与方节点设备在坚挺到链下计算合约生成的链下计算任务相关的任务事件的情况下,可以按照相关的任务事件的要求直接执行相关的任务逻辑,而无需重复验证本地的数据保密策略或资源持有情况是否支持执行相关的任务逻辑。In the embodiment of this specification, each participant node device only approves the corresponding part of the execution logic in the off-chain computing tasks that it participates in, without paying attention to the execution logic of other node devices, realizing a method for involving multiple nodes. The distributed approval authorization for off-chain computing tasks that devices jointly participate in executes, on the one hand, reduces the approval burden on each participating node device, and on the other hand, it can also achieve information isolation. Since off-chain computing tasks can only be executed after being approved and authorized, this allows each participant's node device to follow the requirements of the relevant task events when the off-chain computing contract generates task events related to the off-chain computing tasks. Directly execute relevant task logic without repeatedly verifying whether the local data privacy policy or resource holdings support the execution of relevant task logic.
S106:监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。S106: Monitor the first task event generated by the off-chain computing contract. The first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the first blockchain node belongs to the collaborative computing task corresponding In the case of a computing provider node, the off-chain computing engine deployed by the first node device is called to execute the collaborative computing task. The off-chain computing engine is used to: obtain the collaboration during the process of executing the collaborative computing task. The proxy access engine deployed on the second node device where the data provider node corresponding to the computing task is located accesses the data read from the second node device.
在本说明书实施例中,链下计算合约是一个用于承载链下计算任务的链上载体,链下计算合约中定义有链下计算任务包含的若干子任务,用于描述一个链下计算任务中的数据流向和各节点设备的计算协作过程。由于链下计算合约部署在区块链网络上,因此限定了链下计算合约所定义的链下计算任务的参与方节点不超过区块链网络中的各区块链节点的范围。显然,同一个区块链网络中可以部署多个链下计算合约,而不同的链下计算合约其所涉及的参与方节点的数量和性能均可以灵活配置,这使得依托于同一个区块链网络可以实现不同任务类型、任务需求和任务规模的链下计算任务的部署。In the embodiment of this specification, the off-chain computing contract is an on-chain carrier used to carry off-chain computing tasks. The off-chain computing contract defines several sub-tasks included in the off-chain computing tasks, which are used to describe an off-chain computing task. The data flow direction and the computing collaboration process of each node device. Since the off-chain computing contract is deployed on the blockchain network, the participant nodes of the off-chain computing tasks defined by the off-chain computing contract are limited to not exceeding the scope of each blockchain node in the blockchain network. Obviously, multiple off-chain computing contracts can be deployed in the same blockchain network, and the number and performance of the participant nodes involved in different off-chain computing contracts can be flexibly configured, which makes it possible to rely on the same blockchain The network can realize the deployment of off-chain computing tasks with different task types, task requirements and task scales.
为了说明链下计算合约如何指导以实现其定义的链下计算任务,下面将通过一个典型的链下计算合约的运作过程来简单介绍链下计算任务的实现逻辑。用户可以通过可视化合约编排系统生成链下计算合约的代码并在区块链网络中部署链下计算合约,从而使得链下计算合约定义了一种类型的链下计算任务的工作流程,它体现为若干个具有执行依赖顺序的子任务。在链下计算合约部署成功后,有权限调用该链下计算合约的用户就可以通过向链下计算合约发起任务创建交易的方式来创建并启动一个链下计算任务,链下计算合约在接收到任务创建交易后会相应地创建一个归属于发起方用户的链下计算任务的任务实例,该任务实例中维护有链下计算任务的任务完成状态,具体体现为链下计算任务下各子任务的任务完成状态。链下计算合约响应于任务创建交易并生成对应的 任务实例后,会进一步触发执行该实例对应的第一个子任务,在链下计算合约上体现为生成包含第一个子任务的参与方节点的事件,区块链网络中的各区块链节点都可以监听该事件,并且那些判定自身属于第一个子任务的参与方节点的区块链节点所处的节点设备会进一步调用匹配于该第一个子任务的链下计算资源和/或链下存储资源来在链下执行该第一个子任务,最后,参与方节点所处的节点设备在执行完毕后,会进一步向链下计算合约发起携带有第一个子任务的执行结果的结果返回交易,从而使得链下计算合约更新对应任务实例的任务完成状态,例如当第一个子任务的执行结果为执行成功时,链下计算合约就会将对应任务实例中第一个子任务的任务完成状态标记为已完成,从而按照预定义的链下计算任务包含的各子任务的依赖顺序触发执行下一批子任务,进而生成包含下一批子任务的参与方节点描述信息的事件以供区块链网络中的各区块链节点监听,其后续过程与前述处理第一个子任务的过程类似。由此一来,就形成了一个“链下计算合约更新任务完成状态→链下计算合约生成子任务事件→区块链节点监听子任务事件并由被指定的节点设备执行子任务→节点设备向链下计算合约发起子任务的结果返回交易→链下计算合约更新任务完成状态”的循环,直至链下计算合约中任务实例中所有子任务的任务完成状态均为已完成的情况下,确定该任务实例对应的链下计算任务已经执行完成。In order to explain how the off-chain computing contract guides the implementation of its defined off-chain computing tasks, the following will briefly introduce the implementation logic of off-chain computing tasks through the operation process of a typical off-chain computing contract. Users can generate the code of the off-chain computing contract through the visual contract orchestration system and deploy the off-chain computing contract in the blockchain network, so that the off-chain computing contract defines a type of workflow for off-chain computing tasks, which is embodied as Several subtasks with execution-dependent order. After the off-chain computing contract is successfully deployed, users who have the authority to call the off-chain computing contract can create and start an off-chain computing task by initiating a task creation transaction to the off-chain computing contract. The off-chain computing contract will receive After the task creation transaction, a task instance of the off-chain computing task belonging to the initiating user will be created accordingly. The task instance maintains the task completion status of the off-chain computing task, which is specifically reflected in the status of each sub-task under the off-chain computing task. Task completion status. After the off-chain computing contract responds to the task creation transaction and generates the corresponding task instance, it will further trigger the execution of the first sub-task corresponding to the instance, which is reflected in the off-chain computing contract as generating a participant node containing the first sub-task. event, each blockchain node in the blockchain network can listen to this event, and the node devices of those blockchain nodes that determine that they belong to the participant nodes of the first subtask will further call the node device matching the first subtask. A subtask's off-chain computing resources and/or off-chain storage resources are used to execute the first subtask off-chain. Finally, after the execution is completed, the node device where the participant node is located will further calculate the contract to the off-chain. Initiate a result return transaction carrying the execution result of the first subtask, so that the off-chain computing contract updates the task completion status of the corresponding task instance. For example, when the execution result of the first subtask is successful, the off-chain computing contract The task completion status of the first subtask in the corresponding task instance will be marked as completed, thereby triggering the execution of the next batch of subtasks according to the dependency order of each subtask included in the predefined off-chain computing task, and then generating the next batch of subtasks. The participant nodes of a batch of subtasks describe information events for each blockchain node in the blockchain network to monitor. The subsequent process is similar to the aforementioned process of processing the first subtask. As a result, an "off-chain computing contract updates the task completion status → the off-chain computing contract generates sub-task events → the blockchain node listens to the sub-task events and the designated node device executes the sub-task → the node device reports to The result of the sub-task initiated by the off-chain computing contract is returned to the transaction → the off-chain computing contract updates the task completion status" cycle, until the task completion status of all sub-tasks in the task instance in the off-chain computing contract is completed, the determination of the The off-chain computing task corresponding to the task instance has been executed.
不难发现,链下计算合约在链下计算任务的执行过程中所执行的任务仅包括创建任务实例、接收子任务结果、子任务调度与子任务下发这类调度性任务,实际上并没有真正执行链下计算任务所定义和要求执行的如数据计算、数据转移和数据存储等实际任务,而这些大量消耗资源的任务被调度至各节点设备所对应的链下进行执行,从而通过事件监听机制以及交易回传机制实现了一种基于区块链的分布式计算,使链下计算任务被区块链上的链下计算合约所锚定,在确保任务执行全流程可追踪的前提下充分利用链下资源,同时使得不同节点设备之间依托于区块链实现可信的信息交互与协作计算,另外由于链下计算任务是以合约形式定义且链下计算任务的设计并不受到链上资源的掣肘,这意味着可以通过设计不同的链下计算合约以满足不同的实际需求,通过链下资源扩展了链上协作方式。It is not difficult to find that the tasks performed by the off-chain computing contract during the execution of the off-chain computing task only include scheduling tasks such as creating task instances, receiving sub-task results, sub-task scheduling and sub-task delivery. In fact, there are no Really execute the actual tasks defined and required by off-chain computing tasks, such as data calculation, data transfer and data storage, and these tasks that consume a large amount of resources are scheduled to be executed off-chain corresponding to each node device, thereby through event monitoring The mechanism and the transaction callback mechanism realize a distributed computing based on the blockchain, so that the off-chain computing tasks are anchored by the off-chain computing contracts on the blockchain, fully ensuring that the entire task execution process is traceable. Utilizing off-chain resources simultaneously enables reliable information interaction and collaborative computing between different node devices relying on the blockchain. In addition, since off-chain computing tasks are defined in the form of contracts and the design of off-chain computing tasks is not affected by on-chain Resource constraints mean that different off-chain computing contracts can be designed to meet different actual needs, and on-chain collaboration methods can be expanded through off-chain resources.
在本说明书实施例中,所述链下计算合约维护有所述链下计算任务对应的任务完成状态,所述任务完成状态用于描述所述链下计算任务包含的各子任务的完成状态,所述链下计算任务相关的区块链事件包括所述各子任务对应的任务事件;在所述协作计算任务属于所述链下计算任务的子任务的情况下,所述监听到第一任务事件,包括:监听到所述链下计算合约在所述任务完成状态满足所述协作计算任务对应的执行条件的情况下生成的针对所述协作计算任务的第一任务事件。In the embodiment of this specification, the off-chain computing contract maintains a task completion status corresponding to the off-chain computing task. The task completion status is used to describe the completion status of each sub-task included in the off-chain computing task. The blockchain events related to the off-chain computing task include task events corresponding to each sub-task; when the collaborative computing task belongs to the sub-task of the off-chain computing task, the first task is monitored The event includes: monitoring the first task event generated by the off-chain computing contract for the collaborative computing task when the task completion status satisfies the execution conditions corresponding to the collaborative computing task.
在本说明书实施例中,链下计算任务在链下计算合约上表现为对应的任务实例,其任务完成状态维护在链下计算合约的相应任务实例中,具体表现为该任务实例中维护有各子任务的完成状态。在本说明书实施例中,所述链下计算任务相关的区块链事件包括所述各子任务对应的任务事件且所述协作计算任务属于所述链下计算任务的一个子任务,由于链下计算任务包含的各子任务的执行依赖顺序已经预先定义,这意味着包含所述协作计算任务在内的每个子任务的执行条件也已确定,因此链下计算合约可以依据链下计算任务中包含的各子任务的完成状态来进一步确定接下来所需执行的协作计算任务,从而发起针对协作计算任务的任务事件。进一步的,还包括:在协作计算任务执行完毕的情况下,通过第一区块链节点向所述链下计算合约发起包含协作计算任务对应的执行结果的结果返回交易,以更新所述链下计算合约维护的链下计算任务对应的任务完成状态。如前所述,在第一节点设备通过调用资源执行子任务并执行完毕的情况下,会通过发起结果返回交易来更新链下计算合约维护的链下计算任务的任务完成状态,从而使得链下计算合约可以进一步根据链下计算任务中各子任务的执行依赖顺序确定接下来所应该执行的下一子任务,并生成针对下一子任务的任务事件。在本说明书实施例中,监听链下计算合约生成的任务事件、向链下计算合约发起结果返回交易的实体具体为第 一节点设备上部署的调度引擎。In the embodiment of this specification, the off-chain computing task is represented as a corresponding task instance on the off-chain computing contract, and its task completion status is maintained in the corresponding task instance of the off-chain computing contract. Specifically, the task instance maintains various The completion status of the subtask. In the embodiment of this specification, the blockchain events related to the off-chain computing task include task events corresponding to each sub-task and the collaborative computing task belongs to a sub-task of the off-chain computing task. Since the off-chain computing task The execution dependency sequence of each sub-task included in the computing task has been pre-defined, which means that the execution conditions of each sub-task including the collaborative computing task have also been determined, so the off-chain computing contract can be based on the off-chain computing task. The completion status of each sub-task is used to further determine the collaborative computing task that needs to be executed next, thereby initiating a task event for the collaborative computing task. Further, it also includes: when the collaborative computing task is completed, initiating a result return transaction containing the execution result corresponding to the collaborative computing task to the off-chain computing contract through the first blockchain node to update the off-chain The task completion status corresponding to the off-chain computing tasks maintained by the computing contract. As mentioned above, when the first node device executes a subtask by calling resources and completes the execution, it will update the task completion status of the off-chain computing task maintained by the off-chain computing contract by initiating a result return transaction, thereby making the off-chain The computing contract can further determine the next subtask that should be executed based on the execution dependency sequence of each subtask in the off-chain computing task, and generate a task event for the next subtask. In the embodiment of this specification, the entity that monitors the task events generated by the off-chain computing contract and initiates the result return transaction to the off-chain computing contract is specifically the scheduling engine deployed on the first node device.
如前所述,所述任务完成状态由所述链下计算合约响应于所述链下计算任务对应的交易触发更新,其中,所述链下计算任务对应的交易包括所述链下计算任务对应的任务创建交易,或者任一节点设备在对所述各子任务中任一子任务执行完毕的情况下发起的结果返回交易。在本说明书实施例中,所述链下计算合约维护有一个或多个链下计算任务分别对应的任务完成状态。通常情况下,一个链下计算合约只会定义一种类型的链下计算任务,但可以创建该链下计算任务对应的多个任务实例,每个任务实例都会记录有该任务实例对应的任务完成状态。因此,链下计算合约上维护的多个任务实例可以是不同用户通过向链下计算合约分别发起任务创建合约而触发创建的,也可以是由同一个用户通过多次发起任务创建合约而触发创建的,但这些任务实例都具有相同的执行逻辑,即链下计算合约维护的各任务的任务类型相同。As mentioned above, the task completion status is updated by the off-chain computing contract in response to the transaction corresponding to the off-chain computing task, wherein the transaction corresponding to the off-chain computing task includes the transaction corresponding to the off-chain computing task. task creation transaction, or a result return transaction initiated by any node device after completing the execution of any of the subtasks. In the embodiment of this specification, the off-chain computing contract maintains the task completion status corresponding to one or more off-chain computing tasks. Normally, an off-chain computing contract only defines one type of off-chain computing task, but multiple task instances corresponding to the off-chain computing task can be created, and each task instance will record the completion of the task corresponding to the task instance. state. Therefore, the creation of multiple task instances maintained on the off-chain computing contract can be triggered by different users by initiating task creation contracts to the off-chain computing contract, or the creation can be triggered by the same user by initiating task creation contracts multiple times. , but these task instances all have the same execution logic, that is, the task types of each task maintained by the off-chain computing contract are the same.
本说明书实施例所涉及的代理访问引擎的类型可以为计算引擎或数据引擎。其中,计算引擎又称链下计算引擎,是指为节点设备提供链下计算能能力的服务或子系统,一个计算引擎往往能够承担一种或多种类型的计算任务,这体现在对相关子任务对应的计算需求的支持;数据引擎又称数据库引擎,是指用于存储、检索、处理和保护数据的核心服务程序,利用数据库引擎可控制访问权限并快速处理事务,从而满足企业内大多数需要处理大量数据的应用程序的要求,使用数据库引擎创建用于联机事务处理或联机分析处理数据的关系数据库,这包括创建用于存储数据的表和用于查看、管理和保护数据安全的数据库对象(如索引、视图和存储过程),不同的数据引擎所支持的数据访问方式或访问的数据类型有所不同,因此体现为相关子任务对应的数据引擎需求的支持。The type of proxy access engine involved in the embodiment of this specification may be a computing engine or a data engine. Among them, the computing engine, also known as the off-chain computing engine, refers to the service or subsystem that provides off-chain computing capabilities for node devices. A computing engine can often undertake one or more types of computing tasks, which is reflected in the Support the computing requirements corresponding to the task; the data engine, also known as the database engine, refers to the core service program used to store, retrieve, process and protect data. The database engine can be used to control access permissions and process transactions quickly, thereby satisfying most of the needs within the enterprise. Requirements for applications that need to process large amounts of data, use a database engine to create a relational database for online transaction processing or online analytical processing of data. This includes creating tables for storing data and database objects for viewing, managing, and securing the data. (such as indexes, views, and stored procedures). Different data engines support different data access methods or accessed data types, which are reflected in the support of data engine requirements corresponding to related subtasks.
在本说明书实施例中,第一节点设备监听到的所述链下计算合约生成的针对协作计算任务的第一任务事件中记录有协作计算任务对应的所述数据提供方节点和所述计算提供方节点的描述信息。第一任务事件包括协作计算任务的参与方节点的描述信息,这些描述信息具体是指协作计算任务规定的其所需涉及参与执行的节点设备所处区块链节点的身份信息。协作计算任务对应的参与方节点按照其对应的属性特点可被确定为协作计算任务对应的数据提供方节点和/或计算提供方节点,其中,协作计算任务对应的数据提供方节点是指:在一个由多个节点设备共同参与完成的协作计算任务的执行过程中,需要向其他节点设备提供数据的节点设备上部署的所述区块链网络中的区块链节点,该数据用于给其他节点设备上部署的链下计算引擎作为执行该协作计算任务和/或后续其他子任务所需的数据而使用;而协作计算任务对应的计算提供方是指:在一个由多个节点设备共同参与完成的协作计算任务的执行过程中,提供链下计算引擎资源执行实际计算任务的节点设备上部署的所述区块链网络中的区块链节点。容易理解的是,对于协作计算任务中任一个参与方节点而言,其既可以为该协作计算任务对应的数据提供方节点,也可以为该协作计算任务对应的计算提供方节点,还可以同时为该协作计算任务对应的数据提供方节点与计算提供方节点。例如,对于一个同时为协作计算任务对应的数据提供方节点与计算提供方节点的参与方节点而言,其所处的节点设备上的链下计算引擎将在执行该协作计算任务的过程中,将同时获取该节点设备本地的数据以及数据提供方节点所处节点设备上的数据,以用于执行该协作计算任务和/或后续其他子任务。In the embodiment of this specification, the first task event for the collaborative computing task generated by the off-chain computing contract and monitored by the first node device records the data provider node and the computing provider corresponding to the collaborative computing task. Description information of the square node. The first task event includes description information of the participating nodes of the collaborative computing task. This description information specifically refers to the identity information of the blockchain node where the node device involved in the execution is located as specified by the collaborative computing task. The participant node corresponding to the collaborative computing task can be determined as the data provider node and/or the computing provider node corresponding to the collaborative computing task according to its corresponding attribute characteristics, where the data provider node corresponding to the collaborative computing task refers to: During the execution of a collaborative computing task involving multiple node devices, a blockchain node in the blockchain network deployed on a node device that needs to provide data to other node devices, the data is used to provide data to other node devices. The off-chain computing engine deployed on the node device is used as the data required to perform the collaborative computing task and/or other subsequent sub-tasks; and the computing provider corresponding to the collaborative computing task refers to: in a network jointly participated by multiple node devices During the execution of the completed collaborative computing task, the blockchain node in the blockchain network deployed on the node device that provides off-chain computing engine resources to perform the actual computing task. It is easy to understand that for any participant node in a collaborative computing task, it can be either a data provider node corresponding to the collaborative computing task, a computing provider node corresponding to the collaborative computing task, or both at the same time. The data provider node and computing provider node corresponding to the collaborative computing task. For example, for a participant node that is both a data provider node and a computing provider node corresponding to a collaborative computing task, the off-chain computing engine on the node device where it is located will execute the collaborative computing task. The local data of the node device and the data on the node device where the data provider node is located will be obtained at the same time for performing the collaborative computing task and/or other subsequent subtasks.
在本说明书实施例中,第一任务事件中还记录有计算提供方节点所处第一节点设备上参与执行所述协作计算任务的链下计算引擎的标识信息,以提示第一节点设备对链下计算引擎的调用,以及数据提供方节点所处第二节点设备在调用代理访问引擎应该指导其将读取到的数据发送给该链下计算引擎。另外,第一任务事件中还会记录链下计算任务与协作计算任务的任务标识,从而对不同的任务和子任务进行区分,这主要是方便后续任一节点设备在对协作计算任务执行完毕并回传结果返回交易时能够正确标识是针对链下计算任务中协作计算任务的结果,使得链下计算合约能够通过结果返回交易正确更新对应链下计算任务的任务实例中协作计算任务的完成状态,以应对同一个任务包含 多个子任务以及同一个链下计算年合约同时创建多个链下计算任务的任务实例的情况。当然协作计算任务还记录有自身所需执行的计算和数据转移等操作,且指定了所需数据的来源,这些信息是用于告知各节点设备协作计算任务的任务类型及其实现方式,从而指导节点设备在确定协作计算任务的任务类型及其实现方式对应可调用资源后,按照协作计算任务的预期执行协作计算任务。In the embodiment of this specification, the first task event is also recorded with the identification information of the off-chain computing engine participating in executing the collaborative computing task on the first node device where the computing provider node is located, so as to prompt the first node device to perform on-chain When the second node device where the data provider node is located calls the proxy access engine, it should instruct it to send the read data to the off-chain computing engine. In addition, the first task event will also record the task identifiers of off-chain computing tasks and collaborative computing tasks, thereby distinguishing different tasks and subtasks. This is mainly to facilitate any subsequent node device to complete the collaborative computing task and return When the result return transaction is passed, it can be correctly identified as the result of the collaborative computing task in the off-chain computing task, so that the off-chain computing contract can correctly update the completion status of the collaborative computing task in the task instance corresponding to the off-chain computing task through the result return transaction, so as to To deal with the situation where the same task contains multiple subtasks and the same off-chain computing annual contract creates task instances of multiple off-chain computing tasks at the same time. Of course, the collaborative computing task also records the calculations and data transfer operations it needs to perform, and specifies the source of the required data. This information is used to inform each node device of the task type and implementation method of the collaborative computing task, thereby guiding After determining the task type of the collaborative computing task and its implementation method corresponding to the callable resources, the node device executes the collaborative computing task as expected for the collaborative computing task.
在本说明书实施例中,由于第一任务事件中记录有所述计算提供方节点的描述信息,因此,第一节点设备可以通过在判断出自身部署的第一区块链节点的标识信息包含于第一任务事件中记录的所述计算提供方节点的描述信息情况下,确定第一区块链节点属于所述计算提供方节点;而在判断出第一区块链节点的标识信息未包含于第一任务事件中记录的所述计算提供方节点的描述信息的情况下,确定第一区块链节点不属于所述计算提供方节点。In the embodiment of this specification, since the description information of the computing provider node is recorded in the first task event, the first node device can determine that the identification information of the first blockchain node deployed by itself is included in When the description information of the computing provider node recorded in the first task event is determined, the first blockchain node belongs to the computing provider node; and when it is determined that the identification information of the first blockchain node is not included in In the case of the description information of the computing provider node recorded in the first task event, it is determined that the first blockchain node does not belong to the computing provider node.
在本说明书实施例中,第一节点设备需要在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,才会调用链下计算引擎执行所述协作计算任务,否则,如果第一节点设备不属于所述协作计算任务对应的计算提供方节点,第一节点设备不会调用链下计算引擎执行所述协作计算任务。同时,第一任务事件中还记录有代理访问引擎的标识信息和/或通讯地址,第一节点设备将代理访问引擎的标识信息和/或通讯地址写入用于调用链下计算引擎的调用请求中,并将调用请求发送至链下计算引擎以调用该链下计算引擎,链下计算引擎由此获知协作计算任务对应的数据提供方节点的标识信息以及用于提供数据的第二节点设备中部署的代理访问引擎的标识信息和/或通讯地址,从而能够知晓其需要从代理访问引擎获取第二节点设备上的数据。In the embodiment of this specification, the first node device only calls the off-chain computing engine to execute the collaborative computing task after determining that the first blockchain node belongs to the computing provider node corresponding to the collaborative computing task. Otherwise, if the first node device does not belong to the computing provider node corresponding to the collaborative computing task, the first node device will not call the off-chain computing engine to execute the collaborative computing task. At the same time, the first task event also records the identification information and/or communication address of the proxy access engine. The first node device writes the identification information and/or communication address of the proxy access engine into the call request for calling the off-chain computing engine. , and sends the call request to the off-chain computing engine to call the off-chain computing engine. The off-chain computing engine thus learns the identification information of the data provider node corresponding to the collaborative computing task and the second node device used to provide data. The identification information and/or communication address of the deployed proxy access engine, so that it can know that it needs to obtain the data on the second node device from the proxy access engine.
在本说明书实施例中,所述代理访问引擎和所述链下计算引擎均在同一时间只能执行一个子任务/协作计算任务,因此所述代理访问引擎只能在执行所述协作计算任务的时间段内才具备所述协作计算任务所规定的特定范围的数据的提供权限,而其他链下计算引擎也只能在与所述代理访问引擎共同执行相同的协作计算任务的期间才能从向代理访问引擎请求获取特定数据,而无法在任意时刻从代理访问引擎获取数据,也无法从代理访问引擎处获取任意数据,实现了一种基于协作计算任务的数据的访问时间限制与访问范围限制。In the embodiment of this specification, the proxy access engine and the off-chain computing engine can only execute one subtask/collaborative computing task at the same time. Therefore, the proxy access engine can only perform the collaborative computing task while executing the collaborative computing task. Only within the time period, it has the permission to provide the specific range of data specified by the collaborative computing task, and other off-chain computing engines can only provide data to the agent during the period when they are jointly executing the same collaborative computing task with the agent access engine. The access engine requests specific data, but cannot obtain data from the proxy access engine at any time, nor can it obtain any data from the proxy access engine. This implements an access time limit and access scope limit for data based on collaborative computing tasks.
在本说明书实施例中,链下计算任务对应的各参与方节点所处的节点设备在监听到链下计算合约生成的授权申请事件后,将分别审核各自在链下计算任务中的执行逻辑以生成链下计算任务的授权结果,并向所述链下计算合约发起携带有各自授权结果的授权交易以完成对链下计算任务的授权,链下计算合约在完成对链下计算任务的授权后才会允许生成链下计算任务相关的任务事件,从而通过事件监听机制来指导各节点设备执行链下计算任务相关的协作计算任务,使得数据提供方节点所处的第二节点设备通过代理访问引擎将从第二节点设备读取到的数据提供至计算提供方节点所处的第一节点设备,从而将节点设备之间的数据交互限制在授权的链下计算任务的执行过程中,一方面将数据需求方获取数据的范围和时机限制在授权的链下计算任务的执行逻辑之内,降低了安全隐患;另一方面,同一链下计算引擎在不同链下计算任务中参与的执行逻辑可以不同,这意味着可以对同一链下计算引擎在不同链下计算任务中的数据访问权限进行不同的设计,因此能够实现同一链下计算引擎在不同协作计算任务中的功能独立性。In the embodiment of this specification, after listening to the authorization application event generated by the off-chain computing contract, the node device where each participant node corresponding to the off-chain computing task is located will separately review the execution logic of each off-chain computing task. Generate authorization results for off-chain computing tasks, and initiate authorization transactions carrying respective authorization results to the off-chain computing contract to complete the authorization of off-chain computing tasks. After completing the authorization of off-chain computing tasks, the off-chain computing contract Only then will it be allowed to generate task events related to off-chain computing tasks, thereby guiding each node device to perform collaborative computing tasks related to off-chain computing tasks through the event listening mechanism, so that the second node device where the data provider node is located can access the engine through the proxy The data read from the second node device is provided to the first node device where the computing provider node is located, thereby limiting data interaction between node devices to the execution of authorized off-chain computing tasks. On the one hand, The scope and timing of data acquisition by data demanders are limited to the execution logic of authorized off-chain computing tasks, reducing security risks; on the other hand, the same off-chain computing engine can participate in different execution logics in different off-chain computing tasks. , which means that the data access rights of the same off-chain computing engine in different off-chain computing tasks can be designed differently, so the functional independence of the same off-chain computing engine in different collaborative computing tasks can be achieved.
在本说明书实施例中,链下计算引擎会在被第一节点调用时指明其所需要执行的所述协作计算任务的任务逻辑,这其中包含链下计算任务需要向对应的第二节点设备部署的代理访问引擎获取数据的过程,于是,链下计算引擎就可以在执行协作计算任务的过程中,通过以下至少两种策略来获取代理访问引擎从第二节点设备处读取的数据。In the embodiment of this specification, the off-chain computing engine will specify the task logic of the collaborative computing task that it needs to perform when called by the first node, which includes that the off-chain computing task needs to be deployed to the corresponding second node device. The process of obtaining data by the proxy access engine. Therefore, the off-chain computing engine can obtain the data read by the proxy access engine from the second node device through at least the following two strategies during the execution of the collaborative computing task.
在一实施例中,链下计算引擎在执行协作计算任务的过程中不会主动向代理访问引擎请求获取数据,而是等待代理访问引擎主动向链下计算引擎推送数据。在这种情况下,代理访问引擎响应于第二节点设备的调用而执行协作计算任务的过程中,可以按照协作 计算任务的要求从第二节点设备中读取协作计算任务规定的数据,并向协作计算任务指定的第一节点设备下的链下计算引擎主动推送该数据,从而使得链下计算引擎获取该数据。由于本实施例采用的是代理访问引擎在执行协作计算任务的过程中主动推送数据的机制,作为数据持有方和授权方的代理访问引擎基于可信的链下计算合约生成的第一任务事件以获知第一节点设备部署的链下计算引擎的相关数据获取需求,且具有主动提供数据的能力,这使得代理计算引擎无需在向外部传输数据时进行重复鉴权,而是直接按照协作计算任务的要求执行协作计算任务就能够实现安全的数据交互,一方面将向外部传输数据的时间限定在执行协作计算任务期间,另一方面也使得代理计算引擎对外部传输的数据的范围受到协作计算任务的限制。In one embodiment, the off-chain computing engine will not actively request data from the proxy access engine during the execution of collaborative computing tasks, but will wait for the proxy access engine to actively push data to the off-chain computing engine. In this case, during the process of the proxy access engine executing the collaborative computing task in response to the call from the second node device, the data specified by the collaborative computing task can be read from the second node device according to the requirements of the collaborative computing task, and sent to The off-chain computing engine under the first node device specified by the collaborative computing task actively pushes the data, so that the off-chain computing engine obtains the data. Since this embodiment adopts a mechanism in which the proxy access engine actively pushes data during the execution of collaborative computing tasks, the proxy access engine, as the data holder and authorizer, generates the first task event based on the trusted off-chain computing contract. In order to know the relevant data acquisition requirements of the off-chain computing engine deployed on the first node device, and have the ability to actively provide data, this makes the agent computing engine do not need to perform repeated authentication when transmitting data to the outside, but directly follows the collaborative computing task Safe data interaction can be achieved by executing collaborative computing tasks according to the requirements. On the one hand, the time for transmitting data to the outside is limited to the period of executing the collaborative computing task. On the other hand, the scope of externally transmitted data by the agent computing engine is limited by the collaborative computing task. limits.
在另一实施例中,链下计算引擎在执行协作计算任务的过程中会主动向代理访问引擎发送数据访问请求以获取第二节点设备上的数据,然而这就要求代理访问引擎验证数据访问请求是否符合规定,是否是针对于协作计算任务中必要的数据交互,而只有在代理访问引擎确定接收的数据访问请求符合协作计算任务的执行逻辑,响应于该数据访问请求并向外传输数据的行为属于执行协作计算任务过程中的一个正常环节的情况下,才会响应于数据访问请求并向链下计算引擎提供数据。In another embodiment, the off-chain computing engine will actively send a data access request to the proxy access engine to obtain the data on the second node device during the execution of the collaborative computing task. However, this requires the proxy access engine to verify the data access request. Whether it complies with regulations and whether it is for necessary data interaction in collaborative computing tasks, and only when the proxy access engine determines that the data access request received complies with the execution logic of the collaborative computing task, responds to the data access request and transmits data outwards Only when it is a normal part of the process of executing collaborative computing tasks will it respond to data access requests and provide data to the off-chain computing engine.
可选的,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将数据访问请求与所述数据访问请求对应的授权凭证发送至所述代理访问引擎;所述代理访问引擎用于:在执行所述协作计算任务的过程中,接收所述数据访问请求与所述授权凭证,并在确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务的情况下,将从第二节点设备读取到的所述数据发送至所述链下计算引擎。Optionally, the off-chain computing engine is also configured to: in the process of executing the collaborative computing task, send a data access request and an authorization credential corresponding to the data access request to the proxy access engine; the proxy The access engine is configured to: receive the data access request and the authorization credential during the execution of the collaborative computing task, and determine that the authorization credential is used to indicate that the data access request is for the collaborative computing task. In the case of , the data read from the second node device is sent to the off-chain computing engine.
在本说明书实施例中,链下计算引擎在执行协作计算任务的过程中,如果需要获取第二节点设备中的数据,则会向第二节点设备上部署的代理访问引擎发送数据访问请求,该数据访问请求所要求获取的数据在协作计算任务定义的所需数据的范围之内,同时为了使代理访问引擎确信该数据访问请求是针对于执行协作计算任务而发出的,链下计算引擎还会同步向代理访问引擎发送所述数据访问请求对应的授权凭证,以用于证明所述数据访问请求是基于执行所述协作计算任务的过程中所发出的。第一任务事件被第二节点设备监听后,也会触发第二节点设备调用本地部署的代理访问引擎执行协作计算任务,代理访问引擎在执行所述协作计算任务的过程中,将根据所述协作计算任务的要求向第一节点设备中的链下计算引擎提供第二节点设备上特定的数据,由于本实施例采用的是请求-响应的被动推送数据的机制,因此代理访问引擎在执行协作计算任务期间,将开放协作计算任务所指定的所述链下计算引擎访问第二节点设备上协作计算任务所指定的数据。当接收到所述链下计算引擎发送的数据访问请求和授权凭证后,代理访问引擎对授权凭证进行验证,如果确定所述数据访问请求针对于所述协作计算任务,即是所述数据访问请求在执行所述协作计算任务的过程中所发出的,那么代理访问引擎就会响应所述数据访问请求,在协作计算任务所定义的可供提供的数据范围内,将所述数据访问请求所指定的数据从第二节点设备中读取并返回至所述链下计算引擎,如果未接收到所述数据访问请求对应的授权凭证或接收到的所述授权凭证无法表征所述数据访问请求针对于所述协作计算任务,那么代理访问引擎将不会响应于所述数据访问请求,不将本地数据提供至所述链下计算引擎。本说明书实施例通过对授权凭证进行验证,使得在被动推送的机制下,代理访问引擎能够有效地区分接收到的数据访问请求是否合法,进而拒绝响应除以执行所述协作计算任务以外为目的的所述链下计算引擎的数据访问请求,实现安全地数据交互。In the embodiment of this specification, if the off-chain computing engine needs to obtain data in the second node device during the execution of the collaborative computing task, it will send a data access request to the proxy access engine deployed on the second node device. The data requested by the data access request is within the scope of the required data defined by the collaborative computing task. At the same time, in order to convince the proxy access engine that the data access request is issued for the execution of the collaborative computing task, the off-chain computing engine will also The authorization credentials corresponding to the data access request are synchronously sent to the proxy access engine to prove that the data access request is issued based on the process of executing the collaborative computing task. After the first task event is monitored by the second node device, it will also trigger the second node device to call the locally deployed proxy access engine to perform the collaborative computing task. During the process of executing the collaborative computing task, the proxy access engine will The requirements of the computing task provide specific data on the second node device to the off-chain computing engine in the first node device. Since this embodiment adopts a request-response passive data push mechanism, the proxy access engine performs collaborative computing. During the task, the off-chain computing engine specified by the collaborative computing task will be opened to access the data specified by the collaborative computing task on the second node device. After receiving the data access request and authorization credentials sent by the off-chain computing engine, the proxy access engine verifies the authorization credentials. If it is determined that the data access request is for the collaborative computing task, it is the data access request. is issued during the execution of the collaborative computing task, then the proxy access engine will respond to the data access request, and within the range of available data defined by the collaborative computing task, the data access request specified by the The data is read from the second node device and returned to the off-chain computing engine. If the authorization credential corresponding to the data access request is not received or the received authorization credential cannot characterize the data access request for If the collaborative computing task is performed, the proxy access engine will not respond to the data access request and provide local data to the off-chain computing engine. The embodiment of this specification verifies the authorization credentials, so that under the passive push mechanism, the proxy access engine can effectively distinguish whether the received data access request is legal, and then reject the response except for the purpose of performing the collaborative computing task. The data access request of the off-chain computing engine realizes secure data interaction.
可选的,第一任务事件记录有所述协作计算任务的标识信息,所述授权凭证包括所述标识信息,所述代理访问引擎用于在所述授权凭证包括所述标识信息的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。在本说明书实施例中,由于第一任务事件同时能够被第一节点设备与第二节点设备所监听,因此可以将所 述协作计算任务的标识信息携带在第一任务事件中,从而使得第一节点设备和第二节点设备均获得了所述协作计算任务的标识信息,同时不同的协作计算任务的标识信息互不相同,因此该标识信息可以作为链下计算引擎与代理访问引擎之间确定针对于所述协作计算任务的共识信息。代理访问引擎通过在确定所述授权凭证中包含所述标识信息的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。Optionally, the first task event records the identification information of the collaborative computing task, and the authorization voucher includes the identification information. The proxy access engine is used to, when the authorization voucher includes the identification information, The authorization credentials are determined to indicate that the data access request is for the collaborative computing task. In the embodiment of this specification, since the first task event can be monitored by the first node device and the second node device at the same time, the identification information of the collaborative computing task can be carried in the first task event, so that the first Both the node device and the second node device have obtained the identification information of the collaborative computing task. At the same time, the identification information of different collaborative computing tasks is different from each other. Therefore, the identification information can be used to determine the target between the off-chain computing engine and the proxy access engine. Consensus information on the collaborative computing task. The proxy access engine determines that the authorization credential is used to indicate that the data access request is directed to the collaborative computing task by determining that the authorization credential contains the identification information.
可选的,第一任务事件记录有所述协作计算任务对应的任务公钥和任务私钥密文,其中,所述任务私钥密文通过使用所述链下计算引擎对应的公钥对所述协作计算任务对应的任务私钥进行加密得到;所述授权凭证包括使用所述任务私钥对所述数据访问请求进行签名得到的第一数字签名,所述任务私钥由所述链下计算引擎使用所述链下计算引擎对应的私钥对所述任务私钥密文进行解密得到;所述代理访问引擎用于在使用第一任务事件中记录的所述任务公钥对所述第一数字签名验签成功的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。在本说明书实施例中,链下计算合约在生成所述协作计算任务对应的第一任务事件时,将同步为所述协作计算任务生成一对公私钥对,称为所述协作计算任务的任务公钥与任务私钥,其中,任务公钥被直接记录在第一任务事件中从而通过事件监听机制被各节点设备所获知,而任务私钥则通过所述协作计算任务所涉及的需要跨域获取数据的所述链下计算引擎对应的公钥进行加密后记录在第一任务事件中,即以任务私钥密文的形式被各节点设备所获知,然而由于第一节点设备中的所述链下计算引擎是拥有用于解密所述任务私钥密文的所述链下计算引擎对应的私钥,因此,第一节点设备在第一任务事件读取得到所述任务私钥密文后,会将其放入用于调用所述链下计算引擎的调用请求中,以使所述链下计算引擎在执行所述协作计算任务的过程中,可以通过自身私钥解密所述任务私钥密文以得到所述任务私钥。唯一能够获取所述任务私钥的链下计算任务由此通过所述任务私钥对数据访问请求进行签名以获取第一数字签名以作为所述授权凭证,代理访问引擎在接收到所述授权凭证中的第一数字签名后,通过第一节点设备在第一任务事件中读取得到的所述任务公钥对第一数字签名进行验签,在验签成功的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。在本说明书实施例中,由于只有链下计算引擎能够获取协作计算任务对应的任务私钥,因此一旦代理访问引擎验证第一数字签名成功,则意味着代理访问引擎可以确信所述数据访问请求是拥有所述任务私钥的链下计算引擎所发起的,于是代理访问引擎可以认定所述数据访问请求是针对于所述协作计算任务所发起的,同时所述数据访问请求的发起方必然是所述协作计算任务的合规执行方,因此代理访问引擎无需重复验证所述链下计算引擎的身份信息,加快了被动推送的机制中链下计算引擎获取跨域数据的效率。Optionally, the first task event records the task public key and task private key ciphertext corresponding to the collaborative computing task, wherein the task private key ciphertext is obtained by using the public key pair corresponding to the off-chain computing engine. The task private key corresponding to the collaborative computing task is encrypted; the authorization certificate includes the first digital signature obtained by using the task private key to sign the data access request, and the task private key is calculated by the off-chain The engine uses the private key corresponding to the off-chain computing engine to decrypt the task private key ciphertext; the proxy access engine is used to use the task public key recorded in the first task event to decrypt the first task public key. If the digital signature verification is successful, it is determined that the authorization certificate is used to indicate that the data access request is directed to the collaborative computing task. In the embodiment of this specification, when the off-chain computing contract generates the first task event corresponding to the collaborative computing task, it will synchronously generate a public-private key pair for the collaborative computing task, which is called the task of the collaborative computing task. Public key and task private key, where the task public key is directly recorded in the first task event and is learned by each node device through the event listening mechanism, while the task private key is cross-domain through the needs involved in the collaborative computing task. The public key corresponding to the off-chain computing engine that obtains the data is encrypted and recorded in the first task event, that is, it is known to each node device in the form of task private key ciphertext. However, due to the above mentioned in the first node device The off-chain computing engine owns the private key corresponding to the off-chain computing engine used to decrypt the task private key ciphertext. Therefore, after the first node device reads the task private key ciphertext in the first task event, , will be put into the call request for calling the off-chain computing engine, so that the off-chain computing engine can decrypt the task private key through its own private key during the execution of the collaborative computing task. ciphertext to obtain the task private key. The only off-chain computing task that can obtain the task private key signs the data access request through the task private key to obtain the first digital signature as the authorization certificate. After receiving the authorization certificate, the proxy access engine After the first digital signature is obtained, the first digital signature is verified using the task public key read by the first node device in the first task event. If the verification is successful, the authorization certificate is determined. Used to indicate that the data access request is directed to the collaborative computing task. In the embodiment of this specification, since only the off-chain computing engine can obtain the task private key corresponding to the collaborative computing task, once the proxy access engine successfully verifies the first digital signature, it means that the proxy access engine can be convinced that the data access request is Initiated by the off-chain computing engine that owns the private key of the task, the proxy access engine can determine that the data access request is initiated for the collaborative computing task, and the initiator of the data access request must be the Therefore, the proxy access engine does not need to repeatedly verify the identity information of the off-chain computing engine, which speeds up the efficiency of the off-chain computing engine in obtaining cross-domain data in the passive push mechanism.
可选的,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将使用所述链下计算引擎对应的私钥对所述数据访问请求进行签名得到的第二数字签名发送至所述代理访问引擎;所述代理访问引擎还用于:在执行所述协作计算任务的过程中,使用所述链下计算引擎对应的公钥对接收到的第二数字签名进行验签,在验签成功且确定所述链下计算引擎具有第一节点设备的访问权限的情况下,确定所述授权凭证有效。在本说明书实施例中,链下计算引擎还需要通过第二数字签名向代理访问引擎证明自身身份的有效性,代理访问引擎在对第二数字签名验证通过后,能够确认该数据访问请求来源于所述链下计算引擎,从而可以在所述协作计算任务包含“向所述链下计算引擎提供所述数据访问请求所请求获取的数据”的逻辑的情况下,和/或代理访问引擎基于预先维护的基于身份权限的数据访问监控系统判断“向所述链下计算引擎提供所述数据访问请求所请求获取的数据”是可被允许的情况下,将确认所述授权凭证有效,并进一步对所述授权凭证进行验证。本说明书实施例结合了传统的基于身份的数据访问权限的供给策略,给不同节点设备之间跨域的数据交互带来了更佳的安全性。Optionally, the off-chain computing engine is also configured to: in the process of executing the collaborative computing task, use the private key corresponding to the off-chain computing engine to sign the second number obtained by signing the data access request. The signature is sent to the proxy access engine; the proxy access engine is also configured to: use the public key corresponding to the off-chain computing engine to verify the received second digital signature during the execution of the collaborative computing task. If the signature verification is successful and it is determined that the off-chain computing engine has access rights to the first node device, it is determined that the authorization certificate is valid. In the embodiment of this specification, the off-chain computing engine also needs to prove the validity of its identity to the proxy access engine through a second digital signature. After the proxy access engine passes the verification of the second digital signature, it can confirm that the data access request comes from The off-chain computing engine, so that in the case where the collaborative computing task includes the logic of "providing the off-chain computing engine with the data requested by the data access request", and/or the proxy access engine is based on a pre- If the maintained identity permission-based data access monitoring system determines that "providing the data requested by the data access request to the off-chain computing engine" is allowed, it will confirm that the authorization certificate is valid and further The authorization credentials are verified. The embodiment of this specification combines the traditional identity-based data access permission supply strategy to bring better security to cross-domain data interaction between different node devices.
图2是一示例性实施例提供的另一种数据处理方法的流程图。该方法应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合 约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括S202至S206。Figure 2 is a flow chart of another data processing method provided by an exemplary embodiment. This method is applied to a second node device deployed with a second blockchain node. The blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains a corresponding off-chain computing task. The execution logic of the node device where each participant node is located in the off-chain computing task; the method includes S202 to S206.
S202:在监听到所述链下计算合约生成的授权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑。S202: After monitoring the authorization application event generated by the off-chain computing contract and determining that the second blockchain node belongs to the second participant node, obtain the second node device in the off-chain computing task. Execute logic.
S204:对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件。S204: Approval of the second execution logic to generate a second authorization result corresponding to the off-chain computing task, and initiate a second authorization carrying the second authorization result to the off-chain computing contract through the second blockchain node. Transaction, the off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, and when each authorization result corresponding to the off-chain computing task is used to represent the authorization, allow the chain to The off-chain computing contract generates task events related to the off-chain computing task.
S206:监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。S206: Monitor the first task event generated by the off-chain computing contract. The first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the second blockchain node belongs to the collaborative computing task corresponding In the case of a data provider node, the proxy access engine deployed on the second node device is called to execute the collaborative computing task, and the proxy access engine is used to: during the process of executing the collaborative computing task, access data from the second node device. The read data is provided to the off-chain computing engine deployed on the first node device where the computing provider node corresponding to the collaborative computing task is located.
在第一任务事件中记录的所述数据提供方节点的描述信息中包含第二区块链节点的标识信息的情况下,确定第二区块链节点属于所述数据提供方节点。在本说明书实施例中,针对协作计算任务的第一任务事件中记录有协作计算任务对应的数据提供方节点的描述信息,这意味着第二节点设备可以在确定所述数据提供方节点的描述信息中包含自身部署的第二区块链节点的标识信息的情况下,判断自身所部属的第二区块链节点属于协作计算任务对应的数据提供方节点;而如果所述数据提供方节点的描述信息中不包含第二区块链节点的标识信息,则第二节点设备可以判断自身所部署的第二区块链节点不属于协作计算任务对应的数据提供方节点。When the description information of the data provider node recorded in the first task event includes the identification information of the second blockchain node, it is determined that the second blockchain node belongs to the data provider node. In the embodiment of this specification, the description information of the data provider node corresponding to the collaborative computing task is recorded in the first task event for the collaborative computing task, which means that the second node device can determine the description of the data provider node. If the information contains the identification information of the second blockchain node deployed by itself, it is determined that the second blockchain node to which it is deployed belongs to the data provider node corresponding to the collaborative computing task; and if the data provider node If the description information does not include the identification information of the second blockchain node, the second node device can determine that the second blockchain node deployed by itself does not belong to the data provider node corresponding to the collaborative computing task.
在本说明书实施例中,第二节点设备需要在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,才会调用代理访问引擎执行所述协作计算任务,否则,如果第二节点设备不属于所述协作计算任务对应的数据提供方节点,第二节点设备不会调用代理访问引擎执行所述协作计算任务。代理访问引擎在被第二节点设备调用后,将获知协作计算任务对应的计算提供方节点的标识信息以及需要向其提供数据的第一节点设备中部署的链下计算引擎的标识信息,从而指示代理访问引擎能够将从第二节点设备上读取到的数据传输至对应的链下计算引擎。In the embodiment of this specification, the second node device needs to determine that the second blockchain node belongs to the data provider node corresponding to the collaborative computing task before calling the proxy access engine to execute the collaborative computing task; otherwise , if the second node device does not belong to the data provider node corresponding to the collaborative computing task, the second node device will not call the proxy access engine to execute the collaborative computing task. After being called by the second node device, the proxy access engine will learn the identification information of the computing provider node corresponding to the collaborative computing task and the identification information of the off-chain computing engine deployed in the first node device that needs to provide data, thereby indicating The proxy access engine can transmit the data read from the second node device to the corresponding off-chain computing engine.
图3是一示例性实施例提供的一种节点设备交互的场景示意图。如图3所示,第一节点设备部署有区块链网络中的第一区块链节点、第一调度引擎、链下计算引擎与第一数据源,第二节点设备上部署有区块链网络中的第二区块链节点、第二调度引擎、代理访问引擎与第二数据源。Figure 3 is a schematic diagram of a node device interaction scenario provided by an exemplary embodiment. As shown in Figure 3, the first node device is deployed with the first blockchain node, the first scheduling engine, the off-chain computing engine and the first data source in the blockchain network, and the second node device is deployed with the blockchain The second blockchain node, the second scheduling engine, the proxy access engine and the second data source in the network.
当链下计算合约生成授权申请事件且该事件记录有参与执行链下计算任务的第一区块链节点与第二区块链节点的描述信息后,第一调度引擎将通过第一区块链节点监听到该授权申请事件,假设授权申请事件中包含有各参与方节点设备在链下计算任务中的各执行逻辑,那么第一调度引擎将从授权申请事件中读取得到第一节点设备参与执行链下计算任务的第一执行逻辑,并对第一执行逻辑进行审计以生成所述链下计算任务对应的第一授权结果后,通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易;同理,第二调度引擎在监听到授权申请事件后也能从中读取得到第二节点设备参与执行链下计算任务的第二执行逻辑,对第二执行逻辑进行审计以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易。When the off-chain computing contract generates an authorization application event and the event records the description information of the first blockchain node and the second blockchain node that participate in executing the off-chain computing task, the first scheduling engine will pass the first blockchain The node monitors the authorization application event. Assuming that the authorization application event contains the execution logic of each participating node device in the off-chain computing task, then the first scheduling engine will read from the authorization application event to obtain the participation of the first node device. After executing the first execution logic of the off-chain computing task, and auditing the first execution logic to generate the first authorization result corresponding to the off-chain computing task, initiate an initiative to the off-chain computing contract through the first blockchain node The first authorization transaction carrying the first authorization result; similarly, after listening to the authorization application event, the second scheduling engine can also read from it and obtain the second execution logic of the second node device participating in the execution of off-chain computing tasks. The second execution logic performs auditing to generate a second authorization result corresponding to the off-chain computing task, and initiates a second authorization transaction carrying the second authorization result to the off-chain computing contract through the second blockchain node.
链下计算合约响应于第一授权交易与第二授权交易,获取携带在其中的第一授权结 果与第二授权结果,假设第一授权结果与第二授权结果均用于表征授权通过,那么链下计算合约将允许所述链下计算合约生成所述链下计算任务相关的任务事件。The off-chain computing contract responds to the first authorization transaction and the second authorization transaction, and obtains the first authorization result and the second authorization result carried in it. Assuming that the first authorization result and the second authorization result are both used to represent authorization, then the chain The off-chain computing contract will allow the off-chain computing contract to generate task events related to the off-chain computing task.
当链下计算合约生成所述链下计算任务的子任务之一的协作计算任务的第一任务事件后,第一任务事件将分别被第一调度引擎与第二调度引擎所监听,假设第一任务事件中同时记录有协作计算任务对应的数据提供方节点与计算提供方节点的描述信息,以及所需提供数据的代理访问引擎的标识信息、所需获取数据的链下计算引擎的标识信息、所需提供的数据的标识信息,其中,数据提供方节点的描述信息为第二区块链节点的标识信息,计算提供方节点的描述信息为第一区块链节点的标识信息。因此,第二调度引擎可以确定第二节点设备需要向第一节点设备中的链下计算引擎提供数据,于是第二调度引擎将调用代理访问引擎执行协作计算任务,将从第二数据源中获取的数据主动传输给第一节点设备中的链下计算引擎。另一边,第一调度引擎可以确定第一节点设备中部署的第一任务事件中指定的链下计算引擎需要获取第二节点设备的数据,于是第一调度引擎将调用该指定的链下计算引擎执行协作计算任务,例如,该指定的链下计算引擎为运行在可行执行环境中的可信计算引擎,其需要从第二节点设备获取数据以完成协作计算任务中定义的相关可信计算操作,此时将该可信计算引擎将通过与第二节点设备上部署的代理访问引擎之间的网络连接获取代理访问引擎发送的相关数据,从而进一步执行可信计算操作以支持继续完成协作计算任务。After the off-chain computing contract generates the first task event of the collaborative computing task that is one of the sub-tasks of the off-chain computing task, the first task event will be monitored by the first scheduling engine and the second scheduling engine respectively. Assume that the first The task event also records the description information of the data provider node and the computing provider node corresponding to the collaborative computing task, as well as the identification information of the proxy access engine that needs to provide data, the identification information of the off-chain computing engine that needs to obtain the data, The identification information of the data that needs to be provided, where the description information of the data provider node is the identification information of the second blockchain node, and the description information of the calculation provider node is the identification information of the first blockchain node. Therefore, the second scheduling engine can determine that the second node device needs to provide data to the off-chain computing engine in the first node device, so the second scheduling engine will call the proxy access engine to perform the collaborative computing task and obtain it from the second data source. The data is actively transmitted to the off-chain computing engine in the first node device. On the other hand, the first scheduling engine can determine that the off-chain computing engine specified in the first task event deployed in the first node device needs to obtain the data of the second node device, so the first scheduling engine will call the specified off-chain computing engine Execute collaborative computing tasks, for example, the designated off-chain computing engine is a trusted computing engine running in a feasible execution environment, which needs to obtain data from the second node device to complete the relevant trusted computing operations defined in the collaborative computing task, At this time, the trusted computing engine will obtain relevant data sent by the proxy access engine through the network connection with the proxy access engine deployed on the second node device, thereby further performing trusted computing operations to support continued completion of collaborative computing tasks.
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他功能所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Figure 4 is a schematic structural diagram of a device provided by 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, a memory 408 and a non-volatile memory 410. Of course, it may also include hardware required for other functions. One or more embodiments of this specification can be implemented based on software. For example, the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
如图5所示,图5是本说明书根据一示例性实施例提供的一种数据处理装置的框图,该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案;所述装置应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括第一执行逻辑获取单元501、第一授权交易发起单元502和数据获取单元503。As shown in Figure 5, Figure 5 is a block diagram of a data processing device provided in this specification according to an exemplary embodiment. The device can be applied in the equipment shown in Figure 4 to implement the technical solution of this specification; so The device is applied to a first node device deployed with a first blockchain node. The blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains a corresponding off-chain computing task. The execution logic of the node equipment where each participant node is located in the off-chain computing task; the device includes a first execution logic acquisition unit 501, a first authorized transaction initiation unit 502 and a data acquisition unit 503.
第一执行逻辑获取单元501,用于在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑。The first execution logic acquisition unit 501 is used to acquire the first node device's information on the first node device when it monitors the authorization application event generated by the off-chain computing contract and determines that the first blockchain node belongs to the first participant node. The first execution logic in off-chain computing tasks.
第一授权交易发起单元502,用于对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件。The first authorized transaction initiating unit 502 is used to approve the first execution logic to generate the first authorization result corresponding to the off-chain computing task, and initiate a transaction carrying the first authorization result to the off-chain computing contract through the first blockchain node. The first authorization transaction of the first authorization result, the off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, each authorization result corresponding to the off-chain computing task is used to represent authorization Under certain circumstances, the off-chain computing contract is allowed to generate task events related to the off-chain computing task.
数据获取单元503,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。The data acquisition unit 503 is configured to monitor the first task event generated by the off-chain computing contract. The first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the first blockchain node belongs to the In the case of the computing provider node corresponding to the collaborative computing task, the off-chain computing engine deployed by the first node device is called to execute the collaborative computing task, and the off-chain computing engine is used to: in the process of executing the collaborative computing task , obtain the data read from the second node device by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located.
可选的,所述授权申请事件中包括所述各参与方节点所处节点设备在所述链下计算 任务中的执行逻辑;所述第一执行逻辑获取单元501具体用于:从所述授权申请事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑。Optionally, the authorization application event includes the execution logic of the node device where each participant node is located in the off-chain computing task; the first execution logic acquisition unit 501 is specifically used to: obtain the authorization from the In the application event, the first execution logic of the first node device in the off-chain computing task is read.
可选的,第一执行逻辑包括:第一节点设备上部署的各资源引擎的被调用情况和/或所述各资源引擎与其他节点设备部署的其他资源引擎之间的数据交互情况。Optionally, the first execution logic includes: the calling status of each resource engine deployed on the first node device and/or the data interaction status between each resource engine and other resource engines deployed on other node devices.
可选的,所述第一执行逻辑获取单元501具体用于:向所述链下计算合约发起执行逻辑查询交易,监听所述链下计算合约响应于所述执行逻辑查询交易生成的执行逻辑查询事件,从所述执行逻辑查询事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑,所述执行逻辑查询事件记录有第一节点设备在所述链下计算任务中的第一执行逻辑或所述各参与方节点所处节点设备在所述链下计算任务中的执行逻辑。Optionally, the first execution logic acquisition unit 501 is specifically configured to: initiate an execution logic query transaction to the off-chain computing contract, and monitor the execution logic query generated by the off-chain computing contract in response to the execution logic query transaction. event, the first execution logic of the first node device in the off-chain computing task is read from the execution logic query event, and the execution logic query event records that the first node device is in the off-chain computing task The first execution logic or the execution logic of the node device where each participant node is located in the off-chain computing task.
可选的,所述链下计算合约在部署成功的初始化阶段或响应于授权申请交易的情况下用于触发生成所述授权申请事件。Optionally, the off-chain computing contract is used to trigger the generation of the authorization application event during the initialization phase of successful deployment or in response to an authorization application transaction.
可选的,所述链下计算合约维护有所述链下计算任务对应的任务完成状态,所述任务完成状态用于描述所述链下计算任务包含的各子任务的完成状态,所述链下计算任务相关的区块链事件包括所述各子任务对应的任务事件;在所述协作计算任务属于所述链下计算任务的子任务的情况下,所述第一执行逻辑获取单元501具体用于:监听到所述链下计算合约在所述任务完成状态满足所述协作计算任务对应的执行条件的情况下生成的针对所述协作计算任务的第一任务事件。Optionally, the off-chain computing contract maintains a task completion status corresponding to the off-chain computing task. The task completion status is used to describe the completion status of each sub-task included in the off-chain computing task. The chain Blockchain events related to the off-chain computing task include task events corresponding to each sub-task; when the collaborative computing task belongs to a sub-task of the off-chain computing task, the first execution logic acquisition unit 501 specifically Used to: monitor the first task event generated by the off-chain computing contract for the collaborative computing task when the task completion status satisfies the execution condition corresponding to the collaborative computing task.
可选的,所述任务完成状态由所述链下计算合约响应于所述链下计算任务对应的交易触发更新,其中,所述链下计算任务对应的交易包括所述链下计算任务对应的任务创建交易,或者任一节点设备在对所述各子任务中任一子任务执行完毕的情况下发起的结果返回交易。Optionally, the task completion status is updated by the off-chain computing contract in response to a transaction corresponding to the off-chain computing task, where the transaction corresponding to the off-chain computing task includes the transaction corresponding to the off-chain computing task. A task creation transaction, or a result return transaction initiated by any node device after completing the execution of any of the subtasks.
可选的,第一任务事件中记录有所述数据提供方节点和所述计算提供方节点的描述信息。Optionally, description information of the data provider node and the computing provider node is recorded in the first task event.
可选的,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将数据访问请求与所述数据访问请求对应的授权凭证发送至所述代理访问引擎;所述代理访问引擎用于:在执行所述协作计算任务的过程中,接收所述数据访问请求与所述授权凭证,并在确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务的情况下,将从第二节点设备读取到的所述数据发送至所述链下计算引擎。Optionally, the off-chain computing engine is also configured to: in the process of executing the collaborative computing task, send a data access request and an authorization credential corresponding to the data access request to the proxy access engine; the proxy The access engine is configured to: receive the data access request and the authorization credential during the execution of the collaborative computing task, and determine that the authorization credential is used to indicate that the data access request is for the collaborative computing task. In the case of , the data read from the second node device is sent to the off-chain computing engine.
可选的,第一任务事件记录有所述协作计算任务的标识信息,所述授权凭证包括所述标识信息,所述代理访问引擎用于在所述授权凭证包括所述标识信息的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。Optionally, the first task event records the identification information of the collaborative computing task, and the authorization voucher includes the identification information. The proxy access engine is used to, when the authorization voucher includes the identification information, The authorization credentials are determined to indicate that the data access request is for the collaborative computing task.
可选的,第一任务事件记录有所述协作计算任务对应的任务公钥和任务私钥密文,其中,所述任务私钥密文通过使用所述链下计算引擎对应的公钥对所述协作计算任务对应的任务私钥进行加密得到;所述授权凭证包括使用所述任务私钥对所述数据访问请求进行签名得到的第一数字签名,所述任务私钥由所述链下计算引擎使用所述链下计算引擎对应的私钥对所述任务私钥密文进行解密得到;所述代理访问引擎用于在使用第一任务事件中记录的所述任务公钥对所述第一数字签名验签成功的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。Optionally, the first task event records the task public key and task private key ciphertext corresponding to the collaborative computing task, wherein the task private key ciphertext is obtained by using the public key pair corresponding to the off-chain computing engine. The task private key corresponding to the collaborative computing task is encrypted; the authorization certificate includes the first digital signature obtained by using the task private key to sign the data access request, and the task private key is calculated by the off-chain The engine uses the private key corresponding to the off-chain computing engine to decrypt the task private key ciphertext; the proxy access engine is used to use the task public key recorded in the first task event to decrypt the first task public key. If the digital signature verification is successful, it is determined that the authorization certificate is used to indicate that the data access request is directed to the collaborative computing task.
可选的,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将使用所述链下计算引擎对应的私钥对所述数据访问请求进行签名得到的第二数字签名发送至所述代理访问引擎;所述代理访问引擎还用于:在执行所述协作计算任务的过程中,使用所述链下计算引擎对应的公钥对接收到的第二数字签名进行验签,在验签成功且确定所述链下计算引擎具有第一节点设备的访问权限的情况下,确定所述授权凭证有效。Optionally, the off-chain computing engine is also configured to: in the process of executing the collaborative computing task, use the private key corresponding to the off-chain computing engine to sign the second number obtained by signing the data access request. The signature is sent to the proxy access engine; the proxy access engine is also configured to: use the public key corresponding to the off-chain computing engine to verify the received second digital signature during the execution of the collaborative computing task. If the signature verification is successful and it is determined that the off-chain computing engine has access rights to the first node device, it is determined that the authorization certificate is valid.
如图6所示,图6是本说明书根据一示例性实施例提供的一种数据处理装置的框图, 该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案;所述装置应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括第二执行逻辑获取单元601、第二授权交易发起单元602和数据提供单元603。As shown in Figure 6, Figure 6 is a block diagram of a data processing device provided in this specification according to an exemplary embodiment. This device can be applied to the equipment shown in Figure 4 to implement the technical solution of this specification; so The device is applied to a second node device deployed with a second blockchain node. The blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains a corresponding off-chain computing task. The execution logic of the node device where each participant node is located in the off-chain computing task; the device includes a second execution logic acquisition unit 601, a second authorized transaction initiation unit 602 and a data providing unit 603.
第二执行逻辑获取单元601,用于在监听到所述链下计算合约生成的授权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑。The second execution logic acquisition unit 601 is configured to acquire the second node device's information on the second node device when it monitors the authorization application event generated by the off-chain computing contract and determines that the second blockchain node belongs to the second participant node. The second execution logic in off-chain computing tasks.
第二授权交易发起单元602,用于对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件。The second authorized transaction initiating unit 602 is used to approve the second execution logic to generate the second authorization result corresponding to the off-chain computing task, and initiate an authorization carrying the transaction information to the off-chain computing contract through the second blockchain node. For the second authorization transaction of the second authorization result, the off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, each authorization result corresponding to the off-chain computing task is used to represent authorization. Under certain circumstances, the off-chain computing contract is allowed to generate task events related to the off-chain computing task.
数据提供单元603,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。The data providing unit 603 is configured to monitor the first task event generated by the off-chain computing contract. The first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the second blockchain node belongs to the In the case of the data provider node corresponding to the collaborative computing task, the proxy access engine deployed on the second node device is called to execute the collaborative computing task. The proxy access engine is used to: during the process of executing the collaborative computing task, The data read from the second node device is provided to an off-chain computing engine deployed on the first node device where the computing provider node corresponding to the collaborative computing task is located.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements in a technology could be clearly distinguished as hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method processes). However, with the development of technology, many improvements in today's method processes can be regarded as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement of a method flow cannot be implemented using hardware entity modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic functions are determined by the user programming the device. Designers can program themselves to "integrate" a digital system on a PLD, instead of asking chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing, and before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and HDL is not just one kind, but there are many, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., are currently the most commonly used The two are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that by simply logically programming the method flow using the above-mentioned hardware description languages and programming it into the integrated circuit, the hardware circuit that implements the logical method flow can be easily obtained.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等 的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本公开不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this disclosure does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-inventive means. The sequence of steps listed in the embodiment is only one way of executing the sequence of many steps, and does not represent the only execution sequence. When the actual device or terminal product is executed, it may be executed sequentially or in parallel according to the methods shown in the embodiments or figures (for example, a parallel processor or a multi-thread processing environment, or even a distributed data processing environment). The terms "comprises," "comprises" or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, product or apparatus including a list of elements includes not only those elements but also others not expressly listed elements, or also elements inherent to the process, method, product or equipment. Without further limitation, it does not exclude the presence of additional identical or equivalent elements in a process, method, product or apparatus including the stated elements. For example, if the words "first" and "second" are used to express names, they do not indicate any specific order.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing one or more of this specification, the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. . The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
本公开是参照根据本公开实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非 易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information. Information may be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory. (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape, magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include transient computer-readable media (transitory media), such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner. The same and similar parts between the various embodiments can be referred to each other. Each embodiment focuses on its differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of this specification. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。The above descriptions are only examples of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. To those skilled in the art, various modifications and changes may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification shall be included in the scope of the claims.

Claims (17)

  1. 一种数据处理方法,应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括:A data processing method, applied to a first node device deployed with a first blockchain node. The blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract, and the off-chain computing contract maintains a chain The execution logic of the node device where each participant node corresponding to the off-chain computing task is located in the off-chain computing task; the method includes:
    在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑;After monitoring the authorization application event generated by the off-chain computing contract and determining that the first blockchain node belongs to the first participant node, obtain the first execution logic of the first node device in the off-chain computing task ;
    对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;Approving the first execution logic to generate the first authorization result corresponding to the off-chain computing task, and initiating the first authorization transaction carrying the first authorization result to the off-chain computing contract through the first blockchain node, The off-chain computing contract is used to: respond to the authorization transactions initiated by each participant node, and allow the off-chain calculation when each authorization result corresponding to the off-chain computing task is used to represent the authorization. The contract generates task events related to the off-chain computing tasks;
    监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。Monitor the first task event generated by the off-chain computing contract, and the first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the first blockchain node belongs to the computing provider corresponding to the collaborative computing task In the case of a square node, the off-chain computing engine deployed by the first node device is called to execute the collaborative computing task. The off-chain computing engine is used to: obtain the collaborative computing task during the process of executing the collaborative computing task. The proxy access engine deployed on the second node device where the corresponding data provider node is located accesses the data read from the second node device.
  2. 根据权利要求1所述的方法,所述授权申请事件中包括所述各参与方节点所处节点设备在所述链下计算任务中的执行逻辑;所述获取第一节点设备在所述链下计算任务中的第一执行逻辑,包括:The method according to claim 1, the authorization application event includes the execution logic of the node device where each participant node is located in the off-chain computing task; the obtaining of the off-chain computing task of the first node device The first execution logic in the computing task includes:
    从所述授权申请事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑。The first execution logic of the first node device in the off-chain computing task is read from the authorization application event.
  3. 根据权利要求1所述的方法,第一执行逻辑包括:第一节点设备上部署的各资源引擎的被调用情况和/或所述各资源引擎与其他节点设备部署的其他资源引擎之间的数据交互情况。According to the method of claim 1, the first execution logic includes: the calling status of each resource engine deployed on the first node device and/or the data between each resource engine and other resource engines deployed on other node devices. interaction situation.
  4. 根据权利要求1所述的方法,所述获取第一节点设备在所述链下计算任务中的第一执行逻辑,包括:According to the method of claim 1, said obtaining the first execution logic of the first node device in the off-chain computing task includes:
    向所述链下计算合约发起执行逻辑查询交易,监听所述链下计算合约响应于所述执行逻辑查询交易生成的执行逻辑查询事件,从所述执行逻辑查询事件中读取第一节点设备在所述链下计算任务中的第一执行逻辑,所述执行逻辑查询事件记录有第一节点设备在所述链下计算任务中的第一执行逻辑或所述各参与方节点所处节点设备在所述链下计算任务中的执行逻辑。Initiate an execution logic query transaction to the off-chain computing contract, monitor the execution logic query event generated by the off-chain computing contract in response to the execution logic query transaction, and read the execution logic query event of the first node device from the execution logic query event. The first execution logic in the off-chain computing task, the execution logic query event records the first execution logic of the first node device in the off-chain computing task or the node device where each participant node is located. Execution logic in the off-chain computing tasks.
  5. 根据权利要求1所述的方法,所述链下计算合约在部署成功的初始化阶段或响应于授权申请交易的情况下用于触发生成所述授权申请事件。According to the method of claim 1, the off-chain computing contract is used to trigger the generation of the authorization application event during the initialization phase of successful deployment or in response to an authorization application transaction.
  6. 根据权利要求1所述的方法,所述链下计算合约维护有所述链下计算任务对应的任务完成状态,所述任务完成状态用于描述所述链下计算任务包含的各子任务的完成状态,所述链下计算任务相关的区块链事件包括所述各子任务对应的任务事件;在所述协作计算任务属于所述链下计算任务的子任务的情况下,所述监听到第一任务事件,包括:According to the method of claim 1, the off-chain computing contract maintains a task completion status corresponding to the off-chain computing task, and the task completion status is used to describe the completion of each sub-task included in the off-chain computing task. status, the blockchain events related to the off-chain computing task include task events corresponding to each sub-task; in the case that the collaborative computing task belongs to the sub-task of the off-chain computing task, the monitoring of the A task event includes:
    监听到所述链下计算合约在所述任务完成状态满足所述协作计算任务对应的执行条件的情况下生成的针对所述协作计算任务的第一任务事件。Monitor the first task event generated by the off-chain computing contract for the collaborative computing task when the task completion status satisfies the execution conditions corresponding to the collaborative computing task.
  7. 根据权利要求6所述的方法,所述任务完成状态由所述链下计算合约响应于所述链下计算任务对应的交易触发更新,其中,所述链下计算任务对应的交易包括所述链下计算任务对应的任务创建交易,或者任一节点设备在对所述各子任务中任一子任务执行完毕的情况下发起的结果返回交易。According to the method of claim 6, the task completion status is updated by the off-chain computing contract in response to a transaction corresponding to the off-chain computing task, wherein the transaction corresponding to the off-chain computing task includes the off-chain computing task. The task creation transaction corresponding to the next computing task, or the result return transaction initiated by any node device after completing the execution of any of the subtasks.
  8. 根据权利要求1所述的方法,第一任务事件中记录有所述数据提供方节点和所述计算提供方节点的描述信息。According to the method of claim 1, description information of the data provider node and the computing provider node is recorded in the first task event.
  9. 根据权利要求1所述的方法,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将数据访问请求与所述数据访问请求对应的授权凭证发送至所述代理访 问引擎;According to the method of claim 1, the off-chain computing engine is further configured to: in the process of executing the collaborative computing task, send a data access request and an authorization certificate corresponding to the data access request to the proxy access engine;
    所述代理访问引擎用于:在执行所述协作计算任务的过程中,接收所述数据访问请求与所述授权凭证,并在确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务的情况下,将从第二节点设备读取到的所述数据发送至所述链下计算引擎。The proxy access engine is configured to: receive the data access request and the authorization credential during the execution of the collaborative computing task, and determine that the authorization credential is used to indicate that the data access request is for the In the case of collaborative computing tasks, the data read from the second node device is sent to the off-chain computing engine.
  10. 根据权利要求9所述的方法,第一任务事件记录有所述协作计算任务的标识信息,所述授权凭证包括所述标识信息,所述代理访问引擎用于在所述授权凭证包括所述标识信息的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。The method according to claim 9, the first task event is recorded with identification information of the collaborative computing task, the authorization voucher includes the identification information, and the proxy access engine is configured to include the identification information in the authorization voucher. In the case of information, it is determined that the authorization credentials are used to indicate that the data access request is for the collaborative computing task.
  11. 根据权利要求9所述的方法,第一任务事件记录有所述协作计算任务对应的任务公钥和任务私钥密文,其中,所述任务私钥密文通过使用所述链下计算引擎对应的公钥对所述协作计算任务对应的任务私钥进行加密得到;According to the method of claim 9, the first task event records the task public key and task private key ciphertext corresponding to the collaborative computing task, wherein the task private key ciphertext corresponds to the off-chain computing engine by using the off-chain computing engine. The public key is obtained by encrypting the task private key corresponding to the collaborative computing task;
    所述授权凭证包括使用所述任务私钥对所述数据访问请求进行签名得到的第一数字签名,所述任务私钥由所述链下计算引擎使用所述链下计算引擎对应的私钥对所述任务私钥密文进行解密得到;The authorization certificate includes a first digital signature obtained by signing the data access request using the task private key, which is generated by the off-chain computing engine using the corresponding private key pair of the off-chain computing engine. The task private key ciphertext is decrypted and obtained;
    所述代理访问引擎用于在使用第一任务事件中记录的所述任务公钥对所述第一数字签名验签成功的情况下,确定所述授权凭证用于表明所述数据访问请求针对于所述协作计算任务。The proxy access engine is configured to determine that the authorization certificate is used to indicate that the data access request is for the first digital signature when the first digital signature is successfully verified using the task public key recorded in the first task event. The collaborative computing task.
  12. 根据权利要求9所述的方法,所述链下计算引擎还用于:在执行所述协作计算任务的过程中,将使用所述链下计算引擎对应的私钥对所述数据访问请求进行签名得到的第二数字签名发送至所述代理访问引擎;According to the method of claim 9, the off-chain computing engine is further configured to: use the private key corresponding to the off-chain computing engine to sign the data access request during the execution of the collaborative computing task. The obtained second digital signature is sent to the proxy access engine;
    所述代理访问引擎还用于:在执行所述协作计算任务的过程中,使用所述链下计算引擎对应的公钥对接收到的第二数字签名进行验签,在验签成功且确定所述链下计算引擎具有第一节点设备的访问权限的情况下,确定所述授权凭证有效。The proxy access engine is also configured to: use the public key corresponding to the off-chain computing engine to verify the received second digital signature during the execution of the collaborative computing task. When the signature verification is successful and the signature is determined, When the off-chain computing engine has access rights to the first node device, it is determined that the authorization certificate is valid.
  13. 一种数据处理方法,应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述方法包括:A data processing method applied to a second node device deployed with a second blockchain node. The blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract, and the off-chain computing contract maintains a chain. The execution logic of the node device where each participant node corresponding to the off-chain computing task is located in the off-chain computing task; the method includes:
    在监听到所述链下计算合约生成的授权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑;After monitoring the authorization application event generated by the off-chain computing contract and determining that the second blockchain node belongs to the second participant node, obtain the second execution logic of the second node device in the off-chain computing task ;
    对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;Approving the second execution logic to generate the second authorization result corresponding to the off-chain computing task, and initiating a second authorization transaction carrying the second authorization result to the off-chain computing contract through the second blockchain node, The off-chain computing contract is used to: respond to the authorization transactions initiated by each participant node, and allow the off-chain calculation when each authorization result corresponding to the off-chain computing task is used to represent the authorization. The contract generates task events related to the off-chain computing tasks;
    监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。Monitor the first task event generated by the off-chain computing contract, and the first task event corresponds to the collaborative computing task related to the off-chain computing task; provide data corresponding to the collaborative computing task after determining that the second blockchain node belongs to In the case of a square node, call the proxy access engine deployed on the second node device to execute the collaborative computing task. The proxy access engine is used to: during the process of executing the collaborative computing task, read from the second node device. The obtained data is provided to the off-chain computing engine deployed on the first node device where the computing provider node corresponding to the collaborative computing task is located.
  14. 一种数据处理装置,应用于部署有第一区块链节点的第一节点设备,第一区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括:A data processing device applied to a first node device where a first blockchain node is deployed. The blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains a chain The execution logic of the node device where each participant node corresponding to the off-chain computing task is located in the off-chain computing task; the device includes:
    第一执行逻辑获取单元,用于在监听到所述链下计算合约生成的授权申请事件且确定第一区块链节点属于第一参与方节点的情况下,获取第一节点设备在所述链下计算任务中的第一执行逻辑;The first execution logic acquisition unit is used to acquire the first node device in the chain when it monitors the authorization application event generated by the off-chain computing contract and determines that the first blockchain node belongs to the first participant node. The first execution logic in the next computing task;
    第一授权交易发起单元,用于对第一执行逻辑进行审批以生成所述链下计算任务对应的第一授权结果,并通过第一区块链节点向所述链下计算合约发起携带有第一授权结果的第一授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权 交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;The first authorized transaction initiating unit is used to approve the first execution logic to generate the first authorization result corresponding to the off-chain computing task, and initiate a transaction carrying the first authorization result to the off-chain computing contract through the first blockchain node. The first authorization transaction of an authorization result, the off-chain computing contract is used to: in response to the authorization transaction initiated by each participant node, each authorization result corresponding to the off-chain computing task is used to represent the authorization pass In this case, allow the off-chain computing contract to generate task events related to the off-chain computing task;
    数据获取单元,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第一区块链节点属于所述协作计算任务对应的计算提供方节点的情况下,调用第一节点设备部署的链下计算引擎执行所述协作计算任务,所述链下计算引擎用于:在执行所述协作计算任务的过程中,获取所述协作计算任务对应的数据提供方节点所处的第二节点设备上部署的代理访问引擎从第二节点设备读取到的数据。A data acquisition unit configured to monitor the first task event generated by the off-chain computing contract, where the first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the first blockchain node belongs to the collaboration In the case of the computing provider node corresponding to the computing task, the off-chain computing engine deployed by the first node device is called to execute the collaborative computing task. The off-chain computing engine is used to: in the process of executing the collaborative computing task, Obtain the data read from the second node device by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located.
  15. 一种数据处理装置应用于部署有第二区块链节点的第二节点设备,第二区块链节点所属的区块链网络部署有链下计算合约,所述链下计算合约维护有链下计算任务对应的各参与方节点所处的节点设备在所述链下计算任务中的执行逻辑;所述装置包括:A data processing device is applied to a second node device deployed with a second blockchain node. The blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract. The off-chain computing contract maintains an off-chain computing contract. The execution logic of the node device where each participant node corresponding to the computing task is located in the off-chain computing task; the device includes:
    第二执行逻辑获取单元,用于在监听到所述链下计算合约生成的授权申请事件且确定第二区块链节点属于第二参与方节点的情况下,获取第二节点设备在所述链下计算任务中的第二执行逻辑;The second execution logic acquisition unit is used to acquire the information of the second node device on the chain when it monitors the authorization application event generated by the off-chain computing contract and determines that the second blockchain node belongs to the second participant node. The second execution logic in the lower calculation task;
    第二授权交易发起单元,用于对第二执行逻辑进行审批以生成所述链下计算任务对应的第二授权结果,并通过第二区块链节点向所述链下计算合约发起携带有第二授权结果的第二授权交易,所述链下计算合约用于:响应于所述各参与方节点分别发起的授权交易,在所述链下计算任务对应的各授权结果均用于表征授权通过情况下,允许所述链下计算合约生成所述链下计算任务相关的任务事件;The second authorized transaction initiating unit is used to approve the second execution logic to generate the second authorization result corresponding to the off-chain computing task, and initiate a transaction carrying the third authorization result to the off-chain computing contract through the second blockchain node. A second authorization transaction with two authorization results. The off-chain computing contract is used to: in response to the authorization transactions initiated by each participant node, each authorization result corresponding to the off-chain computing task is used to represent the authorization pass. In this case, allow the off-chain computing contract to generate task events related to the off-chain computing task;
    数据提供单元,用于监听所述链下计算合约生成的第一任务事件,第一任务事件对应于所述链下计算任务相关的协作计算任务;在确定第二区块链节点属于所述协作计算任务对应的数据提供方节点的情况下,调用第二节点设备部署的代理访问引擎执行所述协作计算任务,所述代理访问引擎用于:在执行所述协作计算任务的过程中,将从第二节点设备读取到的数据提供至所述协作计算任务对应的计算提供方节点所处的第一节点设备部署的链下计算引擎。A data providing unit configured to monitor the first task event generated by the off-chain computing contract, where the first task event corresponds to the collaborative computing task related to the off-chain computing task; after determining that the second blockchain node belongs to the collaboration In the case of the data provider node corresponding to the computing task, the proxy access engine deployed on the second node device is called to execute the collaborative computing task. The proxy access engine is used to: in the process of executing the collaborative computing task, from The data read by the second node device is provided to the off-chain computing engine deployed by the first node device where the computing provider node corresponding to the collaborative computing task is located.
  16. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory used to store instructions executable by the processor;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-13中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 1-13 by running the executable instructions.
  17. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-13中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which when executed by a processor, implements the steps of the method according to any one of claims 1-13.
PCT/CN2022/135229 2022-04-29 2022-11-30 Data processing method and apparatus, electronic device, and storage medium WO2023207078A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210474321.XA CN114896639A (en) 2022-04-29 2022-04-29 Data processing method and device, electronic equipment and storage medium
CN202210474321.X 2022-04-29

Publications (1)

Publication Number Publication Date
WO2023207078A1 true WO2023207078A1 (en) 2023-11-02

Family

ID=82720177

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135229 WO2023207078A1 (en) 2022-04-29 2022-11-30 Data processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114896639A (en)
WO (1) WO2023207078A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725622A (en) * 2024-02-18 2024-03-19 北京安华金和科技有限公司 Rights control method and system for multiparty security calculation

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896639A (en) * 2022-04-29 2022-08-12 蚂蚁区块链科技(上海)有限公司 Data processing method and device, electronic equipment and storage medium
CN115514726B (en) * 2022-09-21 2024-02-20 浪潮云信息技术股份公司 NATS-based cloud edge scene file synchronization system
CN116506227B (en) * 2023-06-27 2023-09-19 腾讯科技(深圳)有限公司 Data processing method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090875A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Contract deployment method and device
CN111898153A (en) * 2020-03-18 2020-11-06 支付宝(杭州)信息技术有限公司 Contract calling method and device
US20200382301A1 (en) * 2019-05-31 2020-12-03 International Business Machines Corporation Anonymous rating structure for database
CN112241884A (en) * 2020-09-21 2021-01-19 西安电子科技大学 Alliance chain-based link security payment method, system, medium and equipment
CN114896639A (en) * 2022-04-29 2022-08-12 蚂蚁区块链科技(上海)有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200382301A1 (en) * 2019-05-31 2020-12-03 International Business Machines Corporation Anonymous rating structure for database
CN111090875A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Contract deployment method and device
CN111898153A (en) * 2020-03-18 2020-11-06 支付宝(杭州)信息技术有限公司 Contract calling method and device
CN112241884A (en) * 2020-09-21 2021-01-19 西安电子科技大学 Alliance chain-based link security payment method, system, medium and equipment
CN114896639A (en) * 2022-04-29 2022-08-12 蚂蚁区块链科技(上海)有限公司 Data processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725622A (en) * 2024-02-18 2024-03-19 北京安华金和科技有限公司 Rights control method and system for multiparty security calculation
CN117725622B (en) * 2024-02-18 2024-04-30 北京安华金和科技有限公司 Rights control method and system for multiparty security calculation

Also Published As

Publication number Publication date
CN114896639A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN110457875B (en) Data authorization method and device based on block chain
CN113438289B (en) Block chain data processing method and device based on cloud computing
WO2023207078A1 (en) Data processing method and apparatus, electronic device, and storage medium
TWI696367B (en) Communication method and device between blockchain nodes
CN110473094B (en) Data authorization method and device based on block chain
TWI696933B (en) Data processing method, device, server and system for blockchain member management
WO2021239104A1 (en) Blockchain-based service processing
WO2021184963A1 (en) Contract calling method and apparatus
WO2021184973A1 (en) External data accessing method and device
TWI723261B (en) Data storage method, data query method and device
CN110033267B (en) Method, node, system and storage medium for implementing privacy protection in block chain
CN110020855B (en) Method, node and storage medium for realizing privacy protection in block chain
CN109886682B (en) Method, node and storage medium for realizing contract calling in block chain
TW201917666A (en) Data auditing method and device
CN110008735B (en) Method, node and storage medium for realizing contract calling in block chain
TW201947910A (en) Blockchain data processing methods, apparatuses, processing devices, and systems
TW201911099A (en) Block chain node communication method and device
CN110060054B (en) Method, node, system and storage medium for implementing privacy protection in block chain
CN110580413A (en) Private data query method and device based on down-link authorization
WO2020233626A1 (en) Receipt storage method and node in combination with conditional limitation of transaction and user types
CN110245942B (en) Receipt storage method and node combining user type and judgment condition
TW201822033A (en) Resource processing method and apparatus
CN110020856B (en) Method, node and storage medium for realizing mixed transaction in block chain
WO2020233635A1 (en) Receipt storage method combining conditional restrictions of multiple types of dimensions and node
CN111523110A (en) Permission query configuration method and device based on chain codes

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22939892

Country of ref document: EP

Kind code of ref document: A1