WO2021114889A1 - Computational task processing method and device, storage medium, and processor - Google Patents

Computational task processing method and device, storage medium, and processor Download PDF

Info

Publication number
WO2021114889A1
WO2021114889A1 PCT/CN2020/122886 CN2020122886W WO2021114889A1 WO 2021114889 A1 WO2021114889 A1 WO 2021114889A1 CN 2020122886 W CN2020122886 W CN 2020122886W WO 2021114889 A1 WO2021114889 A1 WO 2021114889A1
Authority
WO
WIPO (PCT)
Prior art keywords
verification
calculation
task
computing
node
Prior art date
Application number
PCT/CN2020/122886
Other languages
French (fr)
Chinese (zh)
Inventor
李振宇
张奥萌
王蒙
曹文财
郑汉城
王健
Original Assignee
深圳数字生命研究院
深圳碳云智能数字生命健康管理有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳数字生命研究院, 深圳碳云智能数字生命健康管理有限公司 filed Critical 深圳数字生命研究院
Publication of WO2021114889A1 publication Critical patent/WO2021114889A1/en

Links

Images

Classifications

    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of blockchain technology, and specifically to a method and device for processing computing tasks, a storage medium, and a processor.
  • the blockchain is a distributed ledger.
  • the decentralized protocol between the nodes of the blockchain network maintains a continuously growing data chain composed of ordered data blocks, and each data block has a timestamp And a pointer to the previous block, which can safely store transaction data such as digital currency or equity, debt, copyright, etc.
  • the information in the block cannot be forged and tampered with.
  • the traditional blockchain proof-of-work method is to solve a complex mathematical problem, such as calculating a number that meets certain specific conditions through a hash function.
  • the first one to solve this problem and the nodes that have been verified by most of the nodes in the blockchain get the right to generate new blocks and receive certain rewards.
  • this approach leads to a lot of waste of computing resources.
  • the embodiments of the present application provide a computing task processing method and device, storage medium, and processor to at least solve the large number of computing tasks in the blockchain in the prior art. In the processing of computing tasks, there are calculations. Technical issues that cannot be quickly verified as a result.
  • a method for processing computing tasks including: a first computing node on a blockchain receives a computing task set, and when the computing task set is completed, the first computing node will The calculation result set is broadcast to the verification node in the blockchain, where the verification node is any calculation node or part of the calculation node on the blockchain; part of the calculation results that have been broadcast on the first calculation node is randomly selected; The calculation task corresponding to the calculation result is recalculated, and the randomly selected part of the calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first computing node is verified.
  • the calculation task that produces the partial calculation result to verify the randomly selected partial calculation result, including: obtaining the input data received by the application program used to process the target calculation task, and the verification node Randomly generated reference data, in which the target calculation task is the calculation task that has generated part of the calculation result; the verification node uses the application program to calculate the input data and reference data to obtain the verification result; the verification result is compared with the corresponding one on the first calculation node The calculation results generated by the calculation task are compared to complete the verification.
  • the reference data is generated based on the random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the verification results of a predetermined number of computing nodes are randomly selected as a subset to form the overall verification result of the blockchain.
  • the predetermined number is used to determine the number of verification nodes, wherein the number of verification nodes is determined based on the problem complexity m and the length of each verification n.
  • the method further includes: acquiring an application program for processing computing tasks on any computing node; acquiring historical information on the blockchain, where , The historical information includes at least: the credit rating of the program publishing object that releases the application, the credit rating of the task publishing object that publishes the computing task; determine the review level based on the credit rating of the program publishing object and/or the credit rating of the task publishing object; based on Review the level and determine the verification mode, where the verification mode is used to verify the calculation results released by the computing node.
  • the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
  • the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses of the published application in the history.
  • the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of completions of the task, and the completion rate of the task in the history.
  • a verification mode is determined based on the review level, where the verification mode includes at least one of the following:
  • the security of the platform that publishes the application program is verified by any one of the following methods: detecting the open source code of the application program, verifying the application program using security verification software, and verifying the application program using a security test program.
  • the computing task includes: program information of an application program used to process the computing task, data information of input data corresponding to the computing task, and virtual resources obtained by completing the computing task.
  • the first computing node while receiving the set of calculation tasks, receives the calculation workload of the calculation task and the verification workload of verifying the set of calculation results according to a preset algorithm, wherein the calculation workload is based on the amount of input data and the application The complexity of the algorithm used by the program is determined, and the verification workload is determined based on the preset total workload and calculation workload.
  • each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
  • a method for processing computing tasks including: when the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed , The first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; acquiring historical information on the blockchain, where history The information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit rating of the program publishing object and / Or the credit rating of the task release object, determine the review level; based on the review level, determine the verification mode, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; pass The calculation tasks corresponding to the partial calculation results are recalculated
  • the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
  • the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses of the published application in the history.
  • the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of completions of the task, and the completion rate of the task in the history.
  • the verification mode is determined based on the review level, where the verification mode includes at least one of the following: no fragment verification and data set verification, no fragment verification and data set verification, reduction of the multiple of fragment verification, and fragment verification And data set verification.
  • verifying the randomly selected part of the calculation result includes: obtaining input data received by the application program for processing the target calculation task, and verifying the node Randomly generated reference data, where the target calculation task is a calculation task that has produced partial calculation results: the verification node uses the application program to calculate the input data and reference data to obtain the verification result; the verification result is compared with the corresponding one on the first calculation node The calculation results generated by the calculation task are compared to complete the verification.
  • reference data is generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the verification results of the verification computing nodes are used as a subset to form the overall verification result of the blockchain.
  • each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
  • a computing task processing device including:
  • the broadcast module is set to receive the set of calculation tasks through the first computing node on the blockchain, and when the set of computing tasks is completed, broadcast the set of calculation results to the verification node in the blockchain through the first computing node, where ,
  • the verification node is any computing node or part of the computing node on the blockchain;
  • the extraction module is set to randomly extract part of the calculation results that have been broadcast on the first computing node;
  • the verification module is set to recalculate the calculation tasks corresponding to the partial calculation results, and is used to verify the randomly selected partial calculation results;
  • the first determining module is configured to determine that the calculation result issued by the first computing node passes the verification if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast.
  • a storage medium is also provided.
  • the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the processing method of the foregoing calculation task.
  • a processor which is configured to run a program, wherein the above-mentioned processing method for computing tasks is executed when the program is running.
  • the first node on the blockchain after the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node.
  • the verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified.
  • the verification speed is faster.
  • each verification node adopts a method of randomly verifying part of the calculation results.
  • the first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results.
  • the difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.
  • Fig. 1 is a flowchart of a method for processing a computing task according to an embodiment of the present application
  • Fig. 2 is a flowchart of an optional processing method for computing tasks according to an embodiment of the present application
  • Fig. 3 is a flowchart of another method for processing a computing task according to an embodiment of the present application.
  • Fig. 4 is a schematic diagram of a processing device for computing tasks according to an embodiment of the present application.
  • Fig. 5 is a schematic diagram of another computing task processing device according to an embodiment of the present application.
  • Blockchain A distributed ledger.
  • the decentralized agreement between blockchain network nodes maintains a continuously growing data chain composed of ordered data blocks, and each data block has a timestamp And a pointer to the previous block. It can safely store transaction data such as digital currency or equity, debt, copyright, etc. The information in the block cannot be forged or tampered with.
  • the block chain is also an open ledger, which is permanent. , which records the transactions between the two efficiently and retrospectively. This ledger can also use programmable scripts to automatically trigger transactions.
  • Blockchain solves the Byzantine general problem, which can greatly reduce the cost of trust in society and reshape The mechanism of Internet value transmission.
  • Proof of Work Proof Of Work, POW for short. Prove the completion of the corresponding workload by certifying the results of the work.
  • Hash function also known as hash function, given an input x, it will calculate the corresponding output H(x).
  • a method for processing computing tasks is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. The logical sequence is shown in the flowchart, but in some cases, the steps shown or described may be performed in a different order than here.
  • Fig. 1 is a flowchart of a method for processing a computing task according to an embodiment of the present application. As shown in Fig. 1, the method includes the following steps:
  • Step S102 the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node broadcasts the computing result set to the verification node in the blockchain, where the verification node is Any computing node or part of computing nodes on the blockchain;
  • any node with computing needs on the blockchain can publish computing tasks and become a task publishing node.
  • computing tasks include: program information of applications used to process computing tasks, data information of input data corresponding to computing tasks, and virtual resources obtained by completing computing tasks.
  • Virtual resources can exist on the Internet and can be The resources to be transferred and used, specifically, can be points, gifts, or online goods, but are not limited to this.
  • a node publishes a computing task, it can provide the following information: the number and version number of the application that needs to be used; the method of obtaining input data (including web crawler acquisition, personal collection, public data, etc.) and the amount of data; for this calculation task Remuneration paid.
  • the calculation task will also attach the release time and the signature of the release node.
  • each computing node in the blockchain has a name, number, and version number.
  • the number of each application is unique, and the number can be automatically generated in the order in which the application is released. Yes, the number can consist of letters and numbers.
  • a verification code such as a hash value
  • each application program has a corresponding publisher, and whenever an application program is successfully used for a computing task, the publisher of the application program can obtain revenue.
  • a task management center is deployed on a specific node on the blockchain, which is responsible for receiving computing tasks issued by each node on the blockchain. As shown in Figure 2, in a transaction cycle, multiple computing tasks are packaged into a computing task set and broadcast to the entire network.
  • any node on the blockchain After any node on the blockchain receives the set of calculation tasks, if it decides to perform task calculation, then this node becomes the first calculation node. First, all transactions in the transaction period are packaged, and then task calculation is started. As shown in Figure 2, after the node has completed the workload, the nodes participating in the calculation will generate an updated block based on the access method of the calculation result and the packaged transaction, and broadcast it to the entire network or verification nodes. Among them, the calculation result may include the expected time length and the actual time length to complete the published calculation task.
  • the verification node can be determined in two ways.
  • any node on the blockchain is a verification node.
  • a node receives the set of calculation results broadcast by other nodes, it first verifies whether the traditional proof of work is passed, and if it passes, then verifies the authenticity of the result of the calculation task.
  • the verification can be performed at the same time or the order of verification can be exchanged.
  • the traditional workload is selected first because the verification is fast, and the minimum workload is used to determine whether it is necessary Proceed to the next verification.
  • the prerequisite for propagating a new block is that both verifications pass.
  • the verification node can be a subset of the entire node, called a verification node set, which can form a verification chain.
  • the selection methods of this collection include but are not limited to:
  • a node pool is composed of all valid nodes.
  • the valid nodes must be survivable (the active nodes are the surviving nodes).
  • the valid nodes are also limited by the node's credit level, for example, the credit level It needs to reach a certain predetermined level or above; in other preferred embodiments, the validity of the node can also include other restrictive factors such as the computing power and historical information of the computing node on the premise that it is survivable, as detailed here Not limited
  • a required number of nodes are randomly selected from the node pool as verification nodes to form a verification node set.
  • the method of random selection can be to number the nodes in sequence, and then use a set of random numbers for extraction.
  • a node pool is composed of all valid nodes.
  • the valid nodes must be survivable (the active nodes are the surviving nodes).
  • the valid nodes are also limited by the node's credit level, for example, the credit level It needs to reach a certain predetermined level or above; in other preferred embodiments, the validity of the node can also include other restrictive factors such as the computing power and historical information of the computing node on the premise that it is survivable, as detailed here Not limited
  • all valid nodes declare the resources that can be used to perform calculations this time, and determine whether they are selected as verification nodes according to the amount of resources that can be used to perform calculations. For example, when the number of resources that can be used to perform calculations is greater than or equal to the predetermined The threshold can be selected for this verification;
  • the verification node that completes the task can also invest in execution computing resources and provide corresponding virtual resources.
  • Each verification node first verifies whether the traditional proof of work is passed, and if it passes, it verifies the authenticity of the result of the calculation task.
  • Step S104 randomly extract part of the calculation results that have been broadcast on the first computing node
  • the randomness requires that the calculation task can be divided into several parts at will, and each part can be calculated independently without relying on the results of other parts.
  • Step S106 by recalculating the calculation tasks corresponding to the partial calculation results, verifying the randomly selected partial calculation results
  • step S108 if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first computing node passes the verification.
  • the verification node can recalculate the input data that produces this part of the calculation result, and compare the recalculation result (that is, the verification result above) and the consistency of the calculation result that has been broadcast to determine whether the first calculation node that initiated the broadcast Completed the calculation task. As shown in Figure 2, if the two calculation results are consistent, it is determined that the first computing node has completed the calculation task, and the calculation result passes the verification.
  • the first node on the blockchain After the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node.
  • the verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified.
  • the verification speed is faster.
  • each verification node adopts a method of randomly verifying part of the calculation results.
  • the first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results.
  • the difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.
  • verifying the randomly selected partial calculation result includes: obtaining the received application program for processing the target calculation task The input data and the reference data randomly generated by the verification node. The input data and reference data are used to determine the target calculation task.
  • the target calculation task is the calculation task that has generated part of the calculation result; the verification node uses the application program to compare the input data and reference The calculation task determined by the data is calculated to obtain a verification result; the verification result is compared with the calculation result generated by the corresponding calculation task on the first computing node to complete the verification.
  • the embodiment of this application does not make any limitation on the task type of the computing task.
  • the input data of the application program used for the calculation task is the result file and the index file of the comparison of the short sequence obtained by the genome sequencing to the reference genome sequence.
  • the result file includes the alignment of each short sequence, such as whether it can be aligned, if so, which position on the reference genome, the quality of the alignment, and the bases included in the short sequence. What are the specific differences between the bases on the reference genome, and so on.
  • the result file is sorted according to the alignment position of the short sequence in the reference genome, for example, from chromosome 1 to chromosome 22, followed by X chromosome, Y chromosome (male specific), and mitochondrial chromosome.
  • the index file allows the application to extract the comparison result of a specific position in the reference genome from the comparison result file.
  • reference data may be generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the aforementioned random number generation function can be a combination of the srand() function and the rand() function in the C language, but it is not limited to this.
  • the system time of the node (the number of seconds elapsed from 0:00:00 on January 1, 1970, UTC to the current time) of the node can be used to perform a remainder operation on the process id of the current verification task.
  • the result of the operation is used as the parameter of the srand() function.
  • the process IDs of different nodes for verification tasks are basically different, the parameters passed by different nodes to the srand() function are also basically different, which eventually leads to different random numbers generated by the rand() function, so different nodes During verification, the randomly generated position coordinates are basically different. It is also impossible for a computing node to know the position coordinates randomly generated by other nodes, so it is impossible to take a cheating behavior that only calculates these position coordinates without calculating other position coordinates.
  • the random number seed used when selecting the result should be hidden, and the same seed should be distributed to multiple nodes to avoid cheating and malicious verification. For maliciously verified or cheating nodes, the probability of selection is reduced.
  • the verification results of a predetermined number of calculation nodes are randomly selected as a subset to form the whole of the blockchain Validation results.
  • the above-mentioned preset threshold can be set according to actual use, which is not specifically limited in this application.
  • the predetermined number is used to determine the number of verification nodes, where the number of verification nodes is determined based on the problem complexity m and the length of each verification n.
  • the set of the result subsets of these node verifications can effectively cover the entire calculation result.
  • the number of verification nodes is determined by the problem complexity m and the length of each verification n.
  • the weight of m, ⁇ 0 , ⁇ 1 are deviations, and the value range can be determined according to the longest length and maximum complexity.
  • the solution Take any solution in space.
  • the interval complete coverage algorithm or other algorithms can be used to find the minimum number of verification nodes P.
  • the value range of P is limited by the specific conditions of the blockchain, for example, the limit is at least 101.
  • the specific principle is: no more than the summary points, no less 1, and according to the requirements issued by the task issuer.
  • part of the calculation result that has been broadcast on the first computing node is randomly selected multiple times, and the part of the calculation result randomly selected each time is verified. If the verification result obtained by recalculating multiple times If they are consistent with the calculation results that have been broadcast, it is determined that the calculation results published by the first computing node pass the verification.
  • V times may be randomly selected for each computing task for verification, where V is greater than or equal to 2 to ensure verification coverage. For example, you can extract 10 times, each time 0.01% of the calculation result is extracted, and then the calculation task of the extracted calculation result is verified. If all V verifications are passed, then a single computing task is verified.
  • each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
  • the verification node approves the calculation results of the calculation node.
  • the verification node broadcasts the verification result in the set. If the verification node set passes, the verification is passed, the block is added to the blockchain of its own record, and a verification node is selected from the verification set to package the transaction cycle The task record generates a new block.
  • the block is rejected as a new block.
  • the task will continue to be in an incomplete state without modification.
  • the method further includes: acquiring an application program for processing computing tasks on any computing node; Historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task; the credit rating based on the program publishing object and/or the task publishing object
  • the credit rating determines the review level; based on the review level, determines the verification mode, where the verification mode is used to verify the calculation results issued by the computing node.
  • an application center is deployed on a specific node of the blockchain, and the application can be a virtual center, which is mainly responsible for security review and verification of the application to be chained and serves as a program warehouse. For querying and calling applications.
  • the application center is also provided with an analysis module of related historical information. This module is the basic component of the application center and is also in the program list of the application center. It can perform the analysis and calculation tasks of the application center on the programs and nodes on the chain, which is used to analyze and calculate the application and node task release behavior/participation in verification behavior and other operations. The result can be used as the safety/efficiency/frequency of the application, etc. Evaluation reference in all aspects. In addition, check the local state of the program (existence state, version check code, integrity check code) when the node initializes or releases/receives tasks.
  • the application center has security.
  • the methods that can be used include but not limited to:
  • the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
  • the analysis module can define the credit rating of the application publisher/task publisher according to the pass rate of historical publishing application information/posting tasks. Those with a high credit rating will appropriately simplify the procedures. The review process and lower the review threshold.
  • the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses in the history of publishing applications.
  • the credit rating is divided into four levels, namely A, B, C, and D.
  • the credit rating will dynamically change with the number of times the program is passed and the number of times the program is used. And displayed in the program center.
  • level A the number of programs issued exceeds 200 times
  • the program pass rate reaches 90%
  • the cumulative number of program uses reaches 5000 times
  • the cumulative number of uses of a single program reaches more than 50%.
  • level B the number of programs issued exceeds 50 times
  • the program pass rate reaches 80%
  • the cumulative number of program uses reaches 500 times
  • the cumulative number of uses of a single program reaches more than 30%.
  • Grade D is the default rating.
  • the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of task completions, and the task completion rate in history.
  • the credit rating is divided into four levels, namely A, B, C, and D.
  • the credit rating will dynamically change as the number of passes and the number of task completions change, and Shown in the task center.
  • level A the number of missions issued exceeds 5000 times, the mission pass rate reaches 90%, and the mission completion rate reaches 70%.
  • level B the number of missions issued exceeds 500 times, the mission pass rate reaches 80%, and the mission completion rate reaches 60%.
  • the C level the number of missions issued exceeds 50 times, the mission pass rate reaches 80%, and the mission completion rate reaches 60%.
  • Grade D is the default rating.
  • the verification mode is determined based on the review level, where the verification mode includes at least one of the following: fragment verification is not performed, and, data set verification is not performed; fragment verification is not performed, and, Perform data set verification; reduce the multiple of fragment verification and perform fragment verification, and, perform data set verification.
  • the rights and interests enjoyed by a single program or task will be based on the credit rating of the issuing party during the review by the Application Center.
  • level A the rights and interests enjoyed by the review program will be exempted from fragment verification and demo data. verification.
  • level B when the right to enjoy is the review procedure, the task segment verification is exempted.
  • level C when the rights it enjoys are review procedures, segment verification is reduced to 2.5 times the amount of demo data/time.
  • Class D no rights are enjoyed.
  • demo data set verification the publisher needs to provide an appropriate amount of demo data set as verification to verify the safety of the program; task fragment verification: verification 8 times (other multiples are also possible, usually more than twice) The random task data in the demo data set/time is used as a sampling verification to verify the safety of the program.
  • demo data set verification the publisher needs to provide an appropriate amount of demo data set as verification to verify the safety of the task and the accuracy of the estimated workload; Fragment verification: verification 8 times (other multiples are also possible, usually More than two times is ok) Real data in the demo data set/time is used as verification, the safety of the verifier and the accuracy of the estimated workload of the evaluation.
  • the security of the platform that publishes the application program is verified by any of the following methods: detecting the open source code of the application program, using the security verification software to verify the application program, and using the security test program to verify the application program .
  • the security policy of the program publisher is as follows: open source review of the application; general computer software security verification; logical verification, which logically evaluates whether the program has malicious infringement of resources and tampering from the open source code Chain data, attack other nodes, etc. The above three-step verification is passed, and then demo data verification and fragment verification are selected according to the credit rating.
  • the first computing node receives the computing workload of the computing task and the verification workload of verifying the computing result set according to a preset algorithm while receiving the computing task set, where the computing workload Based on the amount of input data and the complexity of the algorithm used by the application, the verification workload is determined based on the preset total workload and calculation workload.
  • the foregoing preset algorithm may be a hash algorithm, but is not limited to this, and the preset total workload may be an expected total workload.
  • the workload of the computing task can be estimated.
  • the algorithm complexity can be calculated. For example, if the complexity of an algorithm is O(n) (that is, time complexity), it can be considered that the workload of using the application to complete the calculation task is proportional to the amount of input data.
  • the application can be accompanied by some test cases for the third party to verify the algorithm complexity given by it, or standard data can be produced from classic problems in the field (such as loop algorithm and recursive algorithm) to test the time complexity of the application.
  • the total workload consists of the workload of traditional proof of work (predictable) (for example, calculating the hash function) and the workload of the set of computing tasks published on the blockchain (calculation and composition).
  • the difficulty of the traditional workload proof problem can be automatically adjusted according to the workload of the computing task set.
  • the workload of the computational task set is large, the difficulty of the traditional workload proof problem is reduced.
  • the workload of the computational task set is very small, the difficulty of the traditional workload proof problem increases.
  • the expected speed of the blockchain to generate new blocks is N minutes/block
  • the published calculation task is expected to take X minutes to complete
  • the formula for calculating the difficulty is: reference difficulty value*(NX)/N.
  • the benchmark difficulty value is the difficulty value of the traditional proof of work when there is no published calculation task.
  • the value range of B is any number, depending on the total number of blockchains. Specifically, it is appropriate to range from 5% of the total number of blockchains to the total number of blockchains.
  • the task management center may use the expected total workload minus the workload of the calculation task set to obtain the workload (difficulty value) of the traditional workload proof.
  • the set of computing tasks (including its workload) and the difficulty value of the traditional workload proof are packaged and broadcast to the entire network.
  • the computing node will also perform traditional workload verification during task calculation, and the calculation result also includes the expected duration and actual duration of completing the traditional workload verification.
  • a blockchain-based workload proof system is provided, a method for quickly verifying the authenticity of the results given by the nodes participating in the computing task is proposed, and the security of the issued computing task is clearly proposed. method. While achieving the purpose of proof-of-work, some practical computing tasks (such as computing tasks in the field of biological information) can be completed, thereby improving the efficiency of computing resources.
  • a method for processing computing tasks is provided.
  • Fig. 3 is a flowchart of another method for processing a computing task according to an embodiment of the present application. As shown in Fig. 3, the method includes the following steps:
  • step S302 the first computing node on the blockchain receives the computing task set, and when the computing tasks in the computing task set are completed, the first computing node broadcasts the calculation result set to the verification node in the blockchain, where ,
  • the verification node is any computing node or part of the computing node on the blockchain;
  • Step S304 Obtain historical information on the blockchain, where the historical information includes at least: the credit level of the program publishing object that publishes the application, the credit level of the task publishing object that publishes the computing task, and the application is on any computing node, And used to process computing tasks;
  • Step S306 Determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
  • Step S308 Determine a verification mode based on the review level, where the verification mode is used to verify the calculation results issued by the computing node;
  • Step S310 randomly extract part of the calculation results that have been broadcast on the first computing node
  • Step S312 by recalculating the calculation tasks corresponding to the partial calculation results, and verifying the randomly selected partial calculation results.
  • the first node on the blockchain After the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node.
  • the verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified.
  • the verification speed is faster.
  • each verification node adopts a method of randomly verifying part of the calculation results.
  • the first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results.
  • the difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.
  • the review level is determined through the historical information on the blockchain, and the verification mode is further determined to ensure the security of the application (for security review, including but not limited to malicious infringement of resources, tampering with data on the chain, attacking other nodes, etc. ).
  • the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
  • the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses in the history.
  • the credit rating of the task issuance object is updated based on changes in the number of issuances, the number of task passes, the number of task completions, and the task completion rate of the calculation tasks issued in the history.
  • the verification mode is determined based on the review level, where the verification mode includes at least one of the following: no fragment verification, and, no data set verification; no fragment verification, and, Data set verification; reduce the multiple of fragment verification and perform fragment verification, and, perform data set verification.
  • verifying the randomly selected partial calculation result includes: obtaining the received application program for processing the target calculation task The input data and the reference data randomly generated by the verification node.
  • the target calculation task is the calculation task that produces part of the calculation result: the verification node uses the application program to calculate the input data and reference data to obtain the verification result; compare the verification result with The calculation results generated by the corresponding calculation tasks on the first calculation node are compared to complete the verification.
  • reference data is generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the verification result of the verification computing node is used as a subset to form the overall verification result of the blockchain.
  • each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
  • a processing device for computing tasks is provided.
  • Fig. 4 is a schematic diagram of a computing task processing device according to an embodiment of the present application. As shown in Fig. 4, the device includes:
  • the broadcasting module 42 is configured to receive the set of calculation tasks through the first calculation node on the blockchain, and when the set of calculation tasks is completed, broadcast the set of calculation results to the verification node in the blockchain through the first calculation node, Among them, the verification node is any computing node or part of the computing node on the blockchain;
  • the extraction module 44 is configured to randomly extract part of the calculation results that have been broadcast on the first computing node;
  • the verification module 46 is configured to verify the randomly selected part of the calculation result by recalculating the calculation task corresponding to the part of the calculation result;
  • the determining module 48 is configured to determine that the calculation result issued by the first computing node passes the verification if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast.
  • the above-mentioned broadcasting module 42, extraction module 44, verification module 46, and determination module 48 can be run in a computer terminal as a part of the device, and the functions implemented by the above modules can be executed by the processor in the computer terminal.
  • the computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (Mobile Internet Devices, MID), PAD and other terminal devices.
  • the verification module includes: an acquisition unit configured to acquire input data received by an application program for processing the target computing task, and reference data randomly generated by the verification node, wherein the target computing The task is a calculation task that produces a partial calculation result; the calculation unit is set to use the application to calculate the input data and reference data to obtain the verification result; the comparison unit is set to compare the verification result with the corresponding calculation on the first calculation node The calculation results generated by the task are compared to complete the verification.
  • the above-mentioned acquisition unit, calculation unit, and comparison unit can be run in a computer terminal as part of the device, and the functions implemented by the above-mentioned modules can be executed by the processor in the computer terminal, and the computer terminal can also be a smart device.
  • Mobile phones such as Android phones, IOS phones, etc.
  • tablet computers such as Samsung Galaxy Tabs, Samsung Galaxy Tabs, etc.
  • terminal devices such as MID and PAD.
  • the extraction module is further configured to generate reference data based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the extraction module is further configured to randomly extract the verification results of a predetermined number of computing nodes as the subset constituent area when the number of computing nodes for verification on the blockchain exceeds a preset threshold.
  • the overall verification result of the block chain is further configured to randomly extract the verification results of a predetermined number of computing nodes as the subset constituent area when the number of computing nodes for verification on the blockchain exceeds a preset threshold.
  • the extraction module is further configured to randomly extract part of the calculation results that have been broadcast on the first computing node multiple times;
  • the verification module is further configured to verify the part of the calculation results randomly extracted each time;
  • the determining module is further configured to determine that the calculation result published by the first computing node passes the verification if the verification results obtained by multiple recalculations are consistent with the calculation results that have been broadcast.
  • the determining module is further configured to determine that the updated block is a new block when each computing node on the blockchain passes the verification.
  • the device further includes: a first acquisition module configured to acquire an application program used to process computing tasks on any computing node; a second acquisition module configured to acquire a blockchain
  • the historical information includes at least: the credit rating of the program publishing object that publishes the application, and the credit rating of the task publishing object that publishes the computing task; the first determining module is set based on the credit rating of the program publishing object and/ Or the credit rating of the task release object determines the review level; the second determining module is set to determine the verification mode based on the review level, where the verification mode is used to verify the calculation results released by the computing node.
  • the above-mentioned first acquisition module, second acquisition module, first determination module, and second determination module may be run in a computer terminal as part of the device, and the above modules may be executed by a processor in the computer terminal.
  • the computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, and a terminal device such as MID and PAD.
  • the second determining module is further configured to determine the credit level of the program publishing object based on the historical information of the publishing application, and determine the credit level of the task publishing object based on the historical pass rate of the publishing calculation task.
  • the verification module is also set to verify the security of the platform that publishes the application by any of the following methods: detecting the open source code of the application, using security verification software to verify the application, and using security The test program verifies the application.
  • the device further includes: a receiving module configured to receive the calculation workload of the calculation task and verify the calculation result set according to a preset algorithm when the first computing node receives the calculation task set
  • the verification workload is determined based on the amount of input data and the complexity of the algorithm used by the application, and the verification workload is determined based on the preset total workload and calculation workload.
  • a processing device for computing tasks is provided.
  • Fig. 5 is a schematic diagram of another computing task processing device according to an embodiment of the present application. As shown in Fig. 5, the device includes:
  • the broadcast module 52 is configured to be configured to the first computing node on the blockchain to receive the computing task set, and in the case that the computing tasks in the computing task set are completed, the first computing node broadcasts the calculation result set to the blockchain for verification Nodes, where the verification node is any computing node or part of the computing node on the blockchain;
  • the obtaining module 54 is configured to obtain historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, and the application calculates at any one On the node, and used to process computing tasks;
  • the first determining module 56 is configured to determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
  • the second determining module 58 is configured to determine a verification mode based on the review level, where the verification mode is used to verify the calculation results issued by the computing node;
  • the extraction module 510 is configured to randomly extract part of the calculation results that have been broadcast on the first computing node;
  • the verification module 512 is configured to verify the randomly selected part of the calculation result by recalculating the calculation task corresponding to the generated part of the calculation result.
  • the above-mentioned broadcast module 52, acquisition module 54, first determination module 56, second determination module 58, extraction module 510, and verification module 512 can be run in a computer terminal as a part of the device, and can be run through the computer terminal.
  • the processor in the computer performs the functions realized by the above modules, and the computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, and terminal devices such as MID and PAD.
  • the verification module includes: an acquisition unit configured to acquire input data received by an application program for processing the target computing task, and reference data randomly generated by the verification node, wherein the target computing
  • the task is a calculation task that produces a partial calculation result: the calculation unit is set to use the application program to calculate the input data and reference data to obtain the verification result; the comparison unit is set to compare the verification result with the corresponding calculation on the first calculation node The calculation results generated by the task are compared to complete the verification.
  • the above-mentioned acquisition unit, calculation unit, and comparison unit 2 can be run in a computer terminal as a part of the device, and the functions implemented by the above-mentioned modules can be executed by the processor in the computer terminal, and the computer terminal can also be Smart phones (such as Android phones, IOS phones, etc.), tablet computers, handheld computers, and terminal devices such as MID and PAD.
  • the extraction module is further configured to generate reference data based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
  • the device further includes: a third determining module configured to determine that the updated block is a new block when each computing node on the blockchain passes the verification.
  • the above-mentioned third determining module can be run in a computer terminal as a part of the device, and the functions realized by the above-mentioned module can be executed by the processor in the computer terminal.
  • the computer terminal can also be a smart phone (such as an Android phone). , IOS mobile phones, etc.), tablet computers, handheld computers, and MID, PAD and other terminal devices.
  • a storage medium includes a stored program, wherein the device where the storage medium is located is controlled to execute the processing method of the calculation task in the foregoing Embodiments 1 and 2 when the program is running.
  • the foregoing storage medium may be located in any computer terminal in a computer terminal group in a computer network, or located in any mobile terminal in a mobile terminal group.
  • the storage medium is configured to store program code for executing the following steps: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node A computing node broadcasts a set of calculation results to a verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; and a part of the calculation result that has been broadcast on the first computing node is randomly selected; By recalculating the calculation task corresponding to the partial calculation result, the randomly selected partial calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is passed verification.
  • the storage medium is configured to store program code for executing the following steps: the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed In this case, the first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; obtaining historical information on the blockchain, where , The historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit of the program publishing object The level and/or the credit level of the task release object to determine the review level; based on the review level, determine the verification mode, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node ; By recalculating the calculation tasks corresponding to the partial calculation results, the
  • the storage medium may also be configured to store the program codes of various preferred or optional method steps provided by the processing method of the computing task.
  • a processor is provided, and the processor is configured to run a program, wherein the processing method of the calculation task in the foregoing embodiments 1 and 2 is executed when the program is running.
  • the above-mentioned processor may be located in any computer terminal in a computer terminal group in a computer network, or located in any mobile terminal in a mobile terminal group.
  • the processor is configured to perform the following steps: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node will calculate the result Collectively broadcast to verification nodes in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; randomly select part of the calculation results that have been broadcast on the first computing node; generate partial calculation results by pairing The corresponding calculation task is recalculated, and the randomly selected partial calculation results are verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is verified.
  • the processor is configured to perform the following steps: when the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed, the first computing The node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; acquiring historical information on the blockchain, where the historical information includes at least: The credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process computing tasks; based on the credit rating and/or task publishing of the program publishing object The credit rating of the object determines the review level; based on the review level, the verification mode is determined, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; The calculation task corresponding to the result is recalculated, and the randomly selected part of the calculation result is verified.
  • the processor may also be configured to perform various preferred or optional method steps provided by the processing method of the computing task.
  • the functional units provided in the embodiments of the present application may run in a mobile terminal, a computer terminal or a similar computing device, or may be stored as a part of a storage medium.
  • the embodiments of the present invention can provide a computer terminal, and the computer terminal can be any computer terminal device in a computer terminal group.
  • the above-mentioned computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the above-mentioned computer terminal may be located in at least one network device among a plurality of network devices in the computer network.
  • the above-mentioned computer terminal can execute the program code of the following steps in the computing task processing method: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing The node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any calculation node or part of the calculation node on the blockchain; randomly selects part of the calculation results that have been broadcast on the first calculation node; The calculation task corresponding to the partial calculation result is recalculated, and the randomly selected partial calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is verified.
  • the above-mentioned computer terminal may also execute the program code of the following steps in the method for processing computing tasks: the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed Next, the first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; obtaining historical information on the blockchain, where, The historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit rating of the program publishing object And/or the credit level of the task release object, determine the review level; determine the verification mode based on the review level, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; By recalculating the calculation tasks corresponding to the partial calculation results
  • the computer terminal may include: one or more processors, memories, and transmission devices.
  • the memory can be used to store software programs and modules, such as the program instructions/modules corresponding to the computing task processing method and device in the embodiment of the present invention.
  • the processor executes various programs and modules by running the software programs and modules stored in the memory. Functional application and data processing, that is, the processing method for realizing the above-mentioned computing tasks.
  • the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory may further include a memory remotely provided with respect to the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the aforementioned transmission device is used to receive or send data via a network.
  • the above-mentioned specific examples of the network may include a wired network and a wireless network.
  • the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network.
  • the transmission device is a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF radio frequency
  • the memory is used to store a set of calculation tasks, a set of calculation results, reference data and historical information, and application programs.
  • the processor may call the information and application programs stored in the memory through the transmission device to execute the program code of the method steps of each optional or preferred embodiment in the foregoing method embodiments.
  • the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and terminal devices such as MID and PAD.
  • a smart phone such as an Android phone, an iOS phone, etc.
  • a tablet computer such as a Samsung Galaxy Tab, etc.
  • terminal devices such as MID and PAD.
  • the disclosed technical content can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code .
  • the solutions provided in the embodiments of this application can be applied to blockchain technology. Based on the solution provided by the embodiments of the present application, since each node only extracts part of the calculation results for verification, the verification speed is relatively fast. Moreover, each verification node adopts a method of randomly verifying part of the calculation results. The first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results. , The difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Storage Device Security (AREA)

Abstract

A computational task processing method and device, a storage medium, and a processor. The method comprises: a first computing node on a blockchain receiving a computational task set, and, upon completing the computational task set, broadcasting a computational result set to a verification node in the blockchain (S102), wherein the verification node is any computing node on the blockchain; randomly selecting part of a computational result that has been broadcasted by the first computing node (S104); performing recomputation with respect to a corresponding computational task that has generated the partial computational result, so as to perform verification for the randomly selected partial computational result (S106); and if a verification result obtained by the recomputation is consistent with the broadcasted computational result, determining that the computational result published by the first computing node has passed the verification (S108).

Description

计算任务的处理方法和装置、存储介质及处理器Computing task processing method and device, storage medium and processor 技术领域Technical field
本申请涉及区块链技术领域,具体而言,涉及一种计算任务的处理方法和装置、存储介质及处理器。This application relates to the field of blockchain technology, and specifically to a method and device for processing computing tasks, a storage medium, and a processor.
背景技术Background technique
区块链是一个分布式的账本,区块链网络节点之间的去中心化协议维护着一条不停增长的由有序数据块组成的数据链,每一个数据区块内都有一个时间戳和一个指针,指向上一个区块,它能安全地存储数字货币或者股权,债权,版权等的交易数据,区块中的信息不可伪造和篡改。The blockchain is a distributed ledger. The decentralized protocol between the nodes of the blockchain network maintains a continuously growing data chain composed of ordered data blocks, and each data block has a timestamp And a pointer to the previous block, which can safely store transaction data such as digital currency or equity, debt, copyright, etc. The information in the block cannot be forged and tampered with.
在完成计算任务的过程中,有三个主要因素:输入数据、应用程序和计算资源。其中,应用程序发挥着非常重要的作用,它往往决定了如何使用计算资源,对输入数据进行怎样的操作。因此,为了保证计算任务的安全性,避免数据泄露或者计算资源被入侵的情况,需要对应用程序的安全性有一定的要求。In the process of completing computing tasks, there are three main factors: input data, applications, and computing resources. Among them, the application program plays a very important role. It often determines how to use computing resources and what operations are performed on input data. Therefore, in order to ensure the security of computing tasks and avoid data leakage or intrusion of computing resources, it is necessary to have certain requirements on the security of applications.
在区块链中的一个节点向其它节点广播其已经生成了新的区块后,其它节点需要对其完成的工作量进行验证,以确保该节点的确使用指定的应用程序完成了对所有输入数据的处理,产生了真实的计算结果,而不是伪造了计算结果。After a node in the blockchain broadcasts to other nodes that it has generated a new block, other nodes need to verify the amount of work it has completed to ensure that the node has indeed completed all input data using the specified application The processing produced real calculation results, rather than falsified calculation results.
传统的区块链的工作量证明方式为解决一个复杂的数学问题,例如通过哈希函数计算得到满足某些特定条件的数字。最终第一个解决该问题,并得到区块链中大多数节点验证通过的节点得到生成新的区块的权利并获得一定的奖励。但是,该种做法导致大量计算资源被浪费。The traditional blockchain proof-of-work method is to solve a complex mathematical problem, such as calculating a number that meets certain specific conditions through a hash function. In the end, the first one to solve this problem, and the nodes that have been verified by most of the nodes in the blockchain get the right to generate new blocks and receive certain rewards. However, this approach leads to a lot of waste of computing resources.
针对现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的问题,目前尚未提出有效的解决方案。In view of the large number of calculation tasks in the blockchain in the prior art, there is a problem that the calculation results cannot be quickly verified during the processing of the calculation tasks, and no effective solution has been proposed yet.
发明内容Summary of the invention
本申请实施例提供了一种计算任务的处理方法和装置、存储介质及处理器,以至少解决现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的技术问题。The embodiments of the present application provide a computing task processing method and device, storage medium, and processor to at least solve the large number of computing tasks in the blockchain in the prior art. In the processing of computing tasks, there are calculations. Technical issues that cannot be quickly verified as a result.
根据本申请实施例的一个方面,提供了一种计算任务的处理方法,包括:区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。According to one aspect of the embodiments of the present application, a method for processing computing tasks is provided, including: a first computing node on a blockchain receives a computing task set, and when the computing task set is completed, the first computing node will The calculation result set is broadcast to the verification node in the blockchain, where the verification node is any calculation node or part of the calculation node on the blockchain; part of the calculation results that have been broadcast on the first calculation node is randomly selected; The calculation task corresponding to the calculation result is recalculated, and the randomly selected part of the calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first computing node is verified.
可选地,通过对产生部分计算结果的计算任务进行重新计算,来对随机抽取的部分计算结果进行验证,包括:获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,目标计算任务为产生了部分计算结果的计算任务;验证节点使用应用程序对输入数据和参考数据进行计算,得到验证结果;将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, by recalculating the calculation task that produces the partial calculation result, to verify the randomly selected partial calculation result, including: obtaining the input data received by the application program used to process the target calculation task, and the verification node Randomly generated reference data, in which the target calculation task is the calculation task that has generated part of the calculation result; the verification node uses the application program to calculate the input data and reference data to obtain the verification result; the verification result is compared with the corresponding one on the first calculation node The calculation results generated by the calculation task are compared to complete the verification.
可选地,基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。Optionally, the reference data is generated based on the random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
可选地,区块链上进行验证的计算节点的数量超过预设阈值的情况下,随机抽取预定数量的计算节点的验证结果作为子集构成区块链的整体验证结果。Optionally, in the case where the number of computing nodes to be verified on the blockchain exceeds a preset threshold, the verification results of a predetermined number of computing nodes are randomly selected as a subset to form the overall verification result of the blockchain.
可选地,预定数量用于确定验证节点数量,其中,基于问题复杂度m和每次验证长度n确定验证节点数量。Optionally, the predetermined number is used to determine the number of verification nodes, wherein the number of verification nodes is determined based on the problem complexity m and the length of each verification n.
可选地,在对区块链上的计算任务集合进行验证的过程中,该方法还包括:获取任意一个计算节点上用于处理计算任务的应用程序;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果。Optionally, in the process of verifying the set of computing tasks on the blockchain, the method further includes: acquiring an application program for processing computing tasks on any computing node; acquiring historical information on the blockchain, where , The historical information includes at least: the credit rating of the program publishing object that releases the application, the credit rating of the task publishing object that publishes the computing task; determine the review level based on the credit rating of the program publishing object and/or the credit rating of the task publishing object; based on Review the level and determine the verification mode, where the verification mode is used to verify the calculation results released by the computing node.
可选地,根据发布应用程序的历史信息确定程序发布对象的信用等级,根据发布计算任务的历史通过率确定任务发布对象的信用等级。Optionally, the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
可选地,程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新。Optionally, the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses of the published application in the history.
可选地,任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。Optionally, the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of completions of the task, and the completion rate of the task in the history.
可选地,基于审查等级,确定验证模式,其中,验证模式包括如下至少之一:Optionally, a verification mode is determined based on the review level, where the verification mode includes at least one of the following:
不进行片段验证和不进行数据集验证;No fragment verification and no data set verification;
不进行片段验证和进行数据集验证;No fragment verification and data set verification;
降低片段验证的倍数并进行片段验证,和进行数据集验证。Reduce the multiple of fragment verification and perform fragment verification, and perform data set verification.
可选地,通过如下任意一种方式验证发布应用程序的平台的安全性:检测应用程序的开源代码、使用安全验证软件验证应用程序、使用安全测试程序验证应用程序。Optionally, the security of the platform that publishes the application program is verified by any one of the following methods: detecting the open source code of the application program, verifying the application program using security verification software, and verifying the application program using a security test program.
可选地,计算任务包括:用于处理计算任务的应用程序的程序信息,计算任务对应的输入数据的数据信息,以及完成计算任务所获得的虚拟资源。Optionally, the computing task includes: program information of an application program used to process the computing task, data information of input data corresponding to the computing task, and virtual resources obtained by completing the computing task.
可选地,第一计算节点接收到计算任务集合的同时,接收计算任务的计算工作量和按照预设算法验证计算结果集合的验证工作量,其中,计算工作量基于输入数据的数据量和应用程序使用的算法的复杂度确定,验证工作量基于预设总工作量和计算工作量确定。Optionally, while receiving the set of calculation tasks, the first computing node receives the calculation workload of the calculation task and the verification workload of verifying the set of calculation results according to a preset algorithm, wherein the calculation workload is based on the amount of input data and the application The complexity of the algorithm used by the program is determined, and the verification workload is determined based on the preset total workload and calculation workload.
可选地,多次随机抽取第一计算节点上已经广播的部分计算结果,并对每次随机抽取的部分计算结果进行验证,如果多次重新计算得到的验证结果均与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。Optionally, randomly extract part of the calculation results that have been broadcast on the first computing node for multiple times, and verify the part of the calculation results randomly selected each time, if the verification results obtained after multiple recalculations are consistent with the calculation results that have been broadcast , It is determined that the calculation result published by the first computing node passes the verification.
可选地,在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, when each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
根据本申请实施例的另一方面,还提供了一种计算任务的处理方法,包括:区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。According to another aspect of the embodiments of the present application, a method for processing computing tasks is also provided, including: when the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed , The first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; acquiring historical information on the blockchain, where history The information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit rating of the program publishing object and / Or the credit rating of the task release object, determine the review level; based on the review level, determine the verification mode, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; pass The calculation tasks corresponding to the partial calculation results are recalculated, and the randomly selected partial calculation results are verified.
可选地,根据发布应用程序的历史信息确定程序发布对象的信用等级,根据发布计算任务的历史通过率确定任务发布对象的信用等级。Optionally, the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
可选地,程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新。Optionally, the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses of the published application in the history.
可选地,任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。Optionally, the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of completions of the task, and the completion rate of the task in the history.
可选地,基于审查等级,确定验证模式,其中,验证模式包括如下至少之一:不进行片段验证及数据集验证、不进行片段验证且进行数据集验证、降低片段验证的倍数和进行片段验证及数据集验证。Optionally, the verification mode is determined based on the review level, where the verification mode includes at least one of the following: no fragment verification and data set verification, no fragment verification and data set verification, reduction of the multiple of fragment verification, and fragment verification And data set verification.
可选地,通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证,包括:获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,目标计算任务为产生了部分计算结果的计算任务:验证节点使用应用程序对输入数据和参考数据进行计算,得到验证结果;将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, by recalculating the calculation task corresponding to the part of the calculation result, verifying the randomly selected part of the calculation result includes: obtaining input data received by the application program for processing the target calculation task, and verifying the node Randomly generated reference data, where the target calculation task is a calculation task that has produced partial calculation results: the verification node uses the application program to calculate the input data and reference data to obtain the verification result; the verification result is compared with the corresponding one on the first calculation node The calculation results generated by the calculation task are compared to complete the verification.
可选地,基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。Optionally, reference data is generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
可选地,区块链上进行验证的计算节点的数量超过阈值的情况下,进行验证计算节点的验证结果作为子集构成区块链的整体验证结果。Optionally, when the number of verification computing nodes on the blockchain exceeds a threshold, the verification results of the verification computing nodes are used as a subset to form the overall verification result of the blockchain.
可选地,在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, when each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
根据本申请实施例的另一方面,提供了一种计算任务的处理装置,包括:According to another aspect of the embodiments of the present application, there is provided a computing task processing device, including:
广播模块,设置为通过区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,通过第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;The broadcast module is set to receive the set of calculation tasks through the first computing node on the blockchain, and when the set of computing tasks is completed, broadcast the set of calculation results to the verification node in the blockchain through the first computing node, where , The verification node is any computing node or part of the computing node on the blockchain;
抽取模块,设置为随机抽取第一计算节点上已经广播的部分计算结果;The extraction module is set to randomly extract part of the calculation results that have been broadcast on the first computing node;
验证模块,设置为通过对产生部分计算结果对应的计算任务进行重新计算,用于对随机抽取的部分计算结果进行验证;The verification module is set to recalculate the calculation tasks corresponding to the partial calculation results, and is used to verify the randomly selected partial calculation results;
第一确定模块,设置为如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。The first determining module is configured to determine that the calculation result issued by the first computing node passes the verification if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast.
根据本申请实施例的另一方面,还提供了一种存储介质,存储介质包括存储的程 序,其中,在程序运行时控制存储介质所在设备执行上述的计算任务的处理方法。According to another aspect of the embodiments of the present application, a storage medium is also provided. The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the processing method of the foregoing calculation task.
根据本申请实施例的另一方面,还提供了一种处理器,处理器设置为运行程序,其中,程序运行时执行上述的计算任务的处理方法。According to another aspect of the embodiments of the present application, there is also provided a processor, which is configured to run a program, wherein the above-mentioned processing method for computing tasks is executed when the program is running.
在本申请实施例中,区块链上的第一节点接收到计算任务集合之后,会使用相应的应用程序对计算任务集合进行计算,得到计算结果集合,并将计算结果集合广播至验证节点,验证节点可以随机抽取部分计算结果,并通过对部分计算结果对应的计算任务进行重新计算,并比较重新计算得到的验证结果与已经广播的计算结果的一致性,从而确定第一计算节点发布的计算结果是否通过验证。与相关技术相比,由于每个节点仅抽取部分计算结果进行验证,因此,验证速度较快。而且每个验证节点采用随机验证部分计算结果的方式,参与计算任务的第一计算节点无法预知哪些计算结果会被验证,从而无法仅生成这些可能被验证的计算结果,而伪造其他部分的计算结果,提高了计算节点作弊的难度,进而解决了现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的技术问题。In the embodiment of the present application, after the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node. The verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified. Compared with related technologies, since each node only extracts part of the calculation results for verification, the verification speed is faster. Moreover, each verification node adopts a method of randomly verifying part of the calculation results. The first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results. , The difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.
附图说明Description of the drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明设置为解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are provided to explain the application, and do not constitute an improper limitation of the application. In the attached picture:
图1是根据本申请实施例的一种计算任务的处理方法的流程图;Fig. 1 is a flowchart of a method for processing a computing task according to an embodiment of the present application;
图2是根据本申请实施例的一种可选的计算任务的处理方法的流程图;Fig. 2 is a flowchart of an optional processing method for computing tasks according to an embodiment of the present application;
图3是根据本申请实施例的另一种计算任务的处理方法的流程图;Fig. 3 is a flowchart of another method for processing a computing task according to an embodiment of the present application;
图4是根据本申请实施例的一种计算任务的处理装置的示意图;以及Fig. 4 is a schematic diagram of a processing device for computing tasks according to an embodiment of the present application; and
图5是根据本申请实施例的另一种计算任务的处理装置的示意图。Fig. 5 is a schematic diagram of another computing task processing device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only These are a part of the embodiments of this application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of this application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms “first” and “second” in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those clearly listed. Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
首先,对本申请实施例中出现的技术名称或技术术语进行如下解释说明:First, the technical names or technical terms appearing in the embodiments of this application are explained as follows:
区块链:一个分布式的账本,区块链网络节点之间的去中心化协议维护着一条不停增长的由有序数据块组成的数据链,每一个数据区块内都有一个时间戳和一个指针,指向上一个区块,它能安全地存储数字货币或者股权,债权,版权等的交易数据,区块中的信息不可伪造和篡改,区块链也是一个开放性的账本,它永久,高效并可追溯地记录着两者之间的交易,这个账本也可以利用可编程的脚本自动地触发交易,区块链解决了拜占庭将军问题,可以极大降低社会中的信任成本,重塑了互联网价值传输的机制。Blockchain: A distributed ledger. The decentralized agreement between blockchain network nodes maintains a continuously growing data chain composed of ordered data blocks, and each data block has a timestamp And a pointer to the previous block. It can safely store transaction data such as digital currency or equity, debt, copyright, etc. The information in the block cannot be forged or tampered with. The block chain is also an open ledger, which is permanent. , Which records the transactions between the two efficiently and retrospectively. This ledger can also use programmable scripts to automatically trigger transactions. Blockchain solves the Byzantine general problem, which can greatly reduce the cost of trust in society and reshape The mechanism of Internet value transmission.
工作量证明:Proof Of Work,简称POW。通过对工作的结果进行认证来证明完成了相应的工作量。Proof of Work: Proof Of Work, POW for short. Prove the completion of the corresponding workload by certifying the results of the work.
哈希函数(Hash Function),也称为散列函数,给定一个输入x,它会算出相应的输出H(x)。Hash function, also known as hash function, given an input x, it will calculate the corresponding output H(x).
实施例1Example 1
根据本申请实施例,提供了一种计算任务的处理方法,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present application, a method for processing computing tasks is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. The logical sequence is shown in the flowchart, but in some cases, the steps shown or described may be performed in a different order than here.
图1是根据本申请实施例的一种计算任务的处理方法的流程图,如图1所示,该方法包括如下步骤:Fig. 1 is a flowchart of a method for processing a computing task according to an embodiment of the present application. As shown in Fig. 1, the method includes the following steps:
步骤S102,区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;Step S102, the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node broadcasts the computing result set to the verification node in the blockchain, where the verification node is Any computing node or part of computing nodes on the blockchain;
如图2所示,区块链上任一有计算需求的节点都可以发布计算任务,成为任务发 布节点。其中,计算任务包括:用于处理计算任务的应用程序的程序信息,计算任务对应的输入数据的数据信息,以及完成计算任务所获得的虚拟资源,虚拟资源可以是存在于互联网中,并且可以被转移、使用的资源,具体的,可以是积分、礼物或网络商品等,但不仅限于此。节点发布计算任务时,可以提供如下信息:需要使用的应用程序的编号和版本号;输入数据的获取方式(包括网络爬虫获取、个人收集、公开数据等)和数据量的大小;为此计算任务支付的报酬。另外,计算任务还会附上发布的时间和发布节点的签名。As shown in Figure 2, any node with computing needs on the blockchain can publish computing tasks and become a task publishing node. Among them, computing tasks include: program information of applications used to process computing tasks, data information of input data corresponding to computing tasks, and virtual resources obtained by completing computing tasks. Virtual resources can exist on the Internet and can be The resources to be transferred and used, specifically, can be points, gifts, or online goods, but are not limited to this. When a node publishes a computing task, it can provide the following information: the number and version number of the application that needs to be used; the method of obtaining input data (including web crawler acquisition, personal collection, public data, etc.) and the amount of data; for this calculation task Remuneration paid. In addition, the calculation task will also attach the release time and the signature of the release node.
需要说明的是,区块链中每个计算节点使用的应用程序都有名称、编号和版本号,其中,每个应用程序的编号都是唯一的,编号可以是按应用程序发布的顺序自动生成的,编号可以由字母和数字组成。每个应用程序在发布或升级时,都会生成一个可以验证应用程序是否被修改过的验证码(例如哈希值)。而且,每个应用程序都有相应的发布者,每当一个应用程序被成功用于一个计算任务时,该应用程序的发布者都可以获得收益。It should be noted that the applications used by each computing node in the blockchain have a name, number, and version number. Among them, the number of each application is unique, and the number can be automatically generated in the order in which the application is released. Yes, the number can consist of letters and numbers. When each application is released or upgraded, it will generate a verification code (such as a hash value) that can verify whether the application has been modified. Moreover, each application program has a corresponding publisher, and whenever an application program is successfully used for a computing task, the publisher of the application program can obtain revenue.
区块链上的一个特定节点上部署有任务管理中心,该中心负责接收区块链上各节点发布的计算任务。如图2所示,在一个交易周期内,将多个计算任务打包成计算任务集合,并向全网广播。A task management center is deployed on a specific node on the blockchain, which is responsible for receiving computing tasks issued by each node on the blockchain. As shown in Figure 2, in a transaction cycle, multiple computing tasks are packaged into a computing task set and broadcast to the entire network.
区块链上任一节点在接收到计算任务集合之后,如果决定进行任务计算,则该节点成为第一计算节点,首先将交易周期内的所有交易打包,然后开始任务计算。如图2所示,当节点完成工作量之后,参与计算的节点将计算结果的访问方式和已打包的交易生成一个更新后的区块,并向全网或者验证节点广播。其中,计算结果可以包括完成发布的计算任务的预期时长和实际时长。After any node on the blockchain receives the set of calculation tasks, if it decides to perform task calculation, then this node becomes the first calculation node. First, all transactions in the transaction period are packaged, and then task calculation is started. As shown in Figure 2, after the node has completed the workload, the nodes participating in the calculation will generate an updated block based on the access method of the calculation result and the packaged transaction, and broadcast it to the entire network or verification nodes. Among them, the calculation result may include the expected time length and the actual time length to complete the published calculation task.
验证节点可以由两种方式确定,在一种可选的方案中,区块链上的任一节点都是验证节点。当一个节点接收到其他节点广播的计算结果集合时,首先验证传统的工作量证明是否通过,如果通过,则验证产生该计算任务的结果的真实性。验证传统的工作量证明和验证产生该计算任务的结果的真实性,可同时进行验证或调换顺序进行验证,选择先验证传统的工作量是因为该验证很快,以最少的工作量决定是否需要进行下一个验证。传播新区块的前提是两个验证都通过。在另一种可选的方案中,验证节点可以是全体节点的子集,称为验证节点集合,可以组成验证链。该集合的选择方式包括但不限于:The verification node can be determined in two ways. In an optional scheme, any node on the blockchain is a verification node. When a node receives the set of calculation results broadcast by other nodes, it first verifies whether the traditional proof of work is passed, and if it passes, then verifies the authenticity of the result of the calculation task. To verify the authenticity of the traditional proof of work and verify the result of the calculation task, the verification can be performed at the same time or the order of verification can be exchanged. The traditional workload is selected first because the verification is fast, and the minimum workload is used to determine whether it is necessary Proceed to the next verification. The prerequisite for propagating a new block is that both verifications pass. In another optional solution, the verification node can be a subset of the entire node, called a verification node set, which can form a verification chain. The selection methods of this collection include but are not limited to:
1.随机选取:1. Random selection:
a)由所有有效节点组成节点池,有效节点需具有存活性(处于活动状态的节点为 存活的节点),在一个优选的实施方式中,有效节点还受节点的信用等级限制,比如,信用等级需达到某个预定的等级或以上;在其他优选实施方式中,节点的有效性在为具有存活性的前提下,还可以包括其他针对计算节点的计算能力、历史信息等限制因素,具体在此不做限定;a) A node pool is composed of all valid nodes. The valid nodes must be survivable (the active nodes are the surviving nodes). In a preferred embodiment, the valid nodes are also limited by the node's credit level, for example, the credit level It needs to reach a certain predetermined level or above; in other preferred embodiments, the validity of the node can also include other restrictive factors such as the computing power and historical information of the computing node on the premise that it is survivable, as detailed here Not limited
b)在验证阶段从节点池随机抽取需要数量的节点作为验证节点组成验证节点集合。随机选取的方式可以是对节点按顺序进行编号,再用一组随机数进行抽取。b) In the verification phase, a required number of nodes are randomly selected from the node pool as verification nodes to form a verification node set. The method of random selection can be to number the nodes in sequence, and then use a set of random numbers for extraction.
2.竞选:2. Campaign:
a)由所有有效节点组成节点池,有效节点需具有存活性(处于活动状态的节点为存活的节点),在一个优选的实施方式中,有效节点还受节点的信用等级限制,比如,信用等级需达到某个预定的等级或以上;在其他优选实施方式中,节点的有效性在为具有存活性的前提下,还可以包括其他针对计算节点的计算能力、历史信息等限制因素,具体在此不做限定;a) A node pool is composed of all valid nodes. The valid nodes must be survivable (the active nodes are the surviving nodes). In a preferred embodiment, the valid nodes are also limited by the node's credit level, for example, the credit level It needs to reach a certain predetermined level or above; in other preferred embodiments, the validity of the node can also include other restrictive factors such as the computing power and historical information of the computing node on the premise that it is survivable, as detailed here Not limited
b)在验证阶段,所有有效节点申报本次可投入执行计算的资源,根据各自可投入执行计算的资源数量决定是否当选本次验证节点,比如,当可投入执行计算的资源数量大于或等于预定阈值时即可当选为本次验证的;b) In the verification phase, all valid nodes declare the resources that can be used to perform calculations this time, and determine whether they are selected as verification nodes according to the amount of resources that can be used to perform calculations. For example, when the number of resources that can be used to perform calculations is greater than or equal to the predetermined The threshold can be selected for this verification;
c)验证结束后为完成任务的验证节点返还可投入执行计算资源,并提供相应的虚拟资源。c) After the verification is completed, the verification node that completes the task can also invest in execution computing resources and provide corresponding virtual resources.
每个验证节点首先验证传统的工作量证明是否通过,如果通过,则验证产生该计算任务的结果的真实性。Each verification node first verifies whether the traditional proof of work is passed, and if it passes, it verifies the authenticity of the result of the calculation task.
步骤S104,随机抽取第一计算节点上已经广播的部分计算结果;Step S104, randomly extract part of the calculation results that have been broadcast on the first computing node;
需要说明的是,对于同样的输入数据,使用同样的应用程序得到的计算结果应该是相同的。在此基础上,如图2所示,验证节点在验证计算结果的真实性时,可以根据更新后的区块中的计算结果的访问方式,对每个计算任务都随机抽取计算结果的一部分来验证其真实性。It should be noted that for the same input data, the calculation results obtained by using the same application program should be the same. On this basis, as shown in Figure 2, when the verification node verifies the authenticity of the calculation result, it can randomly extract a part of the calculation result for each calculation task according to the access method of the calculation result in the updated block. Verify its authenticity.
需要说明的是,为了实现上述目的,该随机性要求计算任务可以随意拆分成若干份,每一份都可以单独计算而不依赖其他份的结果。It should be noted that in order to achieve the above purpose, the randomness requires that the calculation task can be divided into several parts at will, and each part can be calculated independently without relying on the results of other parts.
步骤S106,通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;Step S106, by recalculating the calculation tasks corresponding to the partial calculation results, verifying the randomly selected partial calculation results;
步骤S108,如果重新计算得到的验证结果与已经广播的计算结果为一致,则确定 第一计算节点发布的计算结果通过验证。In step S108, if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first computing node passes the verification.
验证节点可以对产生这部分计算结果的输入数据重新进行计算,并比较重新计算得到的计算结果(即上述的验证结果)和已经广播的计算结果的一致性来判断发起广播的第一计算节点是否完成了计算任务。如图2所示,如果两个计算结果一致,则确定第一计算节点完成了计算任务,该计算结果通过验证。The verification node can recalculate the input data that produces this part of the calculation result, and compare the recalculation result (that is, the verification result above) and the consistency of the calculation result that has been broadcast to determine whether the first calculation node that initiated the broadcast Completed the calculation task. As shown in Figure 2, if the two calculation results are consistent, it is determined that the first computing node has completed the calculation task, and the calculation result passes the verification.
采用本申请上述实施例,区块链上的第一节点接收到计算任务集合之后,会使用相应的应用程序对计算任务集合进行计算,得到计算结果集合,并将计算结果集合广播至验证节点,验证节点可以随机抽取部分计算结果,并通过对部分计算结果对应的计算任务进行重新计算,并比较重新计算得到的验证结果与已经广播的计算结果的一致性,从而确定第一计算节点发布的计算结果是否通过验证。与相关技术相比,由于每个节点仅抽取部分计算结果进行验证,因此,验证速度较快。而且每个验证节点采用随机验证部分计算结果的方式,参与计算任务的第一计算节点无法预知哪些计算结果会被验证,从而无法仅生成这些可能被验证的计算结果,而伪造其他部分的计算结果,提高了计算节点作弊的难度,进而解决了现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的技术问题。Using the above-mentioned embodiment of this application, after the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node. The verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified. Compared with related technologies, since each node only extracts part of the calculation results for verification, the verification speed is faster. Moreover, each verification node adopts a method of randomly verifying part of the calculation results. The first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results. , The difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.
可选地,本申请上述实施例中,通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证,包括:获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,输入数据和参考数据用于确定目标计算任务,目标计算任务为产生了部分计算结果的计算任务;验证节点使用应用程序对输入数据和参考数据所确定计算任务进行计算,得到验证结果;将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, in the above-mentioned embodiment of the present application, by recalculating the calculation task corresponding to the partial calculation result, verifying the randomly selected partial calculation result includes: obtaining the received application program for processing the target calculation task The input data and the reference data randomly generated by the verification node. The input data and reference data are used to determine the target calculation task. The target calculation task is the calculation task that has generated part of the calculation result; the verification node uses the application program to compare the input data and reference The calculation task determined by the data is calculated to obtain a verification result; the verification result is compared with the calculation result generated by the corresponding calculation task on the first computing node to complete the verification.
本申请实施例对计算任务的任务类型不做任何限定,本实施例中,以基因组变异检测作为计算任务为例,对本申请上述实施例进行详细说明。用于该计算任务的应用程序的输入数据为基因组测序得到的短序列比对到参考基因组序列上的结果文件及其索引文件。该结果文件中包括了每一条短序列的比对情况,例如是否可以比对上,如果比对上的话,比对到参考基因组上的哪个位置、比对的质量如何、短序列包括的碱基和参考基因组上的碱基的具体差异有哪些,等等。并且该结果文件根据短序列在参考基因组中的比对位置进行了排序,例如从1号染色体到22号染色体,接下来是X染色体、Y染色体(男性特有)、线粒体染色体。而索引文件使得应用程序可以从比对结果文件中提取参考基因组中特定位置的比对结果。The embodiment of this application does not make any limitation on the task type of the computing task. In this embodiment, taking genome mutation detection as the computing task as an example, the foregoing embodiment of the present application will be described in detail. The input data of the application program used for the calculation task is the result file and the index file of the comparison of the short sequence obtained by the genome sequencing to the reference genome sequence. The result file includes the alignment of each short sequence, such as whether it can be aligned, if so, which position on the reference genome, the quality of the alignment, and the bases included in the short sequence. What are the specific differences between the bases on the reference genome, and so on. And the result file is sorted according to the alignment position of the short sequence in the reference genome, for example, from chromosome 1 to chromosome 22, followed by X chromosome, Y chromosome (male specific), and mitochondrial chromosome. The index file allows the application to extract the comparison result of a specific position in the reference genome from the comparison result file.
因此,验证产生该计算任务的结果的真实性时,只需要随机生成一些参考基因组 的位置坐标,然后把这些位置坐标、比对结果文件及其索引文件提供给应用程序,即可计算出这些位置的变异检测结果,并和计算节点发布的计算结果进行比较。如果结果一致,则证明计算节点发布的计算结果真实。Therefore, when verifying the authenticity of the results of the calculation task, it is only necessary to randomly generate some reference genome position coordinates, and then provide these position coordinates, the comparison result file and its index file to the application program, and then these positions can be calculated. The result of mutation detection is compared with the calculation result released by the computing node. If the results are consistent, it proves that the calculation results published by the computing node are true.
在一种可选的实施例中,可以基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。In an optional embodiment, reference data may be generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
上述的随机数生成函数可以是使用C语言中的srand()函数和rand()函数相结合的方式,但不仅限于此。先给srand()函数传递一个参数,生成一个随机种子,再多次运行rand()函数来获得多个随机数,然后将多个随机数转换成参考基因组上的位置。例如,为了随机获得100个参考基因组序列上的位置,可以先获得200个随机数;然后随机分组,比如可以按如下分组方式分组:(1、2),(3、4)……(199,200)的方式把200个随机数分成100组;接下来使用每组中的第一个数字对25进行取余,获得的余数转换为该组的参考基因组序列上的染色体编号(余数0对应1号染色体,1对应2号染色体,依此类推,余数22对应X染色体,23对应Y染色体,24对应线粒体);再使用每组中的第二个数字对该组的染色体的碱基对的个数进行长度取余,获得染色体上的位置。为了获得更好的随机性,最好使得不同的验证节点传递给srand()函数的参数是不一样的。例如可以使用节点的系统时间(从世界标准时间的1970年的1月1日0时0分0秒到当前时间经过的秒数)对当前验证任务的进程id进行取余运算。运算的结果作为srand()函数的参数。The aforementioned random number generation function can be a combination of the srand() function and the rand() function in the C language, but it is not limited to this. First pass a parameter to the srand() function, generate a random seed, and then run the rand() function multiple times to obtain multiple random numbers, and then convert the multiple random numbers into positions on the reference genome. For example, in order to randomly obtain positions on 100 reference genome sequences, you can first obtain 200 random numbers; then randomly group, for example, you can group according to the following grouping methods: (1, 2), (3, 4)... (199, 200) method to divide 200 random numbers into 100 groups; then use the first number in each group to take the remainder of 25, and the obtained remainder is converted into the chromosome number on the reference genome sequence of the group (the remainder 0 corresponds to 1 Chromosome 1 corresponds to chromosome 2, and so on, the remainder 22 corresponds to chromosome X, 23 corresponds to chromosome Y, and 24 corresponds to mitochondria); then use the second number in each group of the base pair of the group of chromosomes Take the remainder of the length to obtain the position on the chromosome. In order to obtain better randomness, it is best to make the parameters passed to the srand() function by different verification nodes different. For example, the system time of the node (the number of seconds elapsed from 0:00:00 on January 1, 1970, UTC to the current time) of the node can be used to perform a remainder operation on the process id of the current verification task. The result of the operation is used as the parameter of the srand() function.
由于不同的节点进行验证任务的进程id基本都不相同,所以不同的节点传递给srand()函数的参数也基本不一样,最终导致rand()函数生成的随机数也不一样,因此不同的节点在验证的时候随机生成的位置坐标基本都是不相同的。而计算节点也不可能知道其他节点随机生成的位置坐标是什么,因此不可能采取只针对这些位置坐标进行计算,而不计算其他位置坐标的作弊行为。Since the process IDs of different nodes for verification tasks are basically different, the parameters passed by different nodes to the srand() function are also basically different, which eventually leads to different random numbers generated by the rand() function, so different nodes During verification, the randomly generated position coordinates are basically different. It is also impossible for a computing node to know the position coordinates randomly generated by other nodes, so it is impossible to take a cheating behavior that only calculates these position coordinates without calculating other position coordinates.
需要说明的是,为了防止恶意验证或作弊行为,应隐藏选取结果时使用的随机数种子,并将相同种子分发给多个节点,以避免作弊和恶意验证。而对于恶意验证或作弊的节点减少选取的概率。It should be noted that in order to prevent malicious verification or cheating, the random number seed used when selecting the result should be hidden, and the same seed should be distributed to multiple nodes to avoid cheating and malicious verification. For maliciously verified or cheating nodes, the probability of selection is reduced.
可选地,在本申请上述实施例中,区块链上进行验证的计算节点的数量超过预设阈值的情况下,随机抽取预定数量的计算节点的验证结果作为子集构成区块链的整体验证结果。Optionally, in the above-mentioned embodiment of the present application, when the number of verification nodes on the blockchain exceeds a preset threshold, the verification results of a predetermined number of calculation nodes are randomly selected as a subset to form the whole of the blockchain Validation results.
具体地,上述的预设阈值可以根据实际使用进行设定,本申请对此不作具体限定。预定数量用于确定验证节点数量,其中,基于问题复杂度m和每次验证长度n确定验 证节点数量。Specifically, the above-mentioned preset threshold can be set according to actual use, which is not specifically limited in this application. The predetermined number is used to determine the number of verification nodes, where the number of verification nodes is determined based on the problem complexity m and the length of each verification n.
由于不同节点随机验证的结果子集基本都不相同,因此当有大量节点进行验证时,这些节点验证的结果子集的集合可以有效覆盖整个计算结果。Since the random verification result subsets of different nodes are basically different, when there are a large number of nodes to verify, the set of the result subsets of these node verifications can effectively cover the entire calculation result.
在一种可选的方案中,验证节点数量由问题复杂度m和每次验证长度n决定,计算公式如下:Q=(mk+ν 0)n+ν 1,其中,k是对问题复杂度m的权重,ν 0、ν 1是偏差,其取值范围可以根据最长长度与最大复杂度来确定,在满足0<Q<(m maxk+ν 0)n max1时,解空间中取任意解。可以使用区间完全覆盖算法或其他算法求解出最少需要的验证节点个数P,P取值范围由区块链具体情况限制,例如限制最少101个,具体原则是:不能超过总结点数,不能少于1个,且根据任务发布方发布的要求。 In an optional scheme, the number of verification nodes is determined by the problem complexity m and the length of each verification n. The calculation formula is as follows: Q=(mk+ν 0 )n+ν 1 , where k is the complexity of the problem The weight of m, ν 0 , ν 1 are deviations, and the value range can be determined according to the longest length and maximum complexity. When 0<Q<(m max k+ν 0 )n max1 is satisfied, the solution Take any solution in space. The interval complete coverage algorithm or other algorithms can be used to find the minimum number of verification nodes P. The value range of P is limited by the specific conditions of the blockchain, for example, the limit is at least 101. The specific principle is: no more than the summary points, no less 1, and according to the requirements issued by the task issuer.
可选地,在本申请上述实施例中,多次随机抽取第一计算节点上已经广播的部分计算结果,并对每次随机抽取的部分计算结果进行验证,如果多次重新计算得到的验证结果均与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。Optionally, in the above-mentioned embodiment of the present application, part of the calculation result that has been broadcast on the first computing node is randomly selected multiple times, and the part of the calculation result randomly selected each time is verified. If the verification result obtained by recalculating multiple times If they are consistent with the calculation results that have been broadcast, it is determined that the calculation results published by the first computing node pass the verification.
在一种可选的实施例中,对于每个验证节点,可以对每个计算任务随机抽取V次进行验证,其中,V大于等于2,以保证验证的覆盖度。例如,可以抽取10次,每次抽取计算结果的0.01%,然后对抽取的计算结果的计算任务进行验证。如果V次验证都通过,则单个计算任务验证通过。In an optional embodiment, for each verification node, V times may be randomly selected for each computing task for verification, where V is greater than or equal to 2 to ensure verification coverage. For example, you can extract 10 times, each time 0.01% of the calculation result is extracted, and then the calculation task of the extracted calculation result is verified. If all V verifications are passed, then a single computing task is verified.
可选地,在本申请上述实施例中,在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, in the above-mentioned embodiment of the present application, when each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
在一种可选的实施例中,如果所有计算任务的结果的真实性都验证通过,则验证节点认可该计算节点的计算结果。验证节点在集合内广播验证结果,如果验证节点集合全部通过,则验证通过,则把该区块添加到自己记录的区块链中,并且从验证集合中选出一个验证节点打包交易周期内的任务记录产生新的区块。In an optional embodiment, if the authenticity of the results of all calculation tasks is verified, the verification node approves the calculation results of the calculation node. The verification node broadcasts the verification result in the set. If the verification node set passes, the verification is passed, the block is added to the blockchain of its own record, and a verification node is selected from the verification set to package the transaction cycle The task record generates a new block.
需要说明的是,如果验证未通过,则拒绝该区块为新的区块,在一个可选的实施例中,验证未通过则该任务将会继续处于未完成状态不做改动。It should be noted that if the verification fails, the block is rejected as a new block. In an alternative embodiment, if the verification fails, the task will continue to be in an incomplete state without modification.
可选地,在本申请上述实施例中,在对区块链上的计算任务集合进行验证的过程中,该方法还包括:获取任意一个计算节点上用于处理计算任务的应用程序;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果。Optionally, in the foregoing embodiment of the present application, in the process of verifying the set of computing tasks on the blockchain, the method further includes: acquiring an application program for processing computing tasks on any computing node; Historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task; the credit rating based on the program publishing object and/or the task publishing object The credit rating determines the review level; based on the review level, determines the verification mode, where the verification mode is used to verify the calculation results issued by the computing node.
在本申请实施例中,区块链的一个特定节点上部署有应用程序中心,应用程序可以是一个虚拟的中心,主要负责对将要上链的应用程序进行安全性审查以及验证并作为程序仓库,供查询、调用应用程序。该应用程序中心还设置有相关使用的历史信息的分析模块,该模块是应用程序中心的基础组件,也在应用程序中心的程序列表中。可以执行应用程序中心对链上程序和节点的分析计算任务,用于对应用程序和节点的任务发布行为/参与验证行为等操作进行分析计算,结果可作为对应用程序的安全/效率/频率等各方面的评价参考。另外,节点初始化或发布\接收任务时检查该程序在本地的状态(存在状态、版本校验码、完整性校验码)。In the embodiment of the present application, an application center is deployed on a specific node of the blockchain, and the application can be a virtual center, which is mainly responsible for security review and verification of the application to be chained and serves as a program warehouse. For querying and calling applications. The application center is also provided with an analysis module of related historical information. This module is the basic component of the application center and is also in the program list of the application center. It can perform the analysis and calculation tasks of the application center on the programs and nodes on the chain, which is used to analyze and calculate the application and node task release behavior/participation in verification behavior and other operations. The result can be used as the safety/efficiency/frequency of the application, etc. Evaluation reference in all aspects. In addition, check the local state of the program (existence state, version check code, integrity check code) when the node initializes or releases/receives tasks.
需要说明的是,应用程序中心具有安全性,为了保证应用程序安全性(对于安全性的审查,包括但不限于恶意侵占资源、篡改上链数据、攻击其他节点等),可以采用的方式包括但不限于:It should be noted that the application center has security. In order to ensure the security of the application (the review of security, including but not limited to malicious infringement of resources, tampering with data on the chain, attacking other nodes, etc.), the methods that can be used include but not limited to:
可选地,在本申请上述实施例中,根据发布应用程序的历史信息确定程序发布对象的信用等级,根据发布计算任务的历史通过率确定任务发布对象的信用等级。Optionally, in the foregoing embodiment of the present application, the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
在一种可选的实施例中,分析模块可以分别根据历史发布应用程序信息/发布任务的通过率定义该应用程序发布者/任务发布者的信用评级,信用评级高的将会适当简化对程序审查的流程、降低审核门槛。In an optional embodiment, the analysis module can define the credit rating of the application publisher/task publisher according to the pass rate of historical publishing application information/posting tasks. Those with a high credit rating will appropriately simplify the procedures. The review process and lower the review threshold.
可选地,在本申请上述实施例中,程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新。Optionally, in the foregoing embodiment of the present application, the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses in the history of publishing applications.
在一种可选的实施例中,对于程序发布方,信用评级分为四级,也即A、B、C、D,信用评级会随着程序通过次数、程序使用次数的改变动态发生改变,并显示在程序中心。对于A级,其发布程序次数超过200次,程序通过率达到90%,程序使用累计次数达到5000次,并且单个程序使用累计次数达到100次以上的程序占50%。对于B级,其发布程序次数超过50次,程序通过率达到80%,程序使用累计次数达到500次,并且单个程序使用累计次数达到20次以上的程序占30%。对于C级,其发布程序次数超过10次,程序通过率达到80%,并且程序使用累计次数达到50次。D级为默认评级。In an optional embodiment, for the program issuer, the credit rating is divided into four levels, namely A, B, C, and D. The credit rating will dynamically change with the number of times the program is passed and the number of times the program is used. And displayed in the program center. For level A, the number of programs issued exceeds 200 times, the program pass rate reaches 90%, the cumulative number of program uses reaches 5000 times, and the cumulative number of uses of a single program reaches more than 50%. For level B, the number of programs issued exceeds 50 times, the program pass rate reaches 80%, the cumulative number of program uses reaches 500 times, and the cumulative number of uses of a single program reaches more than 30%. For level C, the number of issued procedures exceeds 10 times, the procedure pass rate reaches 80%, and the cumulative number of procedures used reaches 50 times. Grade D is the default rating.
可选地,在本申请上述实施例中,任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。Optionally, in the foregoing embodiment of the present application, the credit rating of the task issuance object is updated based on changes in the number of issuances of the calculation task, the number of passes, the number of task completions, and the task completion rate in history.
在一种可选的实施例中,对于任务发布方,信用评级分为四级,也即A、B、C、D,信用评级会随着通过次数、任务完成次数的改变动态发生改变,并显示在任务中心。对于A级,其发布任务次数超过5000次,任务通过率达到90%,并且任务完成 率达到70%。对于B级,其发布任务次数超过500次,任务通过率达到80%,并且任务完成率达到60%。对于C级,其发布任务次数超过50次,任务通过率达到80%,并且任务完成率达到60%。D级为默认评级。In an optional embodiment, for the task issuer, the credit rating is divided into four levels, namely A, B, C, and D. The credit rating will dynamically change as the number of passes and the number of task completions change, and Shown in the task center. For level A, the number of missions issued exceeds 5000 times, the mission pass rate reaches 90%, and the mission completion rate reaches 70%. For level B, the number of missions issued exceeds 500 times, the mission pass rate reaches 80%, and the mission completion rate reaches 60%. For the C level, the number of missions issued exceeds 50 times, the mission pass rate reaches 80%, and the mission completion rate reaches 60%. Grade D is the default rating.
可选地,在本申请上述实施例中,基于审查等级,确定验证模式,其中,验证模式包括如下至少之一:不进行片段验证,和,不进行数据集验证;不进行片段验证,和,进行数据集验证;降低片段验证的倍数并进行片段验证,和,进行数据集验证。Optionally, in the above-mentioned embodiment of the present application, the verification mode is determined based on the review level, where the verification mode includes at least one of the following: fragment verification is not performed, and, data set verification is not performed; fragment verification is not performed, and, Perform data set verification; reduce the multiple of fragment verification and perform fragment verification, and, perform data set verification.
在一种可选的实施例中,单个程序或任务所享权益将以应用程序中心审查时发布方信用评级为准,对于A级,其享受的权益为审查程序时,免除片段验证及demo数据验证。对于B级,其享受的权益为审查程序时,免除任务片段验证。对于C级,其享受的权益为审查程序时,片段验证降低为2.5倍demo数据量/时间。对于D级,不享受任何权益。In an alternative embodiment, the rights and interests enjoyed by a single program or task will be based on the credit rating of the issuing party during the review by the Application Center. For level A, the rights and interests enjoyed by the review program will be exempted from fragment verification and demo data. verification. For level B, when the right to enjoy is the review procedure, the task segment verification is exempted. For level C, when the rights it enjoys are review procedures, segment verification is reduced to 2.5 times the amount of demo data/time. For Class D, no rights are enjoyed.
其中,对于程序发布方,demo数据集验证:发布方需要提供适量的demo数据集作为验证,验证程序的安全性;任务片段验证:验证8倍(其他倍数也可以,通常大于两倍都可以)于demo数据集/时间的随机任务数据作为抽检验证,验证程序的安全性。对于任务发布方,demo数据集验证:发布方需要提供适量的demo数据集作为验证,验证任务的安全性以及评估预估工作量的准确性;片段验证:验证8倍(其他倍数也可以,通常大于两倍都可以)于demo数据集/时间的真实数据作为验证,验证人的安全性以及评估预估工作量的准确性。Among them, for the program publisher, demo data set verification: the publisher needs to provide an appropriate amount of demo data set as verification to verify the safety of the program; task fragment verification: verification 8 times (other multiples are also possible, usually more than twice) The random task data in the demo data set/time is used as a sampling verification to verify the safety of the program. For the task publisher, demo data set verification: the publisher needs to provide an appropriate amount of demo data set as verification to verify the safety of the task and the accuracy of the estimated workload; Fragment verification: verification 8 times (other multiples are also possible, usually More than two times is ok) Real data in the demo data set/time is used as verification, the safety of the verifier and the accuracy of the estimated workload of the evaluation.
可选地,在本申请上述实施例中,通过如下任意一种方式验证发布应用程序的平台的安全性:检测应用程序的开源代码、使用安全验证软件验证应用程序、使用安全测试程序验证应用程序。Optionally, in the above-mentioned embodiment of the present application, the security of the platform that publishes the application program is verified by any of the following methods: detecting the open source code of the application program, using the security verification software to verify the application program, and using the security test program to verify the application program .
在一种可选的实施例中,程序发布方的安全策略如下:应用程序的开源审查;通用的计算机软件安全性验证;逻辑验证,从开源代码逻辑上评估程序是否具有恶意侵占资源、篡改上链数据、攻击其他节点等。上述三步验证通过,再根据信用评级选择执行demo数据验证和片段验证。In an optional embodiment, the security policy of the program publisher is as follows: open source review of the application; general computer software security verification; logical verification, which logically evaluates whether the program has malicious infringement of resources and tampering from the open source code Chain data, attack other nodes, etc. The above three-step verification is passed, and then demo data verification and fragment verification are selected according to the credit rating.
可选地,在本申请上述实施例中,第一计算节点接收到计算任务集合的同时,接收计算任务的计算工作量和按照预设算法验证计算结果集合的验证工作量,其中,计算工作量基于输入数据的数据量和应用程序使用的算法的复杂度确定,验证工作量基于预设总工作量和计算工作量确定。Optionally, in the foregoing embodiment of the present application, the first computing node receives the computing workload of the computing task and the verification workload of verifying the computing result set according to a preset algorithm while receiving the computing task set, where the computing workload Based on the amount of input data and the complexity of the algorithm used by the application, the verification workload is determined based on the preset total workload and calculation workload.
具体地,上述的预设算法可以是哈希算法,但不仅限于此,预设总工作量可以是预期的总工作量。Specifically, the foregoing preset algorithm may be a hash algorithm, but is not limited to this, and the preset total workload may be an expected total workload.
在本申请实施例中,当一个计算任务的输入数据的数据量确定时,可以预估这个计算任务的工作量。当应用程序使用的算法确定时(不确定时不允许发布任务),可以计算其算法复杂度。例如一个算法的复杂度是O(n)(也即时间复杂度),则可以认为使用该应用程序来完成计算任务的工作量和输入数据量的大小成正比。应用程序可以附带一些测试用例,以供第三方验证其给出的算法复杂度,或者由领域经典问题(如循环算法、递归算法)制作标准数据,以测试应用程序的时间复杂度。In the embodiment of the present application, when the data volume of the input data of a computing task is determined, the workload of the computing task can be estimated. When the algorithm used by the application is determined (it is not allowed to publish tasks when uncertain), the algorithm complexity can be calculated. For example, if the complexity of an algorithm is O(n) (that is, time complexity), it can be considered that the workload of using the application to complete the calculation task is proportional to the amount of input data. The application can be accompanied by some test cases for the third party to verify the algorithm complexity given by it, or standard data can be produced from classic problems in the field (such as loop algorithm and recursive algorithm) to test the time complexity of the application.
总的工作量由传统的工作量证明(可预估)(例如计算哈希函数)的工作量和区块链上发布的计算任务集合的工作量组成(计算以及组成)。为了维持总的工作量的稳定,以保证区块链出块的速度满足一定条件,传统的工作量证明的问题的难度可以根据计算任务集合的工作量大小进行自动调整。当计算任务集合的工作量很大时,将传统的工作量证明的问题的难度减小。当计算任务集合的工作量很小时,将传统的工作量证明的问题的难度增大。The total workload consists of the workload of traditional proof of work (predictable) (for example, calculating the hash function) and the workload of the set of computing tasks published on the blockchain (calculation and composition). In order to maintain the stability of the total workload and to ensure that the block generation speed of the blockchain meets certain conditions, the difficulty of the traditional workload proof problem can be automatically adjusted according to the workload of the computing task set. When the workload of the computational task set is large, the difficulty of the traditional workload proof problem is reduced. When the workload of the computational task set is very small, the difficulty of the traditional workload proof problem increases.
具体来说,假设预期的区块链生成新区块的速度为N分钟/个区块,如果发布的计算任务预计需要X分钟才能完成,则预计传统的工作量证明需要(N-X)分钟来完成,其难度的计算公式为:基准难度值*(N-X)/N。其中基准难度值是没有发布的计算任务时,传统的工作量证明的难度值。该基准难度值每隔B个区块调整一次,其计算方式和比特币工作量证明中的难度值类似:新基准难度值=旧基准难度值*(过去B个区块完成传统的工作量证明所用的实际时长之和+过去B个区块完成发布的计算任务的实际时长之和-过去B个区块完成发布的计算任务的预期时长之和)/过去B个区块完成传统的工作量证明的预期时长之和。Specifically, assuming that the expected speed of the blockchain to generate new blocks is N minutes/block, if the published calculation task is expected to take X minutes to complete, it is expected that the traditional proof of work will take (NX) minutes to complete. The formula for calculating the difficulty is: reference difficulty value*(NX)/N. The benchmark difficulty value is the difficulty value of the traditional proof of work when there is no published calculation task. The benchmark difficulty value is adjusted every B blocks, and its calculation method is similar to the difficulty value in Bitcoin's proof of work: new benchmark difficulty value = old benchmark difficulty value * (the traditional proof of work completed in the past B blocks The sum of the actual length of time used + the sum of the actual length of the calculation task completed in the past B blocks-the sum of the expected time length of the calculation task completed in the past B blocks) / the traditional workload completed in the past B blocks The sum of the expected duration of the proof.
其中,B的取值范围为任意数,取决个区块链的总个数,具体为5%的总区块链个数到总区块链个数为宜。Among them, the value range of B is any number, depending on the total number of blockchains. Specifically, it is appropriate to range from 5% of the total number of blockchains to the total number of blockchains.
在一种可选的实施例中,任务管理中心可以使用预期的总的工作量减去计算任务集合的工作量,来获得传统的工作量证明的工作量(难度值)。如图2所示,最后将计算任务集合(包括其工作量)和传统的工作量证明的难度值打包向全网广播。In an alternative embodiment, the task management center may use the expected total workload minus the workload of the calculation task set to obtain the workload (difficulty value) of the traditional workload proof. As shown in Figure 2, finally the set of computing tasks (including its workload) and the difficulty value of the traditional workload proof are packaged and broadcast to the entire network.
需要说明的是,如图2所示,计算节点在任务计算时,还会进行传统的工作量证明,计算结果中还包括完成传统的工作量证明的预期时长和实际时长。It should be noted that, as shown in Figure 2, the computing node will also perform traditional workload verification during task calculation, and the calculation result also includes the expected duration and actual duration of completing the traditional workload verification.
通过上述步骤提供了一种基于区块链的工作量证明系统,提出了对参与计算任务的节点给出的结果的真实性进行快速验证的方法,并且明确提出了发布的计算任务的安全性的方法。可以在达到工作量证明的目的的同时,完成部分有实际意义的计算任务(例如生物信息领域的计算任务),从而提升计算资源的使用效率。Through the above steps, a blockchain-based workload proof system is provided, a method for quickly verifying the authenticity of the results given by the nodes participating in the computing task is proposed, and the security of the issued computing task is clearly proposed. method. While achieving the purpose of proof-of-work, some practical computing tasks (such as computing tasks in the field of biological information) can be completed, thereby improving the efficiency of computing resources.
实施例2Example 2
根据本申请实施例,提供了一种计算任务的处理方法。According to an embodiment of the present application, a method for processing computing tasks is provided.
图3是根据本申请实施例的另一种计算任务的处理方法的流程图,如图3所示,该方法包括如下步骤:Fig. 3 is a flowchart of another method for processing a computing task according to an embodiment of the present application. As shown in Fig. 3, the method includes the following steps:
步骤S302,区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;In step S302, the first computing node on the blockchain receives the computing task set, and when the computing tasks in the computing task set are completed, the first computing node broadcasts the calculation result set to the verification node in the blockchain, where , The verification node is any computing node or part of the computing node on the blockchain;
步骤S304,获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;Step S304: Obtain historical information on the blockchain, where the historical information includes at least: the credit level of the program publishing object that publishes the application, the credit level of the task publishing object that publishes the computing task, and the application is on any computing node, And used to process computing tasks;
步骤S306,基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;Step S306: Determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
步骤S308,基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;Step S308: Determine a verification mode based on the review level, where the verification mode is used to verify the calculation results issued by the computing node;
步骤S310,随机抽取第一计算节点上已经广播的部分计算结果;Step S310: randomly extract part of the calculation results that have been broadcast on the first computing node;
步骤S312,通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。Step S312, by recalculating the calculation tasks corresponding to the partial calculation results, and verifying the randomly selected partial calculation results.
采用本申请上述实施例,区块链上的第一节点接收到计算任务集合之后,会使用相应的应用程序对计算任务集合进行计算,得到计算结果集合,并将计算结果集合广播至验证节点,验证节点可以随机抽取部分计算结果,并通过对部分计算结果对应的计算任务进行重新计算,并比较重新计算得到的验证结果与已经广播的计算结果的一致性,从而确定第一计算节点发布的计算结果是否通过验证。与相关技术相比,由于每个节点仅抽取部分计算结果进行验证,因此,验证速度较快。而且每个验证节点采用随机验证部分计算结果的方式,参与计算任务的第一计算节点无法预知哪些计算结果会被验证,从而无法仅生成这些可能被验证的计算结果,而伪造其他部分的计算结果,提高了计算节点作弊的难度,进而解决了现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的技术问题。另外,通过区块链上的历史信息确定审查等级,进一步确定验证模式,从而保证应用程序的安全性(对于安全性的审查,包括但不限于恶意侵占资源、篡改上链数据、攻击其他节点等)。Using the above-mentioned embodiment of this application, after the first node on the blockchain receives the calculation task set, it will use the corresponding application to calculate the calculation task set, obtain the calculation result set, and broadcast the calculation result set to the verification node. The verification node can randomly extract part of the calculation results, recalculate the calculation tasks corresponding to the partial calculation results, and compare the consistency of the verification results obtained by the recalculation with the calculation results that have been broadcast, so as to determine the calculation issued by the first calculation node Whether the result is verified. Compared with related technologies, since each node only extracts part of the calculation results for verification, the verification speed is faster. Moreover, each verification node adopts a method of randomly verifying part of the calculation results. The first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results. , The difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified. In addition, the review level is determined through the historical information on the blockchain, and the verification mode is further determined to ensure the security of the application (for security review, including but not limited to malicious infringement of resources, tampering with data on the chain, attacking other nodes, etc. ).
可选地,根据发布应用程序的历史信息确定程序发布对象的信用等级,根据发布计算任务的历史通过率确定任务发布对象的信用等级。Optionally, the credit rating of the program publishing object is determined based on the historical information of the publishing application, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
可选地,本申请上述实施例中,程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新。Optionally, in the foregoing embodiment of the present application, the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses in the history.
可选地,本申请上述实施例中,任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。Optionally, in the foregoing embodiment of the present application, the credit rating of the task issuance object is updated based on changes in the number of issuances, the number of task passes, the number of task completions, and the task completion rate of the calculation tasks issued in the history.
可选地,本申请上述实施例中,基于审查等级,确定验证模式,其中,验证模式包括如下至少之一:不进行片段验证,和,不进行数据集验证;不进行片段验证,和,进行数据集验证;降低片段验证的倍数并进行片段验证,和,进行数据集验证。Optionally, in the above-mentioned embodiment of the present application, the verification mode is determined based on the review level, where the verification mode includes at least one of the following: no fragment verification, and, no data set verification; no fragment verification, and, Data set verification; reduce the multiple of fragment verification and perform fragment verification, and, perform data set verification.
可选地,本申请上述实施例中,通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证,包括:获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,目标计算任务为产生了部分计算结果的计算任务:验证节点使用应用程序对输入数据和参考数据进行计算,得到验证结果;将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, in the above-mentioned embodiment of the present application, by recalculating the calculation task corresponding to the partial calculation result, verifying the randomly selected partial calculation result includes: obtaining the received application program for processing the target calculation task The input data and the reference data randomly generated by the verification node. Among them, the target calculation task is the calculation task that produces part of the calculation result: the verification node uses the application program to calculate the input data and reference data to obtain the verification result; compare the verification result with The calculation results generated by the corresponding calculation tasks on the first calculation node are compared to complete the verification.
可选地,本申请上述实施例中,基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。Optionally, in the foregoing embodiment of the present application, reference data is generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
可选地,本申请上述实施例中,区块链上进行验证的计算节点的数量超过阈值的情况下,进行验证计算节点的验证结果作为子集构成区块链的整体验证结果。Optionally, in the foregoing embodiment of the present application, when the number of verification computing nodes on the blockchain exceeds a threshold, the verification result of the verification computing node is used as a subset to form the overall verification result of the blockchain.
可选地,本申请上述实施例中,在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, in the above-mentioned embodiment of the present application, when each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
需要说明的是,本申请实施例中的优选的实施例或技术方案与实施例1中相同,在此不做赘述。It should be noted that the preferred embodiments or technical solutions in the embodiments of the present application are the same as those in Embodiment 1, and will not be repeated here.
实施例3Example 3
根据本申请实施例,提供了一种计算任务的处理装置。According to an embodiment of the present application, a processing device for computing tasks is provided.
图4是根据本申请实施例的一种计算任务的处理装置的示意图,如图4所示,该装置包括:Fig. 4 is a schematic diagram of a computing task processing device according to an embodiment of the present application. As shown in Fig. 4, the device includes:
广播模块42,设置为通过区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,通过第一计算节点将计算结果集合广播至区块链中的验证节 点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;The broadcasting module 42 is configured to receive the set of calculation tasks through the first calculation node on the blockchain, and when the set of calculation tasks is completed, broadcast the set of calculation results to the verification node in the blockchain through the first calculation node, Among them, the verification node is any computing node or part of the computing node on the blockchain;
抽取模块44,设置为随机抽取第一计算节点上已经广播的部分计算结果;The extraction module 44 is configured to randomly extract part of the calculation results that have been broadcast on the first computing node;
验证模块46,设置为通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;The verification module 46 is configured to verify the randomly selected part of the calculation result by recalculating the calculation task corresponding to the part of the calculation result;
确定模块48,设置为如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。The determining module 48 is configured to determine that the calculation result issued by the first computing node passes the verification if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast.
此处需要说明的是,上述广播模块42、抽取模块44、验证模块46和确定模块48可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。It should be noted here that the above-mentioned broadcasting module 42, extraction module 44, verification module 46, and determination module 48 can be run in a computer terminal as a part of the device, and the functions implemented by the above modules can be executed by the processor in the computer terminal. The computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (Mobile Internet Devices, MID), PAD and other terminal devices.
可选地,本申请上述实施例中,验证模块包括:获取单元,设置为获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,目标计算任务为产生了部分计算结果的计算任务;计算单元,设置为使用应用程序对输入数据和参考数据进行计算,得到验证结果;比对单元,设置为将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, in the foregoing embodiment of the present application, the verification module includes: an acquisition unit configured to acquire input data received by an application program for processing the target computing task, and reference data randomly generated by the verification node, wherein the target computing The task is a calculation task that produces a partial calculation result; the calculation unit is set to use the application to calculate the input data and reference data to obtain the verification result; the comparison unit is set to compare the verification result with the corresponding calculation on the first calculation node The calculation results generated by the task are compared to complete the verification.
此处需要说明的是,上述获取单元、计算单元和比对单元可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及MID、PAD等终端设备。It should be noted here that the above-mentioned acquisition unit, calculation unit, and comparison unit can be run in a computer terminal as part of the device, and the functions implemented by the above-mentioned modules can be executed by the processor in the computer terminal, and the computer terminal can also be a smart device. Mobile phones (such as Android phones, IOS phones, etc.), tablet computers, handheld computers, and terminal devices such as MID and PAD.
可选地,本申请上述实施例中,抽取模块还设置为基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。Optionally, in the foregoing embodiment of the present application, the extraction module is further configured to generate reference data based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
可选地,本申请上述实施例中,抽取模块还设置为区块链上进行验证的计算节点的数量超过预设阈值的情况下,随机抽取预定数量的计算节点的验证结果作为子集构成区块链的整体验证结果。Optionally, in the above-mentioned embodiment of the present application, the extraction module is further configured to randomly extract the verification results of a predetermined number of computing nodes as the subset constituent area when the number of computing nodes for verification on the blockchain exceeds a preset threshold. The overall verification result of the block chain.
可选地,在本申请上述实施例中,抽取模块还设置为多次随机抽取第一计算节点上已经广播的部分计算结果;验证模块还设置为对每次随机抽取的部分计算结果进行验证;确定模块还设置为如果多次重新计算得到的验证结果均与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。Optionally, in the above-mentioned embodiment of the present application, the extraction module is further configured to randomly extract part of the calculation results that have been broadcast on the first computing node multiple times; the verification module is further configured to verify the part of the calculation results randomly extracted each time; The determining module is further configured to determine that the calculation result published by the first computing node passes the verification if the verification results obtained by multiple recalculations are consistent with the calculation results that have been broadcast.
可选地,在本申请上述实施例中,确定模块还设置为在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, in the foregoing embodiment of the present application, the determining module is further configured to determine that the updated block is a new block when each computing node on the blockchain passes the verification.
可选地,在本申请上述实施例中,该装置还包括:第一获取模块,设置为获取任意一个计算节点上用于处理计算任务的应用程序;第二获取模块,设置为获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级;第一确定模块,设置为基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;第二确定模块,设置为基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果。Optionally, in the above-mentioned embodiment of the present application, the device further includes: a first acquisition module configured to acquire an application program used to process computing tasks on any computing node; a second acquisition module configured to acquire a blockchain The historical information, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, and the credit rating of the task publishing object that publishes the computing task; the first determining module is set based on the credit rating of the program publishing object and/ Or the credit rating of the task release object determines the review level; the second determining module is set to determine the verification mode based on the review level, where the verification mode is used to verify the calculation results released by the computing node.
此处需要说明的是,上述第一获取模块、第二获取模块、第一确定模块和第二确定模块可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及MID、PAD等终端设备。It should be noted here that the above-mentioned first acquisition module, second acquisition module, first determination module, and second determination module may be run in a computer terminal as part of the device, and the above modules may be executed by a processor in the computer terminal. For the realized functions, the computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, and a terminal device such as MID and PAD.
可选地,在本申请上述实施例中,第二确定模块还设置为根据发布应用程序的历史信息确定程序发布对象的信用等级,根据发布计算任务的历史通过率确定任务发布对象的信用等级。Optionally, in the foregoing embodiment of the present application, the second determining module is further configured to determine the credit level of the program publishing object based on the historical information of the publishing application, and determine the credit level of the task publishing object based on the historical pass rate of the publishing calculation task.
可选地,在本申请上述实施例中,验证模块还设置为通过如下任意一种方式验证发布应用程序的平台的安全性:检测应用程序的开源代码、使用安全验证软件验证应用程序、使用安全测试程序验证应用程序。Optionally, in the above-mentioned embodiment of the present application, the verification module is also set to verify the security of the platform that publishes the application by any of the following methods: detecting the open source code of the application, using security verification software to verify the application, and using security The test program verifies the application.
可选地,在本申请上述实施例中,该装置还包括:接收模块,设置为第一计算节点接收到计算任务集合的同时,接收计算任务的计算工作量和按照预设算法验证计算结果集合的验证工作量,其中,计算工作量基于输入数据的数据量和应用程序使用的算法的复杂度确定,验证工作量基于预设总工作量和计算工作量确定。Optionally, in the above-mentioned embodiment of the present application, the device further includes: a receiving module configured to receive the calculation workload of the calculation task and verify the calculation result set according to a preset algorithm when the first computing node receives the calculation task set The verification workload is determined based on the amount of input data and the complexity of the algorithm used by the application, and the verification workload is determined based on the preset total workload and calculation workload.
需要说明的是,本申请实施例中的优选的实施例或技术方案可参考实施例1,在此不做赘述。It should be noted that, for the preferred embodiments or technical solutions in the embodiments of the present application, reference may be made to Embodiment 1, which will not be repeated here.
实施例4Example 4
根据本申请实施例,提供了一种计算任务的处理装置。According to an embodiment of the present application, a processing device for computing tasks is provided.
图5是根据本申请实施例的另一种计算任务的处理装置的示意图,如图5所示,该装置包括:Fig. 5 is a schematic diagram of another computing task processing device according to an embodiment of the present application. As shown in Fig. 5, the device includes:
广播模块52,设置为区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验 证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;The broadcast module 52 is configured to be configured to the first computing node on the blockchain to receive the computing task set, and in the case that the computing tasks in the computing task set are completed, the first computing node broadcasts the calculation result set to the blockchain for verification Nodes, where the verification node is any computing node or part of the computing node on the blockchain;
获取模块54,设置为获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;The obtaining module 54 is configured to obtain historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, and the application calculates at any one On the node, and used to process computing tasks;
第一确定模块56,设置为基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;The first determining module 56 is configured to determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
第二确定模块58,设置为基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;The second determining module 58 is configured to determine a verification mode based on the review level, where the verification mode is used to verify the calculation results issued by the computing node;
抽取模块510,设置为随机抽取第一计算节点上已经广播的部分计算结果;The extraction module 510 is configured to randomly extract part of the calculation results that have been broadcast on the first computing node;
验证模块512,设置为通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。The verification module 512 is configured to verify the randomly selected part of the calculation result by recalculating the calculation task corresponding to the generated part of the calculation result.
此处需要说明的是,上述广播模块52、获取模块54、第一确定模块56、第二确定模块58、抽取模块510和验证模块512可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及MID、PAD等终端设备。It should be noted here that the above-mentioned broadcast module 52, acquisition module 54, first determination module 56, second determination module 58, extraction module 510, and verification module 512 can be run in a computer terminal as a part of the device, and can be run through the computer terminal. The processor in the computer performs the functions realized by the above modules, and the computer terminal can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, and terminal devices such as MID and PAD.
可选地,本申请上述实施例中,验证模块包括:获取单元,设置为获取用于处理目标计算任务的应用程序所接收到的输入数据,和验证节点随机生成的参考数据,其中,目标计算任务为产生了部分计算结果的计算任务:计算单元,设置为使用应用程序对输入数据和参考数据进行计算,得到验证结果;比对单元,设置为将验证结果与第一计算节点上对应的计算任务产生的计算结果进行比对,来完成验证。Optionally, in the foregoing embodiment of the present application, the verification module includes: an acquisition unit configured to acquire input data received by an application program for processing the target computing task, and reference data randomly generated by the verification node, wherein the target computing The task is a calculation task that produces a partial calculation result: the calculation unit is set to use the application program to calculate the input data and reference data to obtain the verification result; the comparison unit is set to compare the verification result with the corresponding calculation on the first calculation node The calculation results generated by the task are compared to complete the verification.
此处需要说明的是,上述获取单元、计算单元和比对单元2可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及MID、PAD等终端设备。It should be noted here that the above-mentioned acquisition unit, calculation unit, and comparison unit 2 can be run in a computer terminal as a part of the device, and the functions implemented by the above-mentioned modules can be executed by the processor in the computer terminal, and the computer terminal can also be Smart phones (such as Android phones, IOS phones, etc.), tablet computers, handheld computers, and terminal devices such as MID and PAD.
可选地,本申请上述实施例中,抽取模块还设置为基于随机数生成函数生成参考数据,参考数据用于表征验证的计算结果与第一计算节点上对应的计算任务之间的对应关系。Optionally, in the foregoing embodiment of the present application, the extraction module is further configured to generate reference data based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node.
可选地,本申请上述实施例中,该装置还包括:第三确定模块,设置为在区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。Optionally, in the foregoing embodiment of the present application, the device further includes: a third determining module configured to determine that the updated block is a new block when each computing node on the blockchain passes the verification.
此处需要说明的是,上述第三确定模块可以作为装置的一部分运行在计算机终端中,可以通过计算机终端中的处理器来执行上述模块实现的功能,计算机终端也可以是智能手机(如Android手机、IOS手机等)、平板电脑、掌上电脑以及MID、PAD等终端设备。It should be noted here that the above-mentioned third determining module can be run in a computer terminal as a part of the device, and the functions realized by the above-mentioned module can be executed by the processor in the computer terminal. The computer terminal can also be a smart phone (such as an Android phone). , IOS mobile phones, etc.), tablet computers, handheld computers, and MID, PAD and other terminal devices.
需要说明的是,本申请实施例中的优选的实施例或技术方案可参考实施例1,在此不做赘述。It should be noted that, for the preferred embodiments or technical solutions in the embodiments of the present application, reference may be made to Embodiment 1, which will not be repeated here.
实施例5Example 5
根据本申请实施例,提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行上述实施例1和2中的计算任务的处理方法。According to an embodiment of the present application, a storage medium is provided, and the storage medium includes a stored program, wherein the device where the storage medium is located is controlled to execute the processing method of the calculation task in the foregoing Embodiments 1 and 2 when the program is running.
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the foregoing storage medium may be located in any computer terminal in a computer terminal group in a computer network, or located in any mobile terminal in a mobile terminal group.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node A computing node broadcasts a set of calculation results to a verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; and a part of the calculation result that has been broadcast on the first computing node is randomly selected; By recalculating the calculation task corresponding to the partial calculation result, the randomly selected partial calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is passed verification.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed In this case, the first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; obtaining historical information on the blockchain, where , The historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit of the program publishing object The level and/or the credit level of the task release object to determine the review level; based on the review level, determine the verification mode, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node ; By recalculating the calculation tasks corresponding to the partial calculation results, the randomly selected partial calculation results are verified.
可选地,在本实施例中,存储介质还可以被设置为存储计算任务的处理方法提供的各种优选地或可选的方法步骤的程序代码。Optionally, in this embodiment, the storage medium may also be configured to store the program codes of various preferred or optional method steps provided by the processing method of the computing task.
实施例6Example 6
根据本申请实施例,提供了一种处理器,处理器设置为运行程序,其中,程序运行时执行上述实施例1和2中的计算任务的处理方法。According to an embodiment of the present application, a processor is provided, and the processor is configured to run a program, wherein the processing method of the calculation task in the foregoing embodiments 1 and 2 is executed when the program is running.
可选地,在本实施例中,上述处理器可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the above-mentioned processor may be located in any computer terminal in a computer terminal group in a computer network, or located in any mobile terminal in a mobile terminal group.
可选地,在本实施例中,处理器被设置为执行以下步骤:区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。Optionally, in this embodiment, the processor is configured to perform the following steps: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing node will calculate the result Collectively broadcast to verification nodes in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; randomly select part of the calculation results that have been broadcast on the first computing node; generate partial calculation results by pairing The corresponding calculation task is recalculated, and the randomly selected partial calculation results are verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is verified.
可选地,在本实施例中,处理器被设置为执行以下步骤:区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。Optionally, in this embodiment, the processor is configured to perform the following steps: when the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed, the first computing The node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; acquiring historical information on the blockchain, where the historical information includes at least: The credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process computing tasks; based on the credit rating and/or task publishing of the program publishing object The credit rating of the object determines the review level; based on the review level, the verification mode is determined, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; The calculation task corresponding to the result is recalculated, and the randomly selected part of the calculation result is verified.
可选地,在本实施例中,处理器还可以被设置为执行计算任务的处理方法提供的各种优选地或可选的方法步骤。Optionally, in this embodiment, the processor may also be configured to perform various preferred or optional method steps provided by the processing method of the computing task.
本申请实施例所提供的各个功能单元可以在移动终端、计算机终端或者类似的运算装置中运行,也可以作为存储介质的一部分进行存储。The functional units provided in the embodiments of the present application may run in a mobile terminal, a computer terminal or a similar computing device, or may be stored as a part of a storage medium.
由此,本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。Thus, the embodiments of the present invention can provide a computer terminal, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal may also be replaced with a terminal device such as a mobile terminal.
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the above-mentioned computer terminal may be located in at least one network device among a plurality of network devices in the computer network.
在本实施例中,上述计算机终端可以执行计算任务的处理方法中以下步骤的程序代码:区块链上的第一计算节点接收到计算任务集合,在计算任务集合完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证;如果重新计算得到的验证结果与已经广播的计算结果一致,则确定第一计算节点发布的计算结果通过验证。In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the computing task processing method: the first computing node on the blockchain receives the computing task set, and when the computing task set is completed, the first computing The node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any calculation node or part of the calculation node on the blockchain; randomly selects part of the calculation results that have been broadcast on the first calculation node; The calculation task corresponding to the partial calculation result is recalculated, and the randomly selected partial calculation result is verified; if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first calculation node is verified.
在本实施例中,上述计算机终端还可以执行计算任务的处理方法中以下步骤的程序代码:区块链上的第一计算节点接收到计算任务集合,且计算任务集合中的计算任务完成的情况下,第一计算节点将计算结果集合广播至区块链中的验证节点,其中,验证节点为区块链上的任意一个计算节点或部分计算节点;获取区块链上的历史信息,其中,历史信息至少包括:发布应用程序的程序发布对象的信用等级,发布计算任务的任务发布对象的信用等级,应用程序在任意一个计算节点上,且用于处理计算任务;基于程序发布对象的信用等级和/或任务发布对象的信用等级,确定审查等级;基于审查等级,确定验证模式,其中,验证模式用于验证计算节点发布的计算结果;随机抽取第一计算节点上已经广播的部分计算结果;通过对产生部分计算结果对应的计算任务进行重新计算,对随机抽取的部分计算结果进行验证。In this embodiment, the above-mentioned computer terminal may also execute the program code of the following steps in the method for processing computing tasks: the first computing node on the blockchain receives the computing task set, and the computing tasks in the computing task set are completed Next, the first computing node broadcasts the set of calculation results to the verification node in the blockchain, where the verification node is any computing node or part of the computing node on the blockchain; obtaining historical information on the blockchain, where, The historical information includes at least: the credit rating of the program publishing object that publishes the application, the credit rating of the task publishing object that publishes the computing task, the application is on any computing node and is used to process the computing task; based on the credit rating of the program publishing object And/or the credit level of the task release object, determine the review level; determine the verification mode based on the review level, where the verification mode is used to verify the calculation results published by the computing node; randomly select part of the calculation results that have been broadcast on the first computing node; By recalculating the calculation tasks corresponding to the partial calculation results, the randomly selected partial calculation results are verified.
可选地,该计算机终端可以包括:一个或多个处理器、存储器、以及传输装置。Optionally, the computer terminal may include: one or more processors, memories, and transmission devices.
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的计算任务的处理方法及装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的计算任务的处理方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory can be used to store software programs and modules, such as the program instructions/modules corresponding to the computing task processing method and device in the embodiment of the present invention. The processor executes various programs and modules by running the software programs and modules stored in the memory. Functional application and data processing, that is, the processing method for realizing the above-mentioned computing tasks. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely provided with respect to the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
上述的传输装置用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联 网或局域网进行通讯。在一个实例中,传输装置为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The aforementioned transmission device is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wired network and a wireless network. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device is a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
其中,具体地,存储器用于存储计算任务集合、计算结果集合、参考数据和历史信息、以及应用程序。Among them, specifically, the memory is used to store a set of calculation tasks, a set of calculation results, reference data and historical information, and application programs.
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行上述方法实施例中的各个可选或优选实施例的方法步骤的程序代码。The processor may call the information and application programs stored in the memory through the transmission device to execute the program code of the method steps of each optional or preferred embodiment in the foregoing method embodiments.
本领域普通技术人员可以理解,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及MID、PAD等终端设备。Those of ordinary skill in the art can understand that the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and terminal devices such as MID and PAD.
上述本发明本申请实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus. For a part that is not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only  Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code .
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above are only the preferred embodiments of this application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and modifications can be made, and these improvements and modifications are also Should be regarded as the scope of protection of this application.
工业实用性Industrial applicability
本申请实施例中提供的方案,可以应用于区块链技术中。基于本申请实施例提供的方案,由于每个节点仅抽取部分计算结果进行验证,因此,验证速度较快。而且每个验证节点采用随机验证部分计算结果的方式,参与计算任务的第一计算节点无法预知哪些计算结果会被验证,从而无法仅生成这些可能被验证的计算结果,而伪造其他部分的计算结果,提高了计算节点作弊的难度,进而解决了现有技术中在区块链中存在大量的计算任务,在计算任务的处理过程中,存在计算结果无法快速验证的技术问题。The solutions provided in the embodiments of this application can be applied to blockchain technology. Based on the solution provided by the embodiments of the present application, since each node only extracts part of the calculation results for verification, the verification speed is relatively fast. Moreover, each verification node adopts a method of randomly verifying part of the calculation results. The first calculation node participating in the calculation task cannot predict which calculation results will be verified, so it is impossible to generate only these possible verification calculation results and forge other calculation results. , The difficulty of cheating by computing nodes is increased, and a large number of computing tasks in the blockchain in the prior art are solved. In the processing of computing tasks, there is a technical problem that the calculation results cannot be quickly verified.

Claims (30)

  1. 一种计算任务的处理方法,包括:A method for processing calculation tasks, including:
    区块链上的第一计算节点接收到计算任务集合,在所述计算任务集合完成的情况下,所述第一计算节点将计算结果集合广播至所述区块链中的验证节点,其中,所述验证节点为所述区块链上的任意一个计算节点或部分计算节点;The first computing node on the blockchain receives the set of computing tasks, and when the set of computing tasks is completed, the first computing node broadcasts the set of calculation results to the verification node in the blockchain, where: The verification node is any computing node or part of the computing node on the blockchain;
    随机抽取所述第一计算节点上已经广播的部分计算结果;Randomly extract part of the calculation results that have been broadcast on the first computing node;
    通过对产生所述部分计算结果对应的计算任务进行重新计算,对所述随机抽取的所述部分计算结果进行验证;Verifying the randomly selected partial calculation result by recalculating the calculation task corresponding to the partial calculation result;
    如果重新计算得到的验证结果与已经广播的计算结果一致,则确定所述第一计算节点发布的计算结果通过验证。If the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast, it is determined that the calculation result issued by the first computing node passes the verification.
  2. 根据权利要求1所述的方法,其中,通过对产生所述部分计算结果对应的计算任务进行重新计算,对所述随机抽取的所述部分计算结果进行验证,包括:The method according to claim 1, wherein the verification of the randomly selected partial calculation result by recalculating the calculation task corresponding to the partial calculation result generation includes:
    获取用于处理目标计算任务的应用程序所接收到的输入数据,和所述验证节点随机生成的参考数据,其中,所述目标计算任务为产生了所述部分计算结果的计算任务;Acquiring input data received by an application program for processing a target computing task, and reference data randomly generated by the verification node, wherein the target computing task is a computing task that generates the partial calculation result;
    所述验证节点使用所述应用程序对所述输入数据和所述参考数据进行计算,得到所述验证结果;The verification node uses the application program to calculate the input data and the reference data to obtain the verification result;
    将所述验证结果与所述第一计算节点上对应的计算任务产生的计算结果进行比对,来完成所述验证。The verification result is compared with the calculation result generated by the corresponding calculation task on the first computing node to complete the verification.
  3. 根据权利要求2所述的方法,其中,基于随机数生成函数生成所述参考数据,所述参考数据用于表征验证的计算结果与所述第一计算节点上对应的计算任务之间的对应关系。The method according to claim 2, wherein the reference data is generated based on a random number generation function, and the reference data is used to characterize the correspondence between the verified calculation result and the corresponding calculation task on the first calculation node .
  4. 根据权利要求1所述的方法,其中,所述区块链上进行验证的计算节点的数量超过预设阈值的情况下,随机抽取预定数量的计算节点的验证结果作为子集构成所述区块链的整体验证结果。The method according to claim 1, wherein when the number of verification nodes on the blockchain exceeds a preset threshold, the verification results of a predetermined number of calculation nodes are randomly selected as a subset to form the block The overall verification result of the chain.
  5. 根据权利要求4所述的方法,其中,所述预定数量用于确定所述验证节点数量,其中,基于问题复杂度m和每次验证长度n确定所述验证节点数量。The method according to claim 4, wherein the predetermined number is used to determine the number of verification nodes, wherein the number of verification nodes is determined based on the problem complexity m and the length of each verification n.
  6. 根据权利要求1至5中任意一项所述的方法,其中,在对区块链上的计算任务集 合进行验证的过程中,所述方法还包括:The method according to any one of claims 1 to 5, wherein, in the process of verifying the set of computing tasks on the blockchain, the method further comprises:
    获取所述任意一个计算节点上用于处理所述计算任务的应用程序;Acquiring an application program used to process the computing task on any one of the computing nodes;
    获取所述区块链上的历史信息,其中,所述历史信息至少包括:发布所述应用程序的程序发布对象的信用等级,发布所述计算任务的任务发布对象的信用等级;Acquiring historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, and the credit rating of the task publishing object that publishes the computing task;
    基于所述程序发布对象的信用等级和/或所述任务发布对象的信用等级,确定审查等级;Determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
    基于所述审查等级,确定验证模式,其中,所述验证模式用于验证所述计算节点发布的计算结果。Based on the review level, a verification mode is determined, where the verification mode is used to verify the calculation result issued by the computing node.
  7. 根据权利要求6所述的方法,其中,根据发布所述应用程序的历史信息确定所述程序发布对象的信用等级,根据发布计算任务的历史通过率确定所述任务发布对象的信用等级。7. The method according to claim 6, wherein the credit rating of the program publishing object is determined based on the historical information of publishing the application program, and the credit rating of the task publishing object is determined based on the historical pass rate of the publishing calculation task.
  8. 根据权利要求7所述的方法,其中,所述程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新;和/或所述任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。8. The method according to claim 7, wherein the credit rating of the program publishing object is updated based on changes in the number of publishing applications, the program pass rate, and the number of uses in the history of publishing applications; and/or the credit of the task publishing object The level is updated based on the changes in the number of issued calculation tasks, the number of tasks passed, the number of task completions, and the task completion rate in the history.
  9. 根据权利要求6所述的方法,其中,基于所述审查等级,确定验证模式,其中,所述验证模式包括如下至少之一:The method according to claim 6, wherein a verification mode is determined based on the review level, wherein the verification mode includes at least one of the following:
    不进行片段验证和不进行数据集验证;No fragment verification and no data set verification;
    不进行片段验证和进行数据集验证;No fragment verification and data set verification;
    降低片段验证的倍数并进行片段验证,和进行数据集验证。Reduce the multiple of fragment verification and perform fragment verification, and perform data set verification.
  10. 根据权利要求6所述的方法,其中,通过如下任意一种方式验证发布所述应用程序的平台的安全性:检测所述应用程序的开源代码、使用安全验证软件验证所述应用程序、使用安全测试程序验证所述应用程序。The method according to claim 6, wherein the security of the platform that publishes the application is verified by any one of the following methods: detecting the open source code of the application, using security verification software to verify the application, and using security The test program verifies the application.
  11. 根据权利要求1所述的方法,其中,所述计算任务包括:用于处理所述计算任务的应用程序的程序信息,所述计算任务对应的输入数据的数据信息,以及完成所述计算任务所获得的虚拟资源。The method according to claim 1, wherein the calculation task comprises: program information of an application program used to process the calculation task, data information of input data corresponding to the calculation task, and the calculation task required to complete the calculation task. Virtual resources obtained.
  12. 根据权利要求11所述的方法,其中,所述第一计算节点接收到所述计算任务集合的同时,接收所述计算任务的计算工作量和按照预设算法验证所述计算结果集合 的验证工作量,其中,所述计算工作量基于所述输入数据的数据量和所述应用程序使用的算法的复杂度确定,所述验证工作量基于预设总工作量和所述计算工作量确定。The method according to claim 11, wherein when the first computing node receives the set of computing tasks, it receives the computing workload of the computing tasks and verifies the verification work of the set of computing results according to a preset algorithm. The calculation workload is determined based on the data amount of the input data and the complexity of the algorithm used by the application program, and the verification workload is determined based on the preset total workload and the calculation workload.
  13. 根据权利要求1所述的方法,其中,多次随机抽取所述第一计算节点上已经广播的部分计算结果,并对每次随机抽取的部分计算结果进行验证,如果多次重新计算得到的验证结果均与所述已经广播的计算结果一致,则所述第一计算节点发布的计算结果通过验证。The method according to claim 1, wherein the partial calculation results that have been broadcast on the first computing node are randomly selected multiple times, and the partial calculation results randomly selected each time are verified, if the verification obtained by recalculating multiple times If the results are consistent with the calculation results that have been broadcast, then the calculation results published by the first computing node pass the verification.
  14. 根据权利要求1所述的方法,其中,在所述区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。The method according to claim 1, wherein, in the case that each computing node on the blockchain passes the verification, it is determined that the updated block is a new block.
  15. 一种计算任务的处理装置,包括:A processing device for computing tasks includes:
    广播模块,设置为通过区块链上的第一计算节点接收到计算任务集合,在所述计算任务集合完成的情况下,通过所述第一计算节点将计算结果集合广播至所述区块链中的验证节点,其中,所述验证节点为所述区块链上的任意一个计算节点或部分计算节点;The broadcast module is configured to receive a set of calculation tasks through the first computing node on the blockchain, and when the set of calculation tasks is completed, broadcast the set of calculation results to the blockchain through the first computing node The verification node in, wherein the verification node is any computing node or part of the computing node on the blockchain;
    抽取模块,设置为随机抽取所述第一计算节点上已经广播的部分计算结果;An extraction module, configured to randomly extract part of the calculation results that have been broadcast on the first computing node;
    验证模块,设置为通过对产生所述部分计算结果对应的计算任务进行重新计算,用于对所述随机抽取的所述部分计算结果进行验证;A verification module, configured to recalculate the calculation task corresponding to the partial calculation result to be used to verify the randomly selected partial calculation result;
    第一确定模块,设置为如果重新计算得到的验证结果与已经广播的计算结果一致,则确定所述第一计算节点发布的计算结果通过验证。The first determining module is configured to determine that the calculation result issued by the first computing node passes the verification if the verification result obtained by the recalculation is consistent with the calculation result that has been broadcast.
  16. 根据权利要求15所述的装置,其中,所述验证模块包括:The apparatus according to claim 15, wherein the verification module comprises:
    获取单元,设置为获取用于处理目标计算任务的应用程序所接收到的输入数据,和所述验证节点随机生成的参考数据,其中,所述目标计算任务为产生了所述部分计算结果的计算任务;The obtaining unit is configured to obtain input data received by an application program for processing a target calculation task and reference data randomly generated by the verification node, wherein the target calculation task is a calculation that generates the partial calculation result task;
    计算单元,设置为使用所述应用程序对所述输入数据和所述参考数据进行计算,得到所述验证结果;A calculation unit configured to use the application program to calculate the input data and the reference data to obtain the verification result;
    比对单元,设置为将所述验证结果与所述第一计算节点上对应的计算任务产生的计算结果进行比对,来完成所述验证。The comparison unit is configured to compare the verification result with the calculation result generated by the corresponding calculation task on the first computing node to complete the verification.
  17. 根据权利要求16所述的装置,其中,所述抽取模块还设置为基于随机数生成函数生成所述参考数据,所述参考数据用于表征验证的计算结果与所述第一计算节点 上对应的计算任务之间的对应关系。The device according to claim 16, wherein the extraction module is further configured to generate the reference data based on a random number generation function, and the reference data is used to characterize the verification calculation result corresponding to the first calculation node Calculate the correspondence between tasks.
  18. 根据权利要求15所述的装置,其中,所述抽取模块还设置为所述区块链上进行验证的计算节点的数量超过预设阈值的情况下,随机抽取预定数量的计算节点的验证结果作为子集构成所述区块链的整体验证结果。The device according to claim 15, wherein the extraction module is further configured to randomly extract the verification results of a predetermined number of computing nodes as the verification result of a predetermined number of computing nodes in the case that the number of verification nodes on the blockchain exceeds a preset threshold The subset constitutes the overall verification result of the blockchain.
  19. 根据权利要求18所述的装置,其中,所述预定数量用于确定所述验证节点数量,其中,基于问题复杂度m和每次验证长度n确定所述验证节点数量。The apparatus according to claim 18, wherein the predetermined number is used to determine the number of verification nodes, wherein the number of verification nodes is determined based on the complexity of the problem m and the length of each verification n.
  20. 根据权利要求15至19中任意一项所述的装置,其中,所述装置还包括:The device according to any one of claims 15 to 19, wherein the device further comprises:
    第一获取模块,设置为在对区块链上的计算任务集合进行验证的过程中,获取所述任意一个计算节点上用于处理所述计算任务的应用程序;The first obtaining module is configured to obtain an application program used to process the computing task on any one of the computing nodes in the process of verifying the set of computing tasks on the blockchain;
    第二获取模块,设置为获取所述区块链上的历史信息,其中,所述历史信息至少包括:发布所述应用程序的程序发布对象的信用等级,发布所述计算任务的任务发布对象的信用等级;The second acquisition module is configured to acquire historical information on the blockchain, where the historical information includes at least: the credit rating of the program publishing object that publishes the application, and the task publishing object that publishes the computing task. Credit rating
    第二确定模块,设置为基于所述程序发布对象的信用等级和/或所述任务发布对象的信用等级,确定审查等级;The second determining module is configured to determine the review level based on the credit level of the program release object and/or the credit level of the task release object;
    第三确定模块,设置为基于所述审查等级,确定验证模式,其中,所述验证模式用于验证所述计算节点发布的计算结果。The third determining module is configured to determine a verification mode based on the review level, wherein the verification mode is used to verify the calculation result issued by the computing node.
  21. 根据权利要求20所述的装置,其中,所述第二确定模块还设置为根据发布所述应用程序的历史信息确定所述程序发布对象的信用等级,根据发布计算任务的历史通过率确定所述任务发布对象的信用等级。The device according to claim 20, wherein the second determining module is further configured to determine the credit rating of the program publishing object based on the historical information of publishing the application program, and determine the credit rating of the program publishing object based on the historical pass rate of the publishing calculation task. The credit rating of the task posting object.
  22. 根据权利要求21所述的装置,其中,所述程序发布对象的信用等级基于历史上发布应用程序的发布次数、程序通过率、使用次数的变化而更新;所述任务发布对象的信用等级基于历史上发布计算任务的发布次数、任务通过次数、任务完成次数、任务完成率的变化而更新。21. The device according to claim 21, wherein the credit rating of the program release object is updated based on changes in the number of releases, the program pass rate, and the number of uses of the released application in the history; the credit rating of the task release object is based on the history It is updated with the changes in the number of times the task is issued, the number of tasks passed, the number of task completions, and the task completion rate.
  23. 根据权利要求20所述的装置,其中,所述验证模式包括如下至少之一:不进行片段验证,和,不进行数据集验证;不进行片段验证,和,进行数据集验证;降低片段验证的倍数并进行片段验证,和,进行数据集验证。The apparatus according to claim 20, wherein the verification mode comprises at least one of the following: no fragment verification, and, no data set verification; no fragment verification, and, data set verification; reduced fragment verification Multiple and perform fragment verification, and, perform data set verification.
  24. 根据权利要求20所述的装置,其中,所述验证模块还设置为通过如下任意一种方式验证发布所述应用程序的平台的安全性:检测所述应用程序的开源代码、使用安全验证软件验证所述应用程序、使用安全测试程序验证所述应用程序。The device according to claim 20, wherein the verification module is further configured to verify the security of the platform that publishes the application program by any one of the following methods: detecting the open source code of the application program, and verifying by using security verification software The application program uses a security test program to verify the application program.
  25. 根据权利要求15所述的装置,其中,所述计算任务包括:用于处理所述计算任务的应用程序的程序信息,所述计算任务对应的输入数据的数据信息,以及完成所述计算任务所获得的虚拟资源。The device according to claim 15, wherein the computing task comprises: program information of an application program used to process the computing task, data information of input data corresponding to the computing task, and the calculation task required to complete the computing task. Virtual resources obtained.
  26. 根据权利要求25所述的装置,其中,所述装置还包括:The device according to claim 25, wherein the device further comprises:
    接收模块,设置为所述第一计算节点接收到所述计算任务集合的同时,接收所述计算任务的计算工作量和按照预设算法验证所述计算结果集合的验证工作量,其中,所述计算工作量基于所述输入数据的数据量和所述应用程序使用的算法的复杂度确定,所述验证工作量基于预设总工作量和所述计算工作量确定。The receiving module is configured to receive the calculation workload of the calculation task and the verification workload of verifying the calculation result set according to a preset algorithm at the same time when the first computing node receives the set of calculation tasks, wherein the The calculation workload is determined based on the data amount of the input data and the complexity of the algorithm used by the application program, and the verification workload is determined based on a preset total workload and the calculation workload.
  27. 根据权利要求15所述的装置,其中,The device according to claim 15, wherein:
    所述抽取模块还设置为多次随机抽取所述第一计算节点上已经广播的部分计算结果;The extraction module is further configured to randomly extract part of the calculation results that have been broadcast on the first computing node multiple times;
    所述验证模块还设置为对每次随机抽取的部分计算结果进行验证;The verification module is also configured to verify a part of the calculation results randomly drawn each time;
    所述确定模块还设置为如果多次重新计算得到的验证结果均与所述已经广播的计算结果一致,则所述第一计算节点发布的计算结果通过验证。The determining module is further configured to pass the verification if the verification results obtained by multiple recalculations are consistent with the already broadcasted calculation results.
  28. 根据权利要求15所述的装置,其中,所述确定模块还设置为在所述区块链上的每个计算节点验证通过的情况下,确定更新后的区块为新区块。The device according to claim 15, wherein the determining module is further configured to determine that the updated block is a new block when each computing node on the blockchain passes the verification.
  29. 一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求1至14中任意一项所述的计算任务的处理方法。A storage medium, the storage medium including a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute the computing task processing method according to any one of claims 1 to 14.
  30. 一种处理器,所述处理器设置为运行程序,其中,所述程序运行时执行权利要求1至14中任意一项所述的计算任务的处理方法。A processor configured to run a program, wherein the method for processing a computing task according to any one of claims 1 to 14 is executed when the program is running.
PCT/CN2020/122886 2019-12-13 2020-10-22 Computational task processing method and device, storage medium, and processor WO2021114889A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911285440.5A CN111881147B (en) 2019-12-13 2019-12-13 Processing method and device of computing task, storage medium and processor
CN201911285440.5 2019-12-13

Publications (1)

Publication Number Publication Date
WO2021114889A1 true WO2021114889A1 (en) 2021-06-17

Family

ID=73153882

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122886 WO2021114889A1 (en) 2019-12-13 2020-10-22 Computational task processing method and device, storage medium, and processor

Country Status (2)

Country Link
CN (1) CN111881147B (en)
WO (1) WO2021114889A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672680A (en) * 2021-07-19 2021-11-19 哈尔滨工业大学(深圳) Lightweight probability verification method and device in block chain, block chain node and medium
CN113938483B (en) * 2021-10-29 2023-06-16 北京京航计算通讯研究所 Node identity verification method and system of distributed AI collaborative computing system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848056A (en) * 2018-05-03 2018-11-20 南京理工大学 Block chain common recognition method based on verifying
CN109993004A (en) * 2019-04-10 2019-07-09 广州蚁比特区块链科技有限公司 Block chain autonomy method and system based on credit mechanism
CN110224839A (en) * 2019-06-17 2019-09-10 北京艾摩瑞策科技有限公司 Applied to the verification method and device on block chain
US20190287107A1 (en) * 2018-03-15 2019-09-19 International Business Machines Corporation Resource equity for blockchain
CN110287205A (en) * 2019-06-21 2019-09-27 中国银联股份有限公司 A kind of across the fragment transaction data processing method of block chain and device
US20190311125A1 (en) * 2015-04-16 2019-10-10 Cloud Raxak, Inc. Trust in Block-Chain Implementations Using Compute Resource Configuration and Verification Systems and Methods

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225044B (en) * 2019-06-17 2020-11-27 北京瑞策科技有限公司 Verification method and device on block chain
CN110222537B (en) * 2019-06-17 2021-01-29 北京瑞策科技有限公司 Verification method and device applied to block chain nodes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190311125A1 (en) * 2015-04-16 2019-10-10 Cloud Raxak, Inc. Trust in Block-Chain Implementations Using Compute Resource Configuration and Verification Systems and Methods
US20190287107A1 (en) * 2018-03-15 2019-09-19 International Business Machines Corporation Resource equity for blockchain
CN108848056A (en) * 2018-05-03 2018-11-20 南京理工大学 Block chain common recognition method based on verifying
CN109993004A (en) * 2019-04-10 2019-07-09 广州蚁比特区块链科技有限公司 Block chain autonomy method and system based on credit mechanism
CN110224839A (en) * 2019-06-17 2019-09-10 北京艾摩瑞策科技有限公司 Applied to the verification method and device on block chain
CN110287205A (en) * 2019-06-21 2019-09-27 中国银联股份有限公司 A kind of across the fragment transaction data processing method of block chain and device

Also Published As

Publication number Publication date
CN111881147A (en) 2020-11-03
CN111881147B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
KR102050129B1 (en) Block chain supporting multiple one-way functions used for verification of blocks
US11716199B2 (en) Blockchain generation apparatus, blockchain verification apparatus, and program
EP3586493B1 (en) Method for mining a block in a decentralized blockchain consensus network
CN108512652B (en) Decentralized consensus method and system based on time certification and block chain system
EP3376456A1 (en) Block chain generation device, block chain generation method, block chain verification device, block chain verification method and program
KR20190093012A (en) The method for block generation and validation in block-chain system
CN108764870A (en) Transaction processing method and device, electronic equipment based on block chain
CN108805569A (en) Transaction processing method and device, electronic equipment based on block chain
EP3563553A1 (en) Method for signing a new block in a decentralized blockchain consensus network
WO2021114889A1 (en) Computational task processing method and device, storage medium, and processor
WO2016202952A1 (en) Digital token exchange system
CN109359978B (en) Intelligent contract trading method and system based on block chain network
CN109347643B (en) Ethernet-based user center system security supervision method and device
CN112288434B (en) Privacy transaction method, device, zero knowledge proof system and privacy transaction architecture model
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
CN111612600A (en) Block chain auction method, equipment, storage medium and block chain system
CN111815321A (en) Transaction proposal processing method, device, system, storage medium and electronic device
CN111010284B (en) Processing method of block to be identified, related device and block chain system
CN105024885A (en) Anti-plug-in online game system
CN110599179A (en) Risk control method based on block chain system and related equipment
CN111865595A (en) Block chain consensus method and device
CN113129002A (en) Data processing method and equipment
Suliyanti et al. Evaluation of hash rate-based double-spending based on proof-of-work blockchain
US20210385246A1 (en) Apparatus and method for distinguishing between legitimate and malicious branches of a split blockchain
CN112258326B (en) Random block output method and system

Legal Events

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

Ref document number: 20898728

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20898728

Country of ref document: EP

Kind code of ref document: A1