A model inference task execution method, device, equipment and storage medium

By introducing model inference tasks into the blockchain system and assigning them to computing nodes to perform valuable computational tasks, the problem of resource waste in the PoW process is solved, the efficient use of computing resources and the fairness of the block generation process are achieved, and the credibility and security of blockchain data are enhanced.

CN119865503BActive Publication Date: 2026-11-20CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411847435.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2026-11-20
Estimated Expiration
2044-12-13

Smart Images

  • Figure CN119865503B_ABST
    Figure CN119865503B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a model inference task execution method and device, equipment and a storage medium, obtaining a model inference task initiated by a user; determining a computing node for executing the model inference task; sending task data corresponding to the model inference task to the computing node, and controlling the computing node to execute the model inference task according to the task data to obtain a model inference result corresponding to the computing node; counting the number of the model inference result corresponding to the computing node to obtain a target number corresponding to the computing node; determining a target computing node according to the target number corresponding to the computing node; and controlling the target computing node to generate a target block in a blockchain and store the model inference result corresponding to the target computing node in the target block. Embodiments of the present application distribute the model inference task to the computing node, so that the computing node can execute valuable computing tasks, improve the utilization efficiency of computing resources, and avoid waste of resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for performing model reasoning tasks, an electronic device, and a storage medium. Background Technology

[0002] Blockchain technology is a distributed ledger system that maintains a continuously growing record of transaction data in a decentralized manner. Each newly generated block contains a digest of the previous block, ensuring that data added to the chain cannot be tampered with. Blockchain systems require a consensus mechanism to determine which node adds which data to the blockchain. Some public blockchains use a mathematical problem-solving approach, where the first node to complete the computation adds the data to the blockchain. Because solving this problem consumes significant computational resources, this consensus mechanism is also known as Proof of Work (PoW).

[0003] However, the PoW solution process does not produce any valuable computational results other than selecting nodes to generate new blocks, thus wasting a lot of computing resources.

[0004] Therefore, how to make full use of the computing resources consumed in the PoW process is a problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This application provides a method for executing a model inference task to solve the problem that the PoW solution process wastes a lot of computing resources.

[0006] Accordingly, embodiments of this application also provide an execution device for model reasoning tasks, an electronic device, and a storage medium to ensure the implementation and application of the above methods.

[0007] To address the aforementioned issues, this application discloses a method for executing a model inference task, applied to a blockchain system, wherein the blockchain system includes a blockchain and users, and the method includes:

[0008] Obtain the model inference task initiated by the user; the model inference task has corresponding task data;

[0009] Determine the computing nodes to perform the model inference task;

[0010] The task data corresponding to the model inference task is sent to the computing node, and the computing node is controlled to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node.

[0011] The number of model inference results corresponding to the computing node is counted to obtain the target number corresponding to the computing node;

[0012] The target computing nodes are determined based on the target number corresponding to the computing nodes;

[0013] The target computing node is controlled to generate a target block in the blockchain, and the model inference result corresponding to the target computing node is stored in the target block.

[0014] Optionally, the blockchain system further includes an arbitration node. After sending the task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node, the method further includes:

[0015] The computing node is controlled to send the model inference results to the arbitration node;

[0016] Identify the verification nodes used to validate the inference results of the model;

[0017] The task data corresponding to the model inference task is sent to the verification node, and the verification node is controlled to verify the model inference result according to the task data to obtain the model verification result;

[0018] The verification node is controlled to send the model verification result to the arbitration node;

[0019] The arbitration node is controlled to compare the model inference result and the model verification result to obtain an arbitration result used to determine whether the computing node is a malicious node; the malicious node is a computing node or verification node that affects the normal operation of the blockchain system.

[0020] Optionally, the blockchain system and the model inference task provider are communicatively connected. The model inference task provider includes standard inference results corresponding to the model inference task. The process of controlling the arbitration node to compare whether the model inference result and the model verification result are the same, and obtaining an arbitration result for determining whether the computing node is a malicious node, includes:

[0021] If the model inference result and the model verification result are the same, then a first arbitration result is obtained to determine that the computing node is not the malicious node;

[0022] If the model inference result and the model verification result are different, the standard inference result corresponding to the model inference task is obtained from the model inference task provider, and a second arbitration result is obtained based on the model inference result, the model verification result and the standard inference result to determine whether the computing node or the verification node is the malicious node.

[0023] The first arbitration result or the second arbitration result shall be determined as the arbitration result.

[0024] Optionally, obtaining a second arbitration result based on the model inference result, the model verification result, and the standard inference result to determine whether the computing node or the verification node is the malicious node includes:

[0025] Compare whether the model inference result is the same as the standard inference result, and compare whether the model verification result is the same as the standard inference result;

[0026] If the model inference result differs from the standard inference result, a third arbitration result is obtained to determine that the computing node is the malicious node;

[0027] If the model inference result is the same as the standard inference result, then a fourth arbitration result is obtained to determine that the computing node is not the malicious node;

[0028] If the model verification result differs from the standard inference result, a fifth arbitration result is obtained to determine that the verification node is the malicious node;

[0029] If the model verification result is the same as the standard inference result, then a sixth arbitration result is obtained to determine that the verification node is not the malicious node;

[0030] The third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result, shall be determined as the second arbitration result.

[0031] Optionally, the computing node has a corresponding number of non-response counts. The step of sending task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task based on the task data to obtain the model inference result corresponding to the computing node includes:

[0032] Send the task data corresponding to the model inference task to the computing node;

[0033] Determine whether the computing node responds to the model inference task within a preset time;

[0034] If the computing node does not respond to the model inference task within a preset time, the non-response count corresponding to the computing node is incremented by one.

[0035] Optionally, the computing node has the computing capability to perform the model inference task. After incrementing the count of unresponsive nodes by one if the computing node fails to respond to the model inference task within a preset time, the method further includes:

[0036] If the number of unresponsive events corresponding to the computing node exceeds a preset number, the computing ability of the user corresponding to the computing node will be cancelled.

[0037] Optionally, the computing node has computing power for performing the model inference task, and the verification node has verification power for verifying the model inference result. After determining the third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result as the second arbitration result, the method further includes:

[0038] If the computing node is a malicious node, then the computing capabilities of the computing node are cancelled.

[0039] If the verification node is a malicious node, then the verification capability of the verification node is cancelled.

[0040] This application also discloses an execution device for a model inference task, applied to a blockchain system, the blockchain system including a blockchain and users, the device comprising:

[0041] The model inference task acquisition module is used to acquire the model inference task initiated by the user; the model inference task has corresponding task data.

[0042] A computing node determination module is used to determine the computing nodes used to perform the model inference task;

[0043] The model inference task execution module is used to send the task data corresponding to the model inference task to the computing node, and control the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node.

[0044] The target quantity statistics module is used to count the number of model inference results corresponding to the computing node, and obtain the target quantity corresponding to the computing node.

[0045] The target computing node determination module is used to determine the target computing nodes based on the number of targets corresponding to the computing nodes.

[0046] The target block generation module is used to control the target computing node to generate a target block in the blockchain and store the model inference result corresponding to the target computing node in the target block.

[0047] This application also discloses an electronic device, including: a processor; and a memory storing executable code thereon, wherein when the executable code is executed, the processor performs an execution method for a model inference task as described in any of the embodiments of this application.

[0048] This application also discloses one or more machine-readable media storing executable code thereon, which, when executed, causes a processor to perform an execution method for a model inference task as described in any of the embodiments of this application.

[0049] Compared with the prior art, the embodiments of this application have the following advantages:

[0050] In this embodiment, a model inference task initiated by the user is obtained; the model inference task has corresponding task data; a computing node for executing the model inference task is determined; the task data corresponding to the model inference task is sent to the computing node, and the computing node is controlled to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node; the number of model inference results corresponding to the computing node is counted to obtain the target number corresponding to the computing node; a target computing node is determined according to the target number corresponding to the computing node; the target computing node is controlled to generate a target block in the blockchain, and the model inference result corresponding to the target computing node is stored in the target block. This embodiment replaces mathematical problems with model inference tasks. By allocating model inference tasks to computing nodes, the computing nodes can execute valuable computing tasks, improving the utilization efficiency of computing resources and avoiding resource waste. Furthermore, by having the selected target computing node responsible for generating the target block, the fairness and transparency of the block generation process are ensured, further enhancing the credibility of blockchain data. The model inference results are stored in the target block of the blockchain. Due to the characteristics of blockchain, this data cannot be tampered with once recorded, ensuring the credibility and security of the model inference results. Furthermore, the target computing node is determined based on the number of model inference results corresponding to the computing node, thus avoiding the situation where a single computing node monopolizes computing resources. Attached Figure Description

[0051] Figure 1This is a flowchart illustrating the steps of an embodiment of a model reasoning task execution method according to this application;

[0052] Figure 2 This is a schematic diagram of a target computing node generating a target block according to this application;

[0053] Figure 3 This is a schematic diagram illustrating the process of an arbitration node recording user capabilities in a blockchain system, as described in this application.

[0054] Figure 4 This is a schematic diagram of a user initiating a model inference task in a blockchain system, as described in this application.

[0055] Figure 5 This is a schematic diagram of a process for a model-based inference task provider to arbitrate nodes, as described in this application.

[0056] Figure 6 This is a structural block diagram of an embodiment of an execution device for a model reasoning task according to this application;

[0057] Figure 7 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0058] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0059] Reference Figure 1 This is a flowchart illustrating the steps of an embodiment of a model inference task execution method according to this application, applied to a blockchain system, which includes a blockchain and users, and includes the following steps:

[0060] Step 101: Obtain the model inference task initiated by the user; the model inference task has corresponding task data;

[0061] In this embodiment of the application, the user is a basic role in the blockchain system.

[0062] First, it receives model inference tasks initiated by users. Users submit task requests through an interface or protocol within the blockchain system. These task requests contain specific task data, which is the input information required for model inference.

[0063] Step 102: Determine the computing nodes used to perform the model inference task;

[0064] In this embodiment of the application, each user will have corresponding computing power resources. If the user has computing power and sufficient computing power resources, he / she can participate in the blockchain system as both a computing node and a user. While contributing his / her own computing power, he / she can also use the large model capabilities provided by other computing nodes to achieve computing power sharing.

[0065] Specifically, one or more computing nodes will be selected to execute the model inference tasks submitted by users. These computing nodes are users in the blockchain system who have computing power and abundant computing resources, but are not the users who submitted the model inference tasks.

[0066] Step 103: Send the task data corresponding to the model inference task to the computing node, and control the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node;

[0067] After determining the computing nodes to perform the model inference task, the system sends the task data corresponding to the model inference task to the selected computing nodes and controls these computing nodes to execute the model inference task based on the received task data. After the computing nodes complete the inference, they generate the corresponding model inference results.

[0068] Computing nodes can respond and execute tasks quickly, and perform inference based on task data, ensuring the efficient completion of inference tasks and the accuracy and reliability of inference results.

[0069] In this embodiment, the computing node can receive and process model inference tasks initiated by the user. Completing the model inference task will earn the corresponding token and score. The computing node needs to ensure it is online and maintains a listening status to process user-initiated model inference tasks in a timely manner.

[0070] Step 104: Count the number of model inference results corresponding to the computing node to obtain the target number corresponding to the computing node;

[0071] The system will count the number of model inference tasks completed by each computing node within a certain period of time to obtain the target number for each computing node. This number directly reflects the activity and contribution of the computing node.

[0072] This application embodiment quantifies the contribution of each computing node to the execution of the model inference task by counting the number of inference results, thereby incentivizing more users to participate in the execution of the model inference task as computing nodes.

[0073] Step 105: Determine the target computing nodes based on the target number corresponding to the computing nodes;

[0074] Select one or more target computing nodes based on the target number of computing nodes. These nodes are those that complete the required number of tasks according to preset requirements.

[0075] This application embodiment ensures the fairness and rationality of the selection of target computing nodes by selecting a target number, avoiding the monopoly of blockchain system resources by a single computing node. Furthermore, selecting target computing nodes can effectively incentivize more users to participate in the execution of model inference tasks as computing nodes, thereby increasing the activity of the blockchain system.

[0076] Step 106: Control the target computing node to generate a target block in the blockchain, and store the model inference result corresponding to the target computing node in the target block.

[0077] The system will control the target computing node to generate a new block in the blockchain and store all model inference results of the target computing node in this new block. These results will be permanently recorded on the blockchain and cannot be tampered with.

[0078] Reference Figure 2 This is a schematic diagram of a target computing node generating a target block according to this application.

[0079] In a blockchain system, each block has a unique number, such as... Figure 2 In the blockchain, Block 10, Block 11, Block 12, Block 23, and Block 24 represent the block's position within the blockchain. Similarly, each compute node has a unique identifier, such as... Figure 2 In the range N-2, N, N+1, 2N-3, 2N.

[0080] Suppose the preset requirement for determining the target computing node is that the model inference task is performed 5 times. Then, if... Figure 2 As shown, assuming that the target number of the computing node with the number N is 10 before generating Block11, that is, the computing node with the number N has completed 10 model inference tasks before generating Block11. At this time, the target number of the computing node with the number N meets the preset requirements, so it can be used as the target computing node to generate the target block Block11 in the blockchain.

[0081] This application's embodiments generate new blocks through target computing nodes, ensuring the fairness and transparency of the block generation process. Furthermore, the model inference results are stored in the blockchain, ensuring data security and immutability, and enhancing the credibility of the results.

[0082] This application's embodiments replace mathematical problems with model inference tasks. By assigning these tasks to computing nodes, the nodes can execute valuable computational tasks, improving the utilization efficiency of computing resources and avoiding waste. Furthermore, by selecting target computing nodes to generate target blocks, the fairness and transparency of the block generation process are ensured, further enhancing the credibility of blockchain data. The model inference results are stored in the target blocks of the blockchain; due to the characteristics of blockchain, this data cannot be tampered with once recorded, ensuring the credibility and security of the model inference results. In addition, determining the target computing node based on the number of model inference results corresponding to the computing node avoids the situation where a single computing node monopolizes computing resources.

[0083] In one embodiment of this application, the blockchain system further includes an arbitration node. After sending the task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node, the method further includes:

[0084] The computing node is controlled to send the model inference results to the arbitration node;

[0085] Identify the verification nodes used to validate the inference results of the model;

[0086] The task data corresponding to the model inference task is sent to the verification node, and the verification node is controlled to verify the model inference result according to the task data to obtain the model verification result;

[0087] The verification node is controlled to send the model verification result to the arbitration node;

[0088] The arbitration node is controlled to compare the model inference result and the model verification result to obtain an arbitration result used to determine whether the computing node is a malicious node; the malicious node is a computing node or verification node that affects the normal operation of the blockchain system.

[0089] In this embodiment, to ensure the verifiability of the model inference results, in addition to users and the blockchain, an arbitration node is set up in the blockchain system to participate in the model inference task as a trusted third party. In the blockchain system, the arbitration node cannot actively initiate model inference tasks; all operations are executed automatically according to pre-set rules.

[0090] After completing the model inference task, the computing node sends the inference results to the arbitration node. The arbitration node, acting as a trusted third party, is responsible for receiving and storing the inference results. Receiving the inference results through the arbitration node ensures the reliability and security of the results, preventing malicious nodes from tampering with the model inference results.

[0091] Once the arbitration node receives the model inference result, it will send the model inference result to the user who initiated the model inference task.

[0092] In this embodiment of the application, if the user has verification capabilities and sufficient computing resources, they can participate in the blockchain system as both a verification node and a user.

[0093] Specifically, one or more verification nodes will be selected to verify the model inference results obtained by the computing nodes. These verification nodes are users in the blockchain system with verification capabilities and abundant computing resources, but are not the users who submitted the model inference tasks. Through verification nodes, the accuracy and reliability of the model inference results can be ensured.

[0094] Verification nodes use the exact same input data as computation nodes and judge the authenticity and reliability of the results obtained by the computation nodes based on the output results. All verification nodes in the blockchain system can verify the model inference tasks executed by any computation node; this verification of the model inference results by verification nodes is called a model verification task. Specifically, the system sends the task data for the model inference task to the selected verification nodes and controls these nodes to execute the model inference task based on the received task data, obtaining the model verification results. Verification nodes can respond quickly and execute model inference tasks using the same task data, ensuring the consistency and reliability of the model verification results.

[0095] Similarly, a verification node can also verify model verification tasks initiated by other verification nodes. For the same model inference task, the results of all participating verification nodes must be completely consistent for the verification of the computing node to be considered successful.

[0096] After receiving the model verification results, the verification node sends them to the arbitration node. The arbitration node is responsible for receiving and storing the model verification results. The arbitration node compares the model inference results from the computation node and the model verification results from the verification node to determine if they are consistent. If they are consistent, the model inference results are considered reliable; if they are inconsistent, the computation node or verification node is considered to have engaged in malicious behavior, and an arbitration result is generated.

[0097] This application's embodiments ensure the accuracy and reliability of inference results through comparison of arbitration nodes, avoiding interference from malicious nodes. By identifying and handling malicious nodes, the normal operation of the blockchain system and the security of data are ensured.

[0098] Reference Figure 3 This is a schematic diagram illustrating the process of an arbitration node recording user capabilities in a blockchain system, as described in this application. Specifically, the arbitration node accepts each user's ( Figure 2 The recording operation sent by User 1 and User 2 records User 1's computing power and User 2's verification power in the blockchain.

[0099] Reference Figure 4 This is a flowchart illustrating a user initiating a model inference task in a blockchain system, as described in this application, specifically including the following steps:

[0100] Step 401: The user initiates the model inference task T. infer The arbitration node receives the user's model inference task and stores the raw data and summary.

[0101] Step 402: The computing node executes the model inference task and generates the model inference result. Tinfer and the model inference result Result Tinfer An MD5 hash is calculated to generate a hash value 1234..., which is then sent to the arbitration node. The arbitration node receives the model inference result from the computing node and stores the inference result and its digest.

[0102] Step 403: Result the model inference results. Tinfer Send to the user.

[0103] Step 404: Verification Node 1, Verification Node 2, and Verification Node 3 will verify the model inference results. The arbitration node receives the model verification task T from the verification nodes. verify Generate model validation results. Tverify and the model validation results Result Tverify Perform MD5 hash calculation to generate hash value 5678..., and then send hash value 5678... to the arbitration node, which verifies the model verification result.

[0104] Step 405, due to the model inference result Result Tinfer The corresponding hash value and model validation result Result Tverify If the corresponding hash values ​​are inconsistent, the computing node is marked as a malicious computing node.

[0105] This application's embodiments further enhance the credibility of model inference results and the security of the blockchain system by introducing arbitration nodes and verification nodes. Specifically, through multi-party verification and comparison by arbitration nodes, the accuracy and credibility of model inference results are ensured; and by identifying and handling malicious nodes, the normal operation of the blockchain system and the security of data are ensured.

[0106] In one embodiment of this application, the blockchain system and a model inference task provider are communicatively connected. The model inference task provider includes standard inference results corresponding to the model inference task. The process of controlling the arbitration node to compare the model inference results with the model verification results to obtain an arbitration result used to determine whether the computing node is a malicious node includes:

[0107] If the model inference result and the model verification result are the same, then a first arbitration result is obtained to determine that the computing node is not the malicious node;

[0108] If the model inference result and the model verification result are different, the standard inference result corresponding to the model inference task is obtained from the model inference task provider, and a second arbitration result is obtained based on the model inference result, the model verification result and the standard inference result to determine whether the computing node or the verification node is the malicious node.

[0109] The first arbitration result or the second arbitration result shall be determined as the arbitration result.

[0110] In this embodiment, the model inference task provider is a trusted third party responsible for providing standard inference results. If the model inference results and model verification results are inconsistent, it is assumed that either the computing node or the verification node has engaged in malicious behavior. In this case, it is necessary to determine, based on the standard inference results provided by the model inference task provider, whether the malicious behavior is from the computing node, the verification node, or both.

[0111] Specifically, if the model inference result generated by the computing node is the same as the model verification result generated by the verification node, it indicates that the model inference result is reliable and no anomalies have occurred. In this case, a first arbitration result will be generated to determine that the computing node is not a malicious node, which means that the computing node is an honest node without malicious behavior.

[0112] If the model inference results generated by the compute node differ from the model verification results generated by the verification node, it indicates that the inference results may be abnormal and require further verification. In this case, the standard inference results corresponding to the model inference task can be obtained from the model inference task provider. Since the standard inference results are generated by a trusted third party and have high reliability, it is possible to determine whether any of the compute or verification nodes are malicious nodes exhibiting malicious behavior based on the standard inference results.

[0113] Finally, based on the results of the above comparison and verification, the first arbitration result or the second arbitration result will be determined as the final arbitration result. This arbitration result will be used to determine whether the computing node or the verification node is a malicious node and to take appropriate action.

[0114] Reference Figure 5 This is a schematic diagram of a process for arbitration of nodes by a model inference task provider, as described in this application, which specifically includes the following steps:

[0115] Step 501: The user initiates the model inference task T. infer The arbitration node receives the user's model inference task and stores the raw data and summary.

[0116] Step 502: The computing node executes the model inference task and generates the model inference result. Tinfer and the model inference result Result Tinfer Perform MD5 hash calculation to generate hash value 5678..., and send hash value 5678... to the arbitration node.

[0117] Step 503: Result the model inference results. Tinfer Send to the user.

[0118] Step 504: Verification nodes 1, 2, 3, 4, and 5 will verify the model inference results. The arbitration node receives the model verification task T from the verification nodes. verify Generate model validation results. Tverify and the model validation results Result Tverify Perform MD5 hash calculation to generate hash values ​​(the hash values ​​for verifier node 1, verifier node 2 and verifier node 3 are 1234..., and the hash values ​​for verifier node 4 and verifier node 5 are 5678...), and send the hash values ​​to the arbitration node.

[0119] Step 505: Due to the inconsistent hash values ​​among the verification nodes, the arbitration node initiates a request to the trusted model inference task provider to obtain the standard inference result Result.

[0120] Step 506: The model inference task provider generates a standard inference result Result, performs MD5 hash calculation on the inference result to generate a hash value 5678..., and sends the hash value to the arbitration node.

[0121] Step 507: Since the hash values ​​corresponding to verification node 1, verification node 2 and verification node 3 are inconsistent with the hash value corresponding to the standard inference result Result, verification node 1, verification node 2 and verification node 3 are marked as malicious node 1, malicious node 2 and malicious node 3.

[0122] It should be noted that, Figure 5 Honest node 1 and honest node 2 refer to verification node 4 and verification node 5 in step 504 above. Figure 5 The honest computing node in the above refers to the computing node in step 502.

[0123] This application's embodiments, through this arbitration mechanism, ensure the accuracy and reliability of model inference results. Specifically, multi-party verification and comparison of arbitration nodes ensure the accuracy and reliability of the inference results. By identifying and handling malicious nodes, the normal operation of the blockchain system and data security are ensured. By introducing trusted large model service providers and standard inference results, the accuracy and reliability of the arbitration results are further enhanced, ensuring the fairness and transparency of the system.

[0124] In one embodiment of this application, obtaining a second arbitration result for determining whether the computing node or the verification node is the malicious node based on the model inference result, the model verification result, and the standard inference result includes:

[0125] Compare whether the model inference result is the same as the standard inference result, and compare whether the model verification result is the same as the standard inference result;

[0126] If the model inference result differs from the standard inference result, a third arbitration result is obtained to determine that the computing node is the malicious node;

[0127] If the model inference result is the same as the standard inference result, then a fourth arbitration result is obtained to determine that the computing node is not the malicious node;

[0128] If the model verification result differs from the standard inference result, a fifth arbitration result is obtained to determine that the verification node is the malicious node;

[0129] If the model verification result is the same as the standard inference result, then a sixth arbitration result is obtained to determine that the verification node is not the malicious node;

[0130] The third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result, shall be determined as the second arbitration result.

[0131] In the model inference task, it is necessary to determine whether the computing node or the verification node is a malicious node by comparing the model inference result, the model verification result and the standard inference result, and finally generate a second arbitration result.

[0132] Specifically, we compare whether the model inference results are the same as the standard inference results, and whether the model validation results are the same as the standard inference results.

[0133] If the model's inference result differs from the standard inference result, it indicates that the inference result generated by the computing node is abnormal. In this case, a third arbitration result is generated to determine whether the computing node is a malicious node, meaning that the computing node is considered a malicious node exhibiting abnormal behavior.

[0134] If the model's inference result is the same as the standard inference result, it means that the inference result generated by the computing node is correct. In this case, a fourth arbitration result is generated to determine that the computing node is not a malicious node, which means that the computing node is considered an honest node without malicious behavior.

[0135] If the model validation result differs from the standard inference result, it indicates that the validation result generated by the validation node is abnormal. In this case, a fifth arbitration result is generated to determine that the validation node is a malicious node, meaning that the computation node is considered a malicious node exhibiting abnormal behavior.

[0136] If the model validation result is the same as the standard inference result, it means that the validation result generated by the validation node is correct. In this case, a sixth arbitration result is generated to determine that the validation node is not a malicious node, which means that the computation node is considered an honest node without malicious behavior.

[0137] Finally, based on the above comparison and verification results, one of the following combinations is determined as the second arbitration result: the third arbitration result and the fifth arbitration result (both the computation node and the verification node are malicious nodes); the third arbitration result and the sixth arbitration result (the computation node is a malicious node, and the verification node is an honest node); the fourth arbitration result and the fifth arbitration result (the computation node is an honest node, and the verification node is a malicious node); the fourth arbitration result and the sixth arbitration result (both the computation node and the verification node are honest nodes).

[0138] This application's embodiments ensure the accuracy and reliability of model inference results through multi-party verification and comparison of arbitration nodes. By identifying and handling malicious nodes, the normal operation of the blockchain system and data security are ensured. The accuracy and reliability of arbitration results are further enhanced by introducing trusted large model service providers and standard inference results, ensuring the fairness and transparency of the system. By comparing model inference results, model verification results, and standard inference results, the comprehensiveness and reliability of the arbitration results are ensured, avoiding the limitations of single verification.

[0139] In one embodiment of this application, the computing node has a corresponding number of non-response counts. The step of sending task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task based on the task data to obtain the model inference result corresponding to the computing node includes:

[0140] Send the task data corresponding to the model inference task to the computing node;

[0141] Determine whether the computing node responds to the model inference task within a preset time;

[0142] If the computing node does not respond to the model inference task within a preset time, the non-response count corresponding to the computing node is incremented by one.

[0143] After the system sends the task data corresponding to the user-initiated model inference task to the selected computing node, it will check whether the computing node has responded and started executing the model inference task within a preset time range (such as a few seconds or minutes). The preset time is to ensure that the computing node can process the task in a timely manner.

[0144] If a compute node does not respond to a model inference task within a preset time, the system will increment the non-response count for that compute node by one. The non-response count is a counter used to record the number of times a compute node fails to respond to a task in a timely manner.

[0145] This application embodiment ensures that computing nodes can respond and execute model inference tasks promptly by setting a preset time limit, thus avoiding long waiting times for model inference tasks. By recording the number of times computing nodes fail to respond, the system can monitor the reliability of the computing nodes. By recording the number of times they fail to respond, the system can adjust nodes that frequently fail to respond, incentivizing nodes to maintain a good responsiveness and improving the overall efficiency of the system.

[0146] In one embodiment of this application, the computing node has computing capabilities for performing the model inference task. After incrementing the non-response count corresponding to the computing node by one if the computing node does not respond to the model inference task within a preset time, the method further includes:

[0147] If the number of unresponsive events corresponding to the computing node exceeds a preset number, the computing ability of the user corresponding to the computing node will be cancelled.

[0148] Compute nodes possess the computing power required to execute model inference tasks and can respond to and process user-initiated model inference tasks.

[0149] In the above steps, if a computing node does not respond to the model inference task within a preset time, the system will increment the count of the non-response of that computing node by one.

[0150] If the number of times a computing node fails to respond exceeds a preset limit (such as 3 or 5 times), the system will cancel the computing ability of the user corresponding to that computing node, which means that the user will no longer be able to participate in model inference tasks as a computing node.

[0151] This application embodiment ensures that computing nodes can respond promptly and execute model inference tasks by monitoring preset time limits and the number of unresponsive events, avoiding prolonged task waiting. By recording and processing the number of unresponsive events, the system can monitor the reliability of computing nodes. By recording the number of unresponsive events and canceling computing power, the system can adjust nodes that frequently fail to respond, incentivizing nodes to maintain a good responsiveness and improving the overall system efficiency. By canceling computing power, the system can regulate user behavior, preventing malicious or unreliable users from abusing computing resources and ensuring the fairness and security of the system.

[0152] In one embodiment of this application, the computing node has computing power for performing the model inference task, and the verification node has verification power for verifying the model inference result. After determining the third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result as the second arbitration result, the method further includes:

[0153] If the computing node is a malicious node, then the computing capabilities of the computing node are cancelled.

[0154] If the verification node is a malicious node, then the verification capability of the verification node is cancelled.

[0155] The verification node has the verification capability required to verify the inference results of the model, and can respond to and verify the inference results of the computing node.

[0156] In the above steps, the system generates a second arbitration result by comparing the model inference result, the model verification result, and the standard inference result. Specifically, the third arbitration result is that the computation node is a malicious node; the fourth arbitration result is that the computation node is not a malicious node; the fifth arbitration result is that the verification node is a malicious node; and the sixth arbitration result is that the verification node is not a malicious node.

[0157] If the second arbitration result determines that the computing node is a malicious node, the system will cancel the computing capabilities of that computing node, which means that the node can no longer participate in model inference tasks as a computing node.

[0158] If the second arbitration result determines that the verification node is a malicious node, the system will cancel the verification capability of that verification node, which means that the node will no longer be able to participate in the verification of the model inference results as a verification node.

[0159] This application's embodiments ensure the normal operation of the blockchain system and the security of data by identifying and handling malicious nodes. By canceling the computing or verification capabilities of malicious nodes, the system can adjust these nodes, improving the overall security of the system. By canceling the capabilities of malicious nodes, the system can regulate user behavior, preventing malicious or unreliable users from abusing computing resources and ensuring the fairness and security of the system. By promptly handling malicious nodes, the system's stability and reliability are ensured, preventing task execution failures due to node malfunctions or malicious behavior.

[0160] This application's embodiments replace mathematical problems with model inference tasks. By assigning these tasks to computing nodes, the nodes can execute valuable computational tasks, improving the utilization efficiency of computing resources and avoiding waste. Furthermore, by selecting target computing nodes to generate target blocks, the fairness and transparency of the block generation process are ensured, further enhancing the credibility of blockchain data. The model inference results are stored in the target blocks of the blockchain; due to the characteristics of blockchain, this data cannot be tampered with once recorded, ensuring the credibility and security of the model inference results. In addition, determining the target computing node based on the number of model inference results corresponding to the computing node avoids the situation where a single computing node monopolizes computing resources.

[0161] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0162] Based on the above embodiments, this embodiment also provides an execution device for model reasoning tasks, which can be applied to electronic devices such as terminal devices and servers.

[0163] Reference Figure 6 This diagram illustrates a structural block diagram of an embodiment of an execution device for a model inference task, applicable to a blockchain system. The blockchain system includes a blockchain and users, and may specifically include the following modules:

[0164] The model inference task acquisition module 601 is used to acquire the model inference task initiated by the user; the model inference task has corresponding task data.

[0165] The computing node determination module 602 is used to determine the computing node used to perform the model inference task;

[0166] The model inference task execution module 603 is used to send the task data corresponding to the model inference task to the computing node, and control the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node.

[0167] The target quantity statistics module 604 is used to count the number of model inference results corresponding to the computing node, and obtain the target quantity corresponding to the computing node.

[0168] The target computing node determination module 605 is used to determine the target computing node based on the number of targets corresponding to the computing node;

[0169] The target block generation module 606 is used to control the target computing node to generate a target block in the blockchain and store the model inference result corresponding to the target computing node in the target block.

[0170] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.

[0171] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes various types of devices such as terminal devices and servers (clusters).

[0172] The embodiments of this disclosure can be implemented as an apparatus configured as desired using any suitable hardware, firmware, software, or any combination thereof, including electronic devices such as terminal devices, servers (clusters), etc. Figure 7 An exemplary apparatus 700 is schematically shown that can be used to implement the various embodiments described in this application.

[0173] In one embodiment, Figure 7 An exemplary device 700 is shown, which includes one or more processors 702, a control module (chipset) 704 coupled to at least one of the processors 702, a memory 706 coupled to the control module 704, a non-volatile memory (NVM) / storage device 708 coupled to the control module 704, one or more input / output devices 710 coupled to the control module 704, and a network interface 712 coupled to the control module 704.

[0174] Processor 702 may include one or more single-core or multi-core processors, and processor 702 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 700 can serve as a terminal device, server (cluster), or other device as described in the embodiments of this application.

[0175] In some embodiments, the apparatus 700 may include one or more computer-readable media (e.g., memory 706 or NVM / storage device 708) having instructions 714 and one or more processors 702 that are combined with the one or more computer-readable media and configured to execute the instructions 714 to implement the module and thus perform the actions described in this disclosure.

[0176] In one embodiment, the control module 704 may include any suitable interface controller to provide any suitable interface to at least one of the processors 702 and / or any suitable device or component communicating with the control module 704.

[0177] The control module 704 may include a memory controller module to provide an interface to the memory 706. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0178] Memory 706 may be used, for example, to load and store data and / or instructions 714 for device 700. In one embodiment, memory 706 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 706 may include double data rate type 4 synchronous dynamic random access memory (DDR4 SDRAM).

[0179] In one embodiment, the control module 704 may include one or more input / output controllers to provide an interface to the NVM / storage device 708 and (one or more) input / output devices 710.

[0180] For example, NVM / storage device 708 may be used to store data and / or instructions 714. NVM / storage device 708 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).

[0181] NVM / storage device 708 may include storage resources that are physically part of a device on which device 700 is mounted, or that can be accessed by the device without needing to be part of the device. For example, NVM / storage device 708 may be accessed via a network via one or more input / output devices 710.

[0182] One or more input / output devices 710 may provide an interface for device 700 to communicate with any other suitable device. Input / output devices 710 may include communication components, audio components, sensor components, etc. A network interface 712 may provide an interface for device 700 to communicate via one or more networks. Device 700 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, etc., or combinations thereof.

[0183] In one embodiment, at least one of the processors 702 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 704. In one embodiment, at least one of the processors 702 may be logically packaged with one or more controllers of the control module 704 to form a system-in-package (SiP). In one embodiment, at least one of the processors 702 may be integrated with the logic of one or more controllers of the control module 704 on the same die. In one embodiment, at least one of the processors 702 may be integrated with the logic of one or more controllers of the control module 704 on the same die to form a system-on-a-chip (SoC).

[0184] In various embodiments, device 700 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, device 700 may have more or fewer components and / or different architectures. For example, in some embodiments, device 700 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0185] The detection device may use a main control chip as a processor or control module, and sensor data, position information, etc. may be stored in a memory or NVM / storage device. The sensor group may be used as an input / output device, and the communication interface may include a network interface.

[0186] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0187] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0188] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other execution terminal device for a programmable model inference task to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable model inference task, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0189] These computer program instructions may also be stored in a computer-readable storage medium that can direct an execution terminal device that guides a computer or other programmable model inference tasks to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction means, which is implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0190] These computer program instructions can also be loaded onto a computer or other programmable model inference task execution terminal device, causing a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0191] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0192] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0193] The foregoing has provided a detailed description of the method and apparatus for executing a model reasoning task, an electronic device, and a storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for executing a model reasoning task, characterized in that, Applied to a blockchain system, which includes a blockchain and users, the method includes: Obtain the model inference task initiated by the user; the model inference task has corresponding task data; Determine the computing nodes to perform the model inference task; The task data corresponding to the model inference task is sent to the computing node, and the computing node is controlled to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node. The number of model inference results corresponding to the computing node is counted to obtain the target number corresponding to the computing node; The target computing nodes are determined based on the target number corresponding to the computing nodes; The step of determining the target computing node based on the target number corresponding to the computing node includes: When the target number meets the preset number of times the model inference task needs to be executed, the computing node is determined as the target computing node; The target computing node is controlled to generate a target block in the blockchain, and the model inference result corresponding to the target computing node is stored in the target block.

2. The method according to claim 1, characterized in that, The blockchain system further includes an arbitration node. After sending the task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node, the method further includes: The computing node is controlled to send the model inference results to the arbitration node; Identify the verification nodes used to validate the inference results of the model; The task data corresponding to the model inference task is sent to the verification node, and the verification node is controlled to verify the model inference result according to the task data to obtain the model verification result; The verification node is controlled to send the model verification result to the arbitration node; The arbitration node is controlled to compare the model inference result and the model verification result to obtain an arbitration result used to determine whether the computing node is a malicious node; the malicious node is a computing node or verification node that affects the normal operation of the blockchain system.

3. The method according to claim 2, characterized in that, The blockchain system and the model inference task provider communicate with each other. The model inference task provider includes standard inference results corresponding to the model inference task. The arbitration node is controlled to compare whether the model inference result and the model verification result are the same, and obtains an arbitration result for determining whether the computing node is a malicious node, including: If the model inference result and the model verification result are the same, then a first arbitration result is obtained to determine that the computing node is not the malicious node; If the model inference result and the model verification result are different, the standard inference result corresponding to the model inference task is obtained from the model inference task provider, and a second arbitration result is obtained based on the model inference result, the model verification result and the standard inference result to determine whether the computing node or the verification node is the malicious node. The first arbitration result or the second arbitration result shall be determined as the arbitration result.

4. The method according to claim 3, characterized in that, The step of obtaining a second arbitration result based on the model inference result, the model verification result, and the standard inference result to determine whether the computing node or the verification node is the malicious node includes: Compare whether the model inference result is the same as the standard inference result, and compare whether the model verification result is the same as the standard inference result; If the model inference result differs from the standard inference result, a third arbitration result is obtained to determine that the computing node is the malicious node; If the model inference result is the same as the standard inference result, then a fourth arbitration result is obtained to determine that the computing node is not the malicious node; If the model verification result differs from the standard inference result, a fifth arbitration result is obtained to determine that the verification node is the malicious node; If the model verification result is the same as the standard inference result, then a sixth arbitration result is obtained to determine that the verification node is not the malicious node; The third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result, shall be determined as the second arbitration result.

5. The method according to claim 1, characterized in that, The computing node has a corresponding number of non-response counts. The step of sending task data corresponding to the model inference task to the computing node and controlling the computing node to execute the model inference task based on the task data to obtain the model inference result corresponding to the computing node includes: Send the task data corresponding to the model inference task to the computing node; Determine whether the computing node responds to the model inference task within a preset time; If the computing node does not respond to the model inference task within a preset time, the non-response count corresponding to the computing node is incremented by one.

6. The method according to claim 5, characterized in that, The computing node has the computing capability to execute the model inference task. After incrementing the non-response count corresponding to the computing node by one if the computing node fails to respond to the model inference task within a preset time, the method further includes: If the number of unresponsive events corresponding to the computing node exceeds a preset number, the computing ability of the user corresponding to the computing node will be cancelled.

7. The method according to claim 4, characterized in that, The computing node has the computing capability to perform the model inference task, and the verification node has the verification capability to verify the model inference result. After determining the third arbitration result and the fifth arbitration result, or the third arbitration result and the sixth arbitration result, or the fourth arbitration result and the fifth arbitration result, or the fourth arbitration result and the sixth arbitration result as the second arbitration result, the method further includes: If the computing node is a malicious node, then the computing capabilities of the computing node are cancelled. If the verification node is a malicious node, then the verification capability of the verification node is cancelled.

8. An execution device for a model reasoning task, characterized in that, Applied to a blockchain system, the blockchain system including a blockchain and users, the device includes: The model inference task acquisition module is used to acquire the model inference task initiated by the user; the model inference task has corresponding task data. A computing node determination module is used to determine the computing nodes used to perform the model inference task; The model inference task execution module is used to send the task data corresponding to the model inference task to the computing node, and control the computing node to execute the model inference task according to the task data to obtain the model inference result corresponding to the computing node. The target quantity statistics module is used to count the number of model inference results corresponding to the computing node, and obtain the target quantity corresponding to the computing node. The target computing node determination module is used to determine the target computing nodes based on the number of targets corresponding to the computing nodes. The target block generation module is used to control the target computing node to generate a target block in the blockchain and store the model inference result corresponding to the target computing node in the target block; The device is further configured to determine the computing node as a target computing node when the target number meets the preset number of times the model inference task needs to be performed.

9. An electronic device, characterized in that, include: processor; The processor and a memory, on which executable code is stored, which, when executed, causes the processor to perform the execution method of the model inference task as described in any one of claims 1-7.

10. One or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform an execution method for a model inference task as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Privacy protection machine learning training and reasoning method and system based on block chain

    CN114118438A

  • Block chain system with artificial intelligence nodes

    CN117251887A