Data processing method, device, electronic device and storage medium
By listening to key updates and task events in the blockchain network, updating the public key of the off-chain computing engine, and transmitting data through encryption, the security risks of data exposure in collaborative computing tasks are solved, and the security and privacy protection of data transmission are achieved.
Patent Information
- Application Number
- CN202210345699.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-03-31
AI Technical Summary
In the blockchain network, the data of node devices in collaborative computing tasks need to be read by external node devices, resulting in data sources being exposed, and there are privacy information leakage and security risks.
By listening to off-chain computing contracts generated by the key update event and the task events of the collaborative computing task, obtain the latest public key of the off-chain computing engine, and update the proof public key through the key update transaction. At the same time, the off-chain computing engine is called to perform collaborative computing tasks, encrypting and transmitting data through the proxy access engine to avoid direct exposure of the data source.
It effectively avoids direct data transmission between node devices, reduces the risk of private information leakage, and enhances the security of data transmission.
Smart Images

Figure CN114741736B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of blockchain technology, and in particular, relate to a data processing method, device, electronic device and storage medium. Background Art
[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time sequence, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography. Due to the characteristics of blockchain such as decentralization, information cannot be tampered with, and autonomy, blockchain has also received more and more attention and application.
[0003] The blockchain network can undertake off-chain computing tasks based on the definition of smart contracts. At this time, each node device in the blockchain network will call the locally deployed off-chain computing engine under the guidance of the events generated by the smart contract to implement the off-chain computing tasks. For collaborative computing tasks, that is, off-chain computing tasks that require multiple node devices to work together to complete, there is often a need for the data in a certain node device to be read by the off-chain computing engine in another external node device. Therefore, it is necessary to directly expose the local data source to the external node device, so that the external node device can directly obtain the required data through the data source. At this time, it is equivalent to opening the local data source of a certain node device to the outside, which is easy to cause privacy information leakage and poses a greater security risk. Summary of the invention
[0004] The object of the present invention is to provide a data processing method, device, electronic device and storage medium.
[0005] 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 deployed with a first blockchain node, and the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the method includes:
[0006] In the case of monitoring the key update event generated by the off-chain computing contract, obtaining the latest public key corresponding to the off-chain computing engine deployed by the first node device, and initiating a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node, so as to update the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key;
[0007] In the case of monitoring a task event generated by the off-chain computing contract for a collaborative computing task and determining that the first blockchain node belongs to a computing provider node corresponding to the collaborative computing task, calling the off-chain computing engine to execute the collaborative computing task, the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain encrypted data sent by a proxy access engine deployed on a second node device where the data provider node corresponding to the collaborative computing task is located, the encrypted data being obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
[0008] According to a 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 the blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract; the method includes:
[0009] Listen to the task events generated by the off-chain computing contract for the collaborative computing task; wherein the off-chain computing contract maintains the evidence public key corresponding 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, and the evidence public key is triggered to update by the key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when listening to the key update event generated by the off-chain computing contract, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event;
[0010] 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 to execute the collaborative computing task. The proxy access engine is used to: in the process of executing the collaborative computing task, obtain the stored public key from the off-chain computing contract, and encrypt the data read from the second node device by the stored public key and send the encrypted data obtained to the off-chain computing engine.
[0011] According to a third aspect of one or more embodiments of this specification, a data processing device is proposed, which is applied to a first node device deployed with a first blockchain node, and the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the device includes:
[0012] The evidence public key update unit is used to obtain the latest public key corresponding to the off-chain computing engine deployed by the first node device when monitoring the key update event generated by the off-chain computing contract, and initiate a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node, so as to update the evidence public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key;
[0013] An encrypted data acquisition unit is used to call the off-chain computing engine to execute the collaborative computing task when monitoring the task event generated by the off-chain computing contract for the collaborative computing task and determining that the first blockchain node belongs to the computing provider node corresponding to the collaborative computing task. The off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain the encrypted data sent by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located, and the encrypted data is obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
[0014] According to a fourth aspect of one or more embodiments of this specification, a data processing device is proposed, which 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 with an off-chain computing contract; the device includes:
[0015] An event monitoring unit, used to monitor task events generated by the off-chain computing contract for collaborative computing tasks; wherein the off-chain computing contract maintains a stored public key corresponding to an off-chain computing engine deployed on a first node device where the computing provider node corresponding to the collaborative computing task is located, and the stored public key is updated by a key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when monitoring the key update event generated by the off-chain computing contract, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event;
[0016] An encrypted data sending unit is used to call the proxy access engine deployed by the second node device to execute the collaborative 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 is used to: in the process of executing the collaborative computing task, obtain the stored public key from the off-chain computing contract, and encrypt the data read from the second node device by the stored public key and send the encrypted data obtained to the off-chain computing engine.
[0017] According to a fifth aspect of one or more embodiments of this specification, an electronic device is provided, including:
[0018] processor;
[0019] a memory for storing processor-executable instructions;
[0020] The processor implements the method as described in the first aspect or the second aspect by running the executable instructions.
[0021] According to a sixth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0022] S102: When a key update event generated by the off-chain computing contract is monitored, the latest public key corresponding to the off-chain computing engine deployed by the first node device is obtained, and a key update transaction carrying the latest public key is initiated to the off-chain computing contract through the first blockchain node to update the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key.
[0023] S104: When monitoring a task event generated by the off-chain computing contract for a collaborative computing task and determining that the first blockchain node belongs to a computing provider node corresponding to the collaborative computing task, calling the off-chain computing engine to execute the collaborative computing task, the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain encrypted data sent by a proxy access engine deployed on a second node device where the data provider node corresponding to the collaborative computing task is located, the encrypted data is obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
[0024] In the embodiments of the present specification, the second node device where the computing provider node is located timely maintains the public key of the off-chain computing engine deployed by itself into the off-chain computing contract through the task decentralization mechanism of the off-chain computing contract, so that when the first node device where the data provider node is located needs to provide local data to the second node device, the proxy access engine deployed on the first node device can be used to encrypt the data read locally from the first node device and then transmit it to the second node device, thereby avoiding direct exposure of the local data source of the first node device to the second node device. At the same time, since the data transmitted in the network is encrypted data, it is possible to avoid exposure of privacy information as much as possible and reduce security risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0026] Figure 1 It is a flowchart of a data processing method provided by an exemplary embodiment.
[0027] Figure 2 is a flowchart of another data processing method provided by an exemplary embodiment.
[0028] Figure 3 This is a schematic diagram of a scenario of node device interaction provided by an exemplary embodiment.
[0029] Figure 4 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0030] Figure 5 It is a block diagram of a data processing device provided by an exemplary embodiment.
[0031] Figure 6 is a block diagram of another data processing device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0032] 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 drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0033] Figure 1 This is a flowchart of a data processing method provided by an exemplary embodiment. The method is applied to a first node device deployed with a first blockchain node, and the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the method includes:
[0034] S102: When a key update event generated by the off-chain computing contract is monitored, the latest public key corresponding to the off-chain computing engine deployed by the first node device is obtained, and a key update transaction carrying the latest public key is initiated to the off-chain computing contract through the first blockchain node to update the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key.
[0035] In an embodiment of the present specification, the public key corresponding to the off-chain computing engine maintained by the off-chain computing contract is triggered to be updated by a key update transaction initiated by the first computing device, the key update transaction is initiated by the first computing device when the key update event generated by the off-chain computing contract is monitored, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event. In an embodiment of the present specification, when the first node device determines that it has deployed an off-chain computing engine whose key is to be updated based on the monitored key update event, for example, the key update event records the description information of the participant node involved in the key update task or the identification information of the off-chain computing engine whose key is to be updated, the first node device can determine whether it needs to perform the key update task by judging whether the blockchain node deployed by itself is included in the description information of the participant node, or judging whether there is identification information of the off-chain computing engine deployed by itself in the key update event. When any node device executes a key update task, it needs to access the off-chain computing engine of the key to be updated that is deployed locally and obtain its corresponding latest public key, then carry the latest public key in the key update transaction, and finally initiate the key update transaction to the off-chain computing contract, so that the off-chain computing contract triggers the update of the stored public key of the corresponding off-chain computing engine maintained by itself, that is, the stored public key of the off-chain computing engine pointed to by the key update transaction originally maintained in the off-chain computing contract is replaced with the latest public key of the off-chain computing contract carried in the key update transaction. Through the embodiments of this specification, the public key information of the off-chain computing engine deployed in the node device is maintained in the off-chain computing contract through the event monitoring mechanism and the transaction feedback mechanism, so that the public keys of each off-chain computing engine participating in the off-chain computing task can be stored on the chain and updated in real time, thereby ensuring the authority and validity of the public keys obtained by each subject participating in the execution of the off-chain computing task.
[0036] Furthermore, the off-chain computing contract is used to trigger the generation of the key update event during the initialization phase of successful deployment or in response to a key reset transaction. In the embodiment of the present specification, when the off-chain computing contract is successfully deployed on any node device, the off-chain computing contract will trigger the execution of the initialization program, which includes the generation of a key update event, so that the off-chain computing contract can timely update the stored public key of the off-chain computing engine participating in the off-chain computing task in each newly added node device. In addition, any node device can also actively initiate a key reset transaction to the off-chain computing contract, so that the off-chain computing contract triggers the generation of a key update event in response to the key reset transaction to be listened to by each node device, thereby responding to the situation where the latest public key of the off-chain computing engine participating in the off-chain computing task deployed on some node devices changes, so as to ensure the consistency of the on-chain stored public key and the actual latest public key of the off-chain computing engine.
[0037] Furthermore, in the case of monitoring the key update event generated by the off-chain computing contract, obtaining the latest public key corresponding to the off-chain computing engine deployed by the first node device includes: in the case of monitoring the key update event generated in the initialization phase of the successful deployment of the off-chain computing contract, obtaining the latest public keys corresponding to all off-chain computing engines deployed by the first node device; or, in the case of monitoring the key update event generated by the off-chain computing contract in response to the key reset transaction and determining that the first node device is deployed with the target off-chain computing engine indicated by the key update event, obtaining the latest public key corresponding to the target off-chain computing engine. In the embodiment of the present specification, when the off-chain computing contract is deployed to any node device, an initialization program is triggered, which includes the process of generating the key update event. At this time, the key update event is used to instruct any node device to obtain the latest public keys of all off-chain computing engines deployed on any node device, and maintain them in the off-chain computing contract through a transaction feedback mechanism, so that the public keys of new off-chain computing engines participating in the execution of off-chain computing tasks defined by the off-chain computing contract are immediately maintained in the off-chain computing contract to ensure the normal execution of the off-chain computing tasks; or, after the off-chain computing contract receives the key reset transaction , a key update event will also be generated to indicate the update of the stored public key of the target off-chain computing engine maintained in the off-chain computing contract. At this time, if the first node device recognizes that the target off-chain computing engine is deployed locally, it will respond to the key update event to obtain the latest public key corresponding to the target off-chain computing engine deployed on the first node device, and update it to the off-chain computing contract through the transaction feedback mechanism, thereby instantly updating the stored public key of the specific off-chain computing engine in the off-chain computing contract, avoiding execution errors of off-chain computing tasks caused by the lag of the stored public key of the specific off-chain computing engine behind the latest public key of the specific off-chain computing engine.
[0038] S104: When monitoring a task event generated by the off-chain computing contract for a collaborative computing task and determining that the first blockchain node belongs to a computing provider node corresponding to the collaborative computing task, calling the off-chain computing engine to execute the collaborative computing task, the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain encrypted data sent by a proxy access engine deployed on a second node device where the data provider node corresponding to the collaborative computing task is located, the encrypted data is obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
[0039] In the embodiments of this specification, the off-chain computing contract is an on-chain carrier for carrying off-chain computing tasks. The off-chain computing contract defines several subtasks included in the off-chain computing task, which are used to describe the data flow in an off-chain computing task 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 task defined by the off-chain computing contract are limited to no more than 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 enables the deployment of off-chain computing tasks of different task types, task requirements and task scales based on the same blockchain network.
[0040] In order to illustrate how the off-chain computing contract guides the implementation of the off-chain computing tasks it defines, the following will briefly introduce the implementation logic of the 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 off-chain computing task workflow, which is reflected in several subtasks with execution dependency 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. After receiving the task creation transaction, the off-chain computing contract will correspondingly create a task instance of the off-chain computing task belonging to the initiator user. The task instance maintains the task completion status of the off-chain computing task, which is specifically reflected in the task completion status of each subtask under the off-chain computing task. 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 subtask corresponding to the instance. This is reflected in the off-chain computing contract as an event that generates a participant node containing the first subtask. Each blockchain node in the blockchain network can listen to the event, and the node devices of the blockchain nodes that determine that they belong to the participant nodes of the first subtask will further call the off-chain computing resources and / or off-chain storage resources that match the first subtask to execute the first subtask off-chain. Finally, after the execution is completed, the node devices of the participant nodes will further report to the off-chain computing contract. The off-chain computing contract initiates a result return transaction with 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 will mark the task completion status of the first subtask in the corresponding task instance as completed, thereby triggering the execution of the next batch of subtasks according to the dependency order of the subtasks contained in the predefined off-chain computing task, and then generating an event containing the description information of the participating nodes of the next batch of subtasks for each blockchain node in the blockchain network to monitor. The subsequent process is similar to the aforementioned process of processing the first subtask. In this way, a cycle of "off-chain computing contract updates task completion status → off-chain computing contract generates subtask events → blockchain nodes monitor subtask events and the designated node device executes subtasks → node devices initiate subtask result return transactions to off-chain computing contracts → off-chain computing contracts update task completion status" is formed, until the task completion status of all subtasks in the task instance in the off-chain computing contract is completed, it is determined that the off-chain computing task corresponding to the task instance has been executed.
[0041] 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 subtask results, subtask scheduling and subtask distribution. In fact, the actual tasks defined and required by the off-chain computing task, such as data calculation, data transfer and data storage, are not really executed. These tasks that consume a lot of resources are scheduled to the corresponding off-chain of each node device for execution, thereby realizing a distributed computing based on blockchain through the event monitoring mechanism and the transaction feedback mechanism, so that the off-chain computing task is anchored by the off-chain computing contract on the blockchain, and the off-chain resources are fully utilized under the premise of ensuring that the entire process of task execution can be traced. At the same time, different node devices rely on the blockchain to achieve trusted information interaction and collaborative computing. In addition, since the off-chain computing task is defined in the form of a contract and the design of the off-chain computing task is not constrained by the on-chain resources, this means that different off-chain computing contracts can be designed to meet different actual needs, and the on-chain collaboration method is expanded through off-chain resources.
[0042] In an embodiment of the present specification, 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 status of each subtask included in the off-chain computing task; when the collaborative computing task belongs to a subtask of the off-chain computing task, the task event generated by the off-chain computing contract for the collaborative computing task is monitored, including: monitoring the 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.
[0043] In the embodiment of the present 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, which is specifically manifested as the completion status of each subtask maintained in the task instance. In the embodiment of the present specification, the collaborative computing task belongs to a subtask of the off-chain computing task. Since the execution dependency order of each subtask contained in the off-chain computing task has been pre-defined, this means that the execution conditions of each subtask including the collaborative computing task have also been determined. Therefore, the off-chain computing contract can further determine the collaborative computing task to be executed next based on the completion status of each subtask contained in the off-chain computing task, thereby initiating a task event for the collaborative computing task. Furthermore, it also includes: when the collaborative computing task is executed, a result return transaction containing the execution result corresponding to the collaborative computing task is initiated to the off-chain computing contract through the first blockchain node to update the task completion status corresponding to the off-chain computing task maintained by the off-chain computing contract. As mentioned above, when the first node device executes the 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, so that the off-chain computing contract can further determine the next subtask to be executed according to the execution dependency order 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 event generated by the off-chain computing contract and initiates a result return transaction to the off-chain computing contract is specifically the scheduling engine deployed on the first node device.
[0044] As mentioned above, the task completion status is updated by the off-chain computing contract in response to the transaction trigger corresponding to the off-chain computing task, wherein the transaction corresponding to the off-chain computing task includes the task creation transaction corresponding to the off-chain computing task, or the result return transaction initiated by any node device when any of the subtasks is executed. 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. Usually, an off-chain computing contract will only define 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 task completion status corresponding to the task instance. Therefore, the multiple task instances maintained on the off-chain computing contract can be triggered by different users initiating task creation contracts to the off-chain computing contract respectively, or they can be triggered by the same user by initiating task creation contracts multiple times, but these task instances have the same execution logic, that is, the task types of the tasks maintained by the off-chain computing contract are the same.
[0045] In the embodiments of the present specification, the off-chain computing contract maintains the public keys of the off-chain computing engines participating in the execution of the off-chain computing task, and therefore also includes the public keys of the off-chain computing engines deployed on the first node device participating in the execution of the collaborative computing task. The proxy access engine can obtain the public key of the off-chain computing engine that is the data provider from the off-chain computing contract, and then encrypt the original data read from the second node device using the public key of the off-chain computing engine to obtain the encrypted data, which is then transmitted to the off-chain computing engine. The off-chain computing engine can decrypt the encrypted data using its own public key to obtain the original data, thereby avoiding direct transmission of plaintext data while ensuring the effectiveness of communication and reducing security risks.
[0046] In the embodiments of the present specification, the second node device where the computing provider node is located timely maintains the public key of the off-chain computing engine deployed by itself into the off-chain computing contract through the task decentralization mechanism of the off-chain computing contract, so that when the first node device where the data provider node is located needs to provide local data to the second node device, the proxy access engine deployed on the first node device can be used to encrypt the data read locally from the first node device and then transmit it to the second node device, thereby avoiding direct exposure of the local data source of the first node device to the second node device. At the same time, since the data transmitted in the network is encrypted data, it is possible to avoid exposure of privacy information as much as possible and reduce security risks.
[0047] Optionally, the off-chain computing engine is used to: obtain the digital signature for the encrypted data sent by the proxy access engine, and determine that the encrypted data originates from the proxy access engine deployed on the second node device when the digital signature is successfully verified by the stored public key corresponding to the proxy access engine maintained by the off-chain computing contract. In the embodiment of this specification, in addition to obtaining the encrypted data sent by the proxy access engine, the off-chain computing engine will also receive the data signature for the encrypted data sent by it, which is obtained by the proxy access engine signing the encrypted data with its own private key, and the off-chain computing engine needs to verify the data signature with the public key of the proxy access engine, and can only ensure that the encrypted data is indeed from the proxy access engine after the verification is successful, so as to ensure that the communication is credible and reduce security risks. In the embodiments of the present specification, the off-chain computing engine also maintains a stored public key corresponding to the proxy access engine. The stored public key is also uploaded to the off-chain computing contract through a key update transaction by the second node device when it monitors the key update event generated by the off-chain computing contract and the key update event indicates an update to the public key of the deployed proxy computing engine. Therefore, the off-chain computing engine can also obtain the public key of the proxy access engine through the off-chain computing contract.
[0048] The type of proxy access engine involved in the embodiments of this specification can be a computing engine or a data engine. Among them, the computing engine, also known as the off-chain computing engine, refers to a 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 for the computing needs corresponding to the relevant subtasks; 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 control access rights and quickly process transactions, thereby meeting the requirements of most applications in the enterprise that need to process large amounts of data. The database engine is used to create a relational database for online transaction processing or online analytical processing data, which includes creating tables for storing data and database objects (such as indexes, views and stored procedures) for viewing, managing and protecting data security. Different data engines support different data access methods or access data types, which is reflected in the support of data engine requirements corresponding to relevant subtasks.
[0049] In an embodiment of the present specification, the description information of the data provider node is recorded in the task event. The first node device can determine that the first blockchain node belongs to the data provider node by judging that the identification information of the first blockchain node deployed by itself is included in the description information of the data provider node recorded in the task event, and determine that the first blockchain node does not belong to the data provider node when it is judged that the identification information of the first blockchain node is not included in the description information of the data provider node recorded in the task event. At the same time, the second node device can also be informed of the node device where the relevant data provider node participating in the execution of the collaborative computing task is located, so as to inform the off-chain computing engine where to obtain data in the process of executing the collaborative computing task.
[0050] Optionally, it also includes: when the description information of the computing provider node recorded in the task event contains the identification information of the first blockchain node, or the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task, determining that the first blockchain node belongs to the computing provider node. In one embodiment, the description information of the computing provider node is directly recorded in the task event, so the first node device can determine that the first blockchain node belongs to the computing provider node by determining that the identification information of the first blockchain node is included in the description information of the computing provider node. In another embodiment, if the description information of the computing provider node is not recorded in the task event, the negotiation of the computing provider nodes corresponding to the collaborative computing task is triggered. The negotiation is performed in each node device. Each node device will determine whether it has deployed an off-chain computing engine that supports the execution of the collaborative computing task. When any node device determines that it has deployed an off-chain computing engine that supports the execution of the collaborative computing task, it will determine that the blockchain node deployed by itself belongs to the computing provider node. This embodiment does not assign a computing provider node in the task event generated by the off-chain computing contract, but allows each node device to select the computing provider node through negotiation, thereby realizing dynamic resource planning to a certain extent and making full use of the off-chain computing engine resources on each node device.
[0051] Optionally, it also includes: when it is determined that the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task, broadcasting the computing provision statement to the second node device where the data provider node is located, so that the second node device attributes the first blockchain node to the computing provider node. When negotiating computing provider nodes, each node device needs to know other computing provider nodes in addition to knowing whether the blockchain node deployed by itself belongs to the computing provider node. Therefore, when any computing node device determines that the off-chain computing engine deployed by itself supports the execution of the collaborative computing task, it broadcasts the computing provision statement carrying the identification information of the blockchain node deployed by itself and the identification information of the determined off-chain computing engine to other node devices, so that other node devices can attribute the blockchain node they carry to the computing provider node through the computing provision statement, and determine the off-chain computing engine they carry as needing to participate in the collaborative computing task.
[0052] Optionally, it also includes: when the task event is monitored and it is determined that the first blockchain node belongs to both the computing provider node and the data provider node, calling the off-chain computing engine to perform the collaborative computing task, wherein the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain the local data read from the first node device and the encrypted data sent by the proxy access engine, and further, the second blockchain node deployed on the second node device does not belong to the computing provider node. In the embodiment of this specification, if the first node device determines that the first blockchain node deployed by itself belongs to both the computing provider node and the data provider node, then in this case, the off-chain computing engine in the first node device that participates in the execution of the collaborative computing task will not only obtain the encrypted data from the second node device, but also read the local data of the first node device for further use in the execution of the collaborative computing task or subsequent subtasks. If the second blockchain node deployed on the second node device does not belong to the computing provider node, it means that the second node device does not need to provide off-chain computing engine resources for the collaborative computing task, but only participates in providing data. At this time, the proxy access engine deployed on the second node device is used as an intermediary to transfer the data on the second node device, which can effectively prevent data security issues caused by direct external access to the data on the second node device.
[0053] Figure 2 This is a flowchart of another data processing method provided by an exemplary embodiment. The method 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 with an off-chain computing contract; the method includes:
[0054] S202: Listen to the task events generated by the off-chain computing contract for the collaborative computing task; wherein, the off-chain computing contract maintains the evidence public key corresponding 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, and the evidence public key is triggered to update by a key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when listening to the key update event generated by the off-chain computing contract, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event.
[0055] As previously mentioned, the off-chain computing contract is used to trigger the generation of the key update event during the initialization phase of a successful deployment or in response to a key reset transaction.
[0056] Optionally, the proxy access engine is used to: when the off-chain computing contract does not maintain the evidence public key or the evidence public key has expired, initiate a key reset transaction to the off-chain computing contract through the second blockchain node, so that the off-chain computing contract updates the evidence public key corresponding to the off-chain computing engine, and encrypts the data read from the second node device by the updated evidence public key to send the new encrypted data to the off-chain computing engine. In an embodiment of this specification, if the evidence public key of the off-chain computing engine read by the proxy access engine from the off-chain computing contract is empty or expired, a key reset transaction will be triggered to update the evidence public key of the off-chain computing engine deployed on the first node device maintained on the on-chain computing contract, so as to ensure the consistency between the on-chain evidence public key and the actual latest public key of the off-chain computing engine, and avoid the execution error of the off-chain computing task caused by the absence of the evidence public key of a specific off-chain computing engine or the lag behind the latest public key of a specific off-chain computing engine.
[0057] S204: 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 to execute the collaborative computing task, and the proxy access engine is used to: in the process of executing the collaborative computing task, obtain the stored public key from the off-chain computing contract, and encrypt the data read from the second node device by the stored public key and send the encrypted data obtained to the off-chain computing engine.
[0058] In the embodiment of the present specification, the task event for the collaborative computing task generated by the off-chain computing contract monitored by the second node device records the description information of the participant node of the collaborative computing task. The task event includes the description information of the participant node of the collaborative computing task, which means that the collaborative computing task stipulates the identity information of the blockchain nodes involved in the participation. The participant node of 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, wherein the data provider node corresponding to the collaborative computing task refers to: in the execution process of a collaborative computing task jointly completed by multiple node devices, the blockchain node in the blockchain network deployed on the node device that needs to provide data to other node devices, and the data is used to be used as the data required for the off-chain computing engine deployed on other node devices to execute the collaborative computing task and / or subsequent other subtasks; and the computing provider corresponding to the collaborative computing task refers to: in the execution process of a collaborative computing task jointly completed by multiple node devices, 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, or a computing provider node corresponding to the collaborative computing task, or both a data provider node and a 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 obtain the local data of the node device in order to perform the collaborative computing task and / or other subsequent subtasks during the execution of the collaborative computing task.
[0059] In the embodiment of the present specification, the second node device needs to call the proxy access engine to execute the collaborative computing task only when it is determined that the second blockchain node belongs to the data provider node corresponding to 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 to which data needs to be provided, thereby indicating that the proxy access engine can obtain the corresponding public key of the off-chain computing engine from the off-chain computing contract, and encrypt the data read on the second node device through the public key to obtain encrypted data, and finally transmit the encrypted data to the corresponding off-chain computing engine. In the embodiment of the present specification, the entity that calls the off-chain computing engine to execute the collaborative computing task is specifically the scheduling engine deployed on the second node device.
[0060] In the embodiment of the present specification, after receiving the encrypted data, the off-chain computing engine will use the private key of the off-chain computing engine maintained by itself to decrypt the encrypted data to obtain the data, thereby finally completing the process of the proxy access engine in the second node device securely providing data to the off-chain computing engine in the first node device.
[0061] In the embodiments of the present specification, the off-chain computing contract maintains the public keys of the off-chain computing engines participating in the execution of the off-chain computing task, and therefore also includes the public keys of the off-chain computing engines deployed on the first node device participating in the execution of the collaborative computing task. The proxy access engine can obtain the public key of the off-chain computing engine that is the data provider from the off-chain computing contract, and then encrypt the original data read from the second node device using the public key of the off-chain computing engine to obtain the encrypted data, which is then transmitted to the off-chain computing engine. The off-chain computing engine can decrypt the encrypted data using its own public key to obtain the original data, thereby avoiding direct transmission of plaintext data while ensuring the effectiveness of communication and reducing security risks.
[0062] In the embodiments of the present specification, the second node device where the computing provider node is located timely maintains the public key of the off-chain computing engine deployed by itself into the off-chain computing contract through the task decentralization mechanism of the off-chain computing contract, so that when the first node device where the data provider node is located needs to provide local data to the second node device, the proxy access engine deployed on the first node device can be used to encrypt the data read locally from the first node device and then transmit it to the second node device, thereby avoiding direct exposure of the local data source of the first node device to the second node device. At the same time, since the data transmitted in the network is encrypted data, it is possible to avoid exposure of privacy information as much as possible and reduce security risks.
[0063] Optionally, when the description information of the data provider node recorded in the task event contains 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 participant node of the collaborative computing task is recorded in the task event of the collaborative computing task, which specifically refers to the description information of the data provider node corresponding to the collaborative computing task recorded in the task event, which means that the second node device can determine that the second blockchain node deployed by itself belongs to the data provider node corresponding to the collaborative computing task when it is determined that the description information of the data provider node contains the identification information of the second blockchain node deployed by itself; and if the description information of the data provider node does not contain 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.
[0064] Optionally, it also includes: when the description information of the computing provider node recorded in the task event does not contain the identification information of the second blockchain node, or the second node device is not deployed with an off-chain computing engine that supports the execution of the collaborative computing task, determining that the second blockchain node does not belong to the computing provider node.
[0065] In one embodiment, the task event for the collaborative computing task also records the description information of the computing provider node corresponding to the collaborative computing task, which means that the second node device can determine that the second blockchain node deployed by itself belongs to the computing provider node corresponding to the collaborative computing task when it is determined that the description information of the computing provider node contains the identification information of the second blockchain node deployed by itself; and if the description information of the computing provider node does not contain 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 computing provider node corresponding to the collaborative computing task. In this embodiment, the task event also records the identification information of the off-chain computing engine participating in the execution of the collaborative computing task on the node device where the computing provider node is located.
[0066] In another embodiment, in the case where the task event of the collaborative computing task only records the description information of the data provider node corresponding to the collaborative computing task, but does not record the description information of the computing provider node corresponding to the collaborative computing task and the identification information of the off-chain computing engine participating in the execution of the collaborative computing task, then each node device, after listening to the task event, recognizes that the description information of the computing provider node corresponding to the collaborative computing task is not recorded in the task event, and thus triggers the negotiation of the computing provider node participating in the collaborative computing task. For any node device, it can determine that it belongs to the computing provider node corresponding to the collaborative computing task when it determines that it is deployed with an off-chain computing engine that supports the execution of the collaborative computing task. Therefore, on the second node device, it can determine that the second blockchain node does not belong to the computing provider node when the second node device is not deployed with an off-chain computing engine that supports the execution of the collaborative computing task, or determine that the second blockchain node belongs to the computing provider node when the off-chain computing engine that supports the execution of the collaborative computing task is deployed.
[0067] Furthermore, upon receiving a computing provision statement sent by other node devices, the blockchain node deployed on the other node devices is attributed to the computing provider node, wherein the computing provision statement is broadcast by the other node device to the second node device where the data provider node is located when it is determined that the other node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task. When any node device among the node devices negotiates the computing provider node, in addition to determining whether it belongs to the computing provider node corresponding to the collaborative computing task based on whether it has deployed an off-chain computing engine supporting the collaborative computing task, it will also broadcast a computing provision statement containing the identification information of the off-chain computing engine supporting the collaborative computing task to other node devices after determining that it belongs to the computing provider node, so that other node devices, after receiving the computing provision statement of any node device, attribute the any node device to the computing provider node corresponding to the collaborative computing task, and at the same time, learn about the off-chain computing engine deployed on the other node devices involved in the actual calculation in the collaborative computing task, wherein the other node devices can be all node devices deployed with blockchain nodes in the blockchain network, or can be all node devices deployed with data provider nodes corresponding to the collaborative computing task. Therefore, for the second node device, when it receives the computing provision statement sent by other node devices, it can attribute the blockchain node deployed on the other node devices to the computing provider node, and at the same time, learn about the identification information of the off-chain computing engine as the target of providing data. In the embodiments of the present specification, even if the node device where the participating node is located does not record the description information of the computing provider node corresponding to the collaborative computing task in the task event, it is also possible to obtain the collaborative computing node and its corresponding off-chain computing engine through negotiation of the computing provider node by each node device, thereby further guiding the effective execution of the collaborative computing task.
[0068] In addition, the task event will also record the task identifiers of the off-chain computing task and the collaborative computing task, so as to distinguish different tasks and subtasks. This is mainly to facilitate any subsequent node device to correctly identify the result of the collaborative computing task in the off-chain computing task when it completes the execution of the collaborative computing task and returns the result return transaction, so that the off-chain computing contract can correctly update the completion status of the collaborative computing task in the task instance of the corresponding off-chain computing task through the result return transaction, so as to deal with the situation where the same task contains multiple subtasks and the same off-chain computing year contract creates multiple off-chain computing task instances at the same time. Of course, the collaborative computing task also records the operations such as calculations and data transfers that 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, so as to guide the node device to perform the collaborative computing task as expected after determining the task type and implementation method of the collaborative computing task corresponding to the callable resources.
[0069] Optionally, the proxy access engine is used to: in response to the proxy access engine being called, encrypt the pre-read data corresponding to the task event read from the second node device by using the evidence public key and send the encrypted data to the off-chain computing engine; or, read the pre-read data corresponding to the task event from the second node device, and in response to a data access request sent by the off-chain computing engine, send the encrypted data obtained by encrypting the pre-read data by using the evidence public key to the off-chain computing engine; or, in response to the data access request sent by the off-chain computing engine, encrypt the data corresponding to the data access request read from the second node device by using the evidence public key and send the encrypted data to the off-chain computing engine. In an embodiment of the present specification, the proxy access engine can provide encrypted data to the first node device where the computing provider node is located through at least three logics: first, the second node device carries the identification information of the off-chain computing engine as the transmission target and the data requirements recorded in the task event in the call request to the proxy access engine. Therefore, when the proxy access engine is called to perform a collaborative computing task, it can trigger the reading of the corresponding data from the second node device according to the data requirements contained in the task event and encrypt it through the stored public key to obtain the encrypted data, and then transmit the encrypted data to the off-chain computing engine deployed by the first node device; second, the second node device carries the identification information of the off-chain computing engine as the transmission target and the data requirements recorded in the task event in the call request to the proxy access engine. The proxy access engine will The call request triggers the execution of reading the pre-read data corresponding to the data demand, and encrypts the pre-read data through the stored public key to obtain encrypted data, waiting for the data access request from the off-chain computing engine deployed by the first node device. When the proxy access engine receives the data access request, it will further trigger the transmission of the encrypted data to the off-chain computing engine; thirdly, the call request of the second node device to the proxy access engine carries the identification information of the off-chain computing engine as the transmission target, and the proxy access engine will wait for the data access request from the off-chain computing engine deployed by the first node device. When the proxy access engine receives the data access request, it will further trigger the reading of the data indicated by the data access request and encrypt it through the stored public key to obtain encrypted data, and finally transmit the encrypted data to the off-chain computing engine.The embodiments of this specification provide a variety of ways for the proxy access engine to provide encrypted data to the off-chain computing engine, so as to adapt to the actual needs of different scenarios. For example, compared with the third method, the data provided by the first and second methods are determined by the task events generated by the off-chain computing contract. Therefore, access rights control between different node devices can be achieved by writing off-chain computing tasks. The data provided in the third method is determined by the off-chain computing engine, which can be adapted to the execution of more flexible off-chain computing tasks, and can be used as access rights control by the proxy access engine. Compared with the first method, the second and third methods emphasize that data transmission is controlled by the off-chain computing engine, which can cooperate with some off-chain computing tasks with uncertain specific data flow processes. Because some off-chain computing tasks may not need to obtain data from the proxy access engine depending on the specific circumstances, the off-chain computing engine controlling data transmission can meet the actual needs of the off-chain computing engine and avoid security risks and resource loss that may be caused by unnecessary data transmission.
[0070] Figure 3 FIG. 1 is a schematic diagram of a scenario of node device interaction provided by an exemplary embodiment. Figure 3As shown, 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 second blockchain node, the second scheduling engine, the proxy access engine and the second data source in the blockchain network. When the off-chain computing contract generates a key update event and the node of the participant of the key update specified in the event is the first blockchain node, the first scheduling engine will monitor the key update event through the first blockchain node to include the identification information of the locally deployed off-chain computing engine, thereby further requesting the off-chain computing engine to obtain the latest public key corresponding to it. After obtaining the latest public key of the off-chain computing engine, the first scheduling engine will initiate a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node, so that the off-chain computing contract updates the corresponding public key of the off-chain computing engine to the latest public key. After the off-chain computing contract generates a task event for the collaborative computing task, it will be monitored by the second scheduling engine on the second node device and the first scheduling engine on the first node device through the second blockchain node and the first blockchain node respectively. Assuming that the task event 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 off-chain computing engine that needs to provide data, the description information of the data provider node is the identification information of the second blockchain node, and the description information of the computing 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, and the second node device does not need to provide computing support for the collaborative computing task. Therefore, the second scheduling engine will call the proxy access engine to perform the collaborative computing task, first by initiating a local transaction without consensus to the on-chain computing contract to access and obtain the corresponding off-chain computing engine maintained by the on-chain computing contract, and then encrypt the data obtained from the second data source by the said public key to obtain encrypted data, and finally transmit the encrypted data 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 task event deployed in the first node device needs to obtain data from the second node device, so the first scheduling engine will call the specified off-chain computing engine to perform the collaborative computing task. For example, the specified 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 the encrypted data sent by the proxy access engine through the network connection with the proxy access engine deployed on the second node device, and then decrypt the encrypted data through the private key of the off-chain computing engine maintained by itself to obtain the data in the second data source in plaintext, so as to further perform trusted computing operations to continue to complete the collaborative computing task.
[0071] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. 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, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the 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, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0072] like Figure 5 As shown, Figure 5 is a block diagram of a data processing device provided by this specification according to an exemplary embodiment. The device can be applied to Figure 4 In the device shown, the technical solution of this specification is implemented; the device is applied to a first node device deployed with a first blockchain node, and the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the device includes:
[0073] The evidence public key update unit 501 is used to obtain the latest public key corresponding to the off-chain computing engine deployed by the first node device when monitoring the key update event generated by the off-chain computing contract, and initiate a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node to update the evidence public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key.
[0074] The encrypted data acquisition unit 502 is used to call the off-chain computing engine to execute the collaborative computing task when monitoring the task event generated by the off-chain computing contract for the collaborative computing task and determining that the first blockchain node belongs to the computing provider node corresponding to the collaborative computing task. The off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain the encrypted data sent by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located. The encrypted data is obtained by the proxy access engine encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
[0075] Optionally, 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 status of each subtask included in the off-chain computing task; when the collaborative computing task belongs to a subtask of the off-chain computing task, the encrypted data acquisition unit 502 is specifically used to:
[0076] The task event for the collaborative computing task generated by the off-chain computing contract when the task completion status satisfies the execution condition corresponding to the collaborative computing task is monitored.
[0077] Optionally, the task completion status is updated by the off-chain computing contract in response to a transaction trigger corresponding to the off-chain computing task, wherein the transaction corresponding to the off-chain computing task includes a task creation transaction corresponding to the off-chain computing task, or a result return transaction initiated by any node device upon completion of execution of any of the subtasks.
[0078] Optionally, the off-chain computing contract is used to trigger generation of the key update event during a successful initialization phase of deployment or in response to a key reset transaction.
[0079] Optionally, the evidence public key updating unit 501 is specifically used for:
[0080] In case of monitoring the key update event generated in the initialization phase of the successful deployment of the off-chain computing contract, obtaining the latest public keys corresponding to all off-chain computing engines deployed by the first node device; or
[0081] Upon monitoring the key update event generated by the off-chain computing contract in response to the key reset transaction and determining that the first node device is deployed with the target off-chain computing engine indicated by the key update event, the latest public key corresponding to the target off-chain computing engine is obtained.
[0082] Optionally, the off-chain computing engine is used to obtain a digital signature for the encrypted data sent by the proxy access engine, and when the digital signature is successfully verified by a stored public key corresponding to the proxy access engine maintained by the off-chain computing contract, determine that the encrypted data originates from the proxy access engine deployed on the second node device.
[0083] Optionally, the type of the proxy access engine includes a computing engine or a data engine.
[0084] Optionally, the task event records description information of the data provider node.
[0085] Optionally, also include:
[0086] The computing provider node determination unit 503 is used to determine that the first blockchain node belongs to the computing provider node when the description information of the computing provider node recorded in the task event contains the identification information of the first blockchain node, or the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task.
[0087] Optionally, also include:
[0088] The computing provision declaration broadcasting unit 504, when it is determined that the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task, broadcasts the computing provision declaration to the second node device where the data provider node is located, so that the second node device attributes the first blockchain node to the computing provider node.
[0089] Optionally, also include:
[0090] The off-chain computing task execution unit 505 is used to call the off-chain computing engine to execute the collaborative computing task when the task event is monitored and it is determined that the first blockchain node belongs to both the computing provider node and the data provider node, wherein the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain the local data read from the first node device and the encrypted data sent by the proxy access engine.
[0091] Optionally, the second blockchain node deployed on the second node device does not belong to the computing provider node.
[0092] like Figure 6 As shown, Figure 6 is a block diagram of a data processing device provided by this specification according to an exemplary embodiment. The device can be applied to Figure 4 In the device shown, the technical solution of this specification is implemented; the 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 with an off-chain computing contract; the device includes:
[0093] An event monitoring unit 601 is used to monitor task events generated by the off-chain computing contract for collaborative computing tasks; wherein the off-chain computing contract maintains a stored public key corresponding to an off-chain computing engine deployed on a first node device where the computing provider node corresponding to the collaborative computing task is located, and the stored public key is updated by a key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when the key update event generated by the off-chain computing contract is monitored, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event.
[0094] The encrypted data sending unit 602 is used to call the proxy access engine deployed by the second node device to execute the collaborative 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 is used to: in the process of executing the collaborative computing task, obtain the evidence public key from the off-chain computing contract, and encrypt the data read from the second node device by using the evidence public key and send the encrypted data obtained to the off-chain computing engine.
[0095] Optionally, the off-chain computing contract is used to trigger generation of the key update event during a successful initialization phase of deployment or in response to a key reset transaction.
[0096] Optionally, the proxy access engine is used to: when the off-chain computing contract does not maintain the evidence public key or the evidence public key has expired, initiate a key reset transaction to the off-chain computing contract through the second blockchain node, so that the off-chain computing contract updates the evidence public key corresponding to the off-chain computing engine, and encrypts the data read from the second node device with the updated evidence public key and sends the new encrypted data to the off-chain computing engine.
[0097] Optionally, the proxy access engine is used to:
[0098] In response to the proxy access engine being called, encrypting the pre-read data corresponding to the task event read from the second node device by the stored public key and sending the encrypted data to the off-chain computing engine; or,
[0099] The pre-read data corresponding to the task event is read from the second node device, and in response to the data access request sent by the off-chain computing engine, the encrypted data obtained by encrypting the pre-read data by using the stored public key is sent to the off-chain computing engine; or
[0100] In response to the data access request sent by the off-chain computing engine, the encrypted data obtained by encrypting the data corresponding to the data access request read from the second node device by using the stored public key is sent to the off-chain computing engine.
[0101] Optionally, also include:
[0102] The data provider node determination unit 603 is used to determine that the second blockchain node belongs to the data provider node when the description information of the data provider node recorded in the task event contains the identification information of the second blockchain node.
[0103] Optionally, also include:
[0104] The computing provision declaration receiving unit 604 is used to attribute the blockchain node deployed on the other node device to the computing provider node when receiving the computing provision declaration sent by the other node device, wherein the computing provision declaration is broadcast by the other node device to the second node device where the data provider node is located when it is determined that the other node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task.
[0105] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. 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 in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, 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. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0106] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0107] 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, the present invention 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, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0108] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0109] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0110] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0115] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0116] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0117] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. 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 this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0118] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0119] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.
Claims
1. A data processing method is applied to a first node device deployed with a first blockchain node, and the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the method comprises: In the case of monitoring the key update event generated by the off-chain computing contract, obtaining the latest public key corresponding to the off-chain computing engine deployed by the first node device, and initiating a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node, so as to update the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key; In the case of monitoring a task event generated by the off-chain computing contract for a collaborative computing task and determining that the first blockchain node belongs to a computing provider node corresponding to the collaborative computing task, calling the off-chain computing engine to execute the collaborative computing task, the off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain encrypted data sent by a proxy access engine deployed on a second node device where the data provider node corresponding to the collaborative computing task is located, the encrypted data being obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
2. 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 status of each subtask contained in the off-chain computing task; when the collaborative computing task belongs to a subtask of the off-chain computing task, the task event generated by the off-chain computing contract for the collaborative computing task is monitored, including: The task event for the collaborative computing task generated by the off-chain computing contract when the task completion status satisfies the execution condition corresponding to the collaborative computing task is monitored.
3. According to the method of claim 2, the task completion status is updated by the off-chain computing contract in response to a transaction trigger corresponding to the off-chain computing task, wherein: The transaction corresponding to the off-chain computing task includes a task creation transaction corresponding to the off-chain computing task, or a result return transaction initiated by any node device when any of the subtasks is executed.
4. According to the method of claim 1, the off-chain computing contract is used to trigger the generation of the key update event during the initialization phase of successful deployment or in response to a key reset transaction.
5. The method according to claim 4, wherein, upon monitoring a key update event generated by the off-chain computing contract, obtaining the latest public key corresponding to the off-chain computing engine deployed by the first node device comprises: In the case of monitoring the key update event generated in the initialization phase of the successful deployment of the off-chain computing contract, obtaining the latest public keys corresponding to all off-chain computing engines deployed by the first node device; or, Upon monitoring the key update event generated by the off-chain computing contract in response to the key reset transaction and determining that the first node device is deployed with the target off-chain computing engine indicated by the key update event, the latest public key corresponding to the target off-chain computing engine is obtained.
6. According to the method described in claim 1, the off-chain computing engine is used to: obtain the digital signature for the encrypted data sent by the proxy access engine, and when the digital signature is successfully verified by the stored public key corresponding to the proxy access engine maintained by the off-chain computing contract, determine that the encrypted data originates from the proxy access engine deployed on the second node device. 7 . The method according to claim 1 , wherein the type of the proxy access engine comprises a computing engine or a data engine.
8. According to the method of claim 1, the task event records the description information of the data provider node.
9. The method according to claim 1, further comprising: When the description information of the computing provider node recorded in the task event contains the identification information of the first blockchain node, or the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task, it is determined that the first blockchain node belongs to the computing provider node.
10. The method according to claim 1, further comprising: When it is determined that the first node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task, the computing provision declaration is broadcast to the second node device where the data provider node is located, so that the second node device attributes the first blockchain node to the computing provider node.
11. The method according to claim 1, further comprising: In the case where the task event is monitored and it is determined that the first blockchain node belongs to both the computing provider node and the data provider node, the off-chain computing engine is called to execute the collaborative computing task, wherein the off-chain computing engine is used to: obtain the local data read from the first node device and the encrypted data sent by the proxy access engine during the execution of the collaborative computing task.
12. According to the method of claim 1, the second blockchain node deployed on the second node device does not belong to the computing provider node.
13. A data processing method, applied to a second node device deployed with a second blockchain node, wherein the blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract; the method comprises: Listen to the task events generated by the off-chain computing contract for the collaborative computing task; wherein the off-chain computing contract maintains the evidence public key corresponding 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, and the evidence public key is triggered to update by the key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when listening to the key update event generated by the off-chain computing contract, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event; 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 to execute the collaborative computing task. The proxy access engine is used to: in the process of executing the collaborative computing task, obtain the stored public key from the off-chain computing contract, and encrypt the data read from the second node device by the stored public key and send the encrypted data obtained to the off-chain computing engine.
14. According to the method of claim 13, the off-chain computing contract is used to trigger the generation of the key update event during the initialization phase of successful deployment or in response to a key reset transaction.
15. According to the method described in claim 13, the proxy access engine is used to: when the off-chain computing contract does not maintain the evidence public key or the evidence public key has expired, initiate a key reset transaction to the off-chain computing contract through the second blockchain node, so that the off-chain computing contract updates the evidence public key corresponding to the off-chain computing engine, and encrypts the data read from the second node device with the updated evidence public key to send the new encrypted data to the off-chain computing engine.
16. The method according to claim 13, wherein the proxy access engine is used to: In response to the proxy access engine being called, encrypting the pre-read data corresponding to the task event read from the second node device by the stored public key and sending the encrypted data to the off-chain computing engine; or, The pre-read data corresponding to the task event is read from the second node device, and in response to the data access request sent by the off-chain computing engine, the encrypted data obtained by encrypting the pre-read data by using the stored public key is sent to the off-chain computing engine; or In response to the data access request sent by the off-chain computing engine, the encrypted data obtained by encrypting the data corresponding to the data access request read from the second node device by using the stored public key is sent to the off-chain computing engine.
17. The method according to claim 13, further comprising: When the description information of the data provider node recorded in the task event contains the identification information of the second blockchain node, it is determined that the second blockchain node belongs to the data provider node.
18. The method according to claim 13, further comprising: Upon receiving a computing provision statement sent by other node devices, the blockchain node deployed on the other node devices is attributed to the computing provider node, wherein the computing provision statement is broadcast by the other node device to the second node device where the data provider node is located when it is determined that the other node device is deployed with an off-chain computing engine that supports the execution of the collaborative computing task.
19. A data processing device, applied to a first node device deployed with a first blockchain node, wherein the blockchain network to which the first blockchain node belongs is deployed with an off-chain computing contract; the device comprises: The evidence public key update unit is used to obtain the latest public key corresponding to the off-chain computing engine deployed by the first node device when monitoring the key update event generated by the off-chain computing contract, and initiate a key update transaction carrying the latest public key to the off-chain computing contract through the first blockchain node, so as to update the evidence public key corresponding to the off-chain computing engine maintained by the off-chain computing contract to the latest public key; An encrypted data acquisition unit is used to call the off-chain computing engine to execute the collaborative computing task when monitoring the task event generated by the off-chain computing contract for the collaborative computing task and determining that the first blockchain node belongs to the computing provider node corresponding to the collaborative computing task. The off-chain computing engine is used to: in the process of executing the collaborative computing task, obtain the encrypted data sent by the proxy access engine deployed on the second node device where the data provider node corresponding to the collaborative computing task is located, and the encrypted data is obtained by the proxy access engine by encrypting the data read from the second node device through the stored public key corresponding to the off-chain computing engine maintained by the off-chain computing contract.
20. A data processing device, applied to a second node device deployed with a second blockchain node, wherein the blockchain network to which the second blockchain node belongs is deployed with an off-chain computing contract; the device comprises: An event monitoring unit, used to monitor task events generated by the off-chain computing contract for collaborative computing tasks; wherein the off-chain computing contract maintains a stored public key corresponding to an off-chain computing engine deployed on a first node device where the computing provider node corresponding to the collaborative computing task is located, and the stored public key is updated by a key update transaction initiated by the first computing device, and the key update transaction is initiated by the first computing device when monitoring the key update event generated by the off-chain computing contract, and the key update transaction carries the latest public key corresponding to the off-chain computing engine obtained by the first node device in response to the key update event; An encrypted data sending unit is used to call the proxy access engine deployed by the second node device to execute the collaborative 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 is used to: in the process of executing the collaborative computing task, obtain the stored public key from the off-chain computing contract, and encrypt the data read from the second node device by the stored public key and send the encrypted data obtained to the off-chain computing engine.
21. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 18 by running the executable instructions.
22. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Handover method and mobile terminal and home agent used in the method
CN102204394A
Decentralized multi-party security data processing method and device and storage medium
CN110298190A