A task proof method and device, a task execution method and device, and a storage medium

The validity of the computation task is proven by dividing the computation task into subtasks and generating corresponding arithmetic circuits and keys, and verifying the validity of the subtasks. This solves the problem of time-consuming zero-knowledge proofs, improves the execution efficiency of the computation task and the credibility of the verification results.

CN119254542BActive Publication Date: 2026-03-20ZHEJIANG NANOMICRO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, the generation and verification processes for using zero-knowledge proofs to verify complex computational tasks are too time-consuming, resulting in low execution efficiency of the computational tasks.

Method used

The computational task to be executed is divided into multiple subtasks. Sub-target tasks are selected based on preset rules, and arithmetic circuits, proof keys, and verification keys are generated. These are sent to an untrusted server for computation, and the validity of the task is proven by verifying the validity of the subtasks.

Benefits of technology

By verifying the validity of some subtasks, the time for generation and verification processes is saved, the execution efficiency of computational tasks is improved, and the credibility and security of verification results are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254542B_ABST
    Figure CN119254542B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of information security, and disclose a task proof method and device, a task execution method and equipment, and a storage medium. The task proof method comprises: dividing a to-be-executed computing task into multiple subtasks; selecting at least one sub-target task from the multiple subtasks based on a task selection rule; generating at least one arithmetic circuit, at least one proof key and at least one verification key corresponding to the at least one sub-target task based on the at least one sub-target task; sending the to-be-executed computing task, the at least one proof key and the at least one arithmetic circuit to a second server, receiving a computing result and a proof result of the second server; and proving the validity of the to-be-executed computing task based on the at least one verification key, the at least one arithmetic circuit, the proof result and the computing result. The task proof method disclosed in the present application solves the problem that a large amount of time is consumed in the generation of proof and verification processes, and makes the verification of a computing task more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of information security technology, and in particular to a task verification method, apparatus, task execution method, device and storage medium. Background Technology

[0002] In the field of information security technology, to address the challenge of devices with limited computing power struggling to complete complex and computationally intensive tasks, these tasks are typically outsourced to more powerful computing services, such as cloud computing. However, these more powerful computing services often have lower reliability and may return seemingly reasonable results without actually performing the task. Existing technologies use zero-knowledge proofs to verify the validity of computational results. However, for computational tasks with uncertain results and numerous parameters, the generation and verification processes using zero-knowledge proofs are extremely time-consuming, resulting in low efficiency in executing the computational task. Summary of the Invention

[0003] The purpose of this invention is to provide at least one method, apparatus, method, device, and storage medium for proving a task, which can at least solve the problem that the generation and verification process requires a lot of time, and at least achieve the technical effect of improving the efficiency of proving computation tasks.

[0004] To address the aforementioned technical problems, at least one embodiment of this application provides a task verification method applicable to a first server, wherein the first server refers to a trusted server, comprising: dividing the computational task to be executed into multiple subtasks;

[0005] Based on preset task selection rules, at least one sub-target task is selected from the plurality of sub-tasks; based on the at least one sub-target task, at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task are generated; the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit are sent to a second server, and the computation result and proof result returned by the second server are received, wherein the second server refers to an untrusted server; the validity of the computation task to be executed is proved based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the computation result.

[0006] At least one embodiment of this application also provides a task execution method applicable to a second server, wherein the second server refers to an untrusted server with strong computing power, comprising: receiving a computational task to be executed, at least one proof key, and at least one arithmetic circuit sent by a first server; executing the computational task to be executed to obtain a computational result; generating at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit; processing the proof key and the at least one sub-proof result based on a preset second recursive circuit to obtain a proof result; and sending the computational result and the proof result to the first server.

[0007] At least one embodiment of this application also provides a task verification apparatus, applicable to a first server, wherein the first server is a trusted server, comprising: a segmentation module for segmenting a computational task to be executed into multiple subtasks; a selection module for selecting at least one sub-target task from the multiple subtasks based on a preset task selection rule; a generation module for generating at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task; a receiving module for sending the computational task to be executed, the at least one proof key, and the at least one arithmetic circuit to a second server, and receiving a calculation result and a proof result returned by the second server, wherein the second server is an untrusted server; and a verification module for verifying the validity of the computational task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result.

[0008] At least one embodiment of this application also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described task proof method or task execution method.

[0009] At least one embodiment of this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described task proof method or task execution method.

[0010] The task proof method, apparatus, task execution method, device, and storage medium provided in the embodiments of this application divide the computational task to be executed into multiple subtasks; select at least one sub-target task from the multiple subtasks based on preset task selection rules; generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task; send the computational task to be executed, the at least one proof key, and the at least one arithmetic circuit to a second server, and receive the calculation result and proof result returned by the second server, wherein the second server refers to an untrusted server; prove the validity of the computational task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result. By verifying the validity of some subtasks to prove the validity of the task, it is not necessary to generate proof and verification processes for all processes of the task, saving time in generating proof and verification processes and improving the efficiency of proving that the computational task has been executed.

[0011] In some optional embodiments, selecting at least one sub-target task from the plurality of subtasks based on preset task selection rules includes: selecting a plurality of sub-important computational tasks that conform to the preset task selection rules from the plurality of subtasks; and randomly selecting a portion of the sub-important computational tasks as at least one sub-target task from the plurality of sub-important computational tasks, wherein the number of at least one sub-target task does not exceed the number of the plurality of sub-important computational tasks. By using randomly selected subtasks as sub-target tasks, the second server (the untrusted party) executing the computational task is prevented from guessing the subtasks that the first server might verify. This ensures that the second server must complete the entire computational task to guarantee that any randomly selected subtask by the first server will pass verification, thus improving the credibility of the verification results.

[0012] In some optional embodiments, if the computational workload of a subtask exceeds a computational threshold and / or the subtask contains a preset function, then the subtask is considered to meet the preset task selection rules. By randomly selecting highly important subtasks from those with large computational workloads or those containing preset functions as verification tasks, the reliability and accuracy of the verification results are improved.

[0013] In some optional embodiments, generating at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task based on the at least one sub-target task includes: generating at least one arithmetic circuit corresponding to the at least one sub-target task based on the at least one sub-target task; and generating at least one proof key and at least one verification key corresponding to the at least one sub-target task based on the at least one arithmetic circuit. Generating dedicated proof and verification keys for each sub-target task ensures the security of the verification process and the accuracy of the verification results for the verified sub-target tasks.

[0014] In some optional embodiments, proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result includes: generating at least one sub-verification result based on the at least one verification key and the at least one arithmetic circuit; processing the verification key and the at least one sub-verification result based on a preset first recursive circuit to obtain a verification result; if the verification result is the same as the proof result, then the computation task to be executed is proven to be valid. Determining the validity of the computation task based on a portion of the verification task saves both verification resources and verification time.

[0015] In some optional embodiments, after proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result, the method further includes: if the calculation result is valid, sending the calculation result to the client for display; if the calculation result is invalid, sending an invalid calculation result prompt message to the client. Displaying the calculation result of a valid computation task to the client avoids displaying invalid calculation results, saving transmission and display resources.

[0016] In some optional embodiments, a task execution method is characterized by being applicable to a second server, which is an untrusted server with high computing power. The method includes: receiving a computational task to be executed, at least one proof key, and at least one arithmetic circuit sent by a first server; executing the computational task to be executed to obtain a computation result; generating at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit; processing the proof key and the at least one sub-proof result based on a preset second recursive circuit to obtain a proof result; and sending the computation result and the proof result to the first server. By executing the computational task through a server with high computing power, the computational requirements on the first server are reduced, and server resources are utilized more effectively. Attached Figure Description

[0017] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.

[0018] Figure 1 This is a schematic diagram of a task verification system;

[0019] Figure 2 This is a flowchart illustrating a task proof method;

[0020] Figure 3 This is a flowchart illustrating a task execution method;

[0021] Figure 4 This is a schematic diagram of a task verification device provided in another embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.

[0024] First, some terms used in the embodiments of this application will be explained below to facilitate understanding by those skilled in the art.

[0025] Proof of Computation (PCC) is a blockchain consensus mechanism or protocol used to verify whether a node has performed a specific computational task and to award a corresponding reward upon completion of the task.

[0026] Proving Key: Used to generate the proof, which is then sent to the second server for use in the computation process.

[0027] Verification Key: Used for verification purposes, it is stored by the primary server.

[0028] With the development of crowdsourced computing, big data, and generative AI, the phenomenon of outsourcing computational tasks to untrusted users in projects is becoming increasingly common. This is achieved by outsourcing computational tasks to more powerful computing services, such as cloud computing, to reduce the computational demands on devices with limited computing power. However, this model of outsourcing computational tasks also introduces new security and trust issues, especially when the computing provider may be untrustworthy. Some dishonest computing providers, driven by economic interests, lack of oversight, technical limitations, competitive pressures, and other factors, may modify client software to return seemingly reasonable results without performing the actual computational tasks.

[0029] In existing technologies, to prove that a computing provider has actually performed a computational task, the validity of the computational task is typically verified using zero-knowledge proofs (ZKP). The key to using zero-knowledge proofs to solve the Proof of Computation problem is enabling one participant (the prover or computing provider) to prove to another participant (the verifier) ​​that they have correctly performed a computational task and obtained the correct result, without revealing the specific details of the computation process. However, in AI inference scenarios, using zero-knowledge proofs to prove that a computing provider has indeed performed a reasoning operation faces some difficulties, especially since the computational result of AI inference is usually uncertain, not a definite mathematical calculation result, and AI inference often contains millions or even hundreds of millions of parameters. Directly generating zero-knowledge proofs may lead to an excessively time-consuming proof generation and verification process. Therefore, proving that a computing provider has actually performed a computational task is inefficient.

[0030] Figure 1 A schematic diagram of a task verification system provided for an exemplary embodiment of this application is shown. The system includes: a first server, a second server, and a client.

[0031] Wherein, the first server refers to a trusted server with weak computing power, and the first server is used to perform the following actions: dividing the computation task to be executed into multiple subtasks; selecting at least one sub-target task from the multiple subtasks based on a preset task selection rule; generating at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task; sending the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit to a second server, and receiving the calculation result and proof result returned by the second server, wherein the second server refers to an untrusted server; and proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result.

[0032] The second server refers to an untrusted server with strong computing power, i.e., a computing provider. The second server receives a computational task to be executed, at least one proof key, and at least one arithmetic circuit from the first server; executes the computational task to be executed to obtain a computational result; generates at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit; processes the proof key and the at least one sub-proof result based on a preset second recursive circuit to obtain a proof result; and sends the computational result and the proof result to the first server.

[0033] The client is used to send the computation task to be executed to the first server, and to receive and display the computation results or prompts indicating the validity of the computation results sent by the second server.

[0034] The execution principles and interaction processes of each component unit in this system embodiment, such as the first server, the second server, and the client, can be found in the descriptions of the following method embodiments.

[0035] To address the aforementioned technical problem of low efficiency in proving computational tasks, this invention proposes a task proof method. The implementation details of the task proof method in this embodiment are described below. The following content is only for ease of understanding and is not essential for implementing this solution.

[0036] Example 1:

[0037] The task proof method of this embodiment can be applied to electronic devices with communication, computing, and data storage capabilities. Specifically, it is applicable to a first server, which refers to a trusted server. The specific process can be as follows: Figure 2 As shown, it includes:

[0038] Step 101: Divide the computation task to be executed into multiple subtasks.

[0039] Specifically, the computational task to be executed is a computational task sent by the client that needs to be processed. The computational task to be executed can be composed of multiple subtasks.

[0040] Specifically, for information on how to divide a computational task to be performed into multiple subtasks, please refer to existing methods for dividing computational tasks; further details will not be provided here.

[0041] In some examples, dividing the computation task to be executed into multiple subtasks includes: obtaining the computation task to be executed and dividing the computation task to be executed into multiple subtasks, wherein each of the multiple subtasks can independently complete a part of the computation.

[0042] In some examples, dividing the computation task to be executed into multiple subtasks includes: the first server includes a POC unit, the POC unit includes an initialization module, and dividing the computation task to be executed into multiple subtasks includes: the POC unit obtains the computation task to be executed and uses the initialization module to divide the computation task to be executed into multiple subtasks.

[0043] Step 102: Select at least one sub-target task from the plurality of sub-tasks based on preset task selection rules.

[0044] Specifically, the preset task selection rules refer to the rules for determining the sub-tasks that need to be verified, and can be set according to actual needs. The at least one sub-target task refers to the sub-task that needs to be verified.

[0045] In some examples, the preset task selection rule can be a task selection rule set in real time by relevant personnel, or a task selection rule set in advance by relevant personnel. The step of selecting at least one sub-target task from the plurality of sub-tasks based on the preset task selection rule includes: acquiring a plurality of sub-tasks; if a task selection rule set in real time by relevant personnel is detected, then selecting at least one sub-target task from the plurality of sub-tasks based on the task selection rule set in real time by relevant personnel; if no task selection rule set in real time by relevant personnel is detected, then selecting at least one sub-target task from the plurality of sub-tasks based on the task selection rule set in advance by relevant personnel.

[0046] In some examples, the step of selecting at least one sub-target task from the plurality of sub-tasks based on preset task selection rules includes: selecting a plurality of sub-important computing tasks from the plurality of sub-tasks that conform to the preset task selection rules; and randomly selecting a portion of the sub-important computing tasks from the plurality of sub-important computing tasks as at least one sub-target task, wherein the number of at least one sub-target task does not exceed the number of the plurality of sub-important computing tasks.

[0047] In some examples, the POC unit includes an initial module and a random module. The initial module selects multiple sub-important computational tasks from the multiple sub-tasks that conform to a preset task selection rule. The random module randomly selects some of the multiple sub-important computational tasks as at least one sub-target task.

[0048] In some cases, if the computational workload of a subtask exceeds a computational threshold and / or the subtask contains a preset function, then the subtask is considered to meet the preset task selection rules.

[0049] Specifically, the preset function can be a recursive function, an encryption function, a decryption function, or the core function of an image generation algorithm, etc.

[0050] Specifically, the number of at least one sub-target task can be random or one or more, or a preset number can be randomly selected.

[0051] Step 103: Based on the at least one sub-target task, generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task.

[0052] Specifically, arithmetic circuits are used to represent the computation process of a sub-target task, which includes at least one computation step. The computation process is represented using circuits such as AND gates and OR gates.

[0053] Specifically, the arithmetic circuit includes the input, output, and constraints of the sub-target task corresponding to the arithmetic circuit, wherein the constraints can be described by R1CS (Rank-1 Constraint System).

[0054] In some examples, generating at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task based on the at least one sub-target task includes: generating at least one arithmetic circuit corresponding to the at least one sub-target task based on the at least one sub-target task; and generating at least one proof key and at least one verification key corresponding to the at least one sub-target task based on the at least one arithmetic circuit.

[0055] Step 104: Send the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit to the second server, and receive the computation result and proof result returned by the second server, wherein the second server refers to an untrusted server.

[0056] Specifically, the second server is used to execute the computational task to be executed, and to execute the sub-target task to be proved.

[0057] In some cases, the second server can be a cloud platform.

[0058] Step 105: Prove the validity of the computation task to be performed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result.

[0059] In some examples, the POC unit further includes a verification module that verifies the validity of the computation task to be performed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result.

[0060] In some examples, proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result includes: generating at least one sub-verification result based on the at least one verification key and the at least one arithmetic circuit; processing the verification key and the at least one sub-verification result based on a preset first recursive circuit to obtain a verification result; if the verification result is the same as the proof result, then the computation task to be executed is proven to be valid.

[0061] Specifically, the first recursive circuit is a part of the circuit that calls itself.

[0062] In some examples, after proving the validity of the computation task to be performed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result, the method further includes: if the calculation result is valid, sending the calculation result to the client for display; if the calculation result is invalid, sending an invalid calculation result prompt message to the client.

[0063] Specifically, the invalid calculation result message can be used to indicate that the second server has engaged in cheating.

[0064] In this embodiment, the computational task to be executed is divided into multiple subtasks; at least one sub-target task is selected from the multiple subtasks based on preset task selection rules; based on the at least one sub-target task, at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task are generated; the computational task to be executed, the at least one proof key, and the at least one arithmetic circuit are sent to a second server, and the computation result and proof result returned by the second server are received, wherein the second server refers to an untrusted server; the validity of the computational task to be executed is proved based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the computation result. By verifying the validity of a portion of the subtasks to prove the validity of the task, it is not necessary to generate proofs and verification processes for all processes of the task; only the selected portion needs to be proven, reducing the computational burden on the computation provider. Furthermore, the verifier (first server) only needs to verify a small number of proofs, making the verification process fast. This saves time in generating proofs and verification processes, reduces computation and verification overhead, and improves the efficiency of proving the execution of the computational task.

[0065] Meanwhile, by randomly selecting some sub-tasks for verification, the computation provider (second server) cannot predict which part of the computation task to be verified. This forces the computation provider to pass verification only by correctly executing all parts of the computation task, improving the reliability and security of the verification results. By flexibly setting task selection rules and adjusting the number of selected sub-tasks, the verification intensity can be flexibly adjusted. This improves the scalability of verification and allows for adaptive adjustments based on security requirements. For computationally intensive tasks with many steps, it saves significant verification time and resources, making it highly applicable to large-scale computational tasks.

[0066] Example 2:

[0067] The task execution method of this embodiment can be applied to electronic devices with communication, computing, and data storage capabilities. Specifically, it is applicable to a second server, which refers to an untrusted server with strong computing power. The specific process can be as follows: Figure 3 As shown, it includes:

[0068] Step 301: Receive the computation task to be executed, at least one proof key, and at least one arithmetic circuit sent by the first server;

[0069] Step 302: Execute the computation task to be performed and obtain the computation result;

[0070] Step 303: Generate at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit;

[0071] Specifically, the at least one sub-proof result corresponds one-to-one with the at least one arithmetic circuit, and the sub-proof result is a SNARKs proof. For an explanation of the SNARKs proof and its specific generation process, please refer to the prior art, which will not be elaborated further here.

[0072] Step 304: Process the proof key and the at least one sub-proof result based on the preset second recursive circuit to obtain the proof result;

[0073] Specifically, the second recursive circuit is explained in the same way as the first recursive circuit, and will not be repeated here.

[0074] Step 305: Send the calculation results and the proof results to the first server.

[0075] In step 301, the computational task to be executed, at least one proof key, and at least one arithmetic circuit are obtained through steps 101-103, and steps 301-305 are interactive steps with step 104, with largely the same content, so they will not be described again here.

[0076] Example 3:

[0077] Another embodiment of this application relates to a task verification device. The implementation details of the task verification device in this embodiment are described below. The following implementation details are provided for ease of understanding and are not essential for implementing this solution. The task verification device in this embodiment is applicable to a first server, which refers to a trusted server. A schematic diagram of the task verification device in this embodiment can be shown as follows: Figure 4 As shown, it includes a segmentation module 401, a selection module 402, a generation module 403, a receiving module 404, and a proof module 405.

[0078] The segmentation module 401 is used to divide the computation task to be executed into multiple subtasks.

[0079] The selection module 402 is used to select at least one sub-target task from the plurality of sub-tasks based on preset task selection rules.

[0080] The generation module 403 is used to generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task, based on the at least one sub-target task.

[0081] The receiving module 404 is used to send the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit to the second server, and to receive the computation result and proof result returned by the second server, wherein the second server refers to an untrusted server.

[0082] The proof module 405 is used to prove the validity of the computation task to be performed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result.

[0083] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units are absent in this embodiment.

[0084] Example 4:

[0085] Another embodiment of this application relates to an electronic device, such as... Figure 5As shown, it includes: at least one processor 901; and a memory 902 communicatively connected to the at least one processor 901; wherein the memory 902 stores instructions executable by the at least one processor 901, the instructions being executed by the at least one processor 901 to enable the at least one processor 901 to execute the task verification method or task execution method in the above embodiments.

[0086] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.

[0087] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.

[0088] Example 5:

[0089] Another embodiment of this application relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.

[0090] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.

Claims

1. A task proof method, characterized in that, Applies to the first server, which refers to a trusted server, including: Divide the computational task to be executed into multiple subtasks; Based on preset task selection rules, at least one sub-target task is selected from the plurality of sub-tasks; Based on the at least one sub-target task, generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task; The first server sends the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit to the second server and receives the computation result and proof result returned by the second server. The second server is an untrusted server. The second server is used to generate at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit, process the proof key and the at least one sub-proof result based on a preset second recursive circuit to obtain the proof result, and send the computation result and the proof result to the first server. The validity of the computation task to be performed is proved based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result. The method of proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result includes: Generate at least one sub-verification result based on the at least one verification key and at least one arithmetic circuit; The verification key and at least one sub-verification result are processed based on a preset first recursive circuit to obtain a verification result. The first recursive circuit is a part of the circuit that calls its own circuit. If the verification result is the same as the proof result, then the computation task to be executed is proven to be valid; The selection of at least one sub-target task from the plurality of sub-tasks based on preset task selection rules includes: Select multiple important sub-computation tasks from the multiple sub-tasks that meet the preset task selection rules; From the plurality of important sub-computing tasks, some of the important sub-computing tasks are randomly selected as at least one sub-target task, wherein the number of at least one sub-target task does not exceed the number of the plurality of important sub-computing tasks.

2. The task proof method according to claim 1, characterized in that, If the computational workload of a subtask exceeds a computational threshold and / or the subtask contains a preset function, then the subtask is considered to meet the preset task selection rules.

3. The task proof method according to claim 1, characterized in that, The step of generating at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task includes: Based on the at least one sub-target task, generate at least one arithmetic circuit corresponding to the at least one sub-target task; Based on the at least one arithmetic circuit, at least one proof key and at least one verification key corresponding to the at least one sub-target task are generated.

4. The task proof method according to any one of claims 1 to 3, characterized in that, After proving the validity of the computation task to be performed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result, the method further includes: If the calculation result is valid, the calculation result will be sent to the client for display. If the calculation result is invalid, a message indicating that the calculation result is invalid will be sent to the client.

5. A task execution method, characterized in that, This applies to the second server, which refers to an untrusted server with high computing power, including: The system receives a computation task to be executed, at least one proof key, and at least one arithmetic circuit sent by a first server. The at least one proof key and the at least one arithmetic circuit are generated by the first server after dividing the computation task to be executed into multiple sub-tasks, selecting at least one sub-target task from the multiple sub-tasks based on a preset task selection rule, and generating the corresponding sub-target task. The computational task to be performed is executed to obtain the computational result; Generate at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit; The proof key and the at least one sub-proof result are processed based on a preset second recursive circuit to obtain the proof result; The calculation results and the proof results are sent to the first server; The first server is used for: Divide the computational task to be executed into multiple subtasks; Based on preset task selection rules, at least one sub-target task is selected from the plurality of sub-tasks; Based on the at least one sub-target task, generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task; The computation task to be executed, the at least one proof key, and the at least one arithmetic circuit are sent to the second server, and the computation result and proof result returned by the second server are received. The validity of the computation task to be performed is proved based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result. The method of proving the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result includes: Generate at least one sub-verification result based on the at least one verification key and at least one arithmetic circuit; The verification key and at least one sub-verification result are processed based on a preset first recursive circuit to obtain a verification result. The first recursive circuit is a part of the circuit that calls its own circuit. If the verification result is the same as the proof result, then the computation task to be executed is proven to be valid; The selection of at least one sub-target task from the plurality of sub-tasks based on preset task selection rules includes: Select multiple important sub-computation tasks from the multiple sub-tasks that meet the preset task selection rules; From the plurality of important sub-computing tasks, some of the important sub-computing tasks are randomly selected as at least one sub-target task, wherein the number of at least one sub-target task does not exceed the number of the plurality of important sub-computing tasks.

6. A task verification device, characterized in that, Applies to the first server, which refers to a trusted server, including: The segmentation module is used to divide the computational task to be executed into multiple subtasks; The selection module is used to select at least one sub-target task from the plurality of sub-tasks based on preset task selection rules; The generation module is used to generate at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-target task, based on the at least one sub-target task. A receiving module is configured to send the computation task to be executed, the at least one proof key, and the at least one arithmetic circuit to a second server, and receive the computation result and proof result returned by the second server. The second server is an untrusted server. The second server is configured to generate at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit, process the proof key and the at least one sub-proof result based on a preset second recursive circuit to obtain the proof result, and send the computation result and the proof result to the first server. A proof module is used to prove the validity of the computation task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result, and the calculation result. The selection module is used for: Select multiple important sub-computation tasks from the multiple sub-tasks that meet the preset task selection rules; From the plurality of important sub-computing tasks, some of the important sub-computing tasks are randomly selected as at least one sub-target task, wherein the number of at least one sub-target task does not exceed the number of the plurality of important sub-computing tasks.

7. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the task proof method as described in any one of claims 1 to 4 or the task execution method as described in claim 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the task proof method of any one of claims 1 to 4 or the task execution method of claim 5.

Citation Information

Patent Citations

  • Data verification method and device based on neural network and electronic equipment

    CN109743289A

  • System for implementing a virtual machine based on a zero-knowledge proof circuit for general operation verification

    US10951410B1