Data prediction processing method and model contract processing method based on block chain

The method optimizes blockchain data processing by integrating machine learning models across nodes for diverse applications, reducing resource consumption and operational complexity while ensuring accurate predictions through consensus-based integration.

CN120316151APending Publication Date: 2025-07-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410060999.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-15
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

Traditional blockchain network-based data processing methods consume too much resources, the training and deployment of models are cumbersome, the data processing efficiency is low, and the model needs to be retrained when the data set changes.

Method used

By receiving data prediction requests, obtaining object identification and target data, accessing contract warehouses to obtain machine learning model contracts, performing data prediction processing, and obtaining integrated prediction results through broadcasting and consensus, reducing cumbersome operations and resource consumption.

Benefits of technology

It improves the data processing efficiency of blockchain networks, increases the diversity of models and the accuracy of prediction results, and maintains the stability and accuracy of decentralization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316151A_ABST
    Figure CN120316151A_ABST
Patent Text Reader

Abstract

The invention relates to a block chain-based data prediction processing method, a model contract processing method, and a block chain system and device. The method comprises the steps of obtaining a first object identifier, target data and a prediction service type carried by a data prediction request, if data verification of the first object identifier passes, obtaining machine learning model contracts matched with the prediction service type, calling the machine learning model contracts to perform data prediction processing on the target data, and obtaining a prediction result of the target data; and obtaining a plurality of first prediction results and storing the first prediction results in the new block, feeding back the target data to each slave node, and storing a plurality of obtained second prediction results in the new block through the slave nodes. And performing broadcasting and consensus based on each first prediction result and each second prediction result to obtain a plurality of block prediction results, and if it is determined that verification of each block prediction result is passed, obtaining an integrated prediction result corresponding to the target data. By adopting the method, a plurality of model contracts can be integrated for prediction, and an accurate prediction result is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular, to a data prediction processing method, a model contract processing method, a blockchain system, a device, a computer device, a storage medium, and a computer program product based on blockchain. Background Art

[0002] With the development of blockchain technology and the popularization and application of various resource interaction services, in order to improve the processing efficiency of business data based on the blockchain network, a method has emerged in which a data processing model is deployed in the blockchain network, so that the deployed data processing model can be called from the blockchain network to identify and predict business data on the blockchain network.

[0003] However, the traditional method of deploying a data processing model based on the blockchain network to directly call the data processing model to identify and predict business data on the blockchain network requires a lot of resources to train and deploy different data processing models separately according to different scenarios in different application scenarios, such as application promotion, business recommendation, or resource interaction data statistical processing. And if there are large changes in the dataset to be predicted, the model needs to be retrained and then uploaded to the blockchain network before data processing can continue. Therefore, the traditional data processing method based on the blockchain network still has problems of excessive resource consumption and cumbersome operations for training and deploying models, and thus its data processing efficiency still needs to be improved. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a data prediction processing method, a model contract processing method, a blockchain system, a device, a computer device, a storage medium, and a computer program product based on blockchain that can reduce cumbersome operations and resource consumption and improve the data processing efficiency of the blockchain network.

[0005] In a first aspect, this application provides a data prediction processing method based on blockchain, including:

[0006] Receiving a data prediction request, and obtaining a first object identifier, target data to be predicted, and a prediction service type carried by the data prediction request;

[0007] If it is determined that the data verification for the first object identifier passes, accessing a contract repository deployed on the blockchain network, and obtaining matching machine learning model contracts according to the prediction service type;

[0008] Invoking each of the machine learning model contracts to perform data prediction processing on the target data respectively, obtaining a plurality of first prediction results, and storing each of the first prediction results in a newly created block;

[0009] Feedback the target data to each slave node in the blockchain network, and store the obtained multiple second prediction results into the newly created block through each slave node; the second prediction result is obtained by the slave node through data prediction processing based on the target data;

[0010] Perform broadcasting and consensus based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, obtain an integrated prediction result corresponding to the target data.

[0011] In a second aspect, the present application provides a method for processing a model contract based on a blockchain, including:

[0012] Receive a machine learning model contract deployment request, and obtain a second object identifier carried by the machine learning model contract deployment request, and each machine learning model contract;

[0013] Perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and the permission verification pass, send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract into a contract warehouse through each blockchain node; each machine learning model contract is respectively used to perform data prediction processing on the target data to obtain multiple first prediction results and multiple second prediction results, and each first prediction result and each second prediction result are used to perform broadcasting and consensus to obtain multiple block prediction results. If it is determined that the verification of each block prediction result passes, obtain an integrated prediction result corresponding to the target data;

[0014] Receive the confirmation information of successful storage feedback by each blockchain node, and store each confirmation information and each machine learning model contract into the blockchain network;

[0015] If it is detected that the consensus based on the blockchain network passes, determine that the deployment processing operation of each machine learning model contract is completed.

[0016] In a third aspect, the present application further provides a blockchain system, the system includes a terminal device and a blockchain network, the blockchain network includes a blockchain master node, multiple slave nodes and a contract warehouse, and multiple machine learning model contracts are stored in the contract warehouse; wherein:

[0017] The terminal device is used to detect a data prediction request and feedback the data prediction request to the blockchain network;

[0018] The blockchain master node is used to receive the data prediction request, and obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request; if it is determined that the data verification for the first object identifier passes, it accesses the contract warehouse deployed in the blockchain network, and obtains each machine learning model contract that matches according to the prediction service type; and feeds back the target data to each slave node in the blockchain network;

[0019] The machine learning model contract is used to perform data prediction processing on the target data respectively, obtain multiple first prediction results, and store each of the first prediction results in a newly created block;

[0020] The slave node is used to call each of the machine learning model contracts deployed by itself to perform data prediction processing, and respectively generate corresponding second prediction results and store them in the newly created block;

[0021] The blockchain master node is further used to broadcast and reach a consensus based on each of the first prediction results and each of the second prediction results, obtain multiple block prediction results, and if each blockchain node determines that the verification of each of the block prediction results passes, obtain an integrated prediction result corresponding to the target data.

[0022] In an exemplary embodiment, the terminal device is further used to: detect a machine learning model contract deployment request, and feed back the machine learning model contract deployment request to the blockchain network;

[0023] The blockchain master node is further used to: receive the machine learning model contract deployment request, and obtain the second object identifier carried in the machine learning model contract deployment request, and each machine learning model contract; perform information verification and permission verification based on the second object identifier, if it is determined that the information verification and the permission verification pass, then send each of the machine learning model contracts to each blockchain node in the blockchain network, and store each of the machine learning model contracts in the contract warehouse through each blockchain node; receive the confirmation information of successful storage fed back by each blockchain node, and store each of the confirmation information and each machine learning model contract in the blockchain network; if it is detected that the consensus based on the blockchain network passes, then determine that the deployment processing operation of each of the machine learning model contracts is completed.

[0024] Fourthly, the present application further provides a data prediction processing device based on a blockchain, including:

[0025] A data prediction request receiving module, which is used to receive a data prediction request, and obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request;

[0026] A machine learning model contract acquisition module, configured to access a contract repository deployed on a blockchain network and obtain matching machine learning model contracts according to the predicted service type if it is determined that the data verification for the first object identifier passes;

[0027] A first prediction result storage module, configured to call each of the machine learning model contracts, perform data prediction processing on the target data respectively to obtain multiple first prediction results, and store each of the first prediction results in a newly created block;

[0028] A second prediction result storage module, configured to feedback the target data to each slave node in the blockchain network, and store multiple second prediction results obtained by each slave node in the newly created block through each slave node; the second prediction result is obtained by the slave node performing data prediction processing based on the target data;

[0029] An integrated prediction result acquisition module, configured to perform broadcasting and consensus based on each of the first prediction results and each of the second prediction results to obtain multiple block prediction results, and if each blockchain node determines that the verification of each of the block prediction results passes, obtain an integrated prediction result corresponding to the target data.

[0030] In a fifth aspect, the present application further provides a model contract processing device based on a blockchain, including

[0031] A machine learning model contract deployment request receiving module, configured to receive a machine learning model contract deployment request, and obtain a second object identifier carried in the machine learning model contract deployment request, and each machine learning model contract;

[0032] A machine learning model contract storage module, configured to perform information verification and permission verification based on the second object identifier, and if it is determined that the information verification and the permission verification pass, send each of the machine learning model contracts to each blockchain node in the blockchain network, and store each of the machine learning model contracts in a contract repository through each blockchain node; each of the machine learning model contracts is respectively configured to perform data prediction processing on the target data to obtain multiple first prediction results and multiple second prediction results, and each of the first prediction results and each of the second prediction results are used for broadcasting and consensus to obtain multiple block prediction results, and if it is determined that the verification of each of the block prediction results passes, obtain an integrated prediction result corresponding to the target data;

[0033] A confirmation information receiving module, configured to receive confirmation information of successful storage feedback by each blockchain node, and store each of the confirmation information and each of the machine learning model contracts in the blockchain network;

[0034] A deployment processing operation completion module is used to determine that the deployment processing operations of all the machine learning model contracts are completed if it is detected that the consensus based on the blockchain network is passed.

[0035] In a sixth aspect, the present application further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method in the first aspect or its various implementation manners described above is implemented.

[0036] In a seventh aspect, the present application further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method in the second aspect or its various implementation manners described above is implemented.

[0037] In an eighth aspect, 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 processor, the method in the first aspect or its various implementation manners described above is implemented.

[0038] In a ninth aspect, 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 processor, the method in the second aspect or its various implementation manners described above is implemented.

[0039] In a tenth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the method in the first aspect or its various implementation manners described above is implemented.

[0040] In an eleventh aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the method in the second aspect or its various implementation manners described above is implemented.

[0041] In the above-mentioned blockchain-based data prediction processing method, model contract processing method, blockchain system, device, computer equipment, storage medium, and computer program product, by obtaining the first object identifier, target data to be predicted, and prediction service type carried in the received data prediction request, and when it is determined that the data verification for the first object identifier passes, accessing the contract repository deployed in the blockchain network to obtain various machine learning model contracts that match according to the prediction service type. Thus, different machine learning model contracts that can support different prediction service types can be provided, enabling integrated learning prediction based on multiple machine learning model contracts, allowing different nodes to use different models for prediction, increasing the diversity of the models, and obtaining more accurate prediction results. Further, by invoking each machine learning model contract, performing data prediction processing on the target data respectively to obtain multiple first prediction results, storing each first prediction result in a newly created block, and further feeding back the target data to each slave node in the blockchain network, so that each slave node stores multiple second prediction results obtained by performing data prediction processing on the target data in the newly created block. Furthermore, broadcasting and consensus can be performed based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, an integrated prediction result corresponding to the target data is obtained. That is, by introducing a multi-result consensus method, allowing multiple prediction results to exist and reach a consensus in the blockchain network helps to ensure the stability and accuracy of the entire blockchain system when facing different tasks and data distributions while maintaining decentralization. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0043] Figure 1 It is a schematic structural diagram of a data sharing system in an embodiment;

[0044] Figure 2 It is a schematic structural diagram of a blockchain in an embodiment;

[0045] Figure 3 It is a schematic diagram of the generation process of a newly created block in an embodiment;

[0046] Figure 4 It is an application environment diagram of a blockchain-based data prediction processing method and a model contract processing method in an embodiment;

[0047] Figure 5 Schematic flowchart of a blockchain-based data prediction processing method in an embodiment;

[0048] Figure 6 Schematic flowchart of a blockchain-based data prediction processing method in another embodiment;

[0049] Figure 7 Schematic flowchart of a blockchain-based model contract processing method in an embodiment;

[0050] Figure 8 Schematic diagram of the architecture of a blockchain system in an embodiment;

[0051] Figure 9 Schematic diagram of the storage distribution of model contracts in blockchain nodes in an embodiment;

[0052] Figure 10 Schematic diagram of the block content structure in an embodiment;

[0053] Figure 11 Schematic diagram of an integrated learning model correction mechanism in an embodiment;

[0054] Figure 12 Schematic diagram of the architecture of a blockchain system in another embodiment;

[0055] Figure 13 Schematic diagram of the model contract installation process based on a blockchain system in an embodiment;

[0056] Figure 14 Schematic diagram of the data prediction processing process based on a blockchain system in an embodiment;

[0057] Figure 15 Block diagram of the structure of a blockchain-based data prediction processing device in an embodiment;

[0058] Figure 16 Block diagram of the structure of a blockchain-based model contract processing device in an embodiment;

[0059] Figure 17 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0060] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] Before specific description, some terms related to this application are described. Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain, in essence, is a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block. The blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.

[0062] The blockchain underlying platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and maintaining the correspondence between the real identity of the user and the blockchain address (permission management). And under the authorization, it supervises and audits the transaction situations of certain real identities, and provides the rule configuration for risk control (risk control audit); the basic service module is deployed on all blockchain node devices, used to verify the validity of business requests, and record them on the storage after consensus for valid requests. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through the consensus algorithm (consensus management), transmits it to the shared ledger completely and consistently after encryption (network communication), and performs record storage; the smart contract module is responsible for the registration and issuance of contracts, contract triggering, and contract execution. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), trigger the execution by calling keys or other events according to the logic of the contract terms, complete the contract logic, and at the same time provide the functions of contract upgrade and cancellation; the operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during the product release process, and the visual output of the real-time state during the product operation, such as: alarm, monitoring network conditions, monitoring the health status of node devices, etc. The platform product service layer provides the basic capabilities and implementation frameworks of typical applications. Developers can build on these basic capabilities and overlay the characteristics of the business to complete the blockchain implementation of the business logic. The application service layer provides application services based on the blockchain solution for business participants to use.

[0063] The blockchain-based interactive service processing method provided in the embodiment of this application specifically relates to blockchain technology and can be applied to a data sharing system. See Figure 1The data sharing system shown. The data sharing system 100 refers to a system used for data sharing between nodes. This data sharing system may include multiple nodes 101, and the multiple nodes 101 may refer to each client in the data sharing system. Each node 101 can receive input information during normal operation and maintain the shared data within the data sharing system based on the received input information. To ensure information interconnection within the data sharing system, there can be information connections between each node in the data sharing system, and nodes can transmit information through the above-mentioned information connections. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system is consistent.

[0064] For each node in the data sharing system, there is a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so as to broadcast the generated block to other nodes in the data sharing system according to the node identifiers of other nodes in the future. Each node can maintain a node identifier list as shown in the following table, and store the node name and the node identifier corresponding to each other in the node identifier list. Among them, the node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify the node.

[0065] Each node in the data sharing system stores the same blockchain (BlockChain). The blockchain consists of multiple blocks. See Figure 2 , the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp, and difficulty value. The block body stores the input information. The next block of the genesis block uses the genesis block as the parent block. The next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value of the parent block, version number, timestamp, and difficulty value, and so on. In this way, the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0066] The specific types of blockchain include public blockchains, private blockchains, and consortium blockchains. Among them, a public blockchain (Public Blockchain) is a publicly owned blockchain, where the permissions for access and writing are open to everyone. A private blockchain (Private Blockchain) is a privately owned blockchain, where the permissions for access and writing are controlled only by a certain organization or institution. A consortium blockchain (Consortium Blockchain) is a blockchain of institutional alliances, where the permissions for access and writing are only open to the nodes that join the alliance. The differences between different types of blockchains lie in the permissions for access and writing, as well as the degree of decentralization.

[0067] Specifically, when generating each block in the blockchain, refer to Figure 3 , including steps such as submitting transactions, broadcasting transactions, pre-executing transactions, proposing blocks, verifying blocks, consensus voting, and submitting blocks. Specifically, a client submits a blockchain transaction, such as a contract creation, call transaction, certificate management transaction, etc. Then, the transaction is broadcast to other nodes in the alliance through the network. Next, the block-producing node selects a batch of transactions from the transaction pool, schedules and executes them in parallel to obtain results, generates a directed acyclic graph, and broadcasts the generated block and the directed acyclic graph to other consensus nodes through the consensus module. During the process of verifying the block, the proposed block is received, the transactions are executed in parallel based on the directed acyclic graph, and it is verified whether the results are consistent. If the results are consistent, then based on the corresponding consensus mechanism, a consensus vote is carried out on the proposed block. The block that has completed the consensus vote is submitted to the ledger for recording and the disk write operation is completed.

[0068] The data prediction processing method based on blockchain and the model contract processing method based on blockchain provided in the embodiments of this application can be applied to, for example Figure 4In the application environment shown. The application environment includes a terminal device 402 and a blockchain network 404, and the blockchain network 404 includes multiple blockchain nodes, including a blockchain master node 406 and slave nodes 408. A contract repository 410 is also deployed in the blockchain network 404, and the contract repository 410 includes multiple machine learning model contracts 412. Specifically, taking the example of the terminal device 402 and the blockchain network 404 collaborating to implement a blockchain-based data prediction processing method, when the terminal device 402 detects a data prediction request triggered by a user, it sends the data prediction request to the blockchain network 404. When the blockchain master node 406 in the blockchain network 404 receives the data prediction request, it parses the data prediction request to obtain the first object identifier, the target data to be predicted, and the prediction service type carried by the data prediction request. Among them, if the blockchain master node 406 determines that the data verification for the first object identifier passes, it accesses the contract repository 410 deployed in the blockchain network 404 and obtains the matching machine learning model contracts 412 from the contract repository 410 according to the prediction service type. Further, the blockchain master node 406 performs data prediction processing on the target data by calling each machine learning model contract, obtains multiple first prediction results, and stores each first prediction result in a newly created block. Among them, the blockchain master node 406 feeds back the target data to each slave node 408 in the blockchain network 404, and each slave node 408 stores the multiple second prediction results obtained in the newly created block. Specifically, the target data is fed back to each slave node 408 in the blockchain network 404, and each slave node 408 calls the machine learning model contracts 412 deployed by itself to perform data prediction processing and generates corresponding second prediction results. Further, the blockchain master node 406 and each slave node 408 in the blockchain network 404 broadcast and reach a consensus based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node in the blockchain network 404 determines that the verification of each block prediction result passes, an integrated prediction result corresponding to the target data is obtained.

[0069] Similarly, taking the collaborative implementation of a blockchain-based model contract processing method by the terminal device 402 and the blockchain network 404 as an example, when the terminal device 402 detects a machine learning model contract deployment request triggered by a usage object, it sends the machine learning model contract deployment request to the blockchain network 404. After receiving the machine learning model contract deployment request, the blockchain master node 406 in the blockchain network 404 parses the machine learning model contract deployment request to obtain the second object identifier carried by the machine learning model contract deployment request and each machine learning model contract. Among them, the blockchain master node 406 performs information verification and permission verification based on the second object identifier. If it is determined that the information verification and permission verification are passed, each machine learning model contract is sent 412 to each blockchain node in the blockchain network 404, and each machine learning model contract is stored in the contract repository 410 through each blockchain node. Among them, each machine learning model contract 412 is respectively used to perform data prediction processing on target data to obtain a plurality of first prediction results and a plurality of second prediction results. Each first prediction result and each second prediction result are used for broadcasting and consensus to obtain a plurality of block prediction results. If it is determined that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained. Further, the blockchain master node 406 stores each confirmation information and each machine learning model contract 412 in the blockchain network 404 by receiving the confirmation information of successful storage fed back by each blockchain node. If the blockchain master node 406 detects that the consensus based on the blockchain network is passed, it is determined that the deployment processing operation of each machine learning model contract is completed.

[0070] Among them, the terminal device 402 can be, but is not limited to, various personal computers, laptop computers, smartphones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The multiple blockchain nodes (such as the blockchain master node 406 and the slave node 408) included in the blockchain network 404 can be implemented by independent servers or a server cluster composed of multiple servers. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, intelligent transportation, and assisted driving, etc.

[0071] In an exemplary embodiment, as Figure 5 shown, a blockchain-based data prediction processing method is provided. Taking this method applied to Figure 4 the blockchain master node 406 as an example, the following steps S502 to step S510 are included. Among them:

[0072] Step S502: Receive a data prediction request, and obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request.

[0073] Specifically, the terminal device establishes communication with the blockchain network. When the terminal device detects a data prediction request triggered by a usage object, it sends the detected data prediction request to the blockchain network. After receiving the data prediction request, the blockchain master node in the blockchain network parses the data prediction request to obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request.

[0074] Among them, the first object identifier carried in the data prediction request is used to represent the object identifier of the usage object that triggers the data prediction request. Through the first object identifier, the object credential data and object operation permissions corresponding to the usage object can be obtained. Among them, the object credential data is used to represent the credential information required for the usage object to access the target data or perform a target operation. This credential information is used to determine whether the usage object is a legitimate usage object, and the object operation permissions represent the read permissions, write permissions, and other operation permissions of the usage object, such as whether it has the permission to read or write data from the blockchain network, and whether it has the permission to delete or manage the data in the blockchain network.

[0075] Exemplarily, the target data to be predicted represents data resources that need to be predicted and processed in different application scenarios. For example, in different scenarios such as the financial business risk control field, the medical data analysis and evaluation field, the Internet of Things device management field, and the data personalized recommendation field, the target data to be predicted can specifically be a certain digital image or a digital image set including multiple digital images, or a single text data or a text data set including multiple text data, or multimedia data such as pictures or audio / video.

[0076] Among them, the prediction service type is used to represent the type of prediction processing service required for the target data, specifically including basic services and integrated learning services. Specifically, the basic service corresponds to an ordinary business contract and is used to process basic services in the blockchain network, including resource interaction services, contract deployment, etc., to ensure the normal operation of the blockchain network.

[0077] The integrated learning service corresponds to the machine learning model contract, which needs to integrate the processing results of multiple machine learning model contracts to obtain the integrated processing results. Exemplarily, when performing the prediction processing service on the target data, by integrating multiple machine learning model contracts, the prediction results of multiple machine learning model contracts can be obtained, thereby improving the overall computing power and flexibility, enabling different nodes to use different model contracts for prediction, increasing the diversity of model contracts, and improving the overall prediction performance.

[0078] In one embodiment, after receiving the data prediction request and obtaining the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request, it further includes:

[0079] Obtain the object credential data and object operation permissions corresponding to the first object identifier, and perform information verification based on the object credential data and permission verification on the object operation permissions to obtain the information verification result and the permission verification result; based on the information verification result and the permission verification result, determine whether the data verification for the first object identifier passes.

[0080] Specifically, after obtaining the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request, obtain the object credential data and object operation permissions corresponding to the first object identifier. Among them, the object credential data is used to represent the credential information required for the using object to access the target data or perform the target operation, and this credential information is used to determine whether the using object is a legitimate using object, while the object operation permissions represent the read permissions, write permissions, and other operation permissions of the using object, such as whether it has the permission to read or write data from the blockchain network, and whether it has the permission to delete or manage the data in the blockchain network, etc.

[0081] Furthermore, perform information verification based on the object credential data, that is, verify the credential information provided by the using object when accessing the target data or performing the target operation to determine whether the using object is a legitimate using object and obtain the corresponding information verification result.

[0082] Similarly, perform permission verification based on the object operation permissions, that is, verify the read permissions, write permissions, and other operation permissions of the using object to determine whether each operation permission of the using object includes the data prediction permission corresponding to the current data prediction request to obtain the corresponding permission verification result.

[0083] Step S504, if it is determined that the data verification for the first object identifier passes, then access the contract repository deployed in the blockchain network and obtain the matching machine learning model contracts according to the prediction service type.

[0084] Specifically, if it is determined that the data verification for the first object identifier passes based on the information verification result obtained from verifying information according to the object certificate data and the permission verification result obtained from verifying permissions based on the object operation permissions, access the contract repository deployed on the blockchain network, and obtain each machine learning model contract matching the prediction service type from the contract repository.

[0085] Among them, the information verification result includes information verification passed and information verification failed, and the permission verification result includes permission verification passed and permission verification failed. That is, if it is necessary to determine that the data verification for the first object identifier passes, information verification passed and permission verification passed are required.

[0086] Further, when accessing the contract repository deployed on the blockchain network to obtain the machine learning model contract, it is necessary to determine the specific type of the prediction service type. That is, if it is determined that the prediction service type is the ensemble learning service, based on the ensemble learning service and the target data to be predicted, determine the type and quantity of the required machine learning models, so as to access the contract repository deployed on the blockchain network to obtain each machine learning model contract required for executing the ensemble learning service from the contract repository.

[0087] Step S506, call each machine learning model contract to perform data prediction processing on the target data respectively, obtain multiple first prediction results, and store each first prediction result in a newly created block.

[0088] Specifically, call each determined machine learning model contract to perform data prediction processing on the target data respectively to obtain multiple first prediction results. Among them, after performing the data prediction processing, for each obtained first prediction result, create a new block in the blockchain network and store each first prediction result in the newly created block.

[0089] Among them, the target data to be predicted represents the data resources that need to be predicted under different application scenarios. For example, in different scenarios such as the financial business risk control field, the medical data analysis and evaluation field, the Internet of Things device management field, and the data personalized recommendation field, the target data to be predicted can specifically be a certain digital image or a digital image set including multiple digital images, or a single text data or a text data set including multiple text data, or multimedia data such as pictures or audio / video.

[0090] Exemplarily, in the field of financial business risk control, by deploying different types of machine learning model contracts such as multiple risk prediction models and risk identification models in the blockchain network, multi-node computing of heterogeneous contracts is achieved, and each blockchain node can use different model contracts to perform risk prediction on the target data to be predicted, such as the historical behavior data, historical lending data, and current behavior data of the user, etc., to obtain multiple different risk prediction results, and by integrating multiple different risk prediction results, the overall prediction performance and the accuracy of the risk prediction results can be improved.

[0091] Optionally, in the field of medical data analysis and evaluation, by deploying different types of machine learning models such as multiple medical image recognition models and medical data analysis and evaluation models in the blockchain network, multi-node computing of heterogeneous contracts is achieved, and each blockchain node can use different model contracts to perform risk analysis and evaluation on the target data to be predicted, such as historical medical data and current disease information, etc., to obtain multiple different analysis results or evaluation results, and by integrating multiple different analysis and evaluation results, the overall analysis performance and the accuracy of the risk analysis and evaluation results can be improved.

[0092] For example, in the field of Internet of Things device management, by deploying different types of machine learning models such as multiple device status monitoring models and fault prediction models in the blockchain network, multi-node computing of heterogeneous contracts is achieved, and each blockchain node can use different model contracts to perform status analysis and fault detection on the target data to be predicted, such as historical device status data, historical device operation data, current device status data, and current device operation data, etc., to obtain multiple different analysis results and detection results, and by integrating multiple different analysis results and detection results, the overall fault detection analysis performance and the accuracy of the fault detection results can be improved.

[0093] Again, for example, in the field of data personalized recommendation (such as advertising recommendation, content recommendation, product recommendation, etc.), by deploying different types of machine learning models such as multiple object behavior data analysis models and personalized data recommendation models in the blockchain network, multi-node computing of heterogeneous contracts is achieved, and each blockchain node can use different model contracts to perform analysis and prediction on the target data to be predicted, such as historical access data, historical purchase data, and current behavior data, etc., to obtain multiple different analysis results and prediction results, and by integrating multiple different analysis results and prediction results, the overall behavior data analysis performance and the accuracy of the personalized data recommendation results can be improved.

[0094] Step S508: Feed the target data back to each slave node in the blockchain network, and store the obtained multiple second prediction results in a newly created block through each slave node. The second prediction results are obtained by the slave nodes through data prediction processing based on the target data.

[0095] Specifically, after the blockchain master node calls each machine learning model contract for data prediction processing and obtains multiple first prediction results, it further feeds the target data back to each slave node in the blockchain network, so that each slave node can call each machine learning model contract deployed by itself for data prediction processing, respectively generate corresponding second prediction results, and store the obtained multiple second prediction results in a newly created block through each slave node.

[0096] Step S510: Perform broadcasting and consensus based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained.

[0097] Specifically, by storing both the first prediction results and the second prediction results in the newly created block, it indicates that the newly created block temporarily stores the prediction results of the blockchain master node and each slave node. The blockchain master node can broadcast each first prediction result to all blockchain nodes in the blockchain network, and each slave node can broadcast each second prediction result to all blockchain nodes in the blockchain network. Then, after all blockchain nodes receive each first prediction result and each second prediction result sent by other nodes, they store each first prediction result and each second prediction result sent by other nodes in the newly created block.

[0098] Among them, all blockchain nodes in the blockchain network, after storing each first prediction result and each second prediction result sent by other nodes in the newly created block, perform broadcasting and consensus again to obtain multiple block prediction results, and determine whether the block prediction results (including each first prediction result and each second prediction result) corresponding to the newly created block in each blockchain node are consistent.

[0099] Specifically, if it is determined that the block prediction results corresponding to the newly created block in each blockchain node are consistent, it indicates that the consensus is passed. Then, all blockchain nodes write the newly created block with passed consensus into the block ledger, and at the same time, all blockchain nodes write the status data in the processes such as broadcasting and consensus into the blockchain state database deployed in the blockchain network. Among them, the status data is a data structure used in the blockchain system to represent the current state of the system. The status data includes the balances of all accounts, the status of smart contracts, and other relevant information, and the status data is continuously updated as the business is executed, reflecting the global state of the blockchain system at a certain point in time.

[0100] Further, all blockchain nodes analyze and verify the block prediction results passed by consensus to determine whether the block prediction results are correct. If it is determined that all blockchain nodes have passed the verification of the block prediction results, that is, it indicates that the block prediction results corresponding to all blockchain nodes are correctly predicted, then an integrated prediction result corresponding to the target data is obtained. Among them, the integrated prediction result is understood as the prediction results obtained by separately predicting different machine learning model contracts on all blockchain nodes, thus realizing multi-node computing of heterogeneous contracts and further improving the accuracy of the prediction results.

[0101] In the above blockchain-based data prediction processing method, by obtaining the first object identifier, the target data to be predicted, and the prediction service type carried in the received data prediction request, and when it is determined that the data verification of the first object identifier passes, accessing the contract warehouse deployed in the blockchain network to obtain each machine learning model contract that matches according to the prediction service type, so that different machine learning model contracts that can support different prediction service types can be obtained, and thus integrated learning prediction based on multiple machine learning model contracts can be realized, enabling different nodes to use different models for prediction, increasing the diversity of the models, and obtaining more accurate prediction results. Further, by calling each machine learning model contract, the target data is separately subjected to data prediction processing to obtain multiple first prediction results, storing each first prediction result in a newly created block, and further feeding back the target data to each slave node in the blockchain network, so that each slave node stores the multiple second prediction results obtained in the newly created block. Furthermore, based on each first prediction result and each second prediction result, broadcasting and consensus can be performed to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, then an integrated prediction result corresponding to the target data is obtained, that is, by introducing a multi-result consensus method, allowing multiple prediction results to exist and reach consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system when facing different tasks and data distributions while maintaining decentralization.

[0102] In an exemplary embodiment, as Figure 6 shown, a blockchain-based data prediction processing method is provided. Taking the blockchain master node 406 in Figure 4 as an example for illustration, it includes the following steps S602 to step S620. Among them:

[0103] Step S602, receive a data prediction request, and obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request.

[0104] Specifically, the terminal device establishes communication with the blockchain network. When the terminal device detects a data prediction request triggered by a user, it sends the detected data prediction request to the blockchain network. After receiving the data prediction request, the blockchain master node in the blockchain network parses the data prediction request to obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request.

[0105] Among them, the first object identifier carried in the data prediction request is used to represent the object identifier of the user who triggers the data prediction request. The target data to be predicted represents the data resources that need to be predicted in different application scenarios. The prediction service type is used to represent the type of prediction service that needs to be performed on the target data, specifically including basic services and integrated learning services.

[0106] Step S604: Obtain the object credential data and object operation permissions corresponding to the first object identifier, and perform information verification based on the object credential data and permission verification on the object operation permissions to obtain the information verification result and the permission verification result.

[0107] Specifically, after obtaining the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request, obtain the object credential data and object operation permissions corresponding to the first object identifier. Among them, the object credential data is used to represent the credential information that the user needs to provide when accessing the target data or performing the target operation, and the object operation permissions represent the read permissions, write permissions, and other operation permissions of the user, such as whether the user has the permission to read or write data from the blockchain network, and whether the user has the permission to delete or manage the data in the blockchain network.

[0108] Furthermore, perform information verification based on the object credential data, that is, verify the credential information provided by the user when accessing the target data or performing the target operation to determine whether the user is a legitimate user and obtain the corresponding information verification result. Similarly, perform permission verification based on the object operation permissions, that is, verify the read permissions, write permissions, and other operation permissions of the user to determine whether the various operation permissions of the user include the data prediction permissions corresponding to the current data prediction request to obtain the corresponding permission verification result.

[0109] Step S606: Determine whether the data verification of the first object identifier passes according to the information verification result and the permission verification result.

[0110] Specifically, the information verification result includes passing the information verification and failing the information verification, and the permission verification result includes passing the permission verification and failing the permission verification. That is, if it is necessary to determine that the data verification for the first object identifier passes, the information verification needs to pass and the permission verification needs to pass.

[0111] Step S608, if it is determined that the data verification for the first object identifier passes and the predicted service type is determined to be the integrated learning service, then according to the integrated learning service and the target data to be predicted, determine the type and quantity of the required machine learning models.

[0112] Specifically, if it is determined that the data verification for the first object identifier passes based on the information verification result obtained from the information verification based on the object credential data and the permission verification result obtained from the permission verification based on the object operation permissions, then access the contract repository deployed on the blockchain network to obtain the machine learning model contracts.

[0113] Among them, when accessing the contract repository deployed on the blockchain network to obtain the machine learning model contracts, it is necessary to determine the specific type of the predicted service type. That is, if it is determined that the predicted service type is the integrated learning service, then according to the integrated learning service and the target data to be predicted, determine the type and quantity of the required machine learning models.

[0114] Step S610, access the contract repository deployed on the blockchain network to obtain each machine learning model contract required for executing the integrated learning service from the contract repository.

[0115] Specifically, after determining the type and quantity of the required machine learning models according to the integrated learning service and the target data to be predicted, further access the contract repository deployed on the blockchain network to obtain each machine learning model contract required for executing the integrated learning service from the contract repository.

[0116] Step S612, call each machine learning model contract to perform data prediction processing on the target data respectively, obtain multiple first prediction results, and store each first prediction result in a newly created block.

[0117] Specifically, by calling each determined machine learning model contract, perform data prediction processing on the target data respectively to obtain multiple first prediction results. Among them, after performing the data prediction processing, for each obtained first prediction result, create a new block in the blockchain network and store each first prediction result in the newly created block.

[0118] Step S614, feedback the target data to each slave node in the blockchain network, and through each slave node, call each machine learning model contract deployed by itself to perform data prediction processing, generate corresponding second prediction results respectively, and store the multiple obtained second prediction results in the newly created block through each slave node.

[0119] Specifically, after the blockchain master node calls each machine learning model contract for data prediction processing and obtains multiple first prediction results, it further feeds the target data back to each slave node in the blockchain network, so that each slave node calls each machine learning model contract deployed by itself for data prediction processing, respectively generates corresponding second prediction results, and stores the multiple second prediction results obtained by each slave node into a newly created block.

[0120] Among them, by storing both the first prediction results and the second prediction results into the newly created block, it indicates that the newly created block temporarily stores the prediction results of the blockchain master node and each slave node. The blockchain master node can broadcast each first prediction result to all blockchain nodes in the blockchain network, and each slave node can broadcast each second prediction result to all blockchain nodes in the blockchain network. Then, after all blockchain nodes receive each first prediction result and each second prediction result sent by other nodes, they store each first prediction result and each second prediction result sent by other nodes into the newly created block.

[0121] Step S616: Based on each first prediction result and each second prediction result, perform broadcasting and consensus to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, an integrated prediction result corresponding to the target data is obtained.

[0122] Specifically, all blockchain nodes in the blockchain network, after storing each first prediction result and each second prediction result sent by other nodes into the newly created block, perform broadcasting and consensus again to obtain multiple block prediction results, and determine whether the block prediction results (including each first prediction result and each second prediction result) corresponding to the newly created block in each blockchain node are consistent.

[0123] Among them, if it is determined that the block prediction results corresponding to the newly created block in each blockchain node are consistent, it indicates that the consensus passes. Then, all blockchain nodes write the newly created block that passes the consensus into the block ledger, and at the same time, all blockchain nodes write the status data in the processes such as broadcasting and consensus into the blockchain state database deployed in the blockchain network.

[0124] Furthermore, all blockchain nodes analyze and verify the block prediction results that pass the consensus to determine whether the block prediction results are correct. If it is determined that the verification of the block prediction results by all blockchain nodes passes, that is, it indicates that the block prediction results corresponding to all blockchain nodes are predicted correctly, then an integrated prediction result corresponding to the target data is obtained. Among them, the integrated prediction result is understood as integrating the prediction results obtained by different machine learning model contracts on all blockchain nodes for prediction respectively, thus realizing multi-node computing of heterogeneous contracts and further improving the accuracy of the prediction results.

[0125] Step S618: If it is determined that the verification of the block prediction result by the current blockchain master node fails, then based on the block prediction result and each first prediction result, determine the target machine learning model contract to be corrected and the corresponding model parameters.

[0126] Specifically, when all blockchain nodes analyze and verify the block prediction results passed by consensus, if it is determined that the verification of the block prediction result by the current blockchain master node fails, that is, the block prediction result of the current blockchain master node is incorrect while the block prediction results of other blockchain nodes are correct, it indicates that the machine learning model contract deployed by the current blockchain master node needs to be adjusted and corrected.

[0127] Among them, specifically, based on the block prediction result and each first prediction result, determine the target machine learning model contract to be corrected and the corresponding model parameters, that is, determine the target machine learning model contract with incorrect first prediction results, and obtain the model parameters of the target machine learning model contract.

[0128] Step S620: Determine the difference data between the block prediction result and each first prediction result, and correct and adjust the target machine learning model contract and the corresponding model parameters according to the difference data to obtain the corrected machine learning model contract.

[0129] Specifically, before correcting and adjusting the target machine learning model contract and the corresponding model parameters, it is necessary to determine the difference data between the block prediction result and each first prediction result, that is, determine the difference data between the first prediction result of the current blockchain node and the block prediction result, so as to correct and adjust the target machine learning model contract and the corresponding model parameters according to the determined difference data. Thus, by correcting and adjusting the target machine learning model contract and the corresponding model parameters, a corrected machine learning model contract can be obtained. Finally, when predicting through the corrected machine learning model contract, the difference between the first prediction result obtained by predicting with the corrected machine learning model contract deployed by the current blockchain node and the block prediction result can be reduced, and the accuracy of the prediction result of the machine learning model contract deployed by the current blockchain node can be improved.

[0130] The above blockchain-based data prediction processing method realizes integrated learning prediction based on multiple machine learning model contracts, enabling different nodes to use different models for prediction, increasing the diversity of models, and obtaining more accurate prediction results. At the same time, by introducing a multi-result consensus method, it allows for the existence of multiple prediction results and reaches a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system while maintaining decentralization. Further, when the verification of the block prediction result fails at the current blockchain main node, training and correction are performed based on the machine learning models deployed on the blockchain, without the need to retrain separately and then upload them to the blockchain for application, reducing cumbersome training and deployment operations to further improve the data processing efficiency of the blockchain network.

[0131] In an exemplary embodiment, as Figure 7 shown, a blockchain-based model contract processing method is provided. Taking the blockchain main node 406 in Figure 4 as an example for illustration, it includes the following steps S702 to S708. Among them:

[0132] Step S702, receive a machine learning model contract deployment request, and obtain the second object identifier carried by the machine learning model contract deployment request and each machine learning model contract.

[0133] Specifically, the terminal device establishes communication with the blockchain network. When the terminal device detects a machine learning model contract deployment request triggered by a usage object, it sends the detected machine learning model contract deployment request to the blockchain network. After receiving the machine learning model contract deployment request, the blockchain main node in the blockchain network parses the machine learning model contract deployment request to obtain the second object identifier carried by the machine learning model contract deployment request and each machine learning model contract.

[0134] Among them, the second object identifier carried by the machine learning model contract deployment request is used to represent the object identifier of the usage object that triggers the machine learning model contract deployment request. Through the second object identifier, the corresponding object credential data and object operation permissions of the usage object can be obtained. Among them, the object credential data is used to represent the credential information required for the usage object to access the target data or perform the target operation, and this credential information is used to determine whether the usage object is a legitimate usage object, while the object operation permissions represent the read permissions, write permissions, and other operation permissions of the usage object, such as whether it has the permission to read or write data from the blockchain network, and whether it has the permission to delete or manage the data in the blockchain network, etc.

[0135] Each machine learning model contract represents a machine learning model that needs to be deployed in the form of a contract to each blockchain node in the blockchain network. Among them, the machine learning model can specifically include supervised learning models, unsupervised learning models, and probability models, etc. Among them, the supervised learning model can specifically include single models and ensemble learning models. The single model includes linear models, decision trees, neural network models, and support vector machines, etc. Ensemble learning includes boosting (i.e., ensemble modeling) models and random forest models, etc. Among them, the unsupervised learning model includes clustering models and dimensionality reduction models, etc. The probability model includes Bayesian models, probabilistic graphs, and maximum entropy models, etc.

[0136] Furthermore, different machine learning model contracts can be deployed on different blockchain nodes according to actual needs, so as to realize multi-node computing processing of heterogeneous contracts during subsequent business processing, improving the overall business processing efficiency and performance.

[0137] Step S704: Perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and permission verification are passed, send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract in the contract warehouse through each blockchain node.

[0138] Specifically, through the second object identifier, obtain the object credential data and object operation permissions of the user object that triggers the machine learning model contract deployment request, and perform information verification based on the obtained object credential data to obtain an information verification result, and perform permission verification based on the object operation permissions to obtain a permission verification result.

[0139] Among them, when performing information verification based on the object credential data, it is to verify the credential information provided by the user object when accessing the target data or performing the target operation, determine whether the user object is a legitimate user object, and obtain the corresponding information verification result. Similarly, when performing permission verification based on the object operation permissions, it is to verify the read permissions, write permissions, and other operation permissions of the user object, etc., determine whether each operation permission of the user object, etc., includes the data prediction permission corresponding to the current data prediction request, so as to obtain the corresponding permission verification result. Among them, the information verification result includes information verification passed and information verification failed, and the permission verification result includes permission verification passed and permission verification failed, that is, if it is necessary to determine that the data verification of the second object identifier is passed, information verification passed and permission verification passed are required.

[0140] Further, if it is determined that the information verification and permission verification of the second object identifier are passed, each contract metadata corresponding to each machine learning model contract is obtained to retrieve each machine learning model contract matching the contract metadata from the business data pool, and each machine learning model contract is stored in the contract repository through each blockchain node.

[0141] Among them, each contract metadata corresponding to the machine learning model contract specifically includes the model contract name (or model contract hash value) corresponding to the machine learning model contract, as well as relevant metadata information such as the upload timestamp. The business data pool indicates the storage space for storing the to-be-executed business. Each to-be-executed business carries corresponding business data. When the to-be-executed business is the machine learning model contract deployment business, each machine learning model contract matching the model contract name (or model contract hash value) corresponding to the machine learning model contract can be retrieved from the business data pool, and each machine learning model contract is stored in the contract repository deployed in the blockchain network by calling the blockchain node.

[0142] In an exemplary embodiment, the machine learning model contracts deployed on each blockchain node in the blockchain network are used to perform data prediction processing on the target data to be predicted to obtain multiple first prediction results and multiple second prediction results. Each first prediction result and each second prediction result are used for broadcasting and consensus to obtain multiple block prediction results. Among them, if it is determined that the verification of each block prediction result is passed, the integrated prediction result corresponding to the target data can be obtained.

[0143] Specifically, when the blockchain master node receives a data prediction request, it parses the data prediction request to obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request. Then, the blockchain master node calls each machine learning model contract to perform data prediction processing on the target data respectively, obtains multiple first prediction results, and stores each first prediction result in a newly created block. After obtaining multiple first prediction results, the blockchain master node further feeds back the target data to each slave node in the blockchain network, and each slave node stores the multiple second prediction results obtained in the newly created block.

[0144] Further, each blockchain node in the blockchain network performs broadcasting and consensus based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result is passed, the integrated prediction result corresponding to the target data is obtained.

[0145] Step S706: Receive the confirmation information of successful storage fed back by each blockchain node, and store each confirmation information and each machine learning model contract in the blockchain network.

[0146] Specifically, after the blockchain master node sends each machine learning model contract to each blockchain node in the blockchain network, that is, after other blockchain nodes store each machine learning model contract in the contract warehouse, it triggers a confirmation message for successful storage and feeds back the confirmation message for successful storage to the blockchain master node.

[0147] Further, after the blockchain master node receives the confirmation message for successful storage fed back by other blockchain nodes, it triggers a prompt message for successful business execution, that is, triggers a prompt message for successful deployment of the machine learning model contract, and stores each confirmation message and each machine learning model contract in a newly created block in the blockchain network.

[0148] Step S708, if it is detected that the consensus based on the blockchain network passes, it is determined that the deployment processing operation of each machine learning model contract is completed.

[0149] Specifically, after the blockchain master node stores each confirmation message and each machine learning model contract in a newly created block in the blockchain network, ordinary business consistency consensus processing is performed based on the entire blockchain network. When it is determined that the consensus based on the blockchain network passes, it is determined that the deployment processing operation of each machine learning model contract is completed. After the deployment processing operation is completed, the blockchain node is allowed to call each machine learning model contract to execute subsequent business processing operations.

[0150] In the above method for processing model contracts based on blockchain, by receiving a machine learning model contract deployment request, the second object identifier carried in the machine learning model contract deployment request and each machine learning model contract are obtained, and information verification and permission verification are performed based on the second object identifier. If it is determined that the information verification and permission verification are passed, each machine learning model contract is sent to each blockchain node in the blockchain network, and each machine learning model contract is stored in the contract warehouse through each blockchain node. Further, by receiving the confirmation information of successful storage feedback by each blockchain node, each confirmation information and each machine learning model contract are stored in the blockchain network, and when it is detected that the consensus based on the blockchain network is passed, it is determined that the deployment processing operation of each machine learning model contract is completed. Thus, according to different requirements in actual application scenarios, multiple different machine learning model contracts can be deployed on different blockchain nodes to achieve multi-node computing in the blockchain network, enabling different nodes to use different models for processing, increasing the diversity of the models, and obtaining more accurate processing results. Among them, since each deployed machine learning model contract is respectively used to perform data prediction processing on target data to obtain multiple first prediction results and multiple second prediction results, and each first prediction result and each second prediction result are used for broadcasting and consensus to obtain multiple block prediction results. If it is determined that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained. Furthermore, by introducing a multi-result consensus method, it is allowed to have multiple prediction results and reach a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system in the face of different tasks and data distributions while maintaining decentralization.

[0151] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0152] In an exemplary embodiment, as Figure 8As shown, a blockchain system is provided, specifically including a terminal device 802 and a blockchain network 804. Among them, the blockchain network 804 includes multiple blockchain nodes, specifically a blockchain master node 806 and multiple slave nodes 808. At the same time, a contract warehouse 810 is also deployed in the blockchain network 804, and multiple machine learning model contracts 812 are stored in the contract warehouse 810. Among them:

[0153] The terminal device 802 is used to detect a data prediction request and feedback the data prediction request to the blockchain network 804;

[0154] The blockchain master node 806 is used to receive a data prediction request and obtain the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request; if it is determined that the data verification of the first object identifier passes, it accesses the contract warehouse 810 deployed in the blockchain network 804, and obtains the matching machine learning model contracts 812 according to the prediction service type; feeds the target data back to each slave node 808 in the blockchain network;

[0155] The machine learning model contract 812 is used to perform data prediction processing on the target data respectively, obtain multiple first prediction results, and store each first prediction result in a newly created block;

[0156] The slave node 808 is used to call the machine learning model contracts 812 deployed by each of them to perform data prediction processing, and generate corresponding second prediction results and store them in the newly created block respectively;

[0157] The blockchain master node 806 is further used to broadcast and reach a consensus based on each first prediction result and each second prediction result, obtain multiple block prediction results, and if each blockchain node determines that the verification of each block prediction result passes, obtain an integrated prediction result corresponding to the target data.

[0158] In an exemplary embodiment, as Figure 9 shown, a schematic diagram of the storage distribution of the model contract of a blockchain node is provided. Referring to Figure 9 it can be seen that contract warehouses are respectively deployed on different blockchain nodes in the blockchain network. Multiple different machine learning model contracts can be deployed in each contract warehouse, and the contract metadata corresponding to the machine learning model contracts (such as the model contract name or the model contract hash value) can be stored in the block content of the blockchain node, rather than storing specific multiple machine learning model contracts. Furthermore, according to the stored model contract name or model contract hash value, each machine learning model contract actually needed can be obtained from the business data pool.

[0159] Among them, referring to Figure 9It can be seen that the blockchain network includes blockchain node 1, blockchain node 2, blockchain node 3, and blockchain node 4. A contract warehouse is deployed on each blockchain node, and each contract warehouse includes multiple machine learning model contracts. For the same model contract name or model contract hash value, different machine learning models can be stored on different blockchain nodes.

[0160] Specifically, the model contract name can specifically include Contract 1, Contract 2, Contract 3, etc. On blockchain node 1, Contract 1 can correspond to model a1, Contract 2 can correspond to model a2, and Contract 3 corresponds to model a3. Among them, on blockchain node 2, Contract 1 can correspond to model b1, Contract 2 can correspond to model b2, and Contract 3 corresponds to model b3. On blockchain node 3, Contract 1 can correspond to model c1, Contract 2 can correspond to model c2, and Contract 3 corresponds to model c3. Similarly, on blockchain node 4, Contract 1 can correspond to model d1, Contract 2 can correspond to model d2, and Contract 3 corresponds to model d3.

[0161] Among them, referring to Figure 9 It can be seen that each blockchain node can include multiple block contents, such as block n - 2, block n - 1, and block n, etc. Contract metadata corresponding to the machine learning model contract (such as model contract name or model contract hash value) is stored on block n - 2, block n - 1, and block n respectively. For example, the contract metadata stored on block n - 2 is Contract 1, the contract metadata stored on block n - 1 is Contract 2, and the contract metadata stored on block n is Contract 3.

[0162] In an exemplary embodiment, as Figure 10 shown, a schematic diagram of the block content structure is provided. Referring to Figure 10 It can be seen that the structure of the block content on the blockchain node includes a block header and a block body, and the block body includes ordinary business data and integrated business data. Among them, the ordinary business data includes a read set, a write set, and a return result, and the integrated business data includes a read set, the write set and return result of blockchain node 1, the write set and return result of blockchain node 2, and the write set and return result of blockchain node 3, etc.

[0163] Among them, the read set represents the input data to be predicted (the read sets of all blockchain nodes are the same), and the return result indeed refers to the output result (the return results of different blockchain nodes may be different). Without special specification, the write set is the same as the result. If there is a layer of conversion code to specify the content of the write set, such as success / failure, then the specified value shall prevail (that is, the write sets of different blockchain nodes may also be different).

[0164] Exemplarily, referring to Figure 10It can be known that, for example, in integrated business data, the write set of blockchain node 1 refers to that a machine learning contract model is installed on blockchain node 1. Then, on node 1 that executes the machine learning contract model, there will be stored a write set and results corresponding to the machine learning contract model (i.e., the write set and return results of blockchain node 1).

[0165] In an exemplary embodiment, the blockchain master node 806 is further configured to:

[0166] Obtain object credential data and object operation permissions corresponding to the first object identifier; perform information verification based on the object credential data and permission verification on the object operation permissions to obtain an information verification result and a permission verification result; and determine whether the data verification for the first object identifier passes according to the information verification result and the permission verification result.

[0167] In an exemplary embodiment, the blockchain master node 806 is further configured to:

[0168] If it is determined that the verification of the block prediction result by the current blockchain master node fails, then determine the target machine learning model contract to be corrected and the corresponding model parameters according to the block prediction result and each first prediction result; determine the difference data between the block prediction result and each first prediction result, and correct and adjust the target machine learning model contract and the corresponding model parameters according to the difference data to obtain a corrected machine learning model contract.

[0169] In an exemplary embodiment, as Figure 11 shown, a schematic diagram of an integrated learning model correction mechanism is provided. Referring to Figure 11 it can be known that the prediction results obtained by different blockchain nodes calling the machine learning model contracts deployed by them for prediction processing may have most of the prediction results the same, while there may be a situation where one or several prediction results are different. Furthermore, it is necessary to correct and adjust the machine learning model contracts of the blockchain nodes to which the different prediction results belong according to the other same prediction results.

[0170] Specifically, referring to Figure 11It can be seen that the contract 1 - model a1 on blockchain node 1, the contract 1 - model b1 on blockchain node 2, the contract 1 - model c1 on blockchain node 3, and the contract 1 - model d1 on blockchain node 4 all perform prediction processing on the same target data (i.e., the same read set "7"), but the obtained output results or write sets are different. For example, the obtained write sets are "6", "7", "7", "7", that is, the output result of the contract 1 - model a1 on blockchain node 1 is different from the output results of other nodes. This indicates that the contract 1 - model a1 on blockchain node 1 has a prediction error and needs to be corrected and adjusted to obtain an updated machine learning model, that is, to obtain the contract 1 - model a1 - update on blockchain node 1.

[0171] Among them, the prediction results obtained by each blockchain node will be stored on the blockchain. However, the final consistent result used to adjust the contract 1 - model a1 on blockchain node 1 needs to be confirmed by each other blockchain node, that is, each blockchain node needs to reach a consensus on the data used to adjust the contract 1 - model a1 on blockchain node 1. After the consensus is passed, the data passed through the consensus is used to correct and adjust the contract 1 - model a1 on blockchain node 1.

[0172] Optionally, when it is necessary to determine the final output result after obtaining the prediction results of different blockchain nodes, the final output result can be obtained by weighted - averaging the output results of each model with model equity, or by removing the abnormal prediction results and then taking the average of the output results of all models as the final output result. Among them, when using the method of weighted - averaging the output results of each model with model equity to obtain the final output result, specifically, different models set corresponding equity weights according to their accuracy rates, and weighted summation is performed according to the equity weights to obtain the final output result.

[0173] In the above blockchain system, the first object identifier, the target data to be predicted, and the prediction service type carried in the received data prediction request are obtained. When it is determined that the data verification for the first object identifier passes, the contract repository deployed in the blockchain network is accessed to obtain various machine learning model contracts that match the prediction service type, so as to provide different machine learning model contracts that support different prediction service types. That is, integrated learning prediction based on multiple machine learning model contracts can be achieved, enabling different nodes to use different models for prediction, increasing the diversity of the models, and obtaining more accurate prediction results. Further, by calling each machine learning model contract, data prediction processing is performed on the target data respectively to obtain multiple first prediction results. The first prediction results are stored in a newly created block, and the target data is further fed back to each slave node in the blockchain network, so that each slave node stores the obtained multiple second prediction results in the newly created block. Furthermore, broadcasting and consensus can be performed based on the first prediction results and the second prediction results to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, an integrated prediction result corresponding to the target data is obtained. That is, by introducing a multi-result consensus method, it is allowed to have multiple prediction results and reach a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system when facing different tasks and data distributions while maintaining decentralization.

[0174] In an exemplary embodiment, a blockchain system is provided, wherein:

[0175] The terminal device is further configured to: detect a machine learning model contract deployment request and feed back the machine learning model contract deployment request to the blockchain network;

[0176] The blockchain master node is further configured to: receive the machine learning model contract deployment request, and obtain the second object identifier carried in the machine learning model contract deployment request and each machine learning model contract; perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and permission verification pass, send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract in the contract repository through each blockchain node; receive the confirmation information of successful storage fed back by each blockchain node, and store each confirmation information and each machine learning model contract in the blockchain network; if it is detected that the consensus based on the blockchain network passes, determine that the deployment processing operation of each machine learning model contract is completed.

[0177] In the above blockchain system, by receiving a machine learning model contract deployment request, the second object identifier carried in the machine learning model contract deployment request and each machine learning model contract are obtained, and information verification and permission verification are performed based on the second object identifier. If it is determined that the information verification and permission verification are passed, each machine learning model contract is sent to each blockchain node in the blockchain network, and each machine learning model contract is stored in the contract warehouse through each blockchain node. Further, by receiving the confirmation information of successful storage feedback by each blockchain node, each confirmation information and each machine learning model contract are stored in the blockchain network, and when it is detected that the consensus based on the blockchain network is passed, it is determined that the deployment processing operation of each machine learning model contract is completed. Thus, according to different requirements in the actual application scenario, multiple different machine learning model contracts can be deployed on different blockchain nodes to implement multi-node computing of the blockchain network, enabling different nodes to use different models for processing, increasing the diversity of the models, and obtaining more accurate processing results. Among them, since each deployed machine learning model contract is respectively used to perform data prediction processing on target data to obtain multiple first prediction results and multiple second prediction results, and each first prediction result and each second prediction result are used for broadcasting and consensus to obtain multiple block prediction results. If it is determined that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained. Furthermore, by introducing a multi-result consensus method, it is allowed to have multiple prediction results and reach a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system in the face of different tasks and data distributions while maintaining decentralization.

[0178] In an exemplary embodiment, as Figure 12 shown, a blockchain system is provided. Referring to Figure 12 it can be seen that the blockchain system includes: a network module 1202, a verification module 1204, a business data pool 1206, a scheduling execution and verification module 1208, a consensus module 1210, an integrated learning module 1212, and a storage module 1214, where:

[0179] The network module 1202 is used to handle the communication between blockchain nodes, including sending and receiving pending services, blocks, and other information.

[0180] The verification module 1204 is used to verify the legality and correctness of the using object, including an information verification module 12042 and a permission verification module 12044. Among them, the information verification module 12042 is used to verify the object credential information of the using object to ensure its legality, while the permission verification module 12044 is used to verify whether the using object has the permission to execute the service.

[0181] The business data pool 1206 is used to store business data to be processed, waiting for further scheduling execution and verification.

[0182] The scheduling execution and verification module 1208 is used to process each piece of business data to be processed in the business data pool, including the block business packer 12082, the virtual machine engine 12084, the block generator 12086, and the contract repository 12088.

[0183] Among them, the block business packer 12082 is used to select each piece of business data to be processed from the business data pool 1206 to form a set of business data to be processed. The virtual machine engine 12084 is used to execute the smart contracts carried by the business data and generate business execution results. The block generator: generates new blocks according to the transaction results. The contract repository 12088 is used to store smart contracts, including ordinary business contracts and machine learning model contracts. Among them, ordinary business contracts are used to process ordinary business in the blockchain network, such as resource interaction business, contract deployment business, etc. These contracts are responsible for handling basic operations in the blockchain to ensure the normal operation of the network. The machine learning contract model, on the other hand, is used to process integrated learning business. These contracts contain relevant codes and parameters of the machine learning model and are used to implement model training, prediction, and optimization in the blockchain network.

[0184] The consensus module 1210 is used to reach consensus in the blockchain network, including ordinary business consistency consensus and integrated learning business multi-result consensus. Among them, ordinary business consistency consensus is used to ensure that all nodes in the network reach an agreement on the processing results of ordinary business. The integrated learning business multi-result consensus, on the other hand, allows multiple results to exist in the integrated learning business and reach consensus in the network.

[0185] The integrated learning module 1212 is used to process integrated learning business, including model prediction and model correction. Among them, model prediction is used to perform prediction processing on input data using the machine learning contract model, and model correction is used to determine the target machine learning model to be corrected and adjusted according to the prediction results and consensus results, and to adjust and optimize the model parameters of the target machine learning model.

[0186] The storage module 1214 is used to store the data of the blockchain node, including the block ledger and the state database. Among them, the block ledger is used to store the block data that has reached consensus, and the state database is used to store the state information of the blockchain node, such as resource balance, smart contract state, etc.

[0187] In an exemplary embodiment, as Figure 13 shown, a model contract installation process based on a blockchain system is provided. Refer to Figure 13It can be known that the model contract installation process based on the blockchain system specifically includes the following steps:

[0188] Step S1301, if the blockchain node detects a machine learning model contract deployment request, obtain the second object identifier carried in the machine learning model contract deployment request and multiple different machine learning model contracts.

[0189] Among them, the user can upload multiple different machine learning model contracts based on the terminal device, and by packing the multiple different machine learning model contracts and signing the packed content, the corresponding signature information is obtained.

[0190] Step S1302, the information verification module of the blockchain node performs information verification based on the second object identifier to determine whether the information verification passes.

[0191] Among them, the information verification module of the blockchain node specifically performs signature verification on the signature information corresponding to the second object identifier and information verification on the object credential information. Among them, the object credential information can specifically be certificate information.

[0192] Step S1303, if the information verification fails, feedback a prompt message indicating that the information verification fails.

[0193] Step S1304, if the information verification passes, the permission verification module of the blockchain node performs permission verification on the second object identifier to determine whether the permission verification passes.

[0194] Step S1305, if the permission verification fails, feedback a prompt message indicating that the permission verification fails.

[0195] Step S1306, if it is determined that both the information verification and the permission verification pass, the business data pool of the blockchain node receives and stores each machine learning model contract.

[0196] Step S1307, the block business packer of the blockchain node obtains the contract metadata corresponding to each machine learning model contract to be deployed from the business data pool.

[0197] Step S1308, the virtual machine engine uses a peer-to-peer method between nodes to send the contract metadata corresponding to each machine learning model contract to all blockchain nodes in the blockchain network respectively.

[0198] Step S1309, each blockchain node stores the contract metadata corresponding to each machine learning model contract received in its own deployed contract repository and feedbacks a confirmation message of successful storage to the blockchain main node.

[0199] Step S1310: After the blockchain master node receives the confirmation information of successful storage feedback from other blockchain nodes, it triggers a prompt message indicating the successful deployment of the machine learning model contract, and stores each confirmation information and each machine learning model contract in a newly created block in the blockchain network.

[0200] Step S1311: Perform ordinary business consistency consensus processing based on the entire blockchain network. When it is determined that the consensus based on the blockchain network passes, it is determined that the deployment processing operations of each machine learning model contract are completed. After the deployment processing operations are completed, the blockchain nodes are allowed to call each machine learning model contract to execute subsequent business processing operations.

[0201] In an exemplary embodiment, as Figure 14 shown, a data prediction processing process based on a blockchain system is provided. Referring to Figure 14 it can be known that the data prediction processing process based on the blockchain system specifically includes the following steps:

[0202] Step S1401: If the blockchain master node receives a data prediction request, it obtains the first object identifier, the target data to be predicted, and the prediction service type carried in the data prediction request.

[0203] Among them, the user can feedback the target data to be predicted based on the terminal device, and by packing the target data to be predicted and signing the packed content, the corresponding signature information can be obtained.

[0204] Step S1402: The information verification module of the blockchain node performs information verification based on the first object identifier to determine whether the information verification passes.

[0205] Among them, the information verification module of the blockchain node specifically performs signature verification on the signature information corresponding to the first object identifier and information verification on the object credential information. Among them, the object credential information can specifically be certificate information.

[0206] Step S1403: If the information verification fails, a prompt message indicating that the information verification fails is fed back.

[0207] Step S1404: If the information verification passes, the permission verification module of the blockchain node performs permission verification on the first object identifier to determine whether the permission verification passes.

[0208] Step S1405: If the permission verification fails, a prompt message indicating that the permission verification fails is fed back.

[0209] Step S1406: If it is determined that both the information verification and the permission verification pass, the business data pool of the blockchain node receives and stores each target data to be predicted.

[0210] Step S1407: The block service packer of the blockchain node obtains each target data to be predicted from the service data pool.

[0211] Step S1408: The virtual machine engine schedules the target data to be predicted to start execution. If it is determined that the prediction service type is an integrated learning service, the blockchain master node determines the types and quantities of machine learning models required according to the integrated learning service and the target data to be predicted.

[0212] Step S1409: The blockchain master node accesses the contract repository deployed in the blockchain network to obtain each machine learning model contract required for executing the integrated learning service from the contract repository.

[0213] Step S1410: The scheduling execution and verification module calls each machine learning model contract to perform data prediction processing on the target data to be predicted, obtains multiple first prediction results, and stores each first prediction result in a newly created block.

[0214] Step S1411: The blockchain master node feeds back the target data to each slave node in the blockchain network.

[0215] Step S1412: Each slave node calls each machine learning model contract deployed by itself to perform data prediction processing, respectively generates corresponding second prediction results, and stores the multiple second prediction results obtained in a newly created block.

[0216] Step S1413: The blockchain master node broadcasts each first prediction result to all blockchain nodes in the blockchain network, and each slave node broadcasts each second prediction result to all blockchain nodes in the blockchain network.

[0217] Step S1414: After all blockchain nodes receive each first prediction result and each second prediction result sent by other nodes, they store each first prediction result and each second prediction result sent by other nodes in a newly created block.

[0218] Step S1415: All blockchain nodes in the blockchain network, after storing each first prediction result and each second prediction result sent by other nodes in a newly created block, perform broadcasting and consensus again to obtain multiple block prediction results, and determine whether the block prediction results corresponding to the newly created blocks in each blockchain node are consistent.

[0219] Step S1416: If it is determined that the block prediction results corresponding to the newly created blocks in each blockchain node are inconsistent, then end the current data prediction processing operation.

[0220] Step S1417, if it is determined that the block prediction results corresponding to the newly created blocks of each blockchain node are consistent, then all blockchain nodes write the newly created blocks passed by consensus into the block ledger, and all blockchain nodes write the status data during processes such as broadcasting and consensus into the blockchain status database deployed in the blockchain network.

[0221] Step S1418, all blockchain nodes analyze and verify the block prediction results passed by consensus to determine whether the block prediction results are correct.

[0222] Step S1419, if it is determined that all blockchain nodes pass the verification of the block prediction results, that is, the block prediction results corresponding to all blockchain nodes are predicted correctly, then an integrated prediction result corresponding to the target data is obtained.

[0223] Step S1420, if it is determined that the current blockchain master node fails to verify the block prediction results, then based on the block prediction results and each first prediction result, the target machine learning model contract to be corrected and the corresponding model parameters are determined.

[0224] Step S1421, the difference data between the block prediction results and each first prediction result is determined, and the target machine learning model contract and the corresponding model parameters are corrected and adjusted according to the difference data to obtain a corrected machine learning model contract.

[0225] The above blockchain system realizes integrated learning prediction based on multiple machine learning model contracts, enabling different nodes to use different models for prediction, increasing the diversity of models, and obtaining more accurate prediction results. At the same time, by introducing a multi-result consensus method, it allows for the existence of multiple prediction results and reaches a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system while maintaining decentralization. Further, when the current blockchain master node fails to verify the block prediction results, training and correction are performed based on the machine learning models deployed on the blockchain, without the need to retrain separately and then upload them to the blockchain for application, reducing cumbersome training and deployment operations to further improve the data processing efficiency of the blockchain network.

[0226] Based on the same inventive concept, embodiments of the present application also provide a blockchain-based data prediction processing apparatus and a blockchain-based model contract processing apparatus for implementing the above-mentioned blockchain-based data prediction processing method and blockchain-based model contract processing method. The implementation solutions provided by the apparatus for solving problems are similar to those described in the above methods. Therefore, the specific limitations in one or more of the following embodiments of the blockchain-based data prediction processing apparatus and the blockchain-based model contract processing apparatus can refer to the limitations on the blockchain-based data prediction processing method and the blockchain-based model contract processing method in the above text, and will not be elaborated here.

[0227] In an exemplary embodiment, as Figure 15 shown, a blockchain-based data prediction processing apparatus is provided, including: a data prediction request receiving module 1502, a machine learning model contract obtaining module 1504, a first prediction result storing module 1506, a second prediction result storing module 1508, and an integrated prediction result obtaining module 1510, where:

[0228] The data prediction request receiving module 1502 is configured to receive a data prediction request, and obtain a first object identifier, target data to be predicted, and a prediction service type carried by the data prediction request;

[0229] The machine learning model contract obtaining module 1504 is configured to, if it is determined that the data verification of the first object identifier is passed, access a contract repository deployed in the blockchain network, and obtain each machine learning model contract that matches according to the prediction service type;

[0230] The first prediction result storing module 1506 is configured to call each machine learning model contract, perform data prediction processing on the target data respectively, obtain a plurality of first prediction results, and store each first prediction result into a newly created block;

[0231] The second prediction result storing module 1508 is configured to feed back the target data to each slave node in the blockchain network, and store the obtained plurality of second prediction results into the newly created block through each slave node; the second prediction result is obtained by the slave node based on data prediction processing of the target data;

[0232] The integrated prediction result obtaining module 1510 is configured to perform broadcasting and consensus based on each first prediction result and each second prediction result, obtain a plurality of block prediction results, and if each blockchain node determines that the verification of each block prediction result is passed, obtain an integrated prediction result corresponding to the target data.

[0233] In the above blockchain-based data prediction processing device, by obtaining the first object identifier, the target data to be predicted, and the prediction service type carried in the received data prediction request, and when it is determined that the data verification for the first object identifier passes, accessing the contract repository deployed in the blockchain network to obtain the matching machine learning model contracts according to the prediction service type, so as to provide different machine learning model contracts for different prediction service types, that is, it can realize the integrated learning prediction based on multiple machine learning model contracts, enabling different nodes to use different models for prediction, increasing the diversity of the models, and obtaining more accurate prediction results. Further, by invoking each machine learning model contract, performing data prediction processing on the target data respectively to obtain multiple first prediction results, storing each first prediction result in a newly created block, and further feeding back the target data to each slave node in the blockchain network, so that each slave node stores the obtained multiple second prediction results in the newly created block, and then it is possible to perform broadcasting and consensus based on each first prediction result and each second prediction result to obtain multiple block prediction results. If each blockchain node determines that the verification of each block prediction result passes, then an integrated prediction result corresponding to the target data is obtained, that is, by introducing a multi-result consensus method, allowing there to be multiple prediction results and reaching a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system in the face of different tasks and data distributions while maintaining decentralization.

[0234] In an exemplary embodiment, a blockchain-based data prediction processing device is further provided with a verification module for:

[0235] Obtaining the object certificate data and object operation permissions corresponding to the first object identifier; performing information verification based on the object certificate data and permission verification on the object operation permissions to obtain an information verification result and a permission verification result; and determining whether the data verification for the first object identifier passes according to the information verification result and the permission verification result.

[0236] In an exemplary embodiment, the machine learning model contract acquisition module is further used for:

[0237] If it is determined that the prediction service type is an integrated learning service, then determining the type and quantity of the required machine learning models according to the integrated learning service and the target data to be predicted; accessing the contract repository deployed in the blockchain network to obtain each machine learning model contract required for executing the integrated learning service from the contract repository.

[0238] In an exemplary embodiment, the second prediction result storage module is further used for:

[0239] Feedback the target data to each slave node in the blockchain network, and call each machine learning model contract deployed by each slave node to perform data prediction processing, respectively generating corresponding second prediction results; store the obtained multiple second prediction results in a newly created block through each slave node.

[0240] In an exemplary embodiment, a blockchain-based data prediction processing apparatus is provided, further including a model contract correction module for:

[0241] If it is determined that the verification of the block prediction result by the current blockchain master node fails, then determine the target machine learning model contract to be corrected and the corresponding model parameters according to the block prediction result and each first prediction result; determine the difference data between the block prediction result and each first prediction result, and correct and adjust the target machine learning model contract and the corresponding model parameters according to the difference data to obtain a corrected machine learning model contract.

[0242] In an exemplary embodiment, as Figure 16 shown, a blockchain-based model contract processing apparatus is provided, including: a machine learning model contract deployment request receiving module 1602, a machine learning model contract storage module 1604, a confirmation information receiving module 1606, and a deployment processing operation completion module 1608, where:

[0243] The machine learning model contract deployment request receiving module 1602 is configured to receive a machine learning model contract deployment request, and obtain a second object identifier carried in the machine learning model contract deployment request, and each machine learning model contract;

[0244] The machine learning model contract storage module 1604 is configured to perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and permission verification are passed, then send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract in a contract warehouse through each blockchain node; each machine learning model contract is respectively used to perform data prediction processing on target data to obtain multiple first prediction results and multiple second prediction results, each first prediction result and each second prediction result are used for broadcasting and consensus to obtain multiple block prediction results, and if it is determined that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained;

[0245] The confirmation information receiving module 1606 is configured to receive the confirmation information of successful storage fed back by each blockchain node, and store each confirmation information and each machine learning model contract in the blockchain network;

[0246] Deploy a processing operation completion module 1608 to determine that the deployment processing operations of each machine learning model contract are completed if consensus based on the blockchain network is detected.

[0247] In the above blockchain-based model contract processing device, by receiving a machine learning model contract deployment request, obtain the second object identifier carried in the machine learning model contract deployment request, as well as each machine learning model contract, and perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and permission verification are passed, send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract in the contract warehouse through each blockchain node. Further, by receiving the confirmation information of successful storage feedback from each blockchain node, store each confirmation information and each machine learning model contract in the blockchain network, and when it is detected that the consensus based on the blockchain network is passed, determine that the deployment processing operations of each machine learning model contract are completed. Thus, according to different requirements in the actual application scenario, multiple different machine learning model contracts can be deployed on different blockchain nodes to achieve multi-node computing in the blockchain network, enabling different nodes to use different models for processing, increasing the diversity of the models, and obtaining more accurate processing results. Among them, since each deployed machine learning model contract is used to perform data prediction processing on the target data to obtain multiple first prediction results and multiple second prediction results, and each first prediction result and each second prediction result are used for broadcasting and consensus to obtain multiple block prediction results. If it is determined that the verification of each block prediction result is passed, an integrated prediction result corresponding to the target data is obtained. Furthermore, by introducing a multi-result consensus method, it is allowed to have multiple prediction results and reach a consensus in the blockchain network, which helps to ensure the stability and accuracy of the entire blockchain system when facing different tasks and data distributions while maintaining decentralization.

[0248] In an exemplary embodiment, the machine learning model contract storage module is further configured to:

[0249] Obtain each contract metadata corresponding to each machine learning model contract, and obtain each machine learning model contract that matches the contract metadata from the business data pool; store each machine learning model contract in the contract warehouse through each blockchain node.

[0250] Each module in the above blockchain-based data prediction processing device and blockchain-based model contract processing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0251] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in Figure 17 . The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first object identifier carried in the data prediction request, the target data to be predicted, the prediction service type, the contract warehouse, the machine learning model contract, the first prediction result, the second prediction result, the block prediction result, and the integrated prediction result, etc. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a data prediction processing method based on a blockchain and a model contract processing method based on a blockchain.

[0252] Those skilled in the art can understand that Figure 17 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0253] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in the above-mentioned data prediction processing method based on a blockchain.

[0254] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in the above-mentioned model contract processing method based on a blockchain.

[0255] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, it implements the steps in the above-mentioned data prediction processing method based on a blockchain.

[0256] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned blockchain-based model contract processing method are implemented.

[0257] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above-mentioned blockchain-based data prediction processing method are implemented.

[0258] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above-mentioned blockchain-based model contract processing method are implemented.

[0259] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0260] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.

[0261] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0262] The above embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A data prediction processing method based on blockchain, characterized in that The method includes: Receiving a data prediction request, and obtaining a first object identifier, target data to be predicted, and a prediction service type carried in the data prediction request; If it is determined that the data verification for the first object identifier passes, accessing a contract repository deployed on a blockchain network, and obtaining respective machine learning model contracts that match according to the prediction service type; Invoking each of the machine learning model contracts to perform data prediction processing on the target data respectively, obtaining multiple first prediction results, and storing each of the first prediction results in a newly created block; Feeding back the target data to each slave node in the blockchain network, and storing multiple second prediction results obtained through each of the slave nodes in the newly created block; the second prediction results are obtained by the slave nodes performing data prediction processing based on the target data; Performing broadcasting and consensus based on each of the first prediction results and each of the second prediction results to obtain multiple block prediction results, and if each blockchain node determines that the verification of each of the block prediction results passes, obtaining an integrated prediction result corresponding to the target data.

2. The method according to claim 1, wherein After receiving the data prediction request, and obtaining the first object identifier, target data to be predicted, and prediction service type carried in the data prediction request, it further includes: Obtaining object credential data and object operation permissions corresponding to the first object identifier; Performing information verification based on the object credential data and performing permission verification on the object operation permissions to obtain an information verification result and a permission verification result; Determining whether the data verification for the first object identifier passes according to the information verification result and the permission verification result.

3. The method according to claim 1, wherein Accessing a contract repository deployed on a blockchain network, and obtaining respective machine learning model contracts that match according to the prediction service type, includes: If it is determined that the prediction service type is an integrated learning service, determining the type and quantity of machine learning models required according to the integrated learning service and the target data to be predicted; Accessing the contract repository deployed on the blockchain network to obtain respective machine learning model contracts required for executing the integrated learning service from the contract repository.

4. The method according to any one of claims 1 to 3, characterized in that The feeding back the target data to each slave node in the blockchain network, and storing multiple second prediction results obtained through each of the slave nodes in the newly created block, includes: Feeding back the target data to each slave node in the blockchain network, and through each slave node invoking respective machine learning model contracts deployed by it to perform data prediction processing to respectively generate corresponding second prediction results; Storing multiple second prediction results obtained through each of the slave nodes in the newly created block.

5. The method according to any one of claims 1 to 3, characterized in that The method further includes: If it is determined that the current blockchain master node fails to verify the block prediction result, determining a target machine learning model contract to be corrected and corresponding model parameters according to the block prediction result and each of the first prediction results; Determine the difference data between the block prediction results and each of the first prediction results, and correct and adjust the target machine learning model contract and the corresponding model parameters according to the difference data to obtain a corrected machine learning model contract.

6. A method for processing model contracts based on blockchain, characterized in that, The method includes: Receiving a machine learning model contract deployment request, and obtaining a second object identifier carried in the machine learning model contract deployment request and each machine learning model contract; Based on the second object identifier, perform information verification and permission verification. If it is determined that the information verification and the permission verification pass, send each machine learning model contract to each blockchain node in the blockchain network, and store each machine learning model contract in a contract repository through each blockchain node; each machine learning model contract is respectively used to perform data prediction processing on the target data to obtain a plurality of first prediction results and a plurality of second prediction results, and each of the first prediction results and each of the second prediction results are used for broadcasting and consensus to obtain a plurality of block prediction results. If it is determined that the verification of each block prediction result passes, obtain an integrated prediction result corresponding to the target data; Receive the confirmation information of successful storage feedback by each blockchain node, and store each confirmation information and each machine learning model contract in the blockchain network; If it is detected that the consensus based on the blockchain network passes, determine that the deployment processing operation of each machine learning model contract is completed.

7. The method according to claim 6, wherein Sending each machine learning model contract to each blockchain node in the blockchain network, and storing each machine learning model contract in a contract repository through each blockchain node, includes: Obtain each contract metadata corresponding to each machine learning model contract, and obtain each machine learning model contract matching the contract metadata from the business data pool; Store each machine learning model contract in a contract repository through each blockchain node.

8. A blockchain system, characterized in that, The system includes a terminal device and a blockchain network. The blockchain network includes a blockchain main node, a plurality of slave nodes, and a contract repository. A plurality of machine learning model contracts are stored in the contract repository; wherein: The terminal device is used to detect a data prediction request and feedback the data prediction request to the blockchain network; The blockchain main node is used to receive the data prediction request, and obtain a first object identifier, target data to be predicted, and a prediction service type carried in the data prediction request; if it is determined that the data verification of the first object identifier passes, access the contract repository deployed in the blockchain network, and obtain each machine learning model contract that matches according to the prediction service type; feedback the target data to each slave node in the blockchain network; The machine learning model contract is used to perform data prediction processing on the target data respectively to obtain a plurality of first prediction results, and store each of the first prediction results in a newly created block; The slave node is used to call each machine learning model contract deployed by itself to perform data prediction processing, and respectively generate corresponding second prediction results and store them in the newly created block; The blockchain master node is further configured to perform broadcasting and consensus based on each of the first prediction results and each of the second prediction results to obtain multiple block prediction results. If each blockchain node determines that the verification of each of the block prediction results is passed, an integrated prediction result corresponding to the target data is obtained.

9. The blockchain system according to claim 8, wherein: The terminal device is further configured to: detect a machine learning model contract deployment request and feedback the machine learning model contract deployment request to the blockchain network; The blockchain master node is further configured to: receive the machine learning model contract deployment request and obtain the second object identifier carried in the machine learning model contract deployment request and each machine learning model contract; Perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and the permission verification are passed, send each of the machine learning model contracts to each blockchain node in the blockchain network, and store each of the machine learning model contracts in a contract repository through each of the blockchain nodes; Receive the confirmation information of successful storage fed back by each of the blockchain nodes, and store each of the confirmation information and each of the machine learning model contracts in the blockchain network; If it is detected that the consensus based on the blockchain network is passed, it is determined that the deployment processing operation of each of the machine learning model contracts is completed.

10. A data prediction processing device based on blockchain, characterized in that, The device includes: A data prediction request receiving module, configured to receive a data prediction request and obtain a first object identifier, target data to be predicted, and a prediction service type carried in the data prediction request; A machine learning model contract obtaining module, configured to, if it is determined that the data verification of the first object identifier is passed, access a contract repository deployed in the blockchain network and obtain each machine learning model contract that matches the prediction service type; A first prediction result storage module, configured to call each of the machine learning model contracts to perform data prediction processing on the target data respectively, obtain multiple first prediction results, and store each of the first prediction results in a newly created block; A second prediction result storage module, configured to feedback the target data to each slave node in the blockchain network, and store multiple second prediction results obtained by each slave node in the newly created block; the second prediction result is obtained by the slave node performing data prediction processing based on the target data; An integrated prediction result obtaining module, configured to perform broadcasting and consensus based on each of the first prediction results and each of the second prediction results to obtain multiple block prediction results. If each blockchain node determines that the verification of each of the block prediction results is passed, an integrated prediction result corresponding to the target data is obtained.

11. A model contract processing device based on blockchain, characterized in that, The device includes: A machine learning model contract deployment request receiving module, configured to receive a machine learning model contract deployment request and obtain a second object identifier carried in the machine learning model contract deployment request and each machine learning model contract; The machine learning model contract storage module is used to perform information verification and permission verification based on the second object identifier. If it is determined that the information verification and the permission verification are passed, each of the machine learning model contracts is sent to each blockchain node in the blockchain network, and each of the machine learning model contracts is stored in the contract warehouse through each blockchain node; each of the machine learning model contracts is respectively used to perform data prediction processing on the target data to obtain a plurality of first prediction results and a plurality of second prediction results, and each of the first prediction results and each of the second prediction results are used for broadcasting and consensus to obtain a plurality of block prediction results. If it is determined that the verification of each of the block prediction results is passed, an integrated prediction result corresponding to the target data is obtained; The confirmation information receiving module is used to receive the confirmation information of successful storage fed back by each blockchain node, and store each of the confirmation information and each of the machine learning model contracts in the blockchain network; The deployment processing operation completion module is used to determine that the deployment processing operation of each of the machine learning model contracts is completed if it is detected that the consensus based on the blockchain network is passed.

12. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.