Task certification method and device, task execution method and equipment and storage medium
By segmenting the computing task into subtasks and verifying based on partial subtasks, the problem of zero-knowledge proof taking too long to verify complex computing tasks is solved, which improves the execution efficiency of computing tasks and the credibility of verification results.
Patent Information
- Application Number
- CN202411776040.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In the prior art, when using zero-knowledge proof to verify the calculation task, the calculation results are uncertain and contain a large number of parameters, and the generation and verification process consumes a lot of time, resulting in low efficiency in execution of the calculation task.
The calculation task to be executed is divided into multiple subtasks, and at least one subtarget task is selected based on the preset task selection rules, and an arithmetic circuit, proof key and verification key corresponding to the subtask are generated, and sent to the untrusted The server performs calculations and verifications, and only proves the validity of the task based on the verification results of some subtasks.
By verifying the effectiveness of some subtasks, the time in the generation and verification process is saved, the execution efficiency of the calculation task is improved, and the credibility and accuracy of the verification results are improved by randomly selecting subtasks.
Smart Images

Figure CN119254542A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of information security technology, and in particular to a task certification method, device, task execution method, equipment and storage medium. Background Art
[0002] In the field of information security technology, in order to solve the problem that devices with weak computing power have difficulty completing more complex computing tasks with large amounts of computing power, complex computing tasks with large amounts of computing power are usually outsourced to more powerful computing services, such as cloud computing. However, more powerful computing services have lower credibility and are prone to returning seemingly reasonable computing results without executing the computing task. In the prior art, in order to verify the validity of the computing results, the validity of the computing task can be verified by means of zero-knowledge proof. However, for computing tasks whose calculation results are uncertain and contain a large number of parameters, when using zero-knowledge proof to verify the computing task, the generated proof and verification process takes a lot of time, which makes the efficiency of proving that the computing task is executed low. Summary of the invention
[0003] The purpose of the present invention is to at least provide a task proof method, device, task execution method, equipment and storage medium, which can at least solve the problem that the proof generation and verification process takes a lot of time, and at least achieve the technical effect of improving the efficiency of proving the execution of computing tasks.
[0004] To solve the above technical problem, at least one embodiment of the present application provides a task certification method, which is applicable to a first server, where the first server refers to a trusted server, and includes: dividing a computing task to be executed into a plurality of subtasks; At least one sub-target task is selected from the multiple sub-tasks based on a preset task selection rule; 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 computing 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 computing result and the proof result returned by the second server are received, wherein the second server refers to an untrusted server; the validity of the computing 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 computing result.
[0005] At least one embodiment of the present application also provides a task execution method, which is applicable to a second server, wherein the second server refers to an untrusted server with strong computing power, including: receiving a computing task to be executed, at least one proof key and at least one arithmetic circuit sent by the first server; executing the computing task to be executed to obtain a computing 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 computing result and the proof result to the first server.
[0006] At least one embodiment of the present application also provides a task proof device, which is applicable to a first server, wherein the first server refers to a trusted server, and includes: a segmentation module, which is used to segment the computing task to be executed into multiple sub-tasks; a selection module, which is used to select at least one sub-target task from the multiple sub-tasks based on a preset task selection rule; a generation module, which 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, which is used to send the computing task to be executed, the at least one proof key and the at least one arithmetic circuit to a second server, and receive the computing result and proof result returned by the second server, wherein the second server refers to an untrusted server; a proof module, which is used to prove the validity of the computing task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result and the computing result.
[0007] At least one embodiment of the present application also provides an electronic device, comprising: 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned task certification method or task execution method.
[0008] At least one embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned task certification method or task execution method when executed by a processor.
[0009] The task certification method, device, task execution method, equipment and storage medium provided by the embodiment of the present application are as follows: the computing task to be executed is divided into multiple subtasks; at least one sub-target task is selected from the multiple subtasks based on a preset task selection rule; at least one arithmetic circuit, at least one certification key and at least one verification key corresponding to the at least one sub-target task are generated based on the at least one sub-target task; the computing task to be executed, the at least one certification key and the at least one arithmetic circuit are sent to a second server, and the calculation result and the certification result returned by the second server are received, wherein the second server refers to an untrusted server; the validity of the computing task to be executed is proved based on the at least one verification key, the at least one arithmetic circuit, the certification result and the calculation result. The validity of the task is proved by verifying the validity of some subtasks, so there is no need to generate the certification and verification process for all processes of the task, which saves the time of generating the certification and verification process and improves the efficiency of proving that the computing task is executed.
[0010] In some optional embodiments, the selecting at least one sub-target task from the plurality of sub-tasks based on the preset task selection rule includes: selecting a plurality of sub-important computing tasks that meet the preset task selection rule from the plurality of sub-tasks; randomly selecting some 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. By using the randomly selected sub-tasks as sub-target tasks, it is prevented that the second server (untrusted party) executing the computing task can guess the sub-task that the first server may verify, and it is ensured that the second server needs to complete the entire computing task to ensure that any sub-task randomly selected by the first server can pass the verification, thereby improving the credibility of the verification result.
[0011] In some optional embodiments, if the task calculation amount of a subtask exceeds the calculation threshold and / or the subtask contains a preset function, the subtask is deemed to meet the preset task selection rule. By randomly selecting a subtask with high importance from subtasks with large task calculation amount or subtasks containing preset functions as verification tasks, the credibility and accuracy of the verification results are improved.
[0012] In some optional embodiments, the generating at least one arithmetic circuit, at least one proof key and at least one verification key corresponding to the at least one sub-goal task based on the at least one sub-goal task includes: generating at least one arithmetic circuit corresponding to the at least one sub-goal task based on the at least one sub-goal task; generating at least one proof key and at least one verification key corresponding to the at least one sub-goal task based on the at least one arithmetic circuit. A dedicated proof key and verification key are generated for each sub-goal task, thereby ensuring the security of the verification process of the sub-goal task and the accuracy of the verification result.
[0013] In some optional embodiments, the verification of the validity of the computing task to be executed based on the at least one verification key, the at least one arithmetic circuit, the verification 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 verification result, then the computing task to be executed is proven to be valid. Determining the validity of the computing task based on the verification of part of the computing task saves both verification resources and verification time.
[0014] In some optional embodiments, after 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 method further includes: if the computing result is valid, sending the computing result to the client for display; if the computing result is invalid, sending a prompt message indicating that the computing result is invalid to the client. The computing result of the valid computing task is displayed to the client, and invalid computing results are avoided, thereby saving transmission resources and display resources.
[0015] In some optional embodiments, a task execution method is characterized in that it is applicable to a second server, the second server refers to an untrusted server with strong computing power, and includes: receiving a computing task to be executed, at least one proof key, and at least one arithmetic circuit sent by a first server; executing the computing task to be executed to obtain a computing 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 computing result and the proof result to the first server. By executing the computing task with a server with strong computing power, the computing requirements on the first server are reduced, and server resources are better utilized. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.
[0017] Figure 1 It is a schematic diagram of the structure of a task proof system; Figure 2 It is a flowchart of a task proof method; Figure 3 It is a flowchart of a task execution method; Figure 4 is a schematic diagram of a task certification device provided by another embodiment of the present application; Figure 5 It is a schematic diagram of the structure of an electronic device provided by another embodiment of the present application. DETAILED DESCRIPTION
[0018] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0019] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0020] Proof of Computation: is a blockchain consensus mechanism or protocol used to verify whether a node has performed a specific computing task and to give corresponding rewards after the computing task is completed.
[0021] Proving Key: used to generate proof, which is then sent to the second server and held by the second server for use in the calculation process.
[0022] Verification Key: used to verify the certificate and saved by the first server.
[0023] With the development of crowdsourcing computing, big data, and generative AI, the phenomenon of "outsourcing" computing tasks to untrusted users in projects is becoming more and more common. By outsourcing computing tasks to more powerful computing services, such as cloud computing, the computing requirements for devices with weak computing power can be reduced. However, this model of outsourcing computing tasks also introduces new security and trust issues, especially when the computing provider may not be trustworthy. Some dishonest computing providers may modify the client software to return seemingly reasonable results without performing actual computing tasks based on various factors such as economic interests, lack of supervision, technical capability limitations, and competitive pressure.
[0024] In the prior art, in order to prove that the computing provider has actually performed the computing task, the validity of the computing task is usually verified by means of zero-knowledge proof (ZKP). The key to using zero-knowledge proof to solve the Proof of Computation problem is to enable one participant (prover or computing provider) to prove to another participant (verifier) that it has correctly performed a computing task and obtained the correct result without revealing the specific details of the computing process. However, in the AI reasoning scenario, using zero-knowledge proof to prove that the computing provider has indeed performed a certain reasoning operation will face some difficulties, especially the calculation result of AI reasoning is usually uncertain, not a definite mathematical calculation result, and AI reasoning usually contains millions or even hundreds of millions of parameters. Directly generating zero-knowledge proofs may cause the generation and verification process of the proof to be too time-consuming. Therefore, the efficiency of proving that the computing provider actually performs the computing task is low.
[0025] Figure 1 A structural diagram of a task certification system provided for an exemplary embodiment of the present application, the system comprising: a first server, a second server and a client: Among them, the first server refers to a trusted server with weak computing power, and the first server is used to execute the division of the computing task to be executed into multiple subtasks; select at least one sub-target task from the multiple subtasks based on a preset task selection rule; 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; send the computing task to be executed, the at least one proof key and the at least one arithmetic circuit to the second server, and receive the computing result and the proof result returned by the second server, wherein the second server refers to an untrusted server; prove the validity of the computing task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proof result and the computing result.
[0026] The second server refers to an untrusted server with strong computing power, that is, a computing provider. The second server is used to receive the computing task to be executed, at least one certification key and at least one arithmetic circuit sent by the first server; execute the computing task to be executed to obtain a computing result; generate at least one sub-proof result based on the at least one certification key and the at least one arithmetic circuit; process the certification key and the at least one sub-proof result based on a preset second recursive circuit to obtain a proof result; and send the computing result and the proof result to the first server.
[0027] The client is used to send the computing task to be executed to the first server, and receive and display the computing result or prompt information of the validity of the computing result sent by the second server.
[0028] The execution principles and interaction processes of the various components in the system embodiment, such as the first server, the second server and the client, can be found in the description of the following method embodiments.
[0029] In order to solve the technical problem of low efficiency in executing the above-mentioned proof computing tasks, the present invention proposes a task proof method. The implementation details of the task proof method of this embodiment are specifically described below. The following content is only the implementation details provided for easy understanding and is not necessary for implementing this solution.
[0030] Embodiment 1: The task certification method of this embodiment can be applied to electronic devices with communication, computing and data storage capabilities, and is specifically applicable to a first server, where the first server refers to a trusted server. The specific process can be as follows: Figure 2 As shown, including: Step 101: divide the computing task to be executed into multiple subtasks.
[0031] Specifically, the computing task to be executed is a computing task sent by the client and needs to be processed. The computing task to be executed can be composed of the multiple subtasks.
[0032] Specifically, regarding how to divide the computing task to be executed into multiple subtasks, reference may be made to the computing task division method in the prior art, which will not be described in detail here.
[0033] In some examples, dividing the computing task to be executed into multiple subtasks includes: obtaining the computing task to be executed, and dividing the computing task to be executed into multiple subtasks, wherein each of the multiple subtasks can independently complete a part of the calculation.
[0034] In some examples, dividing the computing task to be executed into multiple subtasks includes: the first server includes a POC unit, the POC unit includes an initial module, and dividing the computing task to be executed into multiple subtasks includes: the POC unit obtains the computing task to be executed, and uses the initial module to divide the computing task to be executed to obtain multiple subtasks.
[0035] Step 102: Select at least one sub-target task from the plurality of sub-tasks based on a preset task selection rule.
[0036] Specifically, the preset task selection rule refers to a rule for determining the subtasks to be verified, and can be set according to actual needs. The at least one sub-target task refers to a subtask that needs to be verified.
[0037] In some examples, the preset task selection rule may be a task selection rule set in real time by relevant personnel, or may be a task selection rule set in advance by relevant personnel, and the selecting at least one sub-target task from the multiple sub-tasks based on the preset task selection rule includes: obtaining multiple sub-tasks; if the task selection rule set in real time by the relevant personnel is detected, then selecting at least one sub-target task from the multiple sub-tasks based on the task selection rule set in real time by the relevant personnel; if the task selection rule set in real time by the relevant personnel is not detected, then selecting at least one sub-target task from the multiple sub-tasks based on the task selection rule set in advance by the relevant personnel.
[0038] In some examples, the selecting at least one sub-target task from the multiple sub-tasks based on a preset task selection rule includes: selecting multiple sub-important computing tasks that meet the preset task selection rule from the multiple sub-tasks; randomly selecting some sub-important computing tasks from the multiple 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 multiple sub-important computing tasks.
[0039] In some examples, the POC unit includes an initial module and a random module, wherein the initial module selects multiple sub-important computing tasks that meet preset task selection rules from the multiple sub-tasks; and the random module randomly selects some sub-important computing tasks from the multiple sub-important computing tasks as at least one sub-target task.
[0040] In some examples, if the task computation amount of a subtask exceeds a computation threshold and / or the subtask includes a preset function, the subtask is deemed to meet the preset task selection rule.
[0041] Specifically, the preset function may be a recursive function, an encryption function, a decryption function, a core function of an image generation algorithm, and the like.
[0042] Specifically, the number of at least one sub-target task may be one or more random ones, or may be a preset number randomly selected.
[0043] Step 103: Based on the at least one sub-goal 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-goal task.
[0044] Specifically, the arithmetic circuit is used to represent the calculation process of the sub-goal task, and the calculation process includes at least one calculation step. The calculation process is represented by circuits such as AND gates and OR gates.
[0045] Specifically, the arithmetic circuit includes input, output and constraint conditions of the sub-target task corresponding to the arithmetic circuit, wherein the constraint conditions can be described by R1CS (Rank-1 Constraint System).
[0046] In some examples, the generating of 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; 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.
[0047] Step 104: Send the computing task to be executed, the at least one certification key, and the at least one arithmetic circuit to a second server, and receive the computing result and the certification result returned by the second server, wherein the second server is an untrusted server.
[0048] Specifically, the second server is used to execute the computing task to be executed and the sub-target task to be proved.
[0049] In some examples, the second server may be a cloud platform.
[0050] Step 105: Prove the validity of the computing 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.
[0051] In some examples, the POC unit further includes a verification module, which verifies the validity of the computing 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.
[0052] In some examples, the proof of validity of the computing 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, it is proved that the computing task to be executed is valid.
[0053] Specifically, the first recursive circuit is a circuit in which a part of the circuit calls itself.
[0054] In some examples, after proving the validity of the computing 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 a prompt message indicating that the calculation result is invalid to the client.
[0055] Specifically, the prompt information that the calculation result is invalid may be used to indicate that cheating behavior occurs in the second server.
[0056] In this embodiment, the computing task to be executed is divided into multiple subtasks; at least one sub-target task is selected from the multiple subtasks based on a preset task selection rule; 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 based on the at least one sub-target task; the computing 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 computing result and the proof result returned by the second server are received, wherein the second server refers to an untrusted server; the validity of the computing 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 computing result. The validity of the task is proved by verifying the validity of some subtasks, and it is not necessary to generate proof and verification processes for all processes of the task, but only to generate proof for the selected part, thereby reducing the computing burden of the computing provider. Moreover, the verifier (first server) only needs to verify a small amount of proof, and the verification process is fast. The time for generating proof and verification process is saved, the overhead of calculation and verification is reduced, and the efficiency of proving that the computing task is executed is improved.
[0057] At the same time, by randomly selecting some sub-target tasks for verification, the computing provider (second server) cannot predict which part of the computing task to be executed will be verified. The computing provider can only pass the verification by correctly executing all parts of the computing task to be executed, which improves the reliability and security of the verification results. By flexibly setting the task selection rules and flexibly adjusting the number of selected sub-target tasks, the verification intensity can be flexibly set. The scalability of verification is improved, and adaptive adjustments can be made according to security requirements. For computing tasks with large computational volume and many steps, it can save a lot of verification time and verification resources, and has strong applicability for large-scale computing tasks.
[0058] Embodiment 2: The task execution method of this embodiment can be applied to electronic devices with communication, computing and data storage capabilities, and specifically, to a second server, which is an untrusted server with strong computing capabilities. The specific process can be as follows: Figure 3 As shown, including: Step 301, receiving a computing task to be executed, at least one certification key, and at least one arithmetic circuit sent by a first server; Step 302: Execute the computing task to be executed to obtain a computing result; Step 303: Generate at least one sub-proof result based on the at least one proof key and the at least one arithmetic circuit; Specifically, the at least one sub-proof result corresponds one-to-one to the at least one arithmetic circuit, and the sub-proof result is a SNARKs proof. For the explanation and specific generation process of the SNARKs proof, please refer to the prior art, and no further details will be given here.
[0059] Step 304: Process the certification key and the at least one sub-certification result based on a preset second recursive circuit to obtain a certification result; Specifically, the explanation of the second recursive circuit is the same as that of the first recursive circuit, which will not be repeated here.
[0060] Step 305: Send the calculation result and the proof result to the first server.
[0061] Among them, the computing task to be executed, at least one proof key and at least one arithmetic circuit in step 301 are obtained through steps 101-103, and steps 301-305 and step 104 are interactive steps with roughly the same content, which will not be repeated here.
[0062] Embodiment three: Another embodiment of the present application relates to a task certification device. The implementation details of the task certification device of this embodiment are specifically described below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this solution. The task certification device in this embodiment is applicable to a first server, and the first server refers to a trusted server. The schematic diagram of the task certification device of this embodiment can be as shown in Figure 4 As shown, it includes a segmentation module 401, a selection module module 402, a generation module module 403, a receiving module module 404 and a certification module module 405.
[0063] The splitting module 401 is used to split the computing task to be executed into multiple subtasks.
[0064] The selection module 402 is used to select at least one sub-target task from the multiple sub-tasks based on a preset task selection rule.
[0065] 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.
[0066] The receiving module 404 is used to send the computing task to be executed, the at least one certification key and the at least one arithmetic circuit to the second server, and receive the computing result and the certification result returned by the second server, wherein the second server is an untrusted server.
[0067] The proving module 405 is used to prove the validity of the computing task to be executed based on the at least one verification key, the at least one arithmetic circuit, the proving result and the computing result.
[0068] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.
[0069] Embodiment 4: Another embodiment of the present application relates to an electronic device, such as Figure 5As shown, it includes: at least one processor 901; and a memory 902 that is communicatively connected to the at least one processor 901; wherein the memory 902 stores instructions that can be executed by the at least one processor 901, and the instructions are executed by the at least one processor 901 so that the at least one processor 901 can execute the task certification method or task execution method in the above-mentioned embodiments.
[0070] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0071] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0072] Embodiment five: Another embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0073] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as: ROM), random access memory (Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.
[0074] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. A task certification method, characterized in that: Applicable to a first server, where the first server refers to a trusted server, including: Divide the computing task to be executed into multiple subtasks; Selecting at least one sub-target task from the plurality of sub-tasks based on a preset task selection rule; Based on the at least one sub-goal task, generating at least one arithmetic circuit, at least one proof key and at least one verification key corresponding to the at least one sub-goal task; Sending the to-be-executed computing task, the at least one certification key, and the at least one arithmetic circuit to a second server, and receiving a computing result and a certification result returned by the second server, wherein the second server is an untrusted server; The validity of the to-be-performed computing task is proved based on the at least one verification key, the at least one arithmetic circuit, the proof result and the computing result.
2. The task certification method according to claim 1, characterized in that: The selecting at least one sub-target task from the plurality of sub-tasks based on a preset task selection rule includes: Selecting a plurality of important sub-computing tasks that meet a preset task selection rule from the plurality of sub-tasks; From the plurality of sub-important computing tasks, some sub-important computing tasks are randomly selected as at least one sub-target task, wherein the number of the at least one sub-target task does not exceed the number of the plurality of sub-important computing tasks.
3. The task certification method according to claim 2, characterized in that: If the task calculation amount of the subtask exceeds the calculation threshold and / or the subtask contains a preset function, the subtask is deemed to meet the preset task selection rule.
4. The task certification method according to claim 1, characterized in that: The step of generating, based on the at least one sub-goal task, at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-goal task comprises: Based on the at least one sub-target task, generating 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-goal task are generated.
5. The task certification method according to claim 1, characterized in that: The proving the validity of the to-be-performed computing task based on the at least one verification key, the at least one arithmetic circuit, the proof result and the computing result comprises: generating at least one sub-verification result based on the at least one verification key and 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, it is proved that the computing task to be executed is valid.
6. The task certification method according to any one of claims 1 to 5, characterized in that: After proving the validity of the to-be-performed computing task 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 is sent to the client for display; If the calculation result is invalid, a prompt message indicating that the calculation result is invalid is sent to the client.
7. A task execution method, characterized in that: Applicable to the second server, which is an untrusted server with strong computing power, including: Receiving a computing task to be executed, at least one certification key, and at least one arithmetic circuit sent by a first server; the at least one certification key and the at least one arithmetic circuit are generated based on the at least one sub-target task after the first server divides the computing 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 at least one sub-target task accordingly; Execute the computing task to be executed to obtain a computing 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 certification key and the at least one sub-certification result based on a preset second recursive circuit to obtain a certification result; The calculation result and the proof result are sent to the first server.
8. A task certification device, characterized in that: Applicable to a first server, where the first server refers to a trusted server, including: A splitting module is used to split the computing task to be executed into multiple subtasks; A selection module, configured to select at least one sub-target task from the plurality of sub-tasks based on a preset task selection rule; A generation module, configured to generate, based on the at least one sub-goal task, at least one arithmetic circuit, at least one proof key, and at least one verification key corresponding to the at least one sub-goal task; a receiving module, configured to send the computing task to be executed, the at least one certification key, and the at least one arithmetic circuit to a second server, and receive a computing result and a certification result returned by the second server, wherein the second server is an untrusted server; A proof module is used to prove the validity of the computing 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.
9. 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the task certification method described in any one of claims 1 to 6 or the task execution method described in claim 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the task certification method described in any one of claims 1 to 6 or the task execution method described in claim 7 is implemented.
Citation Information
Patent Citations
Data verification method and device based on neural network and electronic equipment
CN109743289A
Circuit-based data verification method and device and electronic device
CN109766705A
Intelligent contract authentication data privacy protection method and system based on zero knowledge proof
CN110781521A
Edge calculation-oriented revocable public verifiable calculation method
CN117040734A
Identity verification method and device based on zero-knowledge proof
CN117155577A
Cited By
Verifiable calculation method and device, equipment, medium and product
CN120415761A
