CN113873004B - Task execution method and device and distributed computing system - Google Patents

Task execution method and device and distributed computing system Download PDF

Info

Publication number
CN113873004B
CN113873004B CN202110936101.XA CN202110936101A CN113873004B CN 113873004 B CN113873004 B CN 113873004B CN 202110936101 A CN202110936101 A CN 202110936101A CN 113873004 B CN113873004 B CN 113873004B
Authority
CN
China
Prior art keywords
task
executable
signature
input information
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110936101.XA
Other languages
Chinese (zh)
Other versions
CN113873004A (en
Inventor
刘自强
钱友才
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Digital Currency Institute of the Peoples Bank of China
Original Assignee
Digital Currency Institute of the Peoples Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Digital Currency Institute of the Peoples Bank of China filed Critical Digital Currency Institute of the Peoples Bank of China
Priority to CN202110936101.XA priority Critical patent/CN113873004B/en
Publication of CN113873004A publication Critical patent/CN113873004A/en
Application granted granted Critical
Publication of CN113873004B publication Critical patent/CN113873004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The invention discloses a task execution method and device and a distributed computing system, and relates to the technical field of distributed computing. One embodiment of the method comprises the following steps: after the application of the executable task is finished, the computing program and the task input information of the executable task are loaded to a trusted execution environment of the blockchain, the computing program is executed in the trusted execution environment to obtain a task computing result, the task input information and the task computing result are signed to obtain signature result data, the executable task is determined to be actually executed according to the signature result data through the blockchain, the task computing result is trusted, and the task computing result is stored in the blockchain. The embodiment can ensure the safety of the running environment of the distributed computing program, avoid the malicious access or damage of the distributed computing program to the participant computer, realize the execution of tasks and the verification of the credibility of the computing result, improve the utilization rate of resources, reduce the computing cost and improve the participation enthusiasm of block chain link points.

Description

Task execution method and device and distributed computing system
Technical Field
The present invention relates to the field of distributed computing technologies, and in particular, to a task execution method and apparatus, and a distributed computing system.
Background
With the development of the internet, the degree of informatization is higher and higher, and a large amount of data is generated and needs to be processed by a computer, however, the computing power of a single computer is always limited, so that the generation of distributed computing is necessary. Currently, a distributed computing system is generally built by a mechanism or a person with a certain economical strength in a manner of improving computing power by adopting a computer cluster (a first scheme), or distributed computing tasks are issued by the mechanism, and distributed computing is participated by a cooperative mechanism or a person (a second scheme).
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the existing scheme has high construction cost, and meanwhile, the calculation force is idle and waste is generated because the calculation force demand is not always high-load; the second existing scheme cannot guarantee the security of the running environment of the distributed computing program, cannot avoid the malicious access or damage of the distributed computing program to the participant computer, and cannot verify the result of the distributed computing, namely cannot verify whether the participant actually executes the distributed computing program, and further has the possibility of forging the computing result, and the participation product of the social idle resources is extremely low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a task execution method and apparatus, and a distributed computing system, which can overcome the defects of high construction cost and wasteful computing power due to idle, and ensure the security of the running environment of the distributed computing program, so as to avoid malicious access or destruction of the computers of the participants by the distributed computing program, and realize the verification of the task execution and the reliability of the computing result, and save the resources consumed for the verification, improve the resource utilization rate, reduce the computing cost, and also improve the participation enthusiasm of the blockchain nodes.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a task execution method.
A method of task execution, comprising: applying for an executable task on a blockchain, and after applying for the executable task, acquiring a computing program and task input information of the executable task from the blockchain; loading the calculation program and the task input information into a trusted execution environment of the blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data; and sending the signature result data to the blockchain, determining that the executable task is actually executed and the task calculation result is credible according to the signature result data through the blockchain, and then storing the task calculation result in the blockchain.
Optionally, the acquiring the computing program and task input information of the executable task from the blockchain includes: and obtaining the download address of the computing program and the task input information from the task information written in the intelligent contract, and obtaining the computing program according to the download address of the computing program, wherein the task information is written in the intelligent contract by a task publisher when the executable task is published to the blockchain.
Optionally, the task information of writing the smart contract further includes a hash value of the computing program; before loading the computing program and the task input information into a trusted execution environment of the blockchain, the method comprises: and carrying out hash operation on the computing program, and determining that the result of the hash operation is consistent with the hash value comparison of the computing program obtained from the task information of the written intelligent contract.
Optionally, the task information written in the intelligent contract further includes a task identifier of the executable task; the sending the signature result data to the blockchain includes: and after the signature result data is obtained, generating a first contract transaction, and sending the first contract transaction to the blockchain, wherein the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
Optionally, the task information written in the intelligent contract further includes a public key corresponding to the executable task; the signature result data comprises the task calculation result, the signature of the task calculation result and the signature of the task input information; determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, including: inquiring public keys corresponding to the task input information and the executable task according to the task identification of the executable task through the intelligent contract, verifying the signature of the task input information by using the inquired public keys corresponding to the task input information and the executable task, determining that the executable task is actually executed under the condition that the signature of the task input information is correct, verifying the signature of the task calculation result by using the public key corresponding to the executable task after determining that the executable task is actually executed, and determining that the task calculation result is credible under the condition that the signature of the task calculation result is correct.
Optionally, the task information written in the intelligent contract further includes a public key corresponding to the executable task; the signature result data comprises an overall signature of the task input information and the task calculation result; determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, including: inquiring a public key corresponding to the executable task through the intelligent contract according to the task identifier of the executable task, and verifying the whole signature of the task input information and the task calculation result by utilizing the inquired public key corresponding to the executable task, wherein under the condition that the whole signature is correct, the executable task is determined to be actually executed and the task calculation result is credible.
Optionally, the information of the first contract transaction further includes a task executor identifier; the method further comprises the steps of: applying for the executable task by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identifier and a task identifier of the executable task; before determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, the method further includes: inquiring the corresponding task applicant identifier and the task executor identifier according to the task identifier of the executable task through the intelligent contract, and determining that the task applicant identifier and the task executor identifier are consistent in comparison.
Optionally, signing the task input information and the task calculation result includes: and signing the task input information and the task calculation result respectively by utilizing a private key which is pre-built in a calculation program of the executable task, or signing the task input information and the task calculation result as a whole.
Optionally, the task information written in the intelligent contract further includes task rights corresponding to the executable task; after saving the task computation results in the blockchain, the method further includes: the task rights issued by the blockchain through the smart contract are received.
According to another aspect of the embodiment of the present invention, there is provided a task execution device.
A task execution device comprising: the task application module is used for applying for executable tasks on the block chain and acquiring calculation programs and task input information of the executable tasks from the block chain after the executable tasks are applied for; the task execution module is used for loading the calculation program and the task input information into a trusted execution environment of the blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data; and sending the signature result data to the blockchain, determining that the executable task is actually executed and the task calculation result is credible according to the signature result data through the blockchain, and then storing the task calculation result in the blockchain.
Optionally, the task execution module is further configured to: and obtaining the download address of the computing program and the task input information from the task information written in the intelligent contract, and obtaining the computing program according to the download address of the computing program, wherein the task information is written in the intelligent contract by a task publisher when the executable task is published to the blockchain.
Optionally, the task information of writing the smart contract further includes a hash value of the computing program; the task execution module is further configured to: and carrying out hash operation on the computing program, and determining that the result of the hash operation is consistent with the hash value comparison of the computing program obtained from the task information of the written intelligent contract.
Optionally, the task information written in the intelligent contract further includes a task identifier of the executable task; the task execution module is further configured to: and after the signature result data is obtained, generating a first contract transaction, and sending the first contract transaction to the blockchain, wherein the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
Optionally, the task application module is further configured to: applying for the executable task by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identifier and a task identifier of the executable task.
Optionally, the task execution module is further configured to: respectively signing the task input information and the task calculation result by utilizing a private key which is pre-built in a calculation program of the executable task, so as to obtain signature result data comprising the task calculation result, the signature of the task calculation result and the signature of the task input information; or signing by taking the task input information and the task calculation result as a whole, wherein the obtained signature result data comprises the whole signature of the task input information and the task calculation result.
Optionally, the task information written in the intelligent contract further includes task rights corresponding to the executable task; the device also comprises a task result query module for: querying the task entitlements received from the blockchain issued by the smart contract.
According to yet another aspect of an embodiment of the present invention, a distributed computing system is provided.
A distributed computing system, comprising: the task execution device, the block chain and the task release device provided by the embodiment of the invention, wherein: the task issuing device is used for writing task information of an executable task into an intelligent contract so as to issue the executable task onto the blockchain, wherein the task information written into the intelligent contract comprises a computing program of the executable task and task input information; the block chain is used for providing a trusted execution environment for the task execution device, executing the calculation program in the trusted execution environment by the task execution device, obtaining a task calculation result, signing the task input information and the task calculation result, and sending signature result data obtained by signing to the block chain; the blockchain is also used for determining that the executable task is actually executed and the task calculation result is credible according to the signature result data, and storing the task calculation result.
Optionally, the task publishing device is further configured to decompose a distributed computing task into the executable tasks that can be independently operated, generate a public key and a private key corresponding to the executable tasks, and embed the private key into a computing program of the executable tasks.
Optionally, the task publishing device is further configured to query an execution state of the distributed computing task or the executable task, and query a task computing result of the executable task.
Optionally, the task execution device is further configured to query the executable task and query a task right issued by the smart contract and corresponding to the executable task.
Optionally, the task information written in the intelligent contract further includes a task identifier of the executable task and a public key corresponding to the executable task; the signature result data comprises the task calculation result, the signature of the task calculation result and the signature of the task input information; the blockchain is further used for inquiring the public key corresponding to the task input information and the executable task according to the task identification of the executable task through the intelligent contract, verifying the signature of the task input information by utilizing the inquired public key corresponding to the task input information and the executable task, determining that the executable task is actually executed under the condition that the signature of the task input information is correct, verifying the signature of the task calculation result by utilizing the public key corresponding to the executable task after determining that the executable task is actually executed, and determining that the task calculation result is reliable under the condition that the signature of the task calculation result is correct.
Optionally, the task information written in the intelligent contract further includes a task identifier of the executable task and a public key corresponding to the executable task; the signature result data comprises an overall signature of the task input information and the task calculation result, wherein the overall signature is obtained by the task execution device by taking the task input information and the task calculation result as a whole; the blockchain is further used for inquiring a public key corresponding to the executable task according to the task identification of the executable task through the intelligent contract, verifying the overall signature of the task input information and the task calculation result by using the inquired public key corresponding to the executable task, and determining that the executable task is actually executed and the task calculation result is credible under the condition that the overall signature is correct.
Optionally, the blockchain is further configured to query, according to the task identifier of the executable task, a corresponding task applicant identifier and a task executor identifier, and determine that the task applicant identifier is consistent with the task executor identifier by comparing, where the task applicant identifier is a user public key address corresponding to a task execution device that applies for the executable task, and the task executor identifier is a user public key address corresponding to the task execution device that executes the executable task.
Optionally, the task execution device and/or task publishing device is located on a node of the blockchain.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; and the memory is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the task execution method provided by the embodiment of the invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer-readable medium has stored thereon a computer program which, when executed by a processor, implements a task execution method provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: and after the executable task is applied, acquiring a computing program and task input information of the executable task from the blockchain, loading the acquired computing program and task input information into a trusted execution environment of the blockchain, executing the computing program in the trusted execution environment to obtain a task computing result, signing the task input information and the task computing result to obtain signature result data, sending the signature result data to the blockchain, determining that the executable task is actually executed and the task computing result is trusted according to the signature result data through the blockchain, and then storing the task computing result in the blockchain. The method can overcome the defects of high construction cost and wasteful calculation power due to idle, ensure the safety of the running environment of the distributed calculation program, avoid the malicious access or damage of the computers of the participants by the distributed calculation program, realize the verification of the reliable execution of tasks and the credibility of calculation results, save the resources consumed by the verification, improve the utilization rate of the resources, reduce the calculation cost and improve the participation enthusiasm of the blockchain nodes.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a task execution method according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of a distributed computing task submission flow according to one embodiment of the invention;
FIG. 3 is a schematic diagram of a distributed computing task distribution flow according to one embodiment of the invention;
FIG. 4 is a flow diagram of a distributed computing task application according to one embodiment of the invention;
FIG. 5 is a schematic diagram of a distributed computing task execution flow according to one embodiment of the invention;
FIG. 6 is a schematic diagram of a distributed computing task calculation result feedback flow in accordance with one embodiment of the invention;
FIG. 7 is a schematic diagram of a distributed computing task result query flow in accordance with one embodiment of the invention;
FIG. 8 is a schematic diagram of the main modules of a task performing device according to one embodiment of the present invention;
FIG. 9 is a principal constituent schematic diagram of a distributed computing system according to one embodiment of the invention;
FIG. 10 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 11 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main steps of a task execution method according to one embodiment of the present invention.
As shown in fig. 1, the task execution method according to an embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: applying for the executable task on the blockchain, and after applying for the executable task, acquiring a computing program and task input information of the executable task from the blockchain;
step S102: loading the acquired calculation program and task input information into a trusted execution environment of a blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data;
Step S103: the signature result data is sent to the blockchain, the executable task is determined to be actually executed according to the signature result data through the blockchain, the task calculation result is credible, and then the task calculation result is stored in the blockchain.
The task execution method of the embodiment is executed by the task execution device, and the task execution device can be used as a task applicant to apply for the executable task on the blockchain, and after the executable task is applied for, the task execution device can be used as the task applicant to execute the applied executable task.
The method for acquiring the computing program and the task input information of the executable task from the blockchain specifically comprises the following steps: and obtaining the download address and task input information of the calculation program from the task information written in the intelligent contract, and obtaining the calculation program according to the download address of the calculation program.
Task input information is input of a task, a calculation program calculates the task according to the input of the task, and the specific content of the task input information relates to an executable task.
Wherein the task information is written to the intelligent contract by the task publisher when publishing the executable task to the blockchain.
The task issuing party, namely the task issuing device of the embodiment of the invention, is used for writing the task information of the executable task into the intelligent contract so as to issue the executable task onto the blockchain. The task issuing device can decompose the distributed computing task into independently operable subtasks, namely executable tasks, generate a public key and a private key corresponding to the executable tasks, and embed the private key into a computing program of the executable tasks.
The task issuing device also generates a hash value of the calculation program and writes the hash value to the smart contract, i.e., the task information written to the smart contract may also include the hash value of the calculation program.
Before loading the computing program and the task input information into the trusted execution environment of the blockchain, a hash operation may be performed on the computing program, and it is determined that a result of the hash operation is consistent with a hash value of the computing program obtained from the task information written into the smart contract.
The task information written to the smart contract may also include a task identification of the executable task.
The method for transmitting the signature result data to the blockchain specifically comprises the following steps: after the signature result data is obtained, a first contract transaction is generated and sent to the blockchain, and the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
The task information written to the smart contract may also include a public key corresponding to the executable task.
In one embodiment, the signature result data may specifically include a task calculation result, a signature of the task calculation result, and a signature of the task input information.
Determining that the executable task is actually executed and the task calculation result is reliable according to the signature result data through the blockchain, wherein the method specifically comprises the following steps of: inquiring to obtain task input information and a public key corresponding to an executable task through an intelligent contract according to a task identifier of the executable task, verifying a signature of the task input information by using the inquired task input information and the public key corresponding to the executable task, determining that the executable task is actually executed under the condition that the signature of the task input information is correct, verifying a signature of a task calculation result by using the public key corresponding to the executable task after determining that the executable task is actually executed, and determining that the task calculation result is reliable under the condition that the signature of the task calculation result is correct.
In another embodiment, the signature result data may specifically include an overall signature of the task input information and the task calculation result, the task calculation result.
Determining that the executable task is actually executed and the task calculation result is reliable according to the signature result data through the blockchain, wherein the method specifically comprises the following steps of: the public key corresponding to the executable task is inquired through the intelligent contract according to the task identification of the executable task, the inquired public key corresponding to the executable task is utilized to verify the input information of the task and the integral signature of the task calculation result, and under the condition that the integral signature is correct, the executable task is determined to be actually executed and the task calculation result is credible.
The information of the first contract transaction may also include a task performer identification.
The executable task may be applied by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identification and a task identification of the executable task.
Before the blockchain determines that the executable task is actually executed and the task calculation result is credible according to the signature result data, the corresponding task applicant identifier and task executor identifier can be queried through the intelligent contract according to the task identifier of the executable task, and the task applicant identifier and the task executor identifier are determined to be consistent in comparison.
The task input information and the task calculation result may be signed separately by a private key previously built in a calculation program of an executable task, or the task input information and the task calculation result may be signed as a whole.
The task information written to the smart contract may also include task rights corresponding to the executable task. After storing the task calculation result in the blockchain, task rights issued by the blockchain through the intelligent contract can also be received.
The task information written to the smart contract may also include a task description of the executable task, the task description being descriptive of the task.
FIG. 2 is a schematic diagram of a distributed computing task submission flow according to one embodiment of the invention. As shown in FIG. 2, the distributed computing task submission process of one embodiment of the invention includes:
step S201: decomposing the distributed computing task into independently operable subtasks, namely executable tasks of the embodiment of the invention;
step S202: generating a pair of public and private keys for the executable task;
step S203: the private key is built in a computing program capable of executing tasks, and a hash value of the computing program is generated;
step S204: setting task information, specifically including task identification of an executable task, task description, a download address of a calculation program, a hash value of the calculation program, a public key corresponding to the executable task, task input information of the executable task, task rights corresponding to the executable task and the like;
Step S205: the task information is sent to the blockchain node through the smart contract transaction to write the task information to the smart contract.
The distributed computing task submitting process of the present embodiment is executed by the task issuing device, specifically, a task requiring a large amount of computation is decomposed into subtasks (which are called executable tasks in the present embodiment) that can be independently executed, a pair of public and private keys is generated at the same time, and the private keys are built into a computing program (computing program or distributed computing program) of the executable tasks. And writing the decomposed independently-operable subtasks into the blockchain through the intelligent contract. Information written to the smart contract includes, but is not limited to: task ID (task identification), task description, download address of distributed computing program, hash value of distributed computing program, public key corresponding to distributed computing task (i.e. public key in the generated public and private keys, i.e. public key corresponding to executable task), input information of executable task, right and obligation corresponding to task, etc. The right is an incentive. Obligations are specifications for task execution that act as constraints, e.g., rights may not be issued if not met, etc.
The above-mentioned computing program at least includes a computing process and a signing process of the corresponding task (executable task). The calculation process is used for carrying out relevant calculation according to the task input information, and the signature process is used for signing the task input information and the task calculation result after the task is ended.
The smart contract transaction in S205 is a contract transaction at the time of task issuance for triggering the smart contract to issue an executable task onto the blockchain, which is different from the first contract transaction and the second contract transaction mentioned above.
FIG. 3 is a schematic diagram of a distributed computing task distribution flow according to one embodiment of the invention. As shown in FIG. 3, the distributed computing task distribution flow of one embodiment of the present invention includes:
step S301: the block chain consensus node packages the intelligent contract transaction into blocks for consensus;
step S302: broadcasting the block with the consensus to all nodes through a block chain network for synchronization;
step S303: after the synchronization is successful, the blockchain provides a query function to enable the task applicant to query the task information written into the intelligent contract.
The distributed computing task distribution flow of this embodiment is executed in the blockchain, the task issuing device sends the decomposed independently operable subtasks (i.e., executable tasks) to the blockchain nodes by means of intelligent contract transactions, the blockchain consensus nodes package the intelligent contract transactions into blocks and distribute the executable tasks to all the blockchain nodes through the P2P network (peer-to-peer network), and the intelligent contract transactions are the same contract transactions as those in S205, i.e., the contract transactions when the tasks are issued. After the block synchronization is successful, the task applicant can detect that a new task is issued, and the task applicant or the task applicant side, namely the task execution device for applying the executable task, is provided.
FIG. 4 is a flow diagram of a distributed computing task application according to one embodiment of the invention. As shown in FIG. 4, the distributed computing task application flow of one embodiment of the present invention includes:
step S401: all executable tasks are queried through the block chain link points and displayed to a user;
step S402: applying for the executable task according to the selection information of the user for the executable task, generating a contract transaction of the application, and sending the contract transaction to the blockchain;
step S403: the blockchain consensus node packages the contract transaction into blocks and broadcasts to all nodes of the blockchain.
The distributed computing task application flow of this embodiment may be executed by a task applicant (i.e. a task execution device applying for the executable task), specifically, may check all the executable tasks existing on the current blockchain node, click on the executable tasks therein to apply for, and the application may generate a contract transaction to send to the blockchain for determining the attribution of the task, where the contract transaction is a contract transaction at the time of task application, i.e. a second contract transaction, for triggering the intelligent contract to apply for the task. The blockchain consensus node packages the contract transaction into blocks and broadcasts to all blockchain nodes over the P2P network.
FIG. 5 is a schematic diagram of a distributed computing task execution flow according to one embodiment of the invention. As shown in FIG. 5, the distributed computing task execution flow of one embodiment of the present invention includes:
step S501: detecting that a new executable task is available, namely, task application passes, and acquiring task information of the executable task from a block chain;
step S502: analyzing the acquired task information, downloading the computing program of the executable task according to the downloading address of the computing program, carrying out hash operation on the downloaded computing program, and determining that the hash operation result is consistent with the hash value of the computing program in the task information;
through the comparison, the validity check of the computing program is realized, that is, if the comparison is consistent, the validity check of the computing program passes, otherwise, the validity check does not pass, and the step S503 is executed under the condition that the validity check passes.
Step S503: loading the computing program capable of executing the task and the task input information into a trusted execution environment of a blockchain, and executing the computing program;
step S504: after the program execution is finished, signature result data is obtained, wherein the signature result data comprises a task calculation result and signature information, the signature information comprises a signature of the task calculation result and a signature of task input information, or the signature information comprises an overall signature of the task input information and the task calculation result.
The distributed computing task execution flow of the present embodiment is executed by a task executor (i.e., a task execution device that applies to the executable task). Specifically, when it is detected that the task applied by the node passes the consensus confirmation, the computing program is acquired according to the download address of the computing program in the task information. And verifying the validity of the calculation program, specifically comparing the calculated hash value of the calculation program with the hash value in the task information, and if the calculated hash value and the hash value are consistent, verifying the validity of the calculation program. The method has the advantages that the computing program is loaded into the trusted execution environment of the blockchain node for execution, and is executed in the trusted execution environment, so that the damage of the computing program to the blockchain node and other computer resources is avoided, and information leakage on a computer is avoided. After the execution of the calculation process is finished, the input of the task (namely, the input information of the task) and the calculation result of the task are respectively signed in a trusted execution environment to obtain signature information, then the signature information and the calculation result of the task are returned, and if the calculation program does not really run, the correct signature information cannot be obtained.
An alternative embodiment of the generation manner of the signature information of the present embodiment may be: and signing the task input information and the task calculation result as a whole to obtain signature information.
The signature information described above may be generated using a private key previously built in a calculation program of an executable task.
FIG. 6 is a schematic diagram of a distributed computing task computing outcome feedback flow in accordance with one embodiment of the present invention. Referring to fig. 6, the distributed computing task computing result feedback process according to one embodiment of the present invention includes:
step S601: the blockchain receives intelligent contract transactions sent by the task execution device.
The smart contract transaction received by the block chain in S601 is the first contract transaction. The method comprises the steps that a task execution device obtains signature result data after execution of an executable task is completed, then, an intelligent contract transaction (namely a first contract transaction) is generated and sent to a blockchain, and transaction information comprises, but is not limited to, a task identifier (namely a task ID) of the executable task and the signature result data, wherein the signature result data comprises a task calculation result and signature information;
step S602: the intelligent contract checks whether the task applicant is consistent with the result feedback person according to the task identification;
the task applicant (task applicant) is a task execution device for applying for the executable task, and the result feedback person (task execution party) is a task execution device for executing the executable task.
Step S602 specifically, the intelligent contract queries the corresponding task applicant identifier and the task executor identifier according to the task identifier of the executable task, determines that the task applicant identifier is consistent with the task executor identifier, the task applicant identifier is a user public key address corresponding to the task executor applying for the executable task, and the task executor identifier is a user public key address corresponding to the task executor executing the executable task.
Step S603: the smart contract verifies the signature result data to determine that the executable task was actually executed and that the task calculation result is authentic.
The generation of signature information may be accomplished in a variety of ways: the first mode is to generate a signature of a task calculation result and a signature of task input information respectively; and secondly, generating the overall signature of the task input information and the task calculation result.
Accordingly, there may be two implementations for verifying the signature result data:
in the first mode, step S603 specifically, the signature of the task input information is verified a priori, the executable task is determined to be actually executed when the signature of the task input information is correct, the signature of the task calculation result is verified after the executable task is determined to be actually executed, and the task calculation result is determined to be reliable when the signature of the task calculation result is correct. Specifically, the intelligent contract inquires the task input information and the public key information through the task ID, verifies whether the signature of the task input information is correct or not by using the task input information and the public key, if the signature of the task input information is correct, the task is considered to be actually executed, then verifies the signature of the task calculation result, and if the signature of the task calculation result is correct, the task calculation result is reliable.
In the second mode, step S603 is to verify the overall signature of the task input information and the task calculation result, and determine that the executable task is actually executed and the task calculation result is trusted when the overall signature is correct.
The executable task is actually executed, the task calculation result is reliable, and the legality of the signature information is indicated, namely the signature result data verification passes.
Step S604: the blockchain consensus node packages the intelligent contract transaction in S601 into blocks, stores the task calculation result and issues task rights corresponding to the executable task to the participants.
The participant who receives the task right, i.e. the task execution device which does execute the executable task, the intelligent contract can immediately issue the contracted task right to the task executor.
FIG. 7 is a schematic diagram of a distributed computing task result query flow in accordance with one embodiment of the invention. As shown in FIG. 7, the distributed computing task result query flow of one embodiment of the present invention includes:
step S701: inquiring all the published executable tasks according to the inquiry request sent by the task publisher;
specifically, the task publisher may query the task calculation results of all published tasks. The blockchain node can list the execution states of all the subtasks, and the task publisher can inquire the execution states of all the subtasks or independently inquire the state of any subtask. Subtask execution states include, but are not limited to: issuing, claimed, calculation is complete. The task detail can be displayed for the task in the state of issuing, the task claimant (i.e. the task execution device applying to the task) can be displayed for the task in the state of claimed, and the task calculation result, the corresponding rights issuing situation and the like can be displayed for the task in the state of calculation completion.
Step S702: and inquiring all executable tasks participated by the task executor and corresponding task rights according to the inquiry request issued by the task executor.
The task participant (here, the task executor) can query all the tasks that it participates in, the task details, and the rights (task entitlements) to complete the task acquisition.
The step S701 and the step S702 are executed separately, and the step numbers S701 and S702 do not restrict the order of the step S701 and the step S702.
According to the embodiment of the invention, the block chain is utilized to connect the socially idle computing resources to execute the distributed computing task, so that the resource utilization rate is improved, and the computing cost is reduced. The intelligent contract is operated on the blockchain to determine the right of the nodes participating in the distributed computing task, so that the rights and obligations of the participants are clear, and the participation enthusiasm is improved. The situation that the running environment is maliciously destroyed is guaranteed not to exist in the distributed computing program through the trusted execution environment of the block chain. The method has the advantages that the computable task is confirmed to be executed by the cryptographic technology, the calculation result is reliable and can be verified, and the defect of resource waste caused by the fact that a plurality of participants execute the same calculation and the same result is the same is overcome.
Fig. 8 is a schematic diagram of main modules of a task performing device according to an embodiment of the present invention. As shown in fig. 8, a task execution device 800 according to an embodiment of the present invention mainly includes: task application module 801, task execution module 802.
The task application module 801 is configured to apply for an executable task on a blockchain, and obtain a calculation program of the executable task and task input information from the blockchain after applying for the executable task;
the task execution module 802 is configured to load a computing program and task input information into a trusted execution environment of the blockchain, execute the computing program in the trusted execution environment to obtain a task computing result, and sign the task input information and the task computing result to obtain signature result data; the signature result data is sent to the blockchain, the executable task is determined to be actually executed according to the signature result data through the blockchain, the task calculation result is credible, and then the task calculation result is stored in the blockchain.
The task execution module 802 may specifically obtain a download address of a computing program and task input information from task information written in an intelligent contract, where the task information is written in the intelligent contract by a task publisher when publishing an executable task to a blockchain, and obtain the computing program according to the download address of the computing program.
The task information written to the smart contract also includes a hash value of the computing program.
The task execution module 802 may perform a hash operation on the computing program and determine that the result of the hash operation is consistent with a hash value comparison of the computing program obtained from the task information written in the smart contract.
The task information written to the smart contract also includes a task identification of the executable task.
The task execution module 802 is further configured to: after the signature result data is obtained, a first contract transaction is generated and sent to the blockchain, and the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
The task application module 801 may apply for the executable task by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identification and a task identification of the executable task.
The task execution module 802 is further configured to: respectively signing the task input information and the task calculation result by utilizing a private key which is pre-built in a calculation program of an executable task, so as to obtain signature result data comprising the task calculation result, the signature of the task calculation result and the signature of the task input information; or signing by taking the task input information and the task calculation result as a whole, and obtaining signature result data comprises the whole signature of the task input information and the task calculation result.
The task information written into the intelligent contract also comprises task rights corresponding to the executable task.
The task execution device 800 may further include a task result query module for: task entitlements received from the blockchain issued through the smart contract are queried.
In addition, the specific implementation of the task execution device in the embodiment of the present invention has been described in detail in the task execution method above, so the description is not repeated here.
FIG. 9 is a schematic diagram of the principal components of a distributed computing system according to one embodiment of the invention. As shown in fig. 9, the distributed computing system 900 of one embodiment of the present invention mainly includes:
the distributed computing system 900 of one embodiment of the present invention includes: task execution device 901, and blockchain 902, task issuing device 903, blockchain 902 including nodes, wherein:
the task issuing device 903 is configured to write task information of an executable task into the intelligent contract to issue the executable task onto the blockchain 902, where the task information written into the intelligent contract includes a computing program of the executable task and task input information;
the blockchain 902 is configured to provide a trusted execution environment for the task execution device 901, so that the task execution device 901 executes a computing program in the trusted execution environment to obtain a task computing result, sign task input information and the task computing result, and send signature result data obtained by the signing to the blockchain 902;
The blockchain 902 is further used for determining that the executable task is actually executed and the task calculation result is reliable according to the signature result data, and storing the task calculation result.
The task issuing device 903 is further configured to decompose the distributed computing task into executable tasks that can be independently executed, generate a public key and a private key corresponding to the executable tasks, and embed the private key into a computing program of the executable tasks.
The task issuing device 903 is also used for querying the execution state of a distributed computing task or an executable task, and for querying the task computing result of the executable task.
The task execution device 901 is further configured to query the executable task and query the task right of the corresponding executable task issued by the smart contract.
The task information written in the intelligent contract also comprises a task identifier of the executable task and a public key corresponding to the executable task.
In one embodiment, the signature result data includes a task calculation result, a signature of the task calculation result, and a signature of the task input information.
The blockchain 902 is specifically configured to query, according to a task identifier of an executable task, to obtain task input information and a public key corresponding to the executable task, and verify a signature of the task input information by using the queried task input information and the public key corresponding to the executable task, determine that the executable task is actually executed when the signature of the task input information is correct, and verify a signature of a task calculation result by using the public key corresponding to the executable task after determining that the executable task is actually executed, and determine that the task calculation result is trusted when the signature of the task calculation result is correct.
In another embodiment, the signature result data includes an overall signature of the task input information and the task calculation result, the overall signature being obtained by the task execution device signing the task input information and the task calculation result as a whole.
The blockchain 902 is specifically configured to query, through an intelligent contract, a public key corresponding to an executable task according to a task identifier of the executable task, and verify, by using the queried public key corresponding to the executable task, an overall signature of task input information and a task calculation result, where the overall signature is correct, it is determined that the executable task is actually executed and the task calculation result is trusted.
The blockchain 902 may be further configured to query, according to a task identifier of an executable task, a corresponding task applicant identifier and a task executor identifier according to an intelligent contract, and determine that the task applicant identifier is consistent with the task executor identifier by comparing, where the task applicant identifier is a user public key address corresponding to the task executor 901 that applies for the executable task, and the task executor identifier is a user public key address corresponding to the task executor 901 that executes the executable task.
The task execution device 901 and/or the task publication device 903 may be located on a node of the blockchain 902 or on a different machine than the node of the blockchain 902.
The task performing device 901 functions the same as the task performing device 800 of the above embodiment, and reference may be made to the description of the task performing device 800 of the above embodiment.
Fig. 10 illustrates an exemplary system architecture 1000 to which a task execution method or task execution device of an embodiment of the present invention may be applied.
As shown in fig. 10, a system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 serves as a medium for providing a communication link between the terminal apparatuses 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user can interact with a server 1005 via a network 1004 using terminal apparatuses 1001, 1002, 1003 to receive or transmit messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 1001, 1002, 1003.
The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 1005 may be a server providing various services, such as a background management server (merely an example) providing support for shopping-type websites browsed by the user using the terminal apparatuses 1001, 1002, 1003. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the task execution method provided by the embodiment of the present invention may be executed by the terminal device 1001, 1002, 1003 or the server 1005, and accordingly, the task execution apparatus is generally provided in the terminal device 1001, 1002, 1003 or the server 1005.
It should be understood that the number of terminal devices, networks and servers in fig. 10 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 11, there is illustrated a schematic diagram of a computer system 1100 suitable for use in implementing a terminal device or server in accordance with embodiments of the present application. The terminal device or server illustrated in fig. 11 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU) 1101, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, and the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 1101.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor comprises a task application module and a task execution module. The names of these modules do not limit the module itself in some cases, for example, the task application module may also be described as "a module for applying for an executable task on a blockchain and, after applying for the executable task, acquiring a calculation program and task input information of the executable task from the blockchain".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: applying for an executable task on a blockchain, and after applying for the executable task, acquiring a computing program and task input information of the executable task from the blockchain; loading the calculation program and the task input information into a trusted execution environment of the blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data; and sending the signature result data to the blockchain, determining that the executable task is actually executed and the task calculation result is credible according to the signature result data through the blockchain, and then storing the task calculation result in the blockchain.
According to the technical scheme of the embodiment of the invention, executable tasks on the blockchain are applied, after the executable tasks are applied, computing programs and task input information of the executable tasks are obtained from the blockchain, the obtained computing programs and task input information are loaded into a trusted execution environment of the blockchain, in the trusted execution environment, the computing programs are executed to obtain task computing results, the task input information and the task computing results are signed to obtain signature result data, the signature result data are sent to the blockchain, the fact that the executable tasks are actually executed and the task computing results are trusted is determined through the blockchain according to the signature result data, and then the task computing results are stored in the blockchain. The method can overcome the defects of high construction cost and wasteful calculation power due to idle, ensure the safety of the running environment of the distributed calculation program, avoid the malicious access or damage of the computers of the participants by the distributed calculation program, realize the verification of the reliable execution of tasks and the credibility of calculation results, save the resources consumed by the verification, improve the utilization rate of the resources, reduce the calculation cost and improve the participation enthusiasm of the block chain nodes.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (24)

1. A method of performing a task, comprising:
applying for an executable task on a blockchain, and after applying for the executable task, acquiring a computing program and task input information of the executable task from the blockchain; the computing program at least comprises a computing process and a signing process of corresponding executable tasks, wherein the computing process is used for computing according to task input information, and the signing process is used for signing the task input information and task computing results after the tasks are finished;
loading the calculation program and the task input information into a trusted execution environment of the blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data;
The signature result data is sent to the blockchain, the executable task is determined to be actually executed and the task calculation result is credible according to the signature result data through the blockchain, and then the task calculation result is stored in the blockchain;
the signing the task input information and the task calculation result comprises the following steps: and signing the task input information and the task calculation result respectively by utilizing a private key which is pre-built in a calculation program of the executable task, or signing the task input information and the task calculation result as a whole.
2. The method of claim 1, wherein the obtaining the computing program and task input information for the executable task from the blockchain comprises:
and obtaining the download address of the computing program and the task input information from the task information written in the intelligent contract, and obtaining the computing program according to the download address of the computing program, wherein the task information is written in the intelligent contract by a task publisher when the executable task is published to the blockchain.
3. The method of claim 2, wherein the task information of writing a smart contract further comprises a hash value of the computing program;
before loading the computing program and the task input information into a trusted execution environment of the blockchain, the method comprises:
and carrying out hash operation on the computing program, and determining that the result of the hash operation is consistent with the hash value comparison of the computing program obtained from the task information of the written intelligent contract.
4. The method of claim 2, wherein the task information written to the smart contract further includes a task identification of the executable task;
the sending the signature result data to the blockchain includes:
and after the signature result data is obtained, generating a first contract transaction, and sending the first contract transaction to the blockchain, wherein the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
5. The method of claim 4, wherein the task information written to the smart contract further includes a public key corresponding to the executable task;
The signature result data comprises the task calculation result, the signature of the task calculation result and the signature of the task input information;
determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, including:
inquiring public keys corresponding to the task input information and the executable task according to the task identification of the executable task through the intelligent contract, verifying the signature of the task input information by using the inquired public keys corresponding to the task input information and the executable task, determining that the executable task is actually executed under the condition that the signature of the task input information is correct, verifying the signature of the task calculation result by using the public key corresponding to the executable task after determining that the executable task is actually executed, and determining that the task calculation result is credible under the condition that the signature of the task calculation result is correct.
6. The method of claim 4, wherein the task information written to the smart contract further includes a public key corresponding to the executable task;
The signature result data comprises an overall signature of the task input information and the task calculation result;
determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, including:
inquiring a public key corresponding to the executable task through the intelligent contract according to the task identifier of the executable task, and verifying the whole signature of the task input information and the task calculation result by utilizing the inquired public key corresponding to the executable task, wherein under the condition that the whole signature is correct, the executable task is determined to be actually executed and the task calculation result is credible.
7. The method of claim 4, wherein the information of the first contract transaction further includes a task executor identification;
the method further comprises the steps of: applying for the executable task by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identifier and a task identifier of the executable task;
before determining, by the blockchain, that the executable task is actually executed and the task calculation result is trusted according to the signature result data, the method further includes: inquiring the corresponding task applicant identifier and the task executor identifier according to the task identifier of the executable task through the intelligent contract, and determining that the task applicant identifier and the task executor identifier are consistent in comparison.
8. The method of claim 2, wherein the task information written in the smart contract further includes task rights corresponding to the executable task;
after saving the task computation results in the blockchain, the method further includes: the task rights issued by the blockchain through the smart contract are received.
9. A task execution device, characterized by comprising:
the task application module is used for applying for executable tasks on the block chain and acquiring calculation programs and task input information of the executable tasks from the block chain after the executable tasks are applied for; the computing program at least comprises a computing process and a signing process of corresponding executable tasks, wherein the computing process is used for computing according to task input information, and the signing process is used for signing the task input information and task computing results after the tasks are finished;
the task execution module is used for loading the calculation program and the task input information into a trusted execution environment of the blockchain, executing the calculation program in the trusted execution environment to obtain a task calculation result, and signing the task input information and the task calculation result to obtain signature result data; the signature result data is sent to the blockchain, the executable task is determined to be actually executed and the task calculation result is credible according to the signature result data through the blockchain, and then the task calculation result is stored in the blockchain;
The task execution module is further configured to: respectively signing the task input information and the task calculation result by utilizing a private key which is pre-built in a calculation program of the executable task, so as to obtain signature result data comprising the task calculation result, the signature of the task calculation result and the signature of the task input information; or signing by taking the task input information and the task calculation result as a whole, wherein the obtained signature result data comprises the whole signature of the task input information and the task calculation result.
10. The apparatus of claim 9, wherein the task execution module is further to:
and obtaining the download address of the computing program and the task input information from the task information written in the intelligent contract, and obtaining the computing program according to the download address of the computing program, wherein the task information is written in the intelligent contract by a task publisher when the executable task is published to the blockchain.
11. The apparatus of claim 10, wherein the task information of writing a smart contract further comprises a hash value of the computing program;
The task execution module is further configured to:
and carrying out hash operation on the computing program, and determining that the result of the hash operation is consistent with the hash value comparison of the computing program obtained from the task information of the written intelligent contract.
12. The apparatus of claim 10, wherein the task information written to the smart contract further comprises a task identification of the executable task;
the task execution module is further configured to:
and after the signature result data is obtained, generating a first contract transaction, and sending the first contract transaction to the blockchain, wherein the information of the first contract transaction comprises a task identifier of the executable task and the signature result data.
13. The apparatus of claim 12, wherein the task application module is further configured to: applying for the executable task by sending a second contract transaction to the blockchain, the information of the second contract transaction including a task applicator identifier and a task identifier of the executable task.
14. The apparatus of claim 10, wherein the task information written to the smart contract further includes task rights corresponding to the executable task;
The device also comprises a task result query module for: querying the task entitlements received from the blockchain issued by the smart contract.
15. A distributed computing system, comprising: the task execution device of any one of claims 9 to 14, and a blockchain, task publication device, wherein:
the task issuing device is used for writing task information of an executable task into an intelligent contract so as to issue the executable task onto the blockchain, wherein the task information written into the intelligent contract comprises a computing program of the executable task and task input information; the computing program at least comprises a computing process and a signing process of corresponding executable tasks, wherein the computing process is used for computing according to task input information, and the signing process is used for signing the task input information and task computing results after the tasks are finished;
the block chain is used for providing a trusted execution environment for the task execution device, executing the calculation program in the trusted execution environment by the task execution device, obtaining a task calculation result, signing the task input information and the task calculation result, and sending signature result data obtained by signing to the block chain;
The blockchain is also used for determining that the executable task is actually executed and the task calculation result is credible according to the signature result data, and storing the task calculation result;
the signing the task input information and the task calculation result comprises the following steps: and signing the task input information and the task calculation result respectively by utilizing a private key which is pre-built in a calculation program of the executable task, or signing the task input information and the task calculation result as a whole.
16. The system of claim 15, wherein the task issuing device is further configured to decompose a distributed computing task into the executable tasks that can be independently executed, generate a public key and a private key corresponding to the executable tasks, and embed the private key into a computing program of the executable tasks.
17. The system of claim 16, wherein the task issuing device is further configured to query an execution state of the distributed computing task or the executable task, and to query a task calculation result of the executable task.
18. The system of claim 15, wherein the task execution device is further configured to query the executable task and query the smart contract for issued task entitlements corresponding to the executable task.
19. The system of claim 15, wherein the task information written to the smart contract further includes a task identification of the executable task, a public key corresponding to the executable task;
the signature result data comprises the task calculation result, the signature of the task calculation result and the signature of the task input information;
the blockchain is further used for inquiring the public key corresponding to the task input information and the executable task according to the task identification of the executable task through the intelligent contract, verifying the signature of the task input information by utilizing the inquired public key corresponding to the task input information and the executable task, determining that the executable task is actually executed under the condition that the signature of the task input information is correct, verifying the signature of the task calculation result by utilizing the public key corresponding to the executable task after determining that the executable task is actually executed, and determining that the task calculation result is reliable under the condition that the signature of the task calculation result is correct.
20. The system of claim 15, wherein the task information written to the smart contract further includes a task identification of the executable task, a public key corresponding to the executable task;
The signature result data comprises an overall signature of the task input information and the task calculation result, wherein the overall signature is obtained by the task execution device by taking the task input information and the task calculation result as a whole;
the blockchain is further used for inquiring a public key corresponding to the executable task according to the task identification of the executable task through the intelligent contract, verifying the overall signature of the task input information and the task calculation result by using the inquired public key corresponding to the executable task, and determining that the executable task is actually executed and the task calculation result is credible under the condition that the overall signature is correct.
21. The system of claim 19 or 20, wherein the blockchain is further configured to query, according to the task identifier of the executable task, a corresponding task applicant identifier and a task executor identifier according to the intelligent contract, and determine that the task applicant identifier is consistent with the task executor identifier, where the task applicant identifier is a user public key address corresponding to a task execution device that applies for the executable task, and the task executor identifier is a user public key address corresponding to a task execution device that executes the executable task.
22. The system of claim 15, wherein the task execution device and/or task publication device is located on a node of the blockchain.
23. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
24. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1-8.
CN202110936101.XA 2021-08-16 2021-08-16 Task execution method and device and distributed computing system Active CN113873004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110936101.XA CN113873004B (en) 2021-08-16 2021-08-16 Task execution method and device and distributed computing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110936101.XA CN113873004B (en) 2021-08-16 2021-08-16 Task execution method and device and distributed computing system

Publications (2)

Publication Number Publication Date
CN113873004A CN113873004A (en) 2021-12-31
CN113873004B true CN113873004B (en) 2024-03-26

Family

ID=78990312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110936101.XA Active CN113873004B (en) 2021-08-16 2021-08-16 Task execution method and device and distributed computing system

Country Status (1)

Country Link
CN (1) CN113873004B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114581090B (en) * 2022-05-07 2022-07-22 华控清交信息科技(北京)有限公司 Safety computing method and safety computing system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018119892A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Method and device for publishing and validating software application program
CN109889498A (en) * 2019-01-16 2019-06-14 余炀 Calculating verification method and system based on block chain
CN111027086A (en) * 2019-12-16 2020-04-17 支付宝(杭州)信息技术有限公司 Private data protection method and system
CN111130800A (en) * 2019-12-25 2020-05-08 上海沄界信息科技有限公司 Trusted prediction machine implementation method and device based on TEE
CN111143890A (en) * 2019-12-26 2020-05-12 百度在线网络技术(北京)有限公司 Calculation processing method, device, equipment and medium based on block chain
CN111885050A (en) * 2020-07-21 2020-11-03 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network, related equipment and medium
CN112507369A (en) * 2021-01-29 2021-03-16 腾讯科技(深圳)有限公司 Service processing method and device based on block chain, readable medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018119892A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Method and device for publishing and validating software application program
CN109889498A (en) * 2019-01-16 2019-06-14 余炀 Calculating verification method and system based on block chain
CN111027086A (en) * 2019-12-16 2020-04-17 支付宝(杭州)信息技术有限公司 Private data protection method and system
CN111130800A (en) * 2019-12-25 2020-05-08 上海沄界信息科技有限公司 Trusted prediction machine implementation method and device based on TEE
CN111143890A (en) * 2019-12-26 2020-05-12 百度在线网络技术(北京)有限公司 Calculation processing method, device, equipment and medium based on block chain
CN111885050A (en) * 2020-07-21 2020-11-03 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network, related equipment and medium
CN112507369A (en) * 2021-01-29 2021-03-16 腾讯科技(深圳)有限公司 Service processing method and device based on block chain, readable medium and electronic equipment

Also Published As

Publication number Publication date
CN113873004A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
US20220239496A1 (en) Blockchain consensus method, device and system
EP3559874B1 (en) Event-driven blockchain workflow processing
CN108305072B (en) Method, apparatus, and computer storage medium for deploying a blockchain network
CN108551437B (en) Method and apparatus for authenticating information
CN108900364B (en) Block chain network management method, block chain network management device, block chain network management medium and electronic equipment
JP2022529967A (en) Extracting data from the blockchain network
CN113657900B (en) Cross-chain transaction verification method and system and cross-chain transaction system
CN111309745B (en) Virtual resource processing method and device, electronic equipment and storage medium
CN109690491B (en) Executing remote commands
US11057368B2 (en) Issuing a certificate based on an identification of an application
WO2022057275A1 (en) Data check method and apparatus, and device and computer-readable medium
WO2020156008A1 (en) Blockchain-based information distribution method and system
CN111598575A (en) Business process control method and device, electronic equipment and readable storage medium
US11949688B2 (en) Securing browser cookies
CN110247917B (en) Method and apparatus for authenticating identity
CN113873004B (en) Task execution method and device and distributed computing system
US20110289424A1 (en) Secure application of custom resources in multi-tier systems
CN116070285A (en) Asynchronous consensus method, device, server and medium based on Bayesian fault tolerance
CN113765968A (en) File transmission method, device and system
CN107203724B (en) File submission method and device
CN113206738B (en) Digital certificate management method and device
CN111429326B (en) Method and device for mutual assistance by using blockchain network
CN111209540B (en) Information verification method, device and storage medium
CN111598544A (en) Method and apparatus for processing information
CN109657481B (en) Data management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant