Block chain data processing method and device, equipment and storage medium
Through the decentralized training and incentive mechanism of the blockchain network, the problem of low training accuracy of pre-trained models is solved, and a more efficient training process and more accurate model training is achieved.
Patent Information
- Application Number
- CN202410006765.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
The training process of the existing pre-trained model has low training accuracy and poor generalization due to the limitations of the training sample set and the centralization of control.
Decentralized training of the initial task processing model is realized through the blockchain network, providing a rich training sample set, and introducing an incentive mechanism to allocate digital resources to participating devices to incentivize more devices to participate in training.
The training accuracy and training credibility of the pre-trained model are improved, and a more efficient training process is achieved.
Smart Images

Figure CN120258090A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of blockchain technology and artificial intelligence technology, and particularly relates to a blockchain data processing method, apparatus, device, and storage medium. Background Art
[0002] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, and mechatronics. Among them, the pre-trained model, also known as the large model or the basic model, can be widely applied to downstream tasks in various directions of artificial intelligence after fine-tuning (training). Currently, the training process of the pre-trained model is usually managed by a single entity or institution. In this training method, due to problems such as limitations in the training sample set, the training accuracy of the pre-trained model is relatively low. Summary of the Invention
[0003] Embodiments of this application provide a blockchain data processing method, apparatus, device, and storage medium, which can improve the training accuracy of the pre-trained model (i.e., the initial task processing model).
[0004] One aspect of the embodiments of this application provides a blockchain data processing method, including:
[0005] Obtain a training sample set associated with a task to be processed and an initial task processing model from the blockchain; the training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the initial task processing model is uploaded to the blockchain by a second device cluster in the blockchain network;
[0006] Train the initial task processing model according to the training sample set through a third device cluster in the blockchain network to obtain a task processing model for processing the task to be processed;
[0007] Determine the training participation degree of the first device cluster in the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster in the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster in the training process according to the task processing model;
[0008] Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees corresponding to the first device cluster, the second device cluster, and the third device cluster respectively.
[0009] One aspect of the embodiments of the present application provides a blockchain data processing device, including:
[0010] An acquisition module, configured to acquire, from the blockchain, a training sample set associated with a to-be-processed task and an initial task processing model; the training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the initial task processing model is uploaded to the blockchain by a second device cluster in the blockchain network;
[0011] A training module, configured to train the initial task processing model according to the training sample set through a third device cluster in the blockchain network to obtain a task processing model for processing the to-be-processed task;
[0012] A determination module, configured to determine the training participation degree of the first device cluster in the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster in the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster in the training process according to the task processing model;
[0013] An allocation module, configured to allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees respectively corresponding to the first device cluster, the second device cluster, and the third device cluster.
[0014] Optionally, the first device cluster includes N first node devices, and the training sample set includes training sample subsets respectively provided by the N first node devices, where N is a positive integer;
[0015] Optionally, the determination module may include an acquisition unit, a first determination unit, and a second determination unit;
[0016] The acquisition unit is configured to acquire the sample accuracy of the training sample subsets respectively corresponding to the N first node devices and the sample quantity included in each training sample subset;
[0017] The first determination unit is configured to determine the sample contribution degree of each first node device among the N first node devices according to the sample quantity of each first node device;
[0018] The second determination unit is configured to determine the training participation degree of each first node device in the training process of the initial task processing model according to the sample contribution degree and sample accuracy of each first node device among the N first node devices.
[0019] Optionally, the training sample subset includes a sample object and an annotation object attribute of the sample object, where N>1;
[0020] Optionally, the obtaining unit is specifically configured to determine a first similarity between sample objects in each two of the N training sample subsets corresponding to the N first node devices.
[0021] Determine a second similarity between the labeled object attributes of the sample objects in each two of the above training sample subsets.
[0022] Generate sample accuracies of the training sample subsets corresponding to the N first node devices respectively according to the first similarity and the second similarity.
[0023] Optionally, the determining module may further include a testing unit.
[0024] The obtaining unit is further configured to obtain algorithm attribute information corresponding to the task processing algorithm in the initial task processing model.
[0025] The first determining unit is further configured to determine the algorithm contribution degree of the second device cluster according to the algorithm attribute information.
[0026] The testing unit is configured to test the task processing accuracy of the initial task processing model according to the training sample set.
[0027] The second determining unit is further configured to generate the training participation degree of the second device cluster for the training process based on the algorithm contribution degree and the task processing accuracy of the initial task processing model.
[0028] Optionally, the testing unit is specifically configured to input the sample objects in the training sample set into the initial task processing model, perform prediction processing on the sample objects through the initial task processing model, and obtain the predicted object attributes of the sample objects.
[0029] Determine the attribute similarity between the labeled object attributes and the predicted object attributes of the sample objects in the training sample set.
[0030] Generate the task processing accuracy of the initial task processing model according to the attribute similarity.
[0031] The obtaining unit is further configured to obtain a test sample set associated with the to-be-processed task, and the device resources consumed by the third device cluster in the training process.
[0032] The testing unit is configured to test the task processing accuracy of the task processing model according to the test sample set.
[0033] The first determining unit is further configured to determine the resource contribution degree of the third device cluster according to the device resources.
[0034] The second determination unit is further configured to generate the training participation degree of the third device cluster for the training process based on the above resource contribution degree and the task processing accuracy of the above task processing model.
[0035] Optionally, the number of resource types of the above device resources is K, and K is an integer greater than 1;
[0036] The first determination unit is specifically configured to obtain the consumption amounts respectively corresponding to the K types of device resources consumed by the third device cluster during the training process;
[0037] Perform a weighted summation process on the consumption amounts respectively corresponding to the K types of device resources to obtain the total consumption amount of the device resources of the third device cluster;
[0038] Determine the resource contribution degree of the third device cluster according to the total consumption amount of the device resources of the third device cluster.
[0039] Optionally, the training module may include an input unit, a prediction unit, a third determination unit, and a training unit;
[0040] The input unit is configured to input the sample objects in the above training sample set into the above initial task processing model through the third device cluster in the above blockchain network;
[0041] The prediction unit is configured to perform a prediction process on the above sample objects through the above initial task processing model to obtain the predicted object attributes of the above sample objects;
[0042] The third determination unit is configured to determine the task processing error of the above initial task processing model according to the labeled object attributes and the predicted object attributes of the above sample objects in the above training sample set;
[0043] The training unit is configured to train the above initial task processing model according to the above task processing error to obtain a task processing model for processing the above to-be-processed task.
[0044] Optionally, the training unit is specifically configured to determine the convergence state of the above initial task processing model according to the above task processing error;
[0045] When the convergence state of the above initial task processing model is the non-converged state, adjust the model parameters of the above initial task processing model according to the above task processing error;
[0046] When the convergence state of the adjusted initial task processing model is the converged state, determine the adjusted initial task processing model as the task processing model for processing the above to-be-processed task.
[0047] Optionally, the device may further include a blockchain uploading module, a receiving module, and a calling module;
[0048] The blockchain uploading module is configured to upload the above-mentioned task processing model to the above-mentioned blockchain;
[0049] The receiving module is configured to receive a call request from a terminal for the above-mentioned task processing model on the above-mentioned blockchain;
[0050] The determination module is further configured to determine, according to the above-mentioned call request, the digital resources to be spent by the above-mentioned terminal for calling the above-mentioned task processing model;
[0051] The calling module is configured to call the above-mentioned task processing model according to the above-mentioned call request, and transfer the above-mentioned to-be-spent digital resources from the account address corresponding to the above-mentioned terminal to the account address corresponding to the above-mentioned task processing model.
[0052] Specifically, when the above-mentioned call request is used to indicate to perform recognition processing on a target object, the calling module is configured to input the above-mentioned target object into the above-mentioned task processing model;
[0053] Perform recognition processing on the above-mentioned target object through the above-mentioned task processing model to obtain the recognition object attributes of the above-mentioned target object;
[0054] Return the above-mentioned recognition object attributes to the above-mentioned terminal.
[0055] An embodiment of the present application provides a computer device on the one hand, including a memory and a processor. The above-mentioned memory stores a computer program, and when the above-mentioned processor executes the above-mentioned computer program, the following steps are implemented:
[0056] Obtain a training sample set associated with a to-be-processed task and an initial task processing model from a blockchain; the above-mentioned training sample set is uploaded to the above-mentioned blockchain by a first device cluster in a blockchain network, and the above-mentioned initial task processing model is uploaded to the above-mentioned blockchain by a second device cluster in the above-mentioned blockchain network;
[0057] Train the above-mentioned initial task processing model according to the above-mentioned training sample set through a third device cluster in the above-mentioned blockchain network to obtain a task processing model for processing the above-mentioned to-be-processed task;
[0058] Determine the training participation degree of the above-mentioned first device cluster in the training process of the above-mentioned initial task processing model according to the above-mentioned training sample set, determine the training participation degree of the above-mentioned second device cluster in the training process according to the above-mentioned training sample set and the above-mentioned initial task processing model, and determine the training participation degree of the above-mentioned third device cluster in the training process according to the above-mentioned task processing model;
[0059] Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster respectively according to the training participation degrees corresponding to the above-mentioned first device cluster, the above-mentioned second device cluster, and the above-mentioned third device cluster.
[0060] On the one hand, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0061] Obtain a training sample set and an initial task processing model associated with the task to be processed from the blockchain; the training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the initial task processing model is uploaded to the blockchain by a second device cluster in the blockchain network;
[0062] Through a third device cluster in the blockchain network, train the initial task processing model according to the training sample set to obtain a task processing model for processing the task to be processed;
[0063] Determine the training participation degree of the first device cluster for the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster for the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster for the training process according to the task processing model;
[0064] Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster respectively according to the training participation degrees corresponding to the above-mentioned first device cluster, the above-mentioned second device cluster, and the above-mentioned third device cluster.
[0065] On the one hand, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the above method are implemented.
[0066] In this application, a training sample set for training an initial task processing model is provided by a first device cluster in a blockchain network, the initial task processing model is provided by a second device cluster in the blockchain network, and the initial task processing model is trained by a third device cluster in the blockchain network according to the training sample set to obtain a task processing model for processing tasks to be processed, realizing the decentralized training of the initial task processing model. By reading the training samples and the initial task processing model from the blockchain, the security and transparency of the data are ensured, and the training accuracy and training efficiency of the initial task processing model are improved. At the same time, digital resources are allocated to the first device cluster, the second device cluster, and the third device cluster based on their respective training participation degrees in the training process, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model. Description of the Drawings
[0067] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. 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 be obtained based on these drawings.
[0068] Figure 1 It is a schematic diagram of a blockchain data processing system provided by the present application;
[0069] Figure 2 It is a schematic diagram of the interaction scenario between devices in a blockchain data processing system provided by the present application;
[0070] Figure 3 It is a schematic diagram of the interaction scenario between devices in a blockchain data processing system provided by the present application;
[0071] Figure 4 It is a schematic flowchart of a blockchain data processing method provided by the present application;
[0072] Figure 5 It is a schematic flowchart of a blockchain data processing method provided by the present application;
[0073] Figure 6 It is a schematic diagram of the scenario for obtaining the training participation degree of the first device cluster provided by the present application;
[0074] Figure 7 It is a schematic diagram of the scenario for obtaining the training participation degree of the second device cluster provided by the present application;
[0075] Figure 8It is a schematic diagram of a scenario for obtaining the training participation of a third device cluster provided by this application;
[0076] Figure 9 It is a schematic structural diagram of a blockchain data processing device provided by an embodiment of this application;
[0077] Figure 10 It is a schematic structural diagram of a computer device provided by an embodiment of this application. Detailed implementation manners
[0078] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0079] First, introduce the blockchain data processing system to which this solution is applied. Please refer to Figure 1 , Figure 1 It is a schematic structural diagram of a blockchain data processing system provided by an embodiment of this application. The blockchain data processing system may include a blockchain network and one or more terminals.
[0080] Among them, the blockchain network is an end-to-end decentralized network jointly composed of multiple node devices (which can also be called blockchain nodes). The number of node devices in the blockchain network can be deployed according to actual needs, and this application does not limit the number of node devices; for example Figure 1 in this, it is described by taking the blockchain network including 4 node devices as an example. The 4 node devices are node device 101, node device 102, node device 103, and node device 104 respectively.
[0081] It can be understood that the functions involved in each node device in the blockchain network include:
[0082] 1) Routing, which is a basic function of the node device and is used to support communication between node devices.
[0083] For example, as Figure 1As shown in the figure, data or blocks can be transmitted between node devices through a network connection. The network connection between the above node devices can perform data transmission based on node identifiers. Each node device has its corresponding node identifier, and each of the above node devices can store the node identifiers of other node devices that are connected to itself, so as to broadcast the acquired data or generated blocks to other node devices according to the node identifiers of other node devices in the future. For example, node device 101 can maintain a list of node identifiers, and this list of node identifiers stores the node names and node identifiers of other node devices, as shown in Table 1:
[0084] Table 1
[0085]
[0086]
[0087] As shown in Table 1, assuming that the node identifier of node device 101 is aaaa, node device 101 can send a data synchronization request to node device 102 through aaaa, and node device 102 can know that this data synchronization request is sent by node device 101 through the node identifier aaaa; similarly, node device 102 can send transaction data A to node device 101 through the node identifier bbbb, and node device 101 can know that this transaction data A is sent by node device 102 through the node identifier bbbb. The data transmission between other node devices is also the same, so it will not be elaborated one by one.
[0088] 2) An application, which is used to be deployed in a blockchain, implements specific services according to actual business requirements, records data related to the implemented functions to form recorded data, carries a digital signature in the recorded data to indicate the source of the task data, and sends the recorded data to other node devices in the blockchain network. When other node devices successfully verify the source and integrity of the recorded data, they add the recorded data to a temporary block.
[0089] For example, the services implemented by the application include:
[0090] 2.1) Resource management service. The node device can include a resource client, and the resource client can be used to implement the resource management service function and establish a communication connection with a decentralized application client based on this resource management service function. The resource client is a tool for managing and storing user digital resources. For example, digital resources can be transferred to other accounts based on the resource client, and digital resources transferred from other accounts can also be received based on the resource client. The resource client can be a hardware device or a software program.
[0091] It is understandable that as various decentralized applications are widely deployed on the blockchain and user activities on the blockchain increase, when ordinary users use decentralized applications, they can use blockchain key management tools to log in. The address in the blockchain key management tool corresponds to a user on the blockchain. Decentralized applications can obtain the user address from the key management tool through some interfaces. In order to solve the problem that the Dapp background cannot trust the user address used when the decentralized application logs in.
[0092] 2.2) Shared ledger, which is used to provide functions such as storage, query, and modification of account data (i.e., transaction data), sends the recorded data of the operations on the account data to other nodes in the blockchain network. After other nodes verify it as valid, as a response to acknowledging the validity of the account data, the recorded data is stored in a temporary block, and a confirmation can also be sent to the node device that initiated the operation.
[0093] For example, each node device can receive data to be recorded during normal operation and maintain a shared ledger (i.e., blockchain) based on the received data to be recorded. To ensure information intercommunication within the shared ledger network, there can be network connections between each node device in the shared ledger network, and data transmission can be carried out between node devices through the above network connections. For example, when any node device in the shared ledger network receives data to be recorded, other node devices in the shared ledger network will verify the data to be recorded according to the consensus algorithm. After successful verification (i.e., after reaching a consensus), the data to be recorded is stored as data in the shared ledger, so that the data stored on all node devices in the shared ledger network is consistent.
[0094] 2.3) Smart contract, a computerized protocol that can execute the terms of a certain contract, is implemented through code deployed on the shared ledger and used to execute when certain conditions are met. According to actual business requirements, the code is used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's digital resources to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0095] Among them, each node device in the blockchain network of the present application can be used to participate in the training process of the initial task processing model, that is, each node device in the blockchain network can execute one or more of the following steps: (1) Generate an initial task processing model; (2) Obtain a training sample set for training the initial task processing model; (3) Train the initial task processing model according to the training sample set to obtain a task processing model for processing the task to be processed. It can be understood that the node device in the blockchain network for obtaining the training sample set for training the initial task processing model can be called the first node device in the first device cluster; the node device in the blockchain network for generating the initial task processing model can be called the second node device in the second device cluster; the node device in the blockchain network for training the initial task processing model according to the training sample set to obtain a task processing model for processing the task to be processed can be called the third node device in the third device cluster.
[0096] Among them, the third node device in the third device cluster can also be used to allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees corresponding to the first device cluster, the second device cluster, and the third device cluster respectively. Of course, other node devices in the blockchain network can also allocate digital resources to the first device cluster, the second device cluster, and the third device cluster. The other node devices can refer to the other node devices in the blockchain network except the node devices in the third device cluster. Digital resources can also be allocated to the first device cluster, the second device cluster, and the third device cluster by off-chain devices. The off-chain devices can refer to the node devices outside the blockchain network. In the present application, the case where the third node device in the third device cluster allocates digital resources to the first device cluster, the second device cluster, and the third device cluster is mainly used as an example for illustration.
[0097] Among them, the number of devices in the first device cluster, the second device cluster, and the third device cluster can be one or more. The devices in every two of the first device cluster, the second device cluster, and the third device cluster can be different, or partially the same or completely the same. For example, if the above node device 101 can be used for the above steps (1) and (2), then the node device 101 belongs to one of the devices in the first device cluster and the second device cluster.
[0098] Among them, the task to be processed in this application can refer to tasks related to computer vision, speech processing, natural language processing, and autonomous driving; tasks related to computer vision can include image processing, image recognition, image generation, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, etc. Speech processing tasks can include speech recognition tasks, speech conversion tasks, speech generation tasks, etc.; speech recognition tasks can refer to recognizing speech data into text content, speech conversion tasks can refer to converting speech data in one language into speech data in another language, and speech generation tasks can refer to converting gestures, text, etc. into speech data. Natural language processing tasks can include semantic understanding, robot question answering, knowledge graph creation, etc.; tasks related to autonomous driving can include generating high-precision maps, environmental perception, computer vision, behavior decision-making, path planning, motion control, etc.
[0099] Among them, the initial task processing model can refer to a pre-trained model. A pre-trained model (Pre-training model), also known as a foundation model or a large model, refers to a deep neural network (DNN) with a large number of parameters. It is trained on a large amount of unlabeled data, and uses the function approximation ability of the large-parameter DNN to enable the PTM to extract common features from the data. Through techniques such as fine-tuning, parameter-efficient fine-tuning (PEFT), and prompt-tuning, it is applicable to downstream tasks. Therefore, the pre-trained model can achieve ideal results in few-shot or zero-shot scenarios. PTMs can be classified into language models (ELMO, BERT, GPT), vision models (swin-transformer, ViT, V-MOE), speech models (VALL-E), multi-modal models (ViBERT, CLIP, Flamingo, Gato), etc. according to the data modalities they process. Among them, multi-modal models refer to models that establish feature representations of two or more data modalities. The pre-trained model is an important tool for outputting artificial intelligence-generated content (AIGC) and can also be used as a general interface connecting multiple specific task models.
[0100] Among them, digital resources can refer to digital collections, game themes, stocks, game coins, digital copyrights, game props, etc.
[0101] Among them, the training data set may include sample objects and the labeled object attributes of the sample objects. The sample objects may refer to texts, images, audios, videos, etc. The labeled object attributes may refer to information used to reflect the attribute characteristics of the sample objects. For example, when the task to be processed is an image recognition task, the sample object may refer to an image, and the labeled object attributes may refer to information such as the name and category of the object in the image. The labeled object attributes may be obtained by manually labeling the sample objects; or, the labeled object attributes may be extracted by the first node device from the description information of the sample objects. The description information may include the information edited by the publisher when the sample object is published, as well as the comment information of the sample object, etc.
[0102] Among them, the number of terminals can be deployed according to actual needs, and this application does not limit the number of terminals; for example Figure 1 Taking the example that there are 3 terminals in the system, the 3 terminals are Terminal 111, Terminal 112, and Terminal 113 respectively. The terminal may include a blockchain application, which may also be referred to as a blockchain client. Each terminal can be used to send a training request for the initial task processing model to the node devices in the blockchain network through the blockchain client, and can also be used to call the trained task processing model in the blockchain network to execute the task to be processed.
[0103] Among them, the node devices in the blockchain network may refer to terminals or servers. The server may be an independent physical server, or a server cluster or distributed system composed of at least two physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminals in this application may include: smart phones, tablets, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances (such as smart TVs), wearable devices, vehicle-mounted terminals, etc., which are intelligent terminals with data processing functions. Each terminal and the node device can achieve interaction through wireless communication or wired communication methods.
[0104] The training process of current pre-trained models (i.e., initial task processing models) is usually managed by a single entity or institution. In this training method, due to problems such as limitations in the training sample set and centralization of control in the training process, the training accuracy of the pre-trained model is relatively low. For example, the limited sample size that a single entity or institution can obtain leads to poor generalization of the trained task processing model. Generalization refers to the ability of the task processing model to perform well on unseen data. Based on this, the present application improves the training accuracy of the pre-trained model (initial task processing model) through the following two aspects: First, by implementing the training process of the initial task processing model through a decentralized blockchain network, a richer training sample set can be provided for the training process of the initial task processing model, realizing decentralized management of the training process of the initial task processing model, and improving the training accuracy and training credibility of the initial task processing model. Second, by introducing an incentive mechanism, digital resources are allocated to the devices participating in the training process of the initial task recognition model, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0105] In specific implementation, Figure 1 the blockchain data processing system in can be used to implement Figure 2 and Figure 3 the blockchain data processing method in, Figure 2 and Figure 3 the node device 21a in can refer to Figure 1 the node device 101 in, Figure 2 and Figure 3 the node device 22a in can refer to Figure 1 the node device 102 in, Figure 2 and Figure 3 the node device 23a in can refer to Figure 1 the node device 103 in, Figure 2 and Figure 3 the node device 24a in can refer to Figure 1 the node device 104 in. Figure 2 the terminal 20a in can refer to Figure 1 any one of the terminals in, and the node device 21a, the node device 22a, the node device 23a, and the node device 24a may include the blockchain 25a.
[0106] Such as Figure 2In this case, in response to a configuration operation for a configuration page in a blockchain application, the terminal 20a obtains a to-be-processed task resulting from the configuration operation, and generates a training request for an initial task processing model associated with the to-be-processed task. Taking the to-be-processed task as an image recognition task as an example for illustration, the to-be-recognized task is used to indicate which attributes in the image need to be recognized, and this training request is used to instruct the node devices in the blockchain network to train a task processing model for processing the to-be-processed task. The terminal 20a can broadcast this training request to the node devices in the blockchain network, or the terminal 20a can send this training request to any node device in the blockchain network, and this node device forwards this training request to other node devices in the blockchain network.
[0107] As Figure 2 In this case, after receiving the training request, the node device 24a can obtain a subset of training samples 26a from the network or local storage, and store the subset of training samples 26a in the blockchain 25a; the subset of training samples 26a includes the sample images obtained by the node device 24a, and the labeled object attributes of the sample images, where the labeled object attributes are used to reflect the names, types, etc. of the objects in the sample images. Similarly, after receiving the training request, the node device 23a can obtain a subset of training samples 27a from the network or local storage, and store the subset of training samples 27a in the blockchain 25a; the subset of training samples 27a includes the sample images obtained by the node device 23a, and the labeled object attributes of the sample images. After receiving the training request, the node device 21a can, based on this training request, select an initial task processing model 28a associated with the to-be-processed task from local storage, or can receive an initial task processing model 28a associated with the to-be-processed task written by the user corresponding to the node device 21a, and store the initial task processing model 28a in the blockchain 25a.
[0108] As Figure 2In this case, after the node device 22a receives a training request, it can read a subset of training samples 26a, a subset of training samples 27a, and an initial task processing model 28a from the blockchain 25a. It inputs the sample images in the subset of training samples 26a into the initial task processing model 28a, and the initial task processing model 28a performs prediction processing on the sample images in the subset of training samples 26a to obtain the predicted object attributes of the sample images in the subset of training samples 26a. It adjusts the model parameters of the initial task processing model 28a according to the predicted object attributes and the labeled object attributes of the sample images in the subset of training samples 26a to obtain the adjusted initial task processing model 28a. It inputs the sample images in the subset of training samples 27a into the adjusted initial task processing model 28a, and the adjusted initial task processing model 28a performs prediction processing on the sample images in the subset of training samples 27a to obtain the predicted object attributes of the sample images in the subset of training samples 27a. It adjusts the model parameters of the adjusted initial task processing model according to the predicted object attributes and the labeled object attributes of the sample images in the subset of training samples 27a. After completing one iteration training process of the initial task processing model, it repeats the above steps. After multiple rounds of iteration training processes, it can obtain a task processing model 29a for processing the task to be processed.
[0109] As Figure 3 In this case, after obtaining the task processing model 29a, the node device 22a can determine the training participation degree 20b of the node device 22a in the training process of the initial task processing model according to the task processing accuracy of the task processing model 29a, etc. It can determine the training participation degree 21b of the node device 21 in the training process according to the initial task processing model 28a, the subset of training samples 27a, and the subset of training samples 26a. It determines the training participation degree 22b of the node device 23a in the training process according to the subset of training samples 27a, and determines the training participation degree 23b of the node device 24a in the training process according to the subset of training samples 26a. Furthermore, it can allocate digital resources 24b to the node device 22a according to the training participation degree 20b, allocate digital resources 25b to the node device 21a according to the training participation degree 21b, allocate digital resources 26b to the node device 23a according to the training participation degree 22b, and allocate digital resources 27b to the node device 24a according to the training participation degree 23b. The greater the training participation degree here, the more digital resources the node device is allocated. For example, when the training participation degree 20b corresponding to the node device 22a is the maximum training participation degree and the training participation degree 23b corresponding to the node device 24a is the minimum training participation degree, the resource amount included in the digital resources 24b allocated to the node device 22a is the maximum resource amount, and the resource amount included in the digital resources 27b allocated to the node device 24a is the minimum resource amount.
[0110] In summary, by implementing the training process of the initial task processing model through a decentralized blockchain network, a richer training sample set can be provided for the training process of the initial task processing model, decentralized management of the training process of the initial task processing model can be achieved, and the training accuracy and training credibility of the initial task processing model can be improved. In addition, by introducing an incentive mechanism, digital resources are allocated to the devices participating in the training process of the initial task recognition model, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0111] Further, please refer to Figure 4 which is a schematic flowchart of a blockchain data processing method provided by an embodiment of the present application. As Figure 4 shown, this method can be executed by any third node device in the third device cluster in the Figure 1 blockchain network. Among them, this method may include the following steps:
[0112] S101. Obtain a training sample set associated with the task to be processed and an initial task processing model from the blockchain; the above training sample set is uploaded to the above blockchain by the first device cluster in the blockchain network, and the above initial task processing model is uploaded to the above blockchain by the second device cluster in the above blockchain network.
[0113] In the present application, the terminal can broadcast a training request for the initial task processing model to the node devices in the blockchain network. The initial task processing model is a pre-training model for processing the task to be processed. After receiving the training request, the first node device in the first device cluster in the blockchain network can obtain a training sample set for training the initial task processing model and store the training sample set on the blockchain of the blockchain network. After receiving the training request, the second node device in the second device cluster in the blockchain network can generate an initial task processing model and store the initial task processing model on the blockchain of the blockchain network. The initial task processing model includes one or more task processing algorithms, and the task processing algorithm can be written by the second node device for the corresponding user, or the task processing algorithm can be obtained by the second node device improving (or combining) the existing algorithms.
[0114] Further, after the third node device in the third device cluster in the blockchain network receives the training request, it can read the training sample set and the initial task processing model associated with the to-be-processed task from the blockchain. By storing the training sample set and the initial task processing model on the blockchain, the malicious tampering of the training sample set and the initial task processing model can be avoided, the security of the training sample set and the initial task processing model can be improved, a more accurate and richer training sample set can be provided for the training process of the initial task processing model, and the training accuracy of the initial task processing model can be improved.
[0115] It should be noted that the initial task processing model can refer to the initial task processing model with the minimum time interval between the upload time and the current time in the blockchain, or the initial task processing model can refer to the candidate task processing model with the maximum task processing accuracy among the multiple candidate task processing models provided by the first device cluster. Alternatively, the initial task processing model can refer to the candidate task processing model with the maximum score among the multiple candidate task processing models provided by the first device cluster, and the score of the candidate task processing model can be generated by the third node device in the third device cluster based on the algorithm attribute information of the candidate task processing model.
[0116] S102. Through the third device cluster in the above-mentioned blockchain network, train the above-mentioned initial task processing model according to the above-mentioned training sample set to obtain a task processing model for processing the above-mentioned to-be-processed task.
[0117] In this application, after the third node device in the third device cluster obtains the training sample set and the initial task processing model, the third node device can perform multiple rounds of iterative training on the initial task processing model according to the training sample set to obtain a task processing model for processing the to-be-processed task.
[0118] In one embodiment, the training sample set may include N training sample subsets, where N is a positive integer. When N is equal to 1, it indicates that the training sample set is provided by a first node device in the first device cluster; at this time, the number of third node devices in the third device cluster can be 1, and the third node device can directly perform multiple rounds of iterative training on the initial task processing model according to the training sample subset included in the training sample set to obtain a task processing model for processing the to-be-processed task.
[0119] In one embodiment, when N is greater than 1, it indicates that the training sample set is provided by N first node devices in the first device cluster; at this time, the number of third node devices in the third device cluster can be Q, and Q can be a positive integer less than or equal to N. One third node device in the third device cluster is used to train the initial task processing model with at least one training sample subset. Specifically, the third node device i in the third device cluster can obtain the trained initial task processing model i - 1 obtained by the third node device i - 1, train the trained initial task processing model i - 1 according to the i-th training sample subset to obtain the trained initial task processing model i, and send the trained initial task processing model i to the third node device i + 1 in the third device cluster. i is a positive integer greater than 1 and less than or equal to N, and the trained initial task processing model 1 is obtained by training the initial task processing model with the first training sample subset. Through multiple third node devices in the third device cluster, assisting in training the initial task processing model, decentralized management of the training process of the initial task processing model is achieved, and the training accuracy of the initial task processing model is improved.
[0120] For example, assume Q is 3 and N is 4; the third node device 1 in the third device cluster can train the initial task processing model according to the first training sample subset in the training sample set to obtain the trained task processing model 1, and send the trained task processing model 1 to the third node device 2 in the third device cluster. The third node device 2 can train the trained task processing model 1 according to the second training sample subset to obtain the trained task processing model 2, and send the trained task processing model 2 to the third node device 3 in the third device cluster. The third node device 3 can train the trained task processing model 2 according to the third training sample subset and the fourth training sample subset to obtain the task processing model for processing the task to be processed.
[0121] In one embodiment, when N is greater than 1, it indicates that the training sample set is provided by N first node devices in the first device cluster, and the training sample set includes N training sample subsets; Q can be a positive integer greater than 1 and less than N. One third node device corresponds to one or more training sample subsets, and each third node device in the third device cluster can independently train the initial task processing model based on its corresponding training sample subset to obtain Q task processing models. The task processing model with the highest task processing accuracy among the Q task processing models is determined as the task processing model for processing the task to be processed, and the task processing model with the highest task processing accuracy is uploaded to the blockchain for subsequent invocation to process downstream tasks.
[0122] S103. Determine the training participation of the first device cluster in the training process of the initial task processing model according to the above training sample set. Determine the training participation of the second device cluster in the training process according to the above training sample set and the initial task processing model. Determine the training participation of the third device cluster in the training process according to the above task processing model.
[0123] In this application, the third node device can determine the training participation of the first device cluster in the training process of the initial task processing model according to the training sample set. That is, the training participation corresponding to the first device cluster is used to reflect the contribution of the first device nodes in the first device cluster to the training process. Determine the training participation of the second device cluster in the training process according to the training sample set and the initial task processing model. The training participation corresponding to the second device cluster is used to reflect the contribution of the second device nodes in the second device cluster to the training process. Further, the training participation of the third device cluster in the training process can be determined according to the task processing model. The training participation corresponding to the third device cluster is used to reflect the contribution of the second device nodes in the second device cluster to the training process.
[0124] S104. Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation corresponding to the first device cluster, the second device cluster, and the third device cluster respectively.
[0125] In this application, the third node device can allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation corresponding to the first device cluster, the second device cluster, and the third device cluster respectively. There is a positive correlation between the training participation corresponding to the device cluster and the digital resources obtained by allocation. That is, the greater the training participation corresponding to the device cluster, the more digital resources the device cluster obtains by allocation. Conversely, the smaller the training participation corresponding to the device cluster, the fewer digital resources the device cluster obtains by allocation. Here, the device cluster refers to the first device cluster, the second device cluster, and the third device cluster. By allocating digital resources to the first device cluster, the second device cluster, and the third device cluster based on the training participation, it is beneficial to encourage more node devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0126] In this application, a training sample set for training an initial task processing model is provided by a first device cluster in a blockchain network, and the initial task processing model is provided by a second device cluster in the blockchain network. A third device cluster in the blockchain network trains the initial task processing model according to the training sample set to obtain a task processing model for processing a to-be-processed task, thereby realizing decentralized training of the initial task processing model. By reading the training samples and the initial task processing model from the blockchain, the security and transparency of the data are ensured, and the training accuracy and training efficiency of the initial task processing model are improved. At the same time, digital resources are allocated to the first device cluster, the second device cluster, and the third device cluster based on their respective training participation degrees in the training process, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0127] Further, please refer to Figure 5 which is a schematic flowchart of a blockchain data processing method provided by an embodiment of this application. As Figure 5 shown, this method can be executed by any third node device in a third device cluster in a Figure 1 blockchain network. Among them, this method may include the following steps:
[0128] S201. Obtain a training sample set associated with a to-be-processed task and an initial task processing model from the blockchain; the above training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the above initial task processing model is uploaded to the blockchain by the second device cluster in the blockchain network.
[0129] S202. Input the sample objects in the above training sample set into the above initial task processing model through the third device cluster in the above blockchain network.
[0130] S203. Perform prediction processing on the above sample objects through the above initial task processing model to obtain the predicted object attributes of the above sample objects.
[0131] In steps S202 - S203, a third node device in the third device cluster can input the sample objects in the training sample set into the initial task processing model, and the initial task processing model performs prediction processing on the sample objects to obtain the predicted object attributes of the sample objects. The predicted object attributes reflect the attributes obtained by predicting the sample objects. For example, when the sample object is an image, the predicted object attributes may refer to the name, category, location, etc. of the objects contained in the predicted image; when the sample object is an audio, the predicted object attributes may refer to the text reflected by the predicted audio, etc.
[0132] S204. Determine the task processing error of the initial task processing model according to the labeled object attributes and the predicted object attributes of the sample objects in the above training sample set.
[0133] In this application, the labeled object attributes of the sample objects in the training sample set are used to reflect the attributes obtained by labeling the sample objects. The accuracy of the labeled object attributes is relatively high, and it can also be called the standard object attributes. When the difference between the predicted object attributes and the labeled object attributes is relatively small, it indicates that the initial task processing model can better fit the labeled object attributes, that is, the task processing accuracy of the initial task processing model is relatively high. When the difference between the predicted object attributes and the labeled object attributes is relatively large, it indicates that the initial task processing model cannot better fit the labeled object attributes, that is, the task processing accuracy of the initial task processing model is relatively low. Therefore, the third node device can determine the task processing error of the initial task processing model according to the labeled object attributes and the predicted object attributes of the sample objects in the training sample set. The task processing error is used to reflect the task processing accuracy of the initial task processing model, that is, the smaller the task processing error, the higher the task processing accuracy of the initial task processing model; on the contrary, the larger the task processing error, the lower the task processing accuracy of the initial task processing model.
[0134] S205. Train the initial task processing model according to the above task processing error to obtain a task processing model for processing the above to-be-processed task.
[0135] In this application, the third node device can train the initial task processing model according to the task processing error until the task processing error of the initial task processing model reaches the lowest, or the number of iterations in the training process of the initial task processing model is greater than the number threshold, to obtain a task processing model for processing the to-be-processed task, and improve the training accuracy of the initial task processing model.
[0136] It should be noted that one iteration in the training process of the initial task processing model can refer to the process of training the initial task processing model based on all sample objects in the training sample set; the above number threshold can be determined according to the accuracy requirements of the to-be-processed task, or the number threshold can refer to the one set by the user according to their own needs.
[0137] In one embodiment, training the initial task processing model according to the task processing error to obtain a task processing model for processing the to-be-processed task includes: determining the convergence state of the initial task processing model according to the task processing error; when the convergence state of the initial task processing model is the non-converged state, adjusting the model parameters of the initial task processing model according to the task processing error. When the convergence state of the adjusted initial task processing model is the converged state, the adjusted initial task processing model is determined as the task processing model for processing the to-be-processed task.
[0138] Specifically, the third node device can perform a derivative operation on the loss function of the initial task processing model to obtain the derivative function of the loss function, and determine the minimum value of the loss function of the initial task processing model according to the derivative function. According to the minimum value of the loss function and the task processing error, the convergence state of the initial task processing model is determined. The convergence state includes the converged state or the non-converged state. The converged state means that the task processing error of the initial task processing model is the minimum value of the loss function, that is, the task processing accuracy of the initial task processing model is the maximum value; the non-converged state means that the task processing error of the initial task processing model does not reach the minimum value of the loss function, that is, the task processing accuracy of the initial task processing model does not reach the maximum value. Therefore, when the convergence state of the initial task processing model is the converged state, the third node device can determine the initial task processing model as the task processing model for processing the to-be-processed task; when the convergence state of the initial task processing model is the non-converged state, the third node device can adjust the model parameters of the initial task processing model according to the task processing error until the convergence state of the adjusted initial task processing model is the converged state, and then determine the adjusted initial task processing model as the task processing model for processing the to-be-processed task. By adjusting the model parameters of the initial task processing model based on the task processing error, the training accuracy of the initial task processing model is improved.
[0139] S206. Determine the training participation degree of the first device cluster in the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster in the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster in the training process according to the task processing model.
[0140] In one embodiment, the first device cluster includes N first node devices, and the training sample set includes training sample subsets respectively provided by the N first node devices, where N is a positive integer; determining the training participation degree of the first device cluster for the training process of the initial task processing model according to the training sample set includes: obtaining the sample accuracies of the training sample subsets respectively corresponding to the N first node devices, and the sample sizes included in each of the training sample subsets; determining the sample contribution degree of each of the N first node devices according to the sample size of each first node device among the N first node devices. According to the sample contribution degree and the sample accuracy of each first node device among the N first node devices, determine the training participation degree of each first node device for the training process of the initial task processing model.
[0141] Specifically, the third device can obtain the sample accuracies of the training sample subsets respectively corresponding to the N first node devices, and the sample sizes included in each of the training sample subsets; the sample accuracy is used to reflect the accuracy of the labeled object attributes in the training sample subset provided by the first node device, and the sample size is used to reflect the number of sample objects in the corresponding training sample subset. The sample contribution degree of each first node device can be determined according to the sample size of each first node device among the N first node devices. The sample contribution degree is used to reflect the contribution size of the first node device to the training sample set. There is a positive correlation between the sample size of the first node device and the sample contribution degree, that is, the larger the sample size of the first node device, the larger the corresponding sample contribution degree of the first node device; conversely, the smaller the sample size of the first node device, the smaller the corresponding sample contribution degree of the first node device. Further, the training participation degree of each first node device for the training process of the initial task processing model can be determined according to the sample contribution degree and the sample accuracy of each first node device among the N first node devices. By using the sample contribution degree and the sample accuracy to measure the training participation degree of the first node device, this is conducive to motivating the node devices in the blockchain network to provide a richer and more accurate training sample set and improving the training accuracy of the initial task processing model.
[0142] For example, as Figure 6As shown, the first device cluster includes first node devices 60a, 61a, 62a, …; the first node device 60a provides a training sample subset 60b, the first node device 61a provides a training sample subset 61b; the first node device 62a provides a training sample subset 62b. The third node device can obtain the sample size and sample accuracy of the training sample subset 60b, and determine the training participation degree of the first node device 60a according to the sample size and sample accuracy of the training sample subset 60b; obtain the sample size and sample accuracy of the training sample subset 61b, and determine the training participation degree of the first node device 61a according to the sample size and sample accuracy of the training sample subset 61b. Obtain the sample size and sample accuracy of the training sample subset 62b, and determine the training participation degree of the first node device 62a according to the sample size and sample accuracy of the training sample subset 62b. And so on, until the training participation degrees corresponding to all the first node devices in the first device cluster are obtained, which is beneficial to subsequent allocation of digital resources to each first node device based on the training participation degrees corresponding to each first node device respectively, and is beneficial to motivating more node devices in the blockchain network to provide accurate training sample subsets.
[0143] In one embodiment, the above training sample subset includes a sample object and the labeled object attributes of the sample object, N>1; the obtaining of the sample accuracies of the training sample subsets corresponding to the N first node devices respectively includes: determining a first similarity between the sample objects in every two of the N training sample subsets corresponding to the N first node devices; determining a second similarity between the labeled object attributes of the sample objects in every two of the above training sample subsets; generating the sample accuracies of the training sample subsets corresponding to the N first node devices respectively according to the first similarity and the second similarity.
[0144] Specifically, the third node device can compare the sample objects in every two training sample subsets among the N training sample subsets corresponding to the N first node devices to determine the first similarity between the sample objects in every two training sample subsets among the N training sample subsets corresponding to the N first node devices. Here, the first similarity can refer to the sum of the similarities between the sample objects in every two training sample subsets; compare the labeled object attributes of the sample objects in every two training sample subsets to determine the second similarity between the labeled object attributes of the sample objects in every two training sample subsets. Here, the second similarity can refer to the sum of the similarities between the labeled object attributes of the sample objects in every two training sample subsets. Under normal circumstances, if the first similarity between the sample objects in two training sample subsets is greater, the second similarity between the labeled object attributes of the sample objects in these two training sample subsets is also greater; if the first similarity between the sample objects in two training sample subsets is smaller, the second similarity between the labeled object attributes of the sample objects in these two training sample subsets is also smaller.
[0145] Therefore, the third node device can sum up the first similarities between the target training sample subset and other training sample subsets to obtain the first total similarity of the target training sample subset, and sum up the second similarities between the target training sample subset and other training sample subsets to obtain the second total similarity of the target training sample subset. When the first total similarity of the target training sample subset is greater than the first similarity threshold and the second total similarity is greater than the second similarity threshold, the first accuracy is determined as the sample accuracy of the target training sample subset; when the first total similarity of the target training sample subset is greater than the first similarity threshold and the second total similarity is less than or equal to the second similarity threshold, the second accuracy is determined as the sample accuracy of the target training sample subset; when the first total similarity of the target training sample subset is less than or equal to the first similarity threshold and the second total similarity is greater than the second similarity threshold, the second accuracy is determined as the sample accuracy of the target training sample subset. The second accuracy is less than the first accuracy. The target training sample subset is the training sample subset corresponding to any one of the N first node devices, and the other training sample subsets are the training sample subsets other than the target training sample subset among the N training sample subsets.
[0146] In one embodiment, the third node device may send N subsets of training samples to the scoring node devices in the blockchain network. The scoring node devices may generate quality scores respectively corresponding to the N subsets of training samples, where the quality scores are used to reflect the accuracy of the labeled object attributes of the sample objects in the N subsets of training samples. The third node device may receive the quality scores respectively corresponding to the N subsets of training samples sent by the scoring node devices, and determine the sample accuracy of each of the above-mentioned subsets of training samples according to the quality scores of each subset of training samples in the N subsets of training samples. That is, there is a positive correlation between the quality score of the subset of training samples and the sample accuracy. The higher the quality score of the subset of training samples, the higher the sample accuracy corresponding to the subset of training samples; the lower the quality score of the subset of training samples, the lower the sample accuracy corresponding to the subset of training samples.
[0147] It should be noted that the scoring node device may refer to a node device in the blockchain network other than the first node device in the first device cluster. The number of scoring node devices may be one or more. When the number of scoring node devices is multiple, the quality score of the subset of training samples may refer to the average value of the quality scores of multiple scoring node devices.
[0148] In one embodiment, determining the training participation degree of the second device cluster for the training process according to the training sample set and the initial task processing model includes: obtaining algorithm attribute information corresponding to the task processing algorithm in the initial task processing model; determining the algorithm contribution degree of the second device cluster according to the algorithm attribute information; testing the task processing accuracy of the initial task processing model according to the training sample set. Based on the algorithm contribution degree and the task processing accuracy of the initial task processing model, generate the training participation degree of the second device cluster for the training process.
[0149] Specifically, such as Figure 7As shown, the third node device can obtain the algorithm attribute information corresponding to the task processing algorithm in the initial task processing model. The algorithm attribute information can include the code volume of the task processing algorithm, the algorithm type, etc. The algorithm contribution degree of the second device cluster can be determined according to the algorithm attribute information. For example, taking the algorithm attribute information including the code volume of the task processing algorithm as an example, when the code volume of the task processing algorithm is less than the first code volume, the larger the code volume of the task processing algorithm, the greater the algorithm contribution degree of the second device cluster; conversely, the smaller the code volume of the task processing algorithm, the smaller the algorithm contribution degree of the second device cluster. When the code volume of the task processing algorithm is less than the second code volume, and the second code volume is greater than the first code volume, the smaller the code volume of the task processing algorithm, the greater the algorithm contribution degree of the second device cluster; conversely, the larger the code volume of the task processing algorithm, the smaller the algorithm contribution degree of the second device cluster. This is conducive to generating a lightweight initial task processing model. Further, according to the training sample set, the task processing accuracy of the initial task processing model is tested, and according to the algorithm contribution degree and the task processing accuracy of the initial task processing model, the training participation degree of the second device cluster for the training process is generated. By measuring the training participation degree of the second device cluster for the training process based on the algorithm contribution degree and the task processing accuracy of the initial task processing model, it is beneficial to encourage the node devices in the blockchain network to provide initial task processing models with higher accuracy, and improve the training accuracy and training efficiency of the initial task processing model.
[0150] In one embodiment, testing the task processing accuracy of the initial task processing model according to the training sample set includes: inputting the sample objects in the training sample set into the initial task processing model, performing prediction processing on the sample objects through the initial task processing model to obtain the predicted object attributes of the sample objects; determining the attribute similarity between the labeled object attributes and the predicted object attributes of the sample objects in the training sample set; and generating the task processing accuracy of the initial task processing model according to the attribute similarity.
[0151] Specifically, the third node device can input the sample objects in the training sample set into the initial task processing model, perform prediction processing on the sample objects through the initial task processing model to obtain the predicted object attributes of the sample objects. The similarity algorithm is used to calculate the attribute similarity between the predicted object attributes and the labeled object attributes. The similarity algorithm can include cosine similarity, Euclidean distance algorithm, Manhattan distance algorithm, etc. Further, according to the attribute similarity, the task processing accuracy of the initial task processing model is generated. There is a positive correlation between the attribute similarity and the task processing accuracy, that is, the higher the attribute similarity, the higher the task processing accuracy of the initial task processing model; conversely, the lower the attribute similarity, the lower the task processing accuracy of the initial task processing model.
[0152] In one embodiment, determining the training participation of the third device cluster for the training process according to the above task processing model includes: obtaining a test sample set associated with the task to be processed, and the device resources consumed by the third device cluster during the training process; testing the task processing accuracy of the task processing model according to the test sample set; determining the resource contribution degree of the third device cluster according to the device resources; and generating the training participation of the third device cluster for the training process based on the resource contribution degree and the task processing accuracy of the task processing model.
[0153] Specifically, as Figure 8 shown, the third node device can obtain a test sample set associated with the task to be processed, and the device resources consumed by the third device cluster during the training process; the device resources include one or more of CPU resources, interface resources, hard disk resources, memory resources, etc., and the device resources can be obtained from the historical log data of the third device in the third device cluster. The test sample set can include test objects and the labeled object attributes of the test objects. The test objects can include images, texts, audios, videos, etc., and the labeled object attributes can be obtained by manually labeling the test objects. Further, the third node device can test the task processing accuracy of the task processing model according to the test sample set, determine the resource contribution degree of the third device cluster according to the device resources, and the resource contribution degree is used to reflect the total amount corresponding to the device resources consumed by the third device cluster during the training process; the training participation of the third device cluster for the training process can be generated according to the resource contribution degree and the task processing accuracy of the task processing model. By measuring the training participation of the third device cluster for the training process according to the resource contribution degree and the task processing accuracy of the task processing model, it is beneficial to motivate the node devices in the blockchain network to consume more device resources to train the initial task processing model, so as to improve the training accuracy of the initial task processing model.
[0154] In one embodiment, testing the task processing accuracy of the above-mentioned task processing model according to the above-mentioned test sample set includes: the test object in the test sample set can be input into the task processing model, and the task processing model performs identification processing on the test object to obtain the identified object attributes of the test object. The identified object attributes and the labeled object attributes in the test sample set are input into the loss function of the task processing model to obtain the attribute identification error of the task processing model. According to this attribute identification error, the task processing accuracy of the task processing model is determined; there is a negative correlation between the attribute identification error and the task processing accuracy of the task processing model, that is, the greater the attribute identification error of the task processing model, the lower the task processing accuracy of the task processing model; on the contrary, the smaller the attribute identification error of the task processing model, the higher the task processing accuracy of the task processing model.
[0155] In one embodiment, the number of resource types of the above-mentioned device resources is K, and K is an integer greater than 1; determining the resource contribution degree of the above-mentioned third device cluster according to the above-mentioned device resources includes: the third node device can obtain the consumption amounts respectively corresponding to the K types of device resources consumed by the above-mentioned third device cluster during the above-mentioned training process, and perform a weighted summation process on the consumption amounts respectively corresponding to the K types of device resources to obtain the total consumption amount of the device resources of the above-mentioned third device cluster. Then, the resource contribution degree of the above-mentioned third device cluster can be determined according to the total consumption amount of the device resources of the above-mentioned third device cluster; there is a positive correlation between the total consumption amount of the device resources of the third device cluster and the resource contribution degree, that is, the more the total consumption amount of the device resources of the third device cluster, the higher the resource contribution degree of the third device cluster; on the contrary, the less the total consumption amount of the device resources of the third device cluster, the lower the resource contribution degree of the third device cluster.
[0156] S207. Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees respectively corresponding to the first device cluster, the second device cluster, and the third device cluster.
[0157] In one embodiment, the third node device can upload the above-mentioned task processing model to the above-mentioned blockchain and receive a call request from the terminal for the above-mentioned task processing model on the above-mentioned blockchain. According to the above-mentioned call request, determine the digital resources to be spent by the above-mentioned terminal to call the above-mentioned task processing model; according to the above-mentioned call request, call the above-mentioned task processing model, and transfer the above-mentioned to-be-spent digital resources from the account address corresponding to the above-mentioned terminal to the account address corresponding to the above-mentioned task processing model.
[0158] Specifically, the third node device can upload the above task processing model to the above blockchain, and receive a call request from the terminal for the above task processing model on the above blockchain. The call request can carry the model identifier of the task processing model, the call duration, the account address of the user corresponding to the terminal, etc. The third node device can determine the digital resources to be spent by the above terminal for calling the above task processing model according to the above call request; and call the above task processing model according to the above call request, and transfer the above digital resources to be spent from the account address corresponding to the above terminal to the account address corresponding to the above task processing model.
[0159] It should be noted that the account address corresponding to the task processing model can be the account address for allocating digital resources to the first device cluster, the second device cluster, and the third device cluster, and the account address corresponding to the terminal can be the account address of the user corresponding to the terminal.
[0160] It should be noted that the third node device can continue to allocate the digital resources subsequently obtained in the account address corresponding to the above task processing model to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees corresponding to each node device.
[0161] In one embodiment, the above-mentioned calling the above task processing model according to the above call request includes: when the above call request is used to indicate the recognition processing of a target object, inputting the above target object into the above task processing model; performing recognition processing on the above target object through the above task processing model to obtain the recognition object attributes of the above target object; and returning the above recognition object attributes to the above terminal. There is no need to return the task processing model to the terminal, which can prevent the terminal from inferring the training sample set based on the task processing model, and improve the privacy and security of the training sample set.
[0162] In this application, the first device cluster in the blockchain network provides a training sample set for training the initial task processing model, the second device cluster in the blockchain network provides the initial task processing model, and the third device cluster in the blockchain network trains the initial task processing model according to the training sample set to obtain a task processing model for processing the task to be processed, realizing the decentralized training of the initial task processing model. By reading the training samples and the initial task processing model from the blockchain, the security and transparency of the data are ensured, and the training accuracy and training efficiency of the initial task processing model are improved. At the same time, based on the training participation degrees of the first device cluster, the second device cluster, and the third device cluster respectively for the training process, digital resources are allocated to the first device cluster, the second device cluster, and the third device cluster, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0163] Please refer to Figure 9 , which is a schematic structural diagram of a blockchain data processing device provided by an embodiment of the present application. The above blockchain-based data processing device can be a computer program (including program code) running in a network device. For example, the blockchain-based data processing device is an application software; the device can be used to execute the corresponding steps in the method provided by the embodiment of the present application. As Figure 9 shown, the blockchain data processing device may include:
[0164] An acquisition module 911, configured to acquire a training sample set and an initial task processing model associated with a to-be-processed task from a blockchain; the above training sample set is uploaded to the above blockchain by a first device cluster in the blockchain network, and the above initial task processing model is uploaded to the above blockchain by a second device cluster in the above blockchain network;
[0165] A training module 912, configured to train the above initial task processing model according to the above training sample set through a third device cluster in the above blockchain network to obtain a task processing model for processing the above to-be-processed task;
[0166] A determination module 913, configured to determine the training participation degree of the above first device cluster in the training process of the above initial task processing model according to the above training sample set, determine the training participation degree of the above second device cluster in the above training process according to the above training sample set and the above initial task processing model, and determine the training participation degree of the above third device cluster in the above training process according to the above task processing model;
[0167] An allocation module 914, configured to allocate digital resources to the above first device cluster, the above second device cluster, and the above third device cluster according to the training participation degrees respectively corresponding to the above first device cluster, the above second device cluster, and the above third device cluster.
[0168] Optionally, the above first device cluster includes N first node devices, the above training sample set includes training sample subsets respectively provided by the above N first node devices, and N is a positive integer;
[0169] Optionally, the determination module 913 may include an acquisition unit 91a, a first determination unit 92a, and a second determination unit 93a;
[0170] The acquisition unit 91a is configured to acquire the sample accuracy of the training sample subsets respectively corresponding to the above N first node devices, and the sample quantity included in each of the above training sample subsets;
[0171] The first determination unit 92a is configured to determine the sample contribution degree of each of the above-mentioned N first node devices according to the sample size of each first node device among the above-mentioned N first node devices;
[0172] The second determination unit 93a is configured to determine the training participation degree of each of the above-mentioned first node devices in the training process of the above-mentioned initial task processing model according to the sample contribution degree and sample accuracy of each first node device among the above-mentioned N first node devices.
[0173] Optionally, the above-mentioned training sample subset includes a sample object and the labeled object attributes of the sample object, and N is greater than 1;
[0174] Optionally, the obtaining unit 91a is specifically configured to determine the first similarity between the sample objects in every two of the above-mentioned N training sample subsets corresponding to the above-mentioned N first node devices;
[0175] Determine the second similarity between the labeled object attributes of the above-mentioned sample objects in every two of the above-mentioned training sample subsets;
[0176] Generate the sample accuracy of the training sample subsets respectively corresponding to the above-mentioned N first node devices according to the above-mentioned first similarity and the above-mentioned second similarity.
[0177] Optionally, the determination module 913 may further include a test unit 94a;
[0178] The obtaining unit 91a is further configured to obtain the algorithm attribute information corresponding to the task processing algorithm in the above-mentioned initial task processing model;
[0179] The first determination unit 92a is further configured to determine the algorithm contribution degree of the above-mentioned second device cluster according to the above-mentioned algorithm attribute information;
[0180] The test unit 94a is configured to test the task processing accuracy of the above-mentioned initial task processing model according to the above-mentioned training sample set;
[0181] The second determination unit 93a is further configured to generate the training participation degree of the above-mentioned second device cluster in the above-mentioned training process based on the above-mentioned algorithm contribution degree and the task processing accuracy of the above-mentioned initial task processing model.
[0182] Optionally, the test unit 94a is specifically configured to input the sample objects in the above-mentioned training sample set into the above-mentioned initial task processing model, perform prediction processing on the sample objects through the above-mentioned initial task processing model, and obtain the predicted object attributes of the sample objects;
[0183] Determine the attribute similarity between the labeled object attributes and the predicted object attributes of the above-mentioned sample objects in the above-mentioned training sample set;
[0184] Generate the task processing accuracy of the above initial task processing model according to the above attribute similarity.
[0185] The acquisition unit 91a is further configured to acquire a test sample set associated with the to-be-processed task, and the device resources consumed by the third device cluster during the above training process;
[0186] The test unit 94a is configured to test the task processing accuracy of the task processing model according to the above test sample set;
[0187] The first determination unit 92a is further configured to determine the resource contribution degree of the third device cluster according to the above device resources;
[0188] The second determination unit 93a is further configured to generate the training participation degree of the third device cluster for the above training process based on the above resource contribution degree and the task processing accuracy of the task processing model.
[0189] Optionally, the number of resource types of the above device resources is K, and K is an integer greater than 1;
[0190] The first determination unit 92a is specifically configured to acquire the consumption amounts corresponding to the K types of device resources consumed by the third device cluster during the above training process;
[0191] Perform a weighted summation process on the consumption amounts corresponding to the K types of device resources to obtain the total consumption amount of the device resources of the third device cluster;
[0192] Determine the resource contribution degree of the third device cluster according to the total consumption amount of the device resources of the third device cluster.
[0193] Optionally, the training module 912 may include an input unit 95b, a prediction unit 96b, a third determination unit 97b, and a training unit 98b;
[0194] The input unit 95b is configured to input the sample objects in the above training sample set into the above initial task processing model through the third device cluster in the above blockchain network;
[0195] The prediction unit 96b is configured to perform a prediction process on the above sample objects through the above initial task processing model to obtain the predicted object attributes of the above sample objects;
[0196] The third determination unit 97b is configured to determine the task processing error of the above initial task processing model according to the labeled object attributes and the predicted object attributes of the above sample objects in the above training sample set;
[0197] A training unit 98b for training the above initial task processing model according to the above task processing error to obtain a task processing model for processing the above to-be-processed task.
[0198] Optionally, the training unit 98b is specifically configured to determine the convergence state of the above initial task processing model according to the above task processing error;
[0199] When the convergence state of the above initial task processing model is a non-converged state, adjust the model parameters of the above initial task processing model according to the above task processing error;
[0200] When the convergence state of the adjusted initial task processing model is a converged state, determine the adjusted initial task processing model as the task processing model for processing the above to-be-processed task.
[0201] Optionally, the apparatus may further include an on-chain module 915, a receiving module 916, and a calling module 917;
[0202] The on-chain module 915 is configured to upload the above task processing model to the above blockchain;
[0203] The receiving module 916 is configured to receive a call request from a terminal for the above task processing model on the above blockchain;
[0204] The determination module 913 is further configured to determine the digital resources to be spent by the above terminal for calling the above task processing model according to the above call request;
[0205] The calling module 917 is configured to call the above task processing model according to the above call request, and transfer the above to-be-spent digital resources from the account address corresponding to the above terminal to the account address corresponding to the above task processing model.
[0206] Specifically, when the above call request is used to indicate identifying and processing a target object, the calling module 917 inputs the above target object into the above task processing model;
[0207] Perform identifying and processing on the above target object through the above task processing model to obtain the identifying object attributes of the above target object;
[0208] Return the above identifying object attributes to the above terminal.
[0209] In this application, a training sample set for training an initial task processing model is provided by a first device cluster in a blockchain network, an initial task processing model is provided by a second device cluster in the blockchain network, and the initial task processing model is trained by a third device cluster in the blockchain network according to the training sample set to obtain a task processing model for processing a to-be-processed task, thereby realizing decentralized training of the initial task processing model. By reading the training samples and the initial task processing model from the blockchain, the security and transparency of the data are ensured, and the training accuracy and training efficiency of the initial task processing model are improved. At the same time, digital resources are allocated to the first device cluster, the second device cluster, and the third device cluster based on their respective training participation degrees in the training process, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0210] Please refer to Figure 10 , which is a schematic structural diagram of a computer device provided by an embodiment of this application. As Figure 10 shown, the above computer device 1000 may refer to a terminal or a server, and includes: a processor 1001, a network interface 1004, and a memory 1005. In addition, the above computer device 1000 may further include: a user interface 1003 and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, in some embodiments, the user interface 1003 may include a display screen (DiSPlay) and a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile MeMory), such as at least one disk memory. Optionally, the memory 1005 may further be at least one storage device far from the aforementioned processor 1001. As Figure 10 shown, the memory 1005, as a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a computer program.
[0211] In Figure 10 the computer device 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface; and the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0212] Obtain a training sample set associated with the task to be processed and an initial task processing model from the blockchain; the above training sample set is uploaded to the above blockchain by a first device cluster in the blockchain network, and the above initial task processing model is uploaded to the above blockchain by a second device cluster in the above blockchain network;
[0213] Through a third device cluster in the above blockchain network, train the above initial task processing model according to the above training sample set to obtain a task processing model for processing the above task to be processed;
[0214] Determine the training participation of the above first device cluster in the training process of the above initial task processing model according to the above training sample set, determine the training participation of the above second device cluster in the training process according to the above training sample set and the above initial task processing model, and determine the training participation of the above third device cluster in the training process according to the above task processing model;
[0215] Allocate digital resources to the above first device cluster, the above second device cluster, and the above third device cluster according to the training participation corresponding to the above first device cluster, the above second device cluster, and the above third device cluster respectively.
[0216] Optionally, the above first device cluster includes N first node devices, the above training sample set includes training sample subsets respectively provided by the above N first node devices, and N is a positive integer;
[0217] Optionally, the processor 1001 may be used to call a computer program stored in the memory 1005 to execute:
[0218] Obtain the sample accuracy of the training sample subsets respectively corresponding to the above N first node devices and the sample size included in each of the above training sample subsets;
[0219] Determine the sample contribution degree of each of the above N first node devices according to the sample size of each of the above N first node devices;
[0220] Determine the training participation of each of the above N first node devices in the training process of the above initial task processing model according to the sample contribution degree and sample accuracy of each of the above N first node devices.
[0221] Optionally, the above training sample subset includes a sample object and the labeled object attributes of the sample object, and N is greater than 1;
[0222] Optionally, the processor 1001 may be used to call a computer program stored in the memory 1005 to execute:
[0223] Determine the first similarity between the sample objects in each pair of the N training sample subsets corresponding to the above N first node devices;
[0224] Determine the second similarity between the labeled object attributes of the sample objects in each pair of the above training sample subsets;
[0225] Generate the sample accuracy of the training sample subsets corresponding to the above N first node devices respectively according to the above first similarity and the above second similarity.
[0226] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0227] Obtain the algorithm attribute information corresponding to the task processing algorithm in the above initial task processing model;
[0228] Determine the algorithm contribution degree of the above second device cluster according to the above algorithm attribute information;
[0229] Test the task processing accuracy of the above initial task processing model according to the above training sample set;
[0230] Generate the training participation degree of the above second device cluster for the above training process based on the above algorithm contribution degree and the task processing accuracy of the above initial task processing model.
[0231] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0232] Input the sample objects in the above training sample set into the above initial task processing model, and perform prediction processing on the sample objects through the above initial task processing model to obtain the predicted object attributes of the sample objects;
[0233] Determine the attribute similarity between the labeled object attributes and the predicted object attributes of the sample objects in the above training sample set;
[0234] Generate the task processing accuracy of the above initial task processing model according to the above attribute similarity.
[0235] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0236] Obtain the test sample set associated with the above task to be processed, and the device resources consumed by the above third device cluster during the above training process;
[0237] Test the task processing accuracy of the above task processing model according to the above test sample set;
[0238] Determine the resource contribution degree of the third device cluster based on the above device resources;
[0239] Generate the training participation degree of the third device cluster for the above training process based on the above resource contribution degree and the task processing accuracy of the above task processing model.
[0240] Optionally, the number of resource types of the above device resources is K, and K is an integer greater than 1;
[0241] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0242] Obtain the consumption amounts respectively corresponding to the K types of device resources consumed by the third device cluster during the above training process;
[0243] Perform a weighted summation process on the consumption amounts respectively corresponding to the K types of device resources to obtain the total consumption amount of the device resources of the third device cluster;
[0244] Determine the resource contribution degree of the third device cluster based on the total consumption amount of the device resources of the third device cluster.
[0245] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0246] Input the sample objects in the above training sample set into the above initial task processing model through the third device cluster in the above blockchain network;
[0247] Perform a prediction process on the sample objects through the above initial task processing model to obtain the predicted object attributes of the sample objects;
[0248] Determine the task processing error of the above initial task processing model based on the labeled object attributes and the predicted object attributes of the sample objects in the above training sample set;
[0249] Train the above initial task processing model based on the above task processing error to obtain a task processing model for processing the above to-be-processed task.
[0250] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0251] Determine the convergence state of the above initial task processing model based on the above task processing error;
[0252] When the convergence state of the above initial task processing model is the non-converged state, adjust the model parameters of the above initial task processing model based on the above task processing error;
[0253] When the convergence state of the adjusted initial task processing model is the converged state, the adjusted initial task processing model is determined as the task processing model for processing the above-mentioned to-be-processed task.
[0254] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0255] Upload the above-mentioned task processing model to the above-mentioned blockchain;
[0256] Receive a call request from the terminal for the above-mentioned task processing model on the above-mentioned blockchain;
[0257] Determine the digital resources to be spent by the above-mentioned terminal to call the above-mentioned task processing model according to the above-mentioned call request;
[0258] According to the above-mentioned call request, call the above-mentioned task processing model, and transfer the above-mentioned to-be-spent digital resources from the account address corresponding to the above-mentioned terminal to the account address corresponding to the above-mentioned task processing model.
[0259] Optionally, the processor 1001 can be used to call the computer program stored in the memory 1005 to execute:
[0260] When the above-mentioned call request is used to indicate identifying and processing a target object, input the above-mentioned target object into the above-mentioned task processing model;
[0261] Perform identification processing on the above-mentioned target object through the above-mentioned task processing model to obtain the identification object attributes of the above-mentioned target object;
[0262] Return the above-mentioned identification object attributes to the above-mentioned terminal.
[0263] In this application, a training sample set for training an initial task processing model is provided by a first device cluster in a blockchain network, the initial task processing model is provided by a second device cluster in the blockchain network, and the initial task processing model is trained by a third device cluster in the blockchain network according to the training sample set to obtain a task processing model for processing a to-be-processed task, realizing decentralized training of the initial task processing model. By reading the training samples and the initial task processing model from the blockchain, the security and transparency of the data are ensured, and the training accuracy and training efficiency of the initial task processing model are improved. At the same time, digital resources are allocated to the first device cluster, the second device cluster, and the third device cluster based on their respective training participation degrees in the training process, so as to encourage more devices in the blockchain network to participate in the training process of the initial task processing model and improve the training accuracy of the initial task processing model.
[0264] It should be noted that in the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the functions of that module or unit.
[0265] In addition, it should be pointed out here that: The embodiments of the present application also provide a computer-readable storage medium, and the computer program executed by the aforementioned blockchain data processing device is stored in the above-mentioned computer-readable storage medium. The above computer program includes program instructions. When the above processor executes the above program instructions, it can execute the description of the above blockchain data processing method in the corresponding previous embodiments. Therefore, the description will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application.
[0266] As an example, the above program instructions can be deployed to be executed on a computer device, or deployed to be executed on at least two computer devices at one location. Or, on at least two computer devices distributed at least two locations and interconnected by a communication network. At least two computer devices distributed at least two locations and interconnected by a communication network can form a blockchain network.
[0267] The above computer-readable storage medium can be the middle storage unit of the blockchain data processing device or the above computer device provided in any of the previous embodiments, such as the hard disk or the middle memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium can also include both the middle storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0268] In the description, claims, and drawings of the embodiments of this application, terms such as "first" and "second" are used to distinguish the content in different media, rather than to describe a specific order. In addition, the term "including" and any of its variants are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally further includes steps or modules not listed, or optionally further includes other step units inherent to these processes, methods, devices, products, or equipment.
[0269] When collecting and processing relevant data in this application (such as the initial behavioral characteristics corresponding to the user's interaction behavior and the user's object characteristics, etc.) in practical applications, it should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws, regulations, and the personal information subject.
[0270] The embodiments of this application also provide a computer program product, including a computer program. When the above computer program is executed by a processor, it implements the descriptions of the above blockchain data processing method and decoding method in the corresponding previous embodiments. Therefore, it will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer program product involved in this application, please refer to the description of the method embodiments of this application.
[0271] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0272] The method and related device provided by the embodiments of this application are described with reference to the method flowcharts and / or structural schematic diagrams provided by the embodiments of this application. Specifically, each process and / or block of the method flowchart and / or structural schematic diagram, and the combination of the processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable network-connected devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable network-connected devices generate for implementation in the process Figure 1 one process or multiple processes and / or structural schematicFigure 1 means for the functions specified in one or more boxes. These computer program instructions may also be stored in a computer-readable memory capable of guiding a computer or other programmable network-connected device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means, and the instruction means implements the operations in the process Figure 1 one process or multiple processes and / or structural schematic Figure 1 means for the functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable network-connected device, such that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more boxes in one process or multiple processes and / or structural schematic Figure 1 one process or multiple processes and / or structural schematic steps for the functions specified in one or more boxes.
[0273] The foregoing disclosure is only for the preferred embodiments of the present application, and of course cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A blockchain data processing method, characterized in that, Including: Obtain a training sample set associated with a task to be processed and an initial task processing model from a blockchain; The training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the initial task processing model is uploaded to the blockchain by a second device cluster in the blockchain network; Through a third device cluster in the blockchain network, train the initial task processing model according to the training sample set to obtain a task processing model for processing the task to be processed; Determine the training participation degree of the first device cluster in the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster in the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster in the training process according to the task processing model; Allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees corresponding to the first device cluster, the second device cluster, and the third device cluster respectively.
2. The method according to claim 1, wherein The first device cluster includes N first node devices, and the training sample set includes training sample subsets respectively provided by the N first node devices, where N is a positive integer; The determining the training participation degree of the first device cluster in the training process of the initial task processing model according to the training sample set includes: Obtain the sample accuracy of the training sample subsets corresponding to the N first node devices respectively, and the sample quantity included in each training sample subset; Determine the sample contribution degree of each first node device according to the sample quantity of each first node device among the N first node devices; Determine the training participation degree of each first node device in the training process of the initial task processing model according to the sample contribution degree and sample accuracy of each first node device among the N first node devices.
3. The method according to claim 2, wherein The training sample subset includes a sample object and an annotated object attribute of the sample object, and N is greater than 1; The obtaining the sample accuracy of the training sample subsets corresponding to the N first node devices respectively includes: Determine a first similarity between sample objects in every two of the N training sample subsets corresponding to the N first node devices; Determine a second similarity between the annotated object attributes of the sample objects in every two of the training sample subsets; Generate the sample accuracy of the training sample subsets corresponding to the N first node devices respectively according to the first similarity and the second similarity.
4. The method according to claim 1, characterized in that, The determining the training participation degree of the second device cluster in the training process according to the training sample set and the initial task processing model includes: Obtain algorithm attribute information corresponding to the task processing algorithm in the initial task processing model; Determine the algorithm contribution degree of the second device cluster according to the algorithm attribute information; Test the task processing accuracy of the initial task processing model according to the training sample set; Generate the training participation of the second device cluster for the training process based on the algorithm contribution degree and the task processing accuracy of the initial task processing model.
5. The method according to claim 4, characterized in that, Testing the task processing accuracy of the initial task processing model according to the training sample set includes: Input the sample objects in the training sample set into the initial task processing model, and perform prediction processing on the sample objects through the initial task processing model to obtain the predicted object attributes of the sample objects; Determine the attribute similarity between the labeled object attributes and the predicted object attributes of the sample objects in the training sample set; Generate the task processing accuracy of the initial task processing model according to the attribute similarity.
6. The method according to claim 1, wherein Determining the training participation of the third device cluster for the training process according to the task processing model includes: Obtain a test sample set associated with the task to be processed and the device resources consumed by the third device cluster during the training process; Test the task processing accuracy of the task processing model according to the test sample set; Determine the resource contribution degree of the third device cluster according to the device resources; Generate the training participation of the third device cluster for the training process based on the resource contribution degree and the task processing accuracy of the task processing model.
7. The method according to claim 6, wherein The number of resource types of the device resources is K, and K is an integer greater than 1; Determining the resource contribution degree of the third device cluster according to the device resources includes: Obtain the consumption amounts corresponding to the K types of device resources consumed by the third device cluster during the training process; Perform weighted summation processing on the consumption amounts corresponding to the K types of device resources to obtain the total consumption amount of the device resources of the third device cluster; Determine the resource contribution degree of the third device cluster according to the total consumption amount of the device resources of the third device cluster.
8. The method according to claim 1, wherein Training the initial task processing model through the third device cluster in the blockchain network according to the training sample set to obtain a task processing model for processing the task to be processed includes: Input the sample objects in the training sample set into the initial task processing model through the third device cluster in the blockchain network; Perform prediction processing on the sample objects through the initial task processing model to obtain the predicted object attributes of the sample objects; Determine the task processing error of the initial task processing model according to the labeled object attributes and the predicted object attributes of the sample objects in the training sample set; Train the initial task processing model according to the task processing error to obtain a task processing model for processing the task to be processed.
9. The method according to claim 8, wherein Training the initial task processing model according to the task processing error to obtain a task processing model for processing the task to be processed includes: Determine the convergence state of the initial task processing model according to the task processing error; When the convergence state of the initial task processing model is the non-converged state, adjust the model parameters of the initial task processing model according to the task processing error; When the convergence state of the adjusted initial task processing model is the converged state, determine the adjusted initial task processing model as the task processing model for processing the to-be-processed task.
10. The method according to claim 1, characterized in that, The method further includes: Upload the task processing model to the blockchain; Receive a call request from a terminal for the task processing model on the blockchain; Determine the digital resources to be spent by the terminal for calling the task processing model according to the call request; According to the call request, call the task processing model, and transfer the to-be-spent digital resources from the account address corresponding to the terminal to the account address corresponding to the task processing model.
11. The method according to claim 10, wherein The calling the task processing model according to the call request includes: When the call request is used to indicate performing identification processing on a target object, input the target object into the task processing model; Perform identification processing on the target object through the task processing model to obtain the identification object attributes of the target object; Return the identification object attributes to the terminal.
12. A blockchain data processing device, characterized in that, It includes: An acquisition module, configured to acquire a training sample set and an initial task processing model associated with the to-be-processed task from the blockchain; The training sample set is uploaded to the blockchain by a first device cluster in the blockchain network, and the initial task processing model is uploaded to the blockchain by a second device cluster in the blockchain network; A training module, configured to train the initial task processing model according to the training sample set through a third device cluster in the blockchain network to obtain a task processing model for processing the to-be-processed task; A determination module, configured to determine the training participation degree of the first device cluster for the training process of the initial task processing model according to the training sample set, determine the training participation degree of the second device cluster for the training process according to the training sample set and the initial task processing model, and determine the training participation degree of the third device cluster for the training process according to the task processing model; An allocation module, configured to allocate digital resources to the first device cluster, the second device cluster, and the third device cluster according to the training participation degrees respectively corresponding to the first device cluster, the second device cluster, and the third device cluster.
13. 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 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.