Artificial Intelligence Reasoning System Based on Blockchain
By introducing blockchain technology into the intelligent reasoning system and using the reasoning application end and the consensus node cluster to determine the target accounting node, the problems of low reasoning efficiency and insufficient accuracy in the existing technology are solved, and efficient and accurate intelligent reasoning is achieved. , and reduce operation and maintenance costs.
Patent Information
- Application Number
- CN202210824000.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-07-13
AI Technical Summary
Existing intelligent reasoning systems interact with multiple edge nodes in the cloud, resulting in low reasoning efficiency, insufficient reasoning accuracy, and high operation and maintenance costs.
Adopting a blockchain-based artificial intelligence reasoning system, the target accounting node is determined through the reasoning application and the consensus node cluster to realize a distributed reasoning network across edge nodes, reduce the amount of interaction between the cloud and edge nodes, improve the accuracy of reasoning, and Automatically tune model parameters through smart contracts.
It improves the processing efficiency and accuracy of the inference system, reduces operation and maintenance costs, reduces the impact of human factors on the model training process, and enhances the credibility of the results.
Smart Images

Figure CN115049061B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to an artificial intelligence reasoning system based on blockchain. Background Art
[0002] Intelligent reasoning is one of the key technologies of artificial intelligence (AI) and has been applied in different industrial scenarios. Due to the limitations of intelligent reasoning of a single smart terminal, an intelligent reasoning system consisting of a cloud and multiple edge nodes has emerged.
[0003] In the existing intelligent reasoning system, each edge node separately sets up reasoning applications and algorithm models. When performing intelligent reasoning, the cloud interacts with each edge node separately to determine the target edge node that processes the reasoning request, and then sends the reasoning request to the target edge node. The target edge node uses its internal algorithm model to perform reasoning operations and generate reasoning results.
[0004] However, since the cloud in the prior art needs to interact with multiple edge nodes separately to determine the target edge node for processing the reasoning request, the reasoning efficiency of the existing intelligent reasoning system cannot be guaranteed. Summary of the invention
[0005] The embodiment of the present application provides an artificial intelligence reasoning system based on blockchain to improve the processing efficiency of the reasoning system for reasoning tasks.
[0006] In a first aspect, an embodiment of the present application provides a method for processing an inference task, which is applied to a target accounting node in an accounting node cluster, wherein the accounting node cluster is located in an inference system, and the inference system further includes an inference application end, a consensus node cluster, and a cloud. The method includes:
[0007] Receive a second inference request sent by the consensus node cluster, the second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed, the first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model, the target inference model is determined by the inference application end for the inference task from multiple inference models in the accounting node cluster according to the task type of the inference task, the inference task is obtained from the client by the inference application end through the cloud, the inference task and the second inference request both include the item feature data, and the model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node;
[0008] Using the target reasoning model to perform reasoning operations on the item feature data to generate reasoning results;
[0009] The inference result is sent to the client via the cloud.
[0010] In a second aspect, an embodiment of the present application provides an inference task processing device, which is integrated into a target accounting node in an accounting node cluster, wherein the accounting node cluster is located in an inference system, wherein the inference system also includes an inference application end, a consensus node cluster, and a cloud, wherein the device includes:
[0011] A communication module, used for receiving a second inference request sent by the consensus node cluster, the second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed, the first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model, the target inference model is determined for the inference task by the inference application end from multiple inference models in the accounting node cluster according to the task type of the inference task, the inference task is obtained from the client by the inference application end through the cloud, the inference task and the second inference request both include the item feature data, and the model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node;
[0012] A processing module, used to perform reasoning operations on the item feature data using the target reasoning model to generate a reasoning result;
[0013] The communication module is also used to send the inference result to the client through the cloud.
[0014] In a third aspect, an embodiment of the present application provides a target accounting node, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the inference task processing method as described in the first aspect above is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the reasoning task processing method as described in the first aspect above.
[0016] In a fifth aspect, an embodiment of the present application provides an inference system, including: a cloud, an inference application end, a consensus node cluster and an accounting node cluster, wherein the accounting node cluster includes the target accounting node as described in the third aspect above.
[0017] The blockchain-based artificial intelligence reasoning system provided by the embodiment of the present application includes: a cloud, an reasoning application end, a consensus node cluster and an accounting node cluster. When performing intelligent reasoning, a second reasoning request sent by the consensus node cluster is received through a target accounting node. The second reasoning request is generated by the consensus node cluster according to the item feature data carried in the first reasoning request when the confirmation result is passed. The first reasoning request is generated by the reasoning application end according to the item feature data and the model identifier of the target reasoning model. The target reasoning model is determined for the reasoning task by the reasoning application end from multiple reasoning models in the accounting node cluster according to the task type of the reasoning task. The reasoning task is obtained from the client by the reasoning application end through the cloud. The reasoning task and the second reasoning request both include item feature data. The model identifier of the target reasoning model is used by the consensus node cluster to determine the target accounting node; the target reasoning model is used to perform reasoning operations on the item feature data to generate a reasoning result; and the reasoning result is sent to the client through the cloud. By utilizing the data sharing characteristics of the ledgers of each node in the blockchain, the data volume of the samples for training the inference model is increased, and the reasoning accuracy of the inference model is improved. By setting up the inference application end and the consensus node cluster, the point-to-point confirmation of the target inference model and the confirmation of the feasibility of the reasoning task based on the consensus mechanism are realized, thereby greatly reducing the interaction between the edge node and the cloud and accelerating the reasoning efficiency. At the same time, the blockchain smart contract is used to complete the automatic tuning of the inference algorithm model, reduce the manpower operation and maintenance costs, ensure the stability of the model training process, and avoid the influence of human factors on the model training process, thereby improving the credibility of the reasoning results.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a schematic diagram of the structure of the traditional reasoning system;
[0021] Figure 2 A schematic diagram of the structure of an inference system provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a data processing flow of an inference application end provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a data processing flow of a consensus node cluster provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a process for a master consensus node to confirm a block provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a data processing flow of a target accounting section provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a training process of an inference model provided in an embodiment of the present application;
[0027] Figure 8 A flowchart of a method for processing a reasoning task provided in an embodiment of the present application;
[0028] Fig. 9 A schematic diagram of the structure of an inference task processing device provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of the structure of a target accounting node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Figure 1 This is a schematic diagram of the structure of a traditional reasoning system, such as Figure 1 As shown, the traditional reasoning system includes a cloud and N edge nodes, each edge node is individually set with an algorithm model adapted to a specific reasoning application. When performing intelligent reasoning, the cloud needs to interact with each edge node separately to determine the target edge node for processing the reasoning task, and then send the reasoning task to the target edge node, which uses its internal algorithm model to perform reasoning operations and generate reasoning results. However, the prior art has the following problems:
[0033] (1) When performing intelligent reasoning, the cloud needs to interact with N edge nodes to determine the target edge node for processing the reasoning task, that is, to ask each edge node whether it can process the reasoning task. The communication overhead is high, resulting in low reasoning efficiency of the intelligent reasoning system.
[0034] (2) The inference model used by a single edge node is trained based on the sample data of this node. For example, the inference model in the first edge node is trained based on the sample data in the first edge node, and the inference model in the second edge node is trained based on the sample data in the second edge node. Since the amount of sample data of a single edge node is limited, the inference accuracy of the inference system cannot be guaranteed.
[0035] (3) During the model training process, developers are required to manually adjust model parameters repeatedly and publish them to edge nodes. Since the entire process relies heavily on manual operations by developers, it not only greatly increases the operation and maintenance costs, but also increases the error rate and slows down the model training speed.
[0036] The main idea of the technical solution of this application: In view of the above technical problems, the embodiment of this application provides a reasoning task processing solution, which realizes a distributed reasoning network across edge nodes based on blockchain technology. On the one hand, by setting the reasoning application end in the distributed reasoning network, when receiving the reasoning task, the reasoning application end first determines the target reasoning model that matches the task type of the reasoning task, and then the target accounting node including the target reasoning model performs the reasoning operation, so that the cloud does not need to interact with multiple edge nodes for data, thereby improving the reasoning efficiency. On the other hand, the distributed reasoning system sets up a consensus node cluster. Before the target accounting node performs reasoning, the consensus node cluster first determines the feasibility of the reasoning task through simulation. When the reasoning task is determined to be feasible, the target accounting node performs the actual processing operation. If the reasoning task is determined to be not feasible, a failure response is sent to the client, and no actual processing operation is performed, thereby avoiding unnecessary waste of processing resources. On the other hand, the distributed reasoning system aggregates and integrates the sample data collected by multiple edge nodes, increases the amount of sample data for building the algorithm model, and improves the accuracy of the reasoning results. On the other hand, during the training and optimization process of the inference model, there is no need for manual intervention to publish algorithm models, adjust model parameters, etc., which realizes automatic training and optimization of the model, effectively reduces the manpower operation and maintenance costs, and improves the training and optimization efficiency of the model.
[0037] Embodiment 1
[0038] The reasoning task processing solution provided in this embodiment can be used, for example, in scenarios such as quality inspection, pre-characteristic maintenance, and defect detection of items. Figure 2 A schematic diagram of the structure of an inference system provided in an embodiment of the present application. Figure 2 As shown, the reasoning system 200 of this embodiment includes: a cloud 210, an reasoning application end 220, a consensus node cluster 230 and an accounting node cluster 240.
[0039] (I) Cloud 210
[0040] The cloud 210 is the top-level module of the system. The cloud 210 is connected to the client and the inference application 220, and is responsible for receiving the inference request sent by the client, and parsing the inference request and sending it to the inference application 220. The cloud 210 can also be connected to the consensus node cluster 230 and the accounting node cluster 240, and is responsible for receiving the feedback message sent by the accounting node cluster 240 and / or the accounting node cluster 240, and sending the data in the feedback message to the client in a preset format and / or saving it as needed.
[0041] The client corresponds to the user device that initiates the reasoning task, such as a smart phone, a laptop, etc., and the cloud 210 corresponds to the server that receives the reasoning task, which can be a single server or a large server cluster. For example, when a user has a data processing requirement for reasoning, he can select the task type through the client and submit the data required for reasoning, that is, the item characteristic data, to initiate the reasoning task.
[0042] Among them, the item characteristic data is the description of the item. In different usage scenarios, the item characteristic data may be different. For example, in the quality inspection and testing scenario, the item characteristic data may be the attribute data of the item, such as the size and shape of the refrigerator U shell; in the pre-characteristic maintenance scenario, the item characteristic data may be the usage data of the item, such as the usage time and frequency of the refrigerator; in the defect detection scenario, the item characteristic data may be the status data of the item, such as photos of the item taken from various angles. The item characteristic data may be input to the client by the user through the operation interface provided by the client by uploading or filling in, or may be input to the client by the user through the client or the settings connected to the client by scanning, etc., and there is no restriction here.
[0043] (II) Reasoning Application End 220
[0044] The reasoning application end 220 is set between the cloud 210 and the consensus node cluster 230. For example, Figure 3 A data processing flow diagram of an inference application end provided in an embodiment of the present application is as follows: Figure 3 As shown, in this embodiment, after receiving the inference task sent by the cloud 210, the data processing process of the inference application end 220 includes the following steps:
[0045] S301. Determine a target reasoning model for processing the reasoning task from multiple reasoning models in the accounting node cluster according to the task type of the reasoning task.
[0046] In this embodiment, each accounting node in the accounting node cluster 240 is provided with a reasoning model, and a reasoning model corresponds to a reasoning application, which is used to process a specific type of reasoning task and realize a reasoning function. The model identifier is used to uniquely identify a reasoning model, and can be a number or name of the reasoning model.
[0047] In a possible implementation, the inference application end 220 stores an inference model parameter table, which is generated to store the model identifiers of all inference models included in the accounting node cluster and the inference applications corresponding to different inference models, that is, the task types of inference tasks that the inference models can process. Accordingly, in this step, the inference application end 220 determines the target inference model by looking up the table according to the task type of the received inference task.
[0048] S302: Generate a first reasoning request according to the determined model identifier of the target reasoning model and the item characteristic data.
[0049] S303: Send the first reasoning request to the consensus node cluster.
[0050] The first reasoning request includes the model identifier of the target reasoning model and the item characteristic data. The first reasoning request can be sent to a specific consensus node in the consensus node cluster 230, or to any consensus node in the consensus node cluster 230, without limitation here.
[0051] For example, for a consensus node cluster 230 with a master consensus node and multiple slave consensus nodes, the first reasoning request can be sent directly to the master consensus node or to any slave consensus node, and the slave consensus node forwards the first reasoning request to the master consensus node. For a consensus node cluster 230 without a master consensus node and a slave consensus node, the first reasoning request can be sent to any consensus node, and the node that receives the first reasoning request executes the data processing logic of the master consensus node, while other nodes execute the data processing logic of the slave consensus node.
[0052] In an embodiment of the present application, by setting up an inference application end 220, when the cloud 210 receives an inference task, the inference application end 220 can be directly called to determine the target inference model that matches the task type of the inference task, that is, the target accounting node. Compared with traditional solutions, since the cloud 210 does not need to interact with multiple edge nodes, the system reasoning efficiency is accelerated.
[0053] (III) Consensus Node Cluster 230
[0054] The cluster is composed of multiple consensus nodes and is the module responsible for consensus block generation in the system. Specifically, based on the item feature data parsed from the first reasoning request, multiple consensus nodes perform block generation confirmation through a preset consensus block generation verification algorithm to determine whether the system (mainly the target reasoning model in the target accounting node) can handle the reasoning task, that is, to determine the feasibility of the first reasoning request. When the block generation confirmation result is passed, it is confirmed that the first reasoning request is feasible. Then, based on the model identifier parsed from the first reasoning request, the target accounting node for processing the reasoning task is determined. At the same time, a second reasoning request is generated based on the item feature data, and the second reasoning request is sent to the target accounting node.
[0055] In a possible implementation, the consensus node cluster 230 is composed of a master consensus node and multiple slave consensus nodes, and the master consensus node interacts with the multiple slave consensus nodes for data, and performs block confirmation according to a preset consensus block verification algorithm. Specifically, after receiving the first reasoning request, the master consensus node first generates an endorsement request based on the item feature data and model identifier in the first reasoning request, distributes the endorsement request to each slave consensus node, and each slave consensus node performs reasoning simulation, generates simulation results, and endorses the simulation results. After that, the simulation results and endorsement signatures are obtained as endorsement feedback and sent to the master consensus node. Finally, the master consensus node summarizes the endorsement feedback of multiple slave consensus nodes, and verifies the feasibility of the reasoning request according to the preset consensus block verification algorithm.
[0056] For example, Figure 4 A data processing flow diagram of a consensus node cluster provided in an embodiment of the present application is as follows: Figure 4 As shown, taking the target slave consensus node among multiple slave consensus nodes as an example, after receiving the first inference request, the data processing process of the master consensus node and the target slave consensus node includes the following steps:
[0057] S401. The main consensus node generates an endorsement request including item feature data and a model identifier of a target reasoning model.
[0058] S402: The master consensus node sends the endorsement request to the target slave consensus node.
[0059] S403, the target slave consensus node performs reasoning simulation based on item feature data and model identification to generate simulation results.
[0060] In this step, the target performs inference simulation from the consensus node according to the preset inference simulation logic to obtain the simulation result. The simulation result obtained in this step is an estimated value. It can be understood that in different scenarios, the form of the simulation result can be different. For example, in the quality inspection and detection scenario, the simulation result can be a mark of qualified or unqualified, in the pre-characteristic maintenance scenario, the simulation result can be the number of possible fault points in the item, and in the defect detection scenario, the simulation result can be the number of possible defect types in the item.
[0061] In a possible implementation, the target slave consensus node stores the reasoning task records of all accounting nodes in the accounting node cluster, one accounting node corresponds to one reasoning task record, and the reasoning task record is used to summarize the item characteristic data and the corresponding reasoning result corresponding to the reasoning task processed by the accounting node. Accordingly, in this step, the target slave consensus node finds the corresponding reasoning task record according to the model identifier, and then generates the simulation result according to the item characteristic data and the reasoning task record in the first reasoning request.
[0062] S404. The target signs the simulation result from the consensus node and obtains an endorsement signature.
[0063] In this step, the target signs the simulation result using the preset signature algorithm adopted by the consensus node to obtain an endorsement signature.
[0064] S405. The target slave consensus node generates endorsement feedback based on the simulation results and endorsement signature.
[0065] S406. The target slave consensus node sends the endorsement feedback to the master consensus node.
[0066] It can be understood that the master consensus node and all slave consensus nodes in the consensus node cluster 230 perform data interaction according to the steps in S401-S406 to trigger all slave consensus nodes to perform reasoning simulation and endorsement, thereby obtaining the simulation results and endorsement signatures of all slave consensus nodes.
[0067] In a possible implementation, the consensus block verification algorithm includes an endorsement verification algorithm and a block verification algorithm. For example, Figure 5 A schematic diagram of a process for a master consensus node to confirm a block is provided in an embodiment of the present application, such as Figure 5 As shown in the figure, the main consensus node confirms the block through the following steps:
[0068] S501. Based on the endorsement signatures of multiple slave consensus nodes, an endorsement verification algorithm is used to perform endorsement verification.
[0069] For example, the endorsement verification algorithm can be expressed as follows:
[0070]
[0071] Among them, p is the number of slave consensus nodes whose signature verification results are passed, x n Indicates the verification result of the nth slave consensus node. If the verification result of the nth slave consensus node is successful, then x is taken. n =1, if the verification result of the nth slave consensus node fails, then take x n =-1.
[0072] In this step, the endorsement signature of each slave consensus node is first verified by a preset signature verification algorithm, i.e., verification, to obtain a verification result, wherein the preset signature verification algorithm is the same as the preset signature algorithm in S404, and the verification result includes two cases: pass and fail. Then, the verification results are summarized by the above formula (1) to obtain the number of consensus nodes p whose verification results are pass. Finally, p is compared with a predefined first threshold s1 to determine whether the endorsement verification is passed. Specifically, if p>s1, the endorsement verification is considered to be passed, and step S502 is executed; otherwise, the endorsement verification is considered to be failed, and a feedback message indicating that the consensus block verification has failed is sent to the cloud, and the consensus ends.
[0073] S502: If the endorsement verification is passed, the block verification algorithm is used to perform block verification based on the simulation results of multiple slave consensus nodes.
[0074] In one possible implementation, the simulation results include simulation success and simulation failure. For example, if the simulation result is a valid result (such as a simulation value within a preset range), the simulation is successful; if the simulation result is an invalid result (such as a simulation value outside the preset range), the simulation fails.
[0075] For example, in the pre-feature maintenance scenario, the block verification algorithm can be expressed as follows:
[0076] m=r≥0?m+1:m (2)
[0077] Where m represents the number of slave consensus nodes with successful simulation results, r represents the simulation result, and r≥0 is the condition for judging whether the simulation result is successful. If the simulation result of the current slave consensus node is r≥0, it means that the simulation is successful. At this time, the value of the number of slave consensus nodes m with successful simulation results is increased by 1, otherwise the value of the number of slave consensus nodes m remains unchanged.
[0078] In this step, the simulation results of each slave consensus node that has passed the endorsement verification can be taken in turn, and the simulation results of the slave consensus nodes that have passed the endorsement verification can be summarized based on the above formula (2). After the simulation result is obtained, the number of slave consensus nodes m (m≤p) that is successful is obtained, and then m is compared with a predefined second threshold s2 to determine whether the block verification has passed. Specifically, if m>s2, it is confirmed that the block verification has passed, and S503 is executed; otherwise, the block verification has failed, and a feedback message indicating that the block verification has failed is sent to the cloud, and the consensus ends.
[0079] It should be noted that, depending on different application scenarios, the conditions for determining that the simulation result is successful in formula (2) can be set differently, and no limitation is made here.
[0080] S503: If the block verification passes, it is determined that the first reasoning request is feasible.
[0081] In this implementation, if the results of the endorsement verification and the block verification are both passed, it is determined that the first reasoning request is feasible, that is, the block confirmation is passed.
[0082] S504: Determine the target accounting node for processing the reasoning task according to the model identifier.
[0083] In a possible implementation, the main consensus node stores an accounting node parameter table, which stores the model identifiers of all inference models in the accounting node cluster 240 and the locations of different inference models in the accounting node cluster 240 (such as the identifiers of the accounting nodes where they are located). Accordingly, after the main consensus node parses the model identifier from the first inference request, it determines the target accounting node for processing the inference task by looking up the table according to the model identifier, and the target accounting node includes the target inference model.
[0084] It is not difficult to understand that this step can also be performed on the inference application side. Accordingly, the model parameter table of the inference application side is set to include the model identifiers of all inference models in the accounting node cluster, the model identifiers of different inference models, and the positions of different inference models in the accounting node cluster (such as the identifier of the accounting node where they are located), and the first inference request is set to include item feature data, the model identifier of the target inference model, and the node identifier of the target accounting node.
[0085] S505: Generate a second reasoning request based on the item feature data.
[0086] S506. Send the second inference request to the target accounting node.
[0087] In this embodiment, by setting up a consensus node cluster between the inference application end and the accounting node cluster, the consensus node cluster first determines the feasibility of the inference task through simulation. When the inference task is determined to be feasible, the target accounting node performs the actual processing operation. If it is determined that the inference task is not feasible, a failure response is sent to the client, and no actual processing operation is performed, thereby avoiding unnecessary waste of processing resources, improving the inference success rate of the target accounting node, and ensuring the data processing efficiency of the entire system.
[0088] (IV) Accounting Node Cluster 240
[0089] The accounting node cluster 240 is a module in the system responsible for performing actual reasoning operations. In this embodiment, the accounting node cluster 240 is composed of multiple accounting nodes, each accounting node is provided with a reasoning model, and each reasoning model corresponds to a reasoning application to achieve a specific reasoning function. For example, the accounting node cluster 240 includes a first accounting node, a second accounting node, and a third accounting node, wherein the first accounting node is used to perform quality inspection on items, the second accounting node is used to predict fault points of items (pre-characteristic maintenance scenario), and the third accounting node is used to detect defects in items. It can be understood that different reasoning models can be trained separately according to different application scenarios, different types of items, etc., and arranged in different accounting nodes to obtain an accounting node cluster.
[0090] Taking the target accounting node as an example, the target accounting node is the accounting node that receives the second reasoning request. It can be understood that the target accounting node can be any accounting node in the accounting node cluster 240. For example, Figure 6 A data processing flow diagram of a target accounting section provided in an embodiment of the present application, such as Figure 6 As shown, in this embodiment, the target accounting section processes data through the following steps:
[0091] S601. Receive a second reasoning request sent by the consensus node cluster.
[0092] The second inference request includes item feature data.
[0093] In one possible implementation, the target accounting node receives a second reasoning request sent by a master consensus node in the consensus node cluster.
[0094] S602: Use the target reasoning model to perform reasoning operations on the item feature data to generate reasoning results.
[0095] In this step, the item feature data is taken as input, and the target reasoning model is used to perform reasoning operations to obtain the reasoning result. For example, if the target accounting node is the second accounting node, the reasoning result is the number of fault points existing in the item. Unlike the simulation result, the reasoning result is the actual calculated value.
[0096] S603: Send the inference result to the client via the cloud.
[0097] In this step, the inference result obtained in S602 is sent to the cloud, and the cloud sends the inference result to the client in the form of a feedback message, and the entire inference process ends.
[0098] In this embodiment, since the inference application end and the consensus node cluster are set before the accounting node cluster, on the one hand, through the setting of the inference application end, when the cloud receives the inference task, the cloud only needs to interact with the inference application end for data, and does not need to interact with multiple edge nodes at the same time, thereby reducing the communication overhead. On the other hand, through the setting of the consensus node cluster, the feasibility of the inference task is predicted, so that the accounting node cluster only processes the feasible inference tasks, thereby avoiding unnecessary waste of processing resources. The reasoning efficiency of the system is improved through these two aspects.
[0099] In this embodiment, the accounting nodes in the accounting node cluster 240 are also responsible for the automatic training and optimization of the early inference model. Different from the traditional solution, the sample data is no longer stored separately in each edge node, but the characteristics of the blockchain distributed ledger data consensus are used to integrate the sample data in all edge nodes in the prior art, and train the inference model, which greatly increases the sample data capacity, thereby improving the accuracy of the inference results.
[0100] Taking the training process of the target inference model in the target accounting node as an example, illustratively, Figure 7 A schematic diagram of a training process of an inference model provided in an embodiment of the present application, such as Figure 7 As shown, in this embodiment, the inference model is trained through the following steps:
[0101] S701. Obtain sample data of other accounting nodes in the accounting node cluster.
[0102] Among them, other accounting nodes are accounting nodes other than the target accounting node. Exemplarily, assuming that the accounting node cluster includes a first accounting node, a second accounting node and a third accounting node, and assuming that the target accounting node is the second accounting node, then in this step, the second accounting node obtains sample data from the first accounting node and the third accounting node respectively.
[0103] S702: Generate a sample database based on the sample data of other accounting nodes and the sample data of the target accounting node.
[0104] In this step, the target accounting node integrates the sample data of other accounting nodes and its own sample data to obtain a sample database including the full sample data. Exemplarily, the sample database includes the sample data of the first accounting node, the second accounting node, and the third accounting node.
[0105] S703: According to the task type, the sample data in the sample database and the parameter adjustment algorithm are used to adjust the initial model parameters in the initial reasoning model to obtain the target reasoning model.
[0106] In this step, in order to improve the training speed of the model, you can first obtain a target sample data set that matches the task type in the sample database, and then adjust the initial model parameters in the initial inference model according to the target sample data in the target sample data set to obtain the target inference model.
[0107] The target sample data set includes sample data in all accounting nodes that are consistent with the task type of the target reasoning model, that is, the target sample data in the target sample data set comes from different accounting nodes. Each target sample data includes item feature data and target value. For the sake of distinction, the feature data included in the target sample data is called training data; the initial reasoning model can be designed in advance by the developer, and the initial model parameters in the initial reasoning model can be one or more, which are set according to the actual situation and are not limited here.
[0108] In this embodiment, the model parameters are adjusted based on the parameter adjustment algorithm, wherein the parameter adjustment algorithm is preset based on the dichotomy design, and the parameter adjustment algorithm includes a loss function, an amplitude function and an adjustment range (including a first upper limit value and a first lower limit value). When adjusting the model parameters, the training data of each target sample data in the target sample data set is first substituted into the initial inference model for inference operation to obtain a first inference value, and then, based on the first inference value and the target value, it is judged whether the loss function converges. If not, new model parameters are generated through the model function, and the initial inference model is updated with the new model parameters to obtain a first inference model, and then the training data of each target sample data is substituted into the first inference model to obtain a second inference value, and based on the second inference value and the target value, it is judged whether the loss function converges, ..., and so on, until the loss function converges, and the inference model corresponding to the time when the loss function converges is used as the target inference model.
[0109] In a possible implementation, the model parameters of the target algorithm model are adjusted based on the dichotomy method. Exemplarily, taking one model parameter as an example, the parameter adjustment algorithm can be expressed by the formula:
[0110] min = minH(3)
[0111] max = maxH(4)
[0112] Δ = |t - e|(5)
[0113]
[0114] Where H represents the model parameter adjustment range, h represents the adjusted model parameter, t represents the inference value (obtained by calculating through the inference model), e represents the target value (derived from the sample data), Δ represents the loss value, max represents the upper limit value, and min represents the lower limit value.
[0115] The above formula (3) is used to extract the first lower limit value from H and use the obtained first lower limit value as the initial value of min in formula (5).
[0116] The above formula (4) is used to extract the first upper limit value from H and use the obtained first upper limit value as the initial value of max in formula (5).
[0117] The above formula (5) is the loss function. By calculating the absolute value of the difference between the inference value and the target value, the loss value Δ is calculated, and by determining whether Δ is within the preset range, it is determined whether the loss function converges. In a possible implementation, by determining whether Δ is less than the allowable value α, it is determined whether the loss function converges. If Δ is less than α, it is determined that the loss function converges; otherwise, it is determined that the loss function does not converge.
[0118] The above formula (6) is an assignment function, which is used to generate new model parameters according to the values of max and min when the initial model parameters do not meet the requirements (when it is determined that the loss function does not converge according to the first inference value). Formula (6) indicates that when h > e (the inference value is greater than the target value), the model parameters are adjusted by the first assignment function before the ":" (including the first function and the second function described later); when h < e (the inference value is less than the target value), the model parameters are adjusted by the second assignment function after the ":" (including the third function and the fourth function described later).
[0119] Specifically: when h > e (the inference value is greater than the target value), reset the upper limit value max, and then use the reset max value and the original min value to obtain new model parameters; when h < e (the inference value is less than the target value), through the third function Reset the lower limit value min, and then use the fourth function Use the original max value and the reset min value to get the new model parameters. Then, update the inference model according to the new model parameters to get a new inference model. Then substitute the training data into the new inference model for inference operation to get a new inference value, and substitute the new inference value into formula (5) to determine whether the loss function converges. If it converges, the new inference model is determined as the target inference model. If the initial model parameters meet the requirements, the initial inference model can be directly determined as the target inference model without substituting into formula (5) to adjust the model parameters.
[0120] Exemplarily, when the first inference value is greater than the target value, the second upper limit value is obtained by substituting the first upper limit value and the first lower limit value into the first function, and then the new model parameters, i.e., the first model parameters, are obtained by substituting the second upper limit value and the first lower limit value into the second function; then, the inference model is updated according to the first model parameters to obtain the first inference model. Then, the training data is substituted into the first inference model for inference operation to obtain the second inference value, and the second inference value is substituted into formula (5) to determine whether the loss function converges. If converged, the first inference model is determined as the target inference model. Otherwise, continue to judge the size of the second inference value relative to the target value. If the second inference value is greater than the target value, substitute the second upper limit value and the first lower limit value into the first function to obtain the third upper limit value, and then substitute the third upper limit value and the first lower limit value into the second function to obtain new model parameters. Alternatively, if the second inference value is less than the target value, substitute the second upper limit value and the first lower limit value into the third function to obtain the second lower limit value, and then substitute the second upper limit value and the second lower limit value into the fourth function to obtain new model parameters, i.e., second model parameters. Then, according to the second model parameters, update the inference model to obtain the second inference model. Substitute the training data into the second inference model for inference operation to obtain the third inference value, and substitute the third inference value into formula (5) to determine whether the loss function converges. If it converges, the second inference model is determined as the target inference model. Otherwise, continue to repeat the above steps until the loss function converges, and the inference model corresponding to the convergence of the loss function is used as the target inference model.
[0121] Exemplarily, when the first inference value is less than the target value, the second lower limit value is obtained by substituting the first upper limit value and the first lower limit value into the third function, and then the new model parameters, i.e., the first model parameters, are obtained by substituting the first upper limit value and the second lower limit value into the fourth function. Then, the inference model is updated according to the first model parameters to obtain the first inference model. The training data is then substituted into the first inference model for inference operation to obtain the second inference value, and the second inference value is substituted into formula (5) to determine whether the loss function converges. If converged, the first inference model is determined as the target inference model. Otherwise, continue to judge the size of the second inference value relative to the target value. If the second inference value is greater than the target value, substitute the first upper limit value and the second lower limit value into the first function to obtain the second upper limit value, and then substitute the second upper limit value and the second lower limit value into the second function to obtain new model parameters. Alternatively, if the second inference value is less than the target value, substitute the first upper limit value and the second lower limit value into the third function to obtain the third lower limit value, and then substitute the first upper limit value and the third lower limit value into the fourth function to obtain new model parameters, i.e., second model parameters. Then, according to the second model parameters, update the inference model to obtain the second inference model. Substitute the training data into the second inference model for inference operation to obtain the third inference value, and substitute the third inference value into formula (5) to determine whether the loss function converges. If it converges, the second inference model is determined as the target inference model. Otherwise, continue to repeat the above steps until the loss function converges, and the inference model corresponding to the convergence of the loss function is used as the target inference model.
[0122] In this embodiment, the model parameters are adjusted by using the above formulas (3)-(6), thereby accelerating the convergence speed of the loss function. In addition, since no human intervention is required in the adjustment process of the above model parameters, automatic parameter adjustment is achieved. Therefore, it not only improves the model training speed, but also reduces the labor cost and improves the credibility of the reasoning results.
[0123] It should be noted that the above-mentioned reasoning logic and model parameter adjustment logic can be deployed in each accounting node in the form of a smart contract. In the model training stage, each accounting node in the accounting node cluster 240 acquires sample data and adjusts model parameters in accordance with the steps in S701-S703 above, thereby realizing automatic training and optimization of its reasoning model, and obtaining an accounting node cluster 240 that can be applied to various scenarios and has different reasoning functions.
[0124] In this embodiment, through the automatic adjustment of model parameters, the direct operation of the developer on the algorithm model parameters is decoupled, the human resources of the parameter modification process are released, the influence of human factors on the model training process is avoided, and the efficiency of model training is further improved. In addition, since the inference model of each accounting node is trained based on the full amount of sample data in the accounting node cluster, it is beneficial to improve the inference accuracy of the inference model.
[0125] For example, Figure 8 A flowchart of a method for processing a reasoning task provided in an embodiment of the present application, which can be applied to Figure 2 In the reasoning system shown in Figure 8 As shown, the reasoning task processing method provided in this embodiment includes:
[0126] S801. The cloud receives the inference task sent by the client, and sends the inference task to the inference application end, where the inference task includes item feature data.
[0127] S802: The reasoning application determines a target reasoning model for processing the reasoning task according to the task type of the reasoning task.
[0128] S803: The inference application generates and sends a first inference request to the consensus node cluster based on the item feature data and the model identifier of the target inference model.
[0129] S804: The consensus node cluster performs block confirmation on the first inference request, and when the confirmation result is passed, generates a second inference request based on the item feature data carried in the first inference request.
[0130] S805. The consensus node cluster determines the target accounting node for processing the reasoning task according to the model identifier carried in the first reasoning request, and sends the second reasoning request to the target accounting node.
[0131] S806. The target accounting node uses the target reasoning model to perform reasoning operations on the item feature data, generates reasoning results, and sends the reasoning results to the client through the cloud.
[0132] In this embodiment, an inference system is set up to include a cloud, an inference application end, a consensus node cluster and an accounting node cluster, and an inference task sent by a client is received through the cloud, and the inference task is sent to the inference application end, wherein the inference task includes item feature data; the inference application end determines a target inference model for processing the inference task according to the task type of the inference task, and generates and sends a first inference request to the consensus node cluster according to the item feature data and the model identifier of the target inference model; the consensus node cluster performs block confirmation on the first inference request, and when the confirmation result is passed, generates a second inference request according to the item feature data carried in the first inference request, and at the same time, determines a target accounting node for processing the inference task according to the model identifier carried in the first inference request, and sends the second inference request to the target accounting node; the target accounting node uses the target inference model to perform inference operation on the item feature data, generates an inference result, and sends the inference result to the client through the cloud. A blockchain-based reasoning task processing network is implemented, through which sample data from all edge nodes in the traditional reasoning system are aggregated. This not only makes up for the singleness of node data in traditional solutions, but also realizes point-to-point confirmation of the target reasoning model and confirmation of the feasibility of reasoning tasks based on the consensus mechanism by setting up the reasoning application end and the consensus node cluster, thereby greatly reducing the amount of interaction between edge nodes and the cloud, and greatly improving reasoning efficiency and accuracy.
[0133] Embodiment 2
[0134] Fig. 9 A schematic diagram of the structure of an inference task processing device provided in an embodiment of the present application, the device can be implemented by software and / or hardware, and can be integrated into a target accounting node in an accounting node cluster, the accounting node cluster is located in an inference system, such as Figure 2 As shown in Figure 1, the inference system also includes an inference application end, a consensus node cluster, and a cloud. Fig. 9 As shown, the reasoning task processing device 100 in this embodiment includes:
[0135] The communication module 110 and the processing module 120 .
[0136] The communication module 110 is used to receive a second inference request sent by the consensus node cluster. The second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed. The first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model. The target inference model is determined by the inference application end for the inference task from multiple inference models in the accounting node cluster according to the task type of the inference task. The inference task is obtained from the client by the inference application end through the cloud. The inference task and the second inference request both include item feature data. The model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node.
[0137] The processing module 120 is used to perform reasoning operations on the item feature data using the target reasoning model to generate reasoning results;
[0138] The communication module 110 is also used to send the inference result to the client through the cloud.
[0139] Optionally, the processing module 120 is further configured to:
[0140] Obtain sample data of other accounting nodes in the accounting node cluster;
[0141] Generate a sample database based on the sample data of other accounting nodes and the sample data of the target accounting node;
[0142] According to the task type, the sample data in the sample database and the parameter adjustment algorithm are used to adjust the initial model parameters in the initial reasoning model to obtain the target reasoning model.
[0143] Optionally, the processing module 120 is specifically configured to:
[0144] Obtain target sample data matching the task type from a sample database, where the target sample data includes training data and target values;
[0145] Substituting the training data into the initial inference model to perform inference operation and obtain a first inference value;
[0146] According to the first inference value and the target value, a parameter adjustment algorithm is used to adjust the initial model parameters to obtain a target inference model.
[0147] Optionally, the parameter adjustment algorithm includes a first upper limit value, a first lower limit value, a loss function and an assignment function; the processing module 120 is specifically used to:
[0148] Determine whether the loss function converges according to the first inference value and the target value;
[0149] If it is determined that the loss function does not converge according to the first inference value and the target value, the first model parameter is generated by using the first assignment function or the second assignment function in the assignment function according to the magnitude relationship between the first inference value and the target value, the first upper limit value, and the first lower limit value;
[0150] The initial reasoning model is updated according to the first model parameter to obtain a first reasoning model;
[0151] Substituting the training data into the first inference model to perform inference operation to obtain a second inference value;
[0152] Determining whether the loss function converges according to the second inference value and the target value;
[0153] If the loss function is determined to converge based on the second inference value and the target value, the first inference model is determined as the target inference model.
[0154] Optionally, the assignment function includes a first function and a second function; the processing module 120 is specifically used for:
[0155] If the first inference value is greater than the target value, the first upper limit value and the first lower limit value are substituted into the first function to obtain a second upper limit value;
[0156] Substituting the second upper limit value and the first lower limit value into the second function, first model parameters are obtained.
[0157] Optionally, the processing module 120 is further configured to:
[0158] If it is determined that the loss function does not converge according to the second inference value and the target value, the first assignment function or the second assignment function in the assignment function is used to generate the second model parameter according to the magnitude relationship between the second inference value and the target value, the second upper limit value and the first lower limit value;
[0159] Updating the first reasoning model according to the second model parameters to obtain a second reasoning model;
[0160] Substituting the training data into the second inference model to perform inference operation to obtain a third inference value;
[0161] Determining whether the loss function converges according to the third inference value and the target value;
[0162] If the loss function is determined to converge based on the third inference value and the target value, the second inference model is determined as the target inference model.
[0163] Optionally, the assignment function includes a third function and a fourth function; the processing module 120 is specifically used for:
[0164] If the first inference value is less than the target value, the first upper limit value and the first lower limit value are substituted into the third function to obtain a second lower limit value;
[0165] Substitute the first upper limit value and the second lower limit value into the fourth function to obtain the first model parameter.
[0166] Optionally, the processing module 120 is further configured to:
[0167] If it is determined that the loss function does not converge according to the second inference value and the target value, the first assignment function or the second assignment function in the assignment function is used to generate the second model parameter according to the magnitude relationship between the second inference value and the target value, the first upper limit value, and the second lower limit value;
[0168] Updating the first reasoning model according to the second model parameters to obtain a second reasoning model;
[0169] Substituting the training data into the second inference model to perform inference operation to obtain a third inference value;
[0170] Determining whether the loss function converges according to the third inference value and the target value;
[0171] If the loss function is determined to converge based on the third inference value and the target value, the second inference model is determined as the target inference model.
[0172] Optionally, the processing module 120 is specifically configured to:
[0173] Substitute the first inference value and the target value into the loss function to calculate the loss value;
[0174] Determine whether the loss value is less than the allowable value;
[0175] If so, it is determined that the loss function converges.
[0176] The reasoning task processing device provided in this embodiment can execute the reasoning task processing method provided in the above method embodiment, and has the corresponding functional modules and beneficial effects of the execution method. The implementation principle and technical effects of this embodiment are similar to those of the above method embodiment, and will not be repeated here.
[0177] Embodiment 3
[0178] Fig.10 A schematic diagram of a target accounting node provided in an embodiment of the present application, the target accounting node may be Figure 2 Any accounting node in the accounting node cluster shown, the target accounting node can be an electronic device such as a server or an intelligent terminal, such as Fig.10 As shown, the target accounting node 2400 includes a memory 2401, a processor 2402, and a computer program stored in the memory and executable on the processor; the number of processors 2402 in the target accounting node 2400 may be one or more. Fig.10A processor 2402 is taken as an example; the processor 2402 and the memory 2401 in the target accounting node 2400 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0179] The memory 2401, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the communication module 110 and the processing module 120 in the embodiment of the present application. The processor 2402 executes various functional applications and data processing of the target accounting node by running the software programs, instructions and modules stored in the memory 2401, that is, realizes the above-mentioned reasoning task processing method.
[0180] The memory 2401 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 2401 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 2401 may further include a memory remotely arranged relative to the processor 2402, and these remote memories may be connected to the target accounting node via a grid. Examples of the above-mentioned grid include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0181] Embodiment 4
[0182] Embodiment 4 of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a computer processor, it is used to perform a method for processing an inference task. The method includes:
[0183] Receive a second inference request sent by the consensus node cluster, the second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed, the first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model, the target inference model is determined by the inference application end for the inference task from multiple inference models in the accounting node cluster according to the task type of the inference task, the inference task is obtained from the client by the inference application end through the cloud, the inference task and the second inference request both include item feature data, and the model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node;
[0184] Use the target reasoning model to perform reasoning operations on the item feature data to generate reasoning results;
[0185] The inference results are sent to the client through the cloud.
[0186] Of course, the computer-readable storage medium provided in the embodiment of the present application, whose computer program is not limited to the method operations described above, can also execute related operations in the reasoning task processing method provided in any embodiment of the present application.
[0187] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or grid device, etc.) to execute the methods described in each embodiment of the present application.
[0188] It is worth noting that in the embodiment of the above-mentioned reasoning task processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0189] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for processing an inference task, characterized in that: The method is applied to a target accounting node in an accounting node cluster, wherein the accounting node cluster is located in an inference system, wherein the inference system further includes an inference application end, a consensus node cluster, and a cloud. The method includes: Receive a second inference request sent by the consensus node cluster, the second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed, the first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model, the target inference model is determined by the inference application end for the inference task from multiple inference models in the accounting node cluster according to the task type of the inference task, the inference task is obtained from the client by the inference application end through the cloud, the inference task and the second inference request both include the item feature data, and the model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node; Using the target reasoning model to perform reasoning operations on the item feature data to generate reasoning results; The inference result is sent to the client via the cloud.
2. The method according to claim 1, characterized in that The target reasoning model is obtained by training the initial reasoning model by the target accounting node based on the following method: Obtaining sample data of other accounting nodes in the accounting node cluster; Generate a sample database according to the sample data of the other accounting nodes and the sample data of the target accounting node; According to the task type, the sample data in the sample database and the parameter adjustment algorithm are used to adjust the initial model parameters in the initial reasoning model to obtain the target reasoning model.
3. The method according to claim 2, wherein for the task type, the initial model parameters in the initial reasoning model are adjusted using the sample data in the sample database and the parameter adjustment algorithm to obtain the target reasoning model, comprising: Acquire target sample data matching the task type in the sample database, wherein the target sample data includes training data and target values; Substituting the training data into the initial inference model to perform inference operation to obtain a first inference value; According to the first inference value and the target value, a parameter adjustment algorithm is used to adjust the initial model parameters to obtain the target inference model.
4. The method according to claim 3, characterized in that The parameter adjustment algorithm includes a first upper limit value, a first lower limit value, a loss function and an assignment function; the parameter adjustment algorithm is used to adjust the initial model parameters according to the first inference value and the target value to obtain the target inference model, including: Determining whether the loss function converges according to the first inference value and the target value; If it is determined that the loss function does not converge according to the first inference value and the target value, then according to the magnitude relationship of the first inference value relative to the target value, the first upper limit value and the first lower limit value, the first assignment function or the second assignment function in the assignment function is used to generate the first model parameter; Updating the initial reasoning model according to the first model parameters to obtain a first reasoning model; Substituting the training data into the first inference model to perform inference operation to obtain a second inference value; Determining whether the loss function converges according to the second inference value and the target value; If it is determined that the loss function converges based on the second inference value and the target value, the first inference model is determined as the target inference model.
5. The method according to claim 4, characterized in that The first assignment function includes a first function and a second function; the first assignment function or the second assignment function in the assignment function is used to generate the first model parameter according to the magnitude relationship between the first inference value and the target value, the first upper limit value and the first lower limit value, including: If the first inference value is greater than the target value, substituting the first upper limit value and the first lower limit value into the first function to obtain a second upper limit value; Substitute the second upper limit value and the first lower limit value into the second function to obtain the first model parameter.
6. The method according to claim 5, characterized in that The method further comprises: If it is determined that the loss function does not converge according to the second inference value and the target value, the first assignment function or the second assignment function in the assignment function is used to generate a second model parameter according to the magnitude relationship of the second inference value relative to the target value, the second upper limit value and the first lower limit value; Updating the first reasoning model according to the second model parameters to obtain a second reasoning model; Substituting the training data into the second inference model to perform inference operation to obtain a third inference value; Determining whether the loss function converges according to the third inference value and the target value; If it is determined that the loss function converges based on the third inference value and the target value, the second inference model is determined as the target inference model.
7. The method according to claim 4, characterized in that The second value assignment function includes a third function and a fourth function; the first value assignment function or the second value assignment function in the value assignment function is used to generate the first model parameter according to the magnitude relationship between the first inference value and the target value, the first upper limit value and the first lower limit value, including: If the first inference value is less than the target value, substituting the first upper limit value and the first lower limit value into the third function to obtain a second lower limit value; Substitute the first upper limit value and the second lower limit value into the fourth function to obtain the first model parameter.
8. The method according to claim 7, characterized in that The method further comprises: If it is determined that the loss function does not converge according to the second inference value and the target value, the first assignment function or the second assignment function in the assignment function is used to generate a second model parameter according to the magnitude relationship of the second inference value relative to the target value, the first upper limit value and the second lower limit value; Updating the first reasoning model according to the second model parameters to obtain a second reasoning model; Substituting the training data into the second inference model to perform inference operation to obtain a third inference value; Determining whether the loss function converges according to the third inference value and the target value; If it is determined that the loss function converges based on the third inference value and the target value, the second inference model is determined as the target inference model.
9. The method according to claim 4, characterized in that The determining, according to the first inference value and the target value, whether the loss function converges includes: Substituting the first inference value and the target value into the loss function to calculate the loss value; Determining whether the loss value is less than an allowable value; If so, it is determined that the loss function converges.
10. A reasoning task processing device, characterized in that: A target accounting node integrated in an accounting node cluster, wherein the accounting node cluster is located in an inference system, wherein the inference system further includes an inference application end, a consensus node cluster and a cloud, and wherein the device includes: A communication module, used for receiving a second inference request sent by the consensus node cluster, the second inference request is generated by the consensus node cluster according to the item feature data carried in the first inference request when the confirmation result is passed, the first inference request is generated by the inference application end according to the item feature data and the model identifier of the target inference model, the target inference model is determined for the inference task by the inference application end from multiple inference models in the accounting node cluster according to the task type of the inference task, the inference task is obtained from the client by the inference application end through the cloud, the inference task and the second inference request both include the item feature data, and the model identifier of the target inference model is used by the consensus node cluster to determine the target accounting node; A processing module, used to perform reasoning operations on the item feature data using the target reasoning model to generate a reasoning result; The communication module is also used to send the inference result to the client through the cloud.
11. A target accounting node, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for processing an inference task as described in any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the inference task processing method as described in any one of claims 1 to 9 is implemented.
13. An inference system, characterized in that include: A cloud, an inference application end, a consensus node cluster and an accounting node cluster, wherein the accounting node cluster includes the target accounting node as described in claim 11.
14. The system according to claim 13, characterized in that The consensus node cluster includes a master consensus node and multiple slave consensus nodes, and the master consensus node is used to: Sending an endorsement request to the plurality of slave consensus nodes, wherein the endorsement request includes the item feature data and the model identifier; Receiving the endorsement feedbacks sent by the plurality of slave consensus nodes, wherein the endorsement feedbacks include simulation results and endorsement signatures; Based on the simulation result and the endorsement signature, a preset consensus algorithm is used to verify the feasibility of the first reasoning request; If it is determined that the first inference request is feasible, the block confirmation is passed.
15. The system according to claim 14, characterized in that The master consensus node is specifically used for: Based on the endorsement signatures of the multiple slave consensus nodes, the endorsement verification algorithm is used to perform endorsement verification; If the endorsement verification is passed, the block verification is performed using the block verification algorithm based on the simulation results of the multiple slave consensus nodes; If the block verification passes, it is confirmed that the first reasoning request is feasible.
16. The system according to claim 15, characterized in that The endorsement verification based on the endorsement signatures of the multiple slave consensus nodes is performed using the endorsement verification algorithm, including: Determine the first number of slave consensus nodes that have passed the endorsement signature; confirming whether the first number is greater than a first threshold; If yes, the endorsement verification succeeds.
17. The system according to claim 15, characterized in that The block verification is performed based on the simulation results of the multiple slave consensus nodes using the block verification algorithm, including: Determine a second number of slave consensus nodes for which the simulation result is successful; confirming whether the second number is greater than a second threshold; If yes, the block verification is successful.
18. The system according to claim 14, characterized in that The multiple slave consensus nodes are used to: Receiving the endorsement request sent by the master consensus node; Performing reasoning simulation based on the item feature data and the model identifier to generate a simulation result; Signing the simulation result to obtain the endorsement signature; generating the endorsement feedback according to the simulation result and the endorsement signature; The endorsement feedback is sent to the master consensus node.
