Data processing method and device based on block chain, program product and electronic equipment
By deploying artificial intelligence modules in the blockchain index network and using on-chain data training models, the problem of blockchain data being unable to be fully mined and intelligently analyzed is solved, and data processing capabilities and traceability are improved.
Patent Information
- Application Number
- CN202411931054.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-25
AI Technical Summary
The existing technology cannot fully explore the deep value of blockchain data and cannot meet users' needs for intelligent data analysis, which limits the intelligent development of the blockchain ecosystem.
By deploying artificial intelligence modules in the index network, using the index network to hand over data processing requests to specific models for processing, and using the on-chain data of the blockchain for model training, ensuring data transparency and traceability of query results.
It realizes the deep integration of blockchain data and artificial intelligence, improves the data processing capabilities and data traceability of the decentralized index network based on blockchain networks, and can quickly respond to data processing requests and provide personalized data processing results.
Smart Images

Figure CN119884425A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and more specifically, to a blockchain-based data processing method, a blockchain-based data processing device, a computer program product, and an electronic device. Background Art
[0002] With the development of blockchain technology, decentralized index networks based on blockchain can improve data access efficiency, provide data retrieval functions that meet user needs, and effectively alleviate the query pressure of the blockchain main network. However, it is still impossible to fully explore the deep value of on-chain data, nor can it meet users' needs for intelligent data analysis, which to a certain extent limits the intelligent development of the blockchain ecosystem.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present disclosure is to provide a data processing method and device based on blockchain, a computer program product and an electronic device, so as to fully mine the data on the chain at least to a certain extent, realize the deep integration of blockchain data and artificial intelligence, and improve the data processing capability and data traceability of the decentralized index network based on the blockchain network.
[0005] According to one aspect of the present disclosure, there is provided a data processing method based on blockchain, including: responding to a data processing request of a decentralized application, determining a target model corresponding to the data processing request through an index network, wherein the target model is trained based on on-chain data of the blockchain; loading the target model through a target index node in the index network, and executing the data processing request based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application.
[0006] In an exemplary embodiment of the present disclosure, the method further includes: obtaining a data description file, the data description file being used to describe the required blockchain data and data processing events; obtaining target data from the blockchain network according to the data description file through an indexing network, and training at least one model to be trained using the target data based on the data processing events to obtain at least one candidate model.
[0007] In an exemplary embodiment of the present disclosure, at least one model to be trained is trained based on target data to obtain at least one candidate model, and also includes: determining the correspondence between different request types and candidate models according to the request type; wherein different candidate models have their own corresponding task types.
[0008] In an exemplary embodiment of the present disclosure, in response to a data processing request of a decentralized application, a target model corresponding to the data processing request is determined through an index network, including: responding to the data processing request of the decentralized application, forwarding the data processing request to the index network through a gateway; obtaining a target model that matches the request type of the data processing request through the index network, and obtaining a target index node that matches the request type of the data processing request.
[0009] In an exemplary embodiment of the present disclosure, a data processing request is executed based on a target model to obtain a data processing result, so as to return the data processing result to a decentralized application, including: obtaining a data inference result of the target model executing the data processing request; determining a payment result based on the type of the target model and / or the processing complexity information of the target model executing the data processing request; determining the data processing result based on the data inference result and the payment result, so as to return the data processing result to the decentralized application.
[0010] In an exemplary embodiment of the present disclosure, the method also includes: training a preset decision model based on blockchain data, the preset decision model is used to generate policy information, and the policy information is used to control the data processing process of the target model; executing a data processing request based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application, and also includes: collecting user behavior feature data of the decentralized application; adjusting the policy information of the preset decision model by using the user behavior feature data through the index network; and controlling the data processing process of the target model based on the policy information generated by the preset decision model after adjusting the decision parameters.
[0011] In an exemplary embodiment of the present disclosure, the index nodes in the index network are edge nodes.
[0012] According to one aspect of the present disclosure, there is provided a data processing device based on blockchain, including: a model determination module, used to respond to a data processing request of a decentralized application, and determine a target model corresponding to the data processing request through an index network, wherein the target model is trained based on on-chain data of the blockchain; a data processing module, used to load the target model through a target index node in the index network, and execute the data processing request based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application.
[0013] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0014] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0015] In the technical solution provided by the exemplary embodiment of the present disclosure, in response to the data processing request of the decentralized application, the target model corresponding to the data processing request is determined through the index network, and the target model is trained based on the on-chain data of the blockchain; the target model is loaded through the target index node in the index network, and the data processing request is executed based on the target model to obtain the data processing result, so as to return the data processing result to the decentralized application. On the one hand, the on-chain data of the blockchain is used as the data source for training the model. Unlike the centralized method, the model trained using the index network can be based on the on-chain data, which can benefit from the advantages of public and open source data, ensuring that the data can be audited. This method ensures data transparency and traceability of query results, improves data integrity, and thus improves the training accuracy of the model. On the other hand, the data processing request of the decentralized application can be quickly responded to, and the target index node in the index network is used to load the target model for processing, which can provide personalized data processing results to users in real time, further improve the data processing capability, so as to provide better data processing services. Therefore, the exemplary embodiment of the present disclosure can fully mine the on-chain data, realize the deep integration of blockchain data and artificial intelligence, and improve the data processing capability and data traceability of the decentralized index network based on the blockchain network.
[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1 A flowchart schematically illustrates a data processing method based on blockchain according to an exemplary embodiment of the present disclosure.
[0019] Figure 2 A diagram schematically illustrates a blockchain-based network architecture of an exemplary embodiment of the present disclosure.
[0020] Figure 3 Another blockchain-based network architecture diagram of an exemplary embodiment of the present disclosure is schematically shown.
[0021] Figure 4 A flowchart of a model training method for a decentralized indexing network based on blockchain in an exemplary embodiment of the present disclosure is schematically shown.
[0022] Figure 5 The flowchart of a target model executing a data processing request in an exemplary embodiment of the present disclosure is schematically shown.
[0023] Figure 6 The present invention schematically shows a composition diagram of a blockchain-based data processing device in an exemplary embodiment of the present disclosure.
[0024] Figure 7 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0026] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0027] The decentralized index network based on blockchain can improve data access efficiency, provide data retrieval functions that meet user needs, and effectively alleviate the query pressure of the blockchain main network. However, it is still impossible to fully explore the deep value of on-chain data, nor can it meet users' needs for intelligent data analysis, which to a certain extent limits the intelligent development of the blockchain ecosystem.
[0028] Based on this, the exemplary embodiment of the present disclosure provides a data processing method based on blockchain, by deploying an artificial intelligence module in an index network, based on which the index network can be used to hand over data processing requests to a specific model for processing, thereby achieving rapid data processing, and at the same time, the on-chain data of the blockchain can be used to train the model to ensure that the data can be audited. This method ensures data transparency and traceability of query results, ensures data integrity, and thus improves the training accuracy of the model. The exemplary embodiment of the present disclosure can fully mine on-chain data, achieve deep integration of blockchain data and artificial intelligence, and improve the data processing capability and data traceability of a decentralized index network based on a blockchain network.
[0029] It should be noted that the data processing method based on blockchain of the exemplary embodiment of the present disclosure can be applied to data processing scenarios based on the decentralized index network of blockchain, such as content recommendation scenarios, etc. For example, scenarios requiring high model accuracy or low error rate in the fields of finance, law, and medicine, by using the on-chain data training model to provide model support for data processing, thereby realizing rapid processing of data processing requests. The exemplary embodiment of the present disclosure does not limit the application scenarios of the data processing method based on blockchain.
[0030] like Figure 1 As shown, the exemplary embodiment of the present disclosure first provides a data processing method based on blockchain, referring to Figure 1 As shown, the data processing method based on blockchain of the exemplary embodiment of the present disclosure may include the following steps S110 and S120:
[0031] In step S110, in response to the data processing request of the decentralized application, the target model corresponding to the data processing request is determined through the index network, and the target model is trained based on the on-chain data of the blockchain.
[0032] In the exemplary embodiments of the present disclosure, a decentralized application (DApp) is an application built on blockchain technology. Unlike traditional centralized applications, DApp does not rely on the control and management of any central agency or single entity. They run on a decentralized network, and all decisions and operations are jointly reached and executed by participants in the network. The index network, also known as a decentralized index network, refers to a mechanism used in blockchain technology to manage and maintain data blocks (Blocks) to ensure the immutability and traceability of data. The index network of the exemplary embodiments of the present disclosure is a decentralized architecture including multiple index nodes, which can be connected to a variety of blockchain networks.
[0033] like Figure 2The following is a diagram of a blockchain-based network architecture: Figure 2 As shown, the decentralized index network is connected to the blockchain network, for example, the index network is connected to blockchain network 1 and blockchain network 2, and is used to index the data on the blockchain network. Blockchain users can query the decentralized index network without querying the blockchain network, thereby improving the efficiency of obtaining blockchain data.
[0034] Among them, data processing requests can be of various types, such as content generation, content recommendation, result prediction, etc., and there is no restriction on this. The target model is trained based on the on-chain data of the blockchain, that is, public and open source on-chain data is used as the data source for training the model, which can ensure the transparency of the data and the traceability of the data processing results. Since the chain contains richer and more comprehensive data, the training accuracy of the model can be improved.
[0035] The type of the target model can be constructed using a lightweight neural network, such as CNN (Convolutional Neural Network), RNN (Recurrent Neural Networks), DNN (Deep Neural Networks), etc. Relative to lightweight neural networks, a target model with a more complex network structure can also be used, for example, a heavyweight neural network is constructed, such as BERT (Bidirectional Encoder Representation from Transformers, feature encoder of bidirectional Transformers), Transformer (a language processing model), and any heavyweight neural network that can be used for data processing. Furthermore, the target model can also be a large model of 100 million levels. LLM (Large Language Model) refers to a deep learning model trained with a large amount of data, such as a natural language text that can be generated or the meaning of a language text can be understood. The disclosed embodiment is illustrated by taking the target model as a large model as an example.
[0036] like Figure 3 Another blockchain-based network architecture diagram is shown below. Figure 3 As shown, by introducing an artificial intelligence module (deployed with a target model and other large models (such as large model 2)) based on an index network, it is possible to respond to data processing requests from centralized applications, determine the target model corresponding to the data processing request through the index network, and provide model support for subsequent data processing.
[0037] In step S120, the target model is loaded through the target index node in the index network, and a data processing request is executed based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application.
[0038] In an exemplary embodiment of the present disclosure, the target index node is an index node in the index network that matches the current data processing request. The indexer can run the index node, connect to multiple blockchain networks, and provide data reasoning processing functions. The target index node can process the data processing request using the target model by loading the target model, that is, reasoning the data processing request to obtain the data processing result, and then return the data processing result to the decentralized application via the target index node for use or display by the decentralized application.
[0039] In the technical solution provided by the exemplary embodiment of the present disclosure, on the one hand, the on-chain data of the blockchain is used as the data source for training the model. Unlike the centralized method, the model trained using the index network can be based on the on-chain data, benefiting from the advantages of public and open source data, ensuring that the data can be audited. This method ensures data transparency and traceability of query results, improves data integrity, and thus improves the training accuracy of the model. On the other hand, it can quickly respond to data processing requests of decentralized applications, use the target index node in the index network to load the target model for processing, and provide personalized data processing results to users in real time, further improving data processing capabilities, so as to provide better data processing services. Therefore, the exemplary embodiment of the present disclosure can fully mine the on-chain data, realize the deep integration of blockchain data and artificial intelligence, and improve the data processing capabilities and data traceability of the decentralized index network based on the blockchain network.
[0040] In an exemplary embodiment, a model training method for a decentralized index network based on blockchain is also provided, such as Figure 4 As shown, the model training method may include:
[0041] Step S410: Obtain a data description file.
[0042] The data description file is used to describe the required blockchain data and data processing events. It can be understood that the data description file defines the smart contracts of interest, the events to be monitored, and how to map the event data to the index node for storage, and can even describe the processing method of the event data. Specifically, the data processing event refers to the inference processing process based on the required blockchain data based on the type of model. The data description file is set by the business party and deployed to the blockchain network to the smart contract.
[0043] Among them, the index node needs to synchronize the block data in the blockchain, obtain the relevant data in the data description file, and run the corresponding processing function to build or update the relevant index data in the index node to provide accurate data and method support for data processing.
[0044] Exemplarily, the data description file may be in the form of a subgraph file, and the business party may define the subgraph file as needed and deploy the subgraph file in a smart contract of the blockchain network.
[0045] Step S420: Obtain target data from the blockchain network according to the data description file through the index network, and train at least one model to be trained using the target data based on the data processing event to obtain at least one candidate model.
[0046] After obtaining the data description file, the target data indicated by the data description file can be obtained from the blockchain network through the index network, so as to control the training process of the training model based on the target data based on the data processing event, thereby obtaining at least one candidate model. Among them, the data processing event can guide the model training to obtain a candidate model that meets the task requirements.
[0047] The exemplary embodiment of the present disclosure is based on a data description file and can use blockchain data as a data source for model training, thereby ensuring the transparency and traceability of the data, as well as the comprehensiveness of the data, providing data support for model training, and improving the training accuracy of the model.
[0048] Based on the aforementioned exemplary embodiment, training at least one to-be-trained model based on target data to obtain at least one candidate model may also include:
[0049] According to the request type, the corresponding relationship between different request types and candidate models is determined, wherein different candidate models have their own corresponding task types.
[0050] Specifically, the candidate models corresponding to each task type can be pre-trained according to the task type to be performed. Since the request type is associated with the task type, different request types have their own corresponding task types, so the correspondence between different request types and candidate models can be pre-determined. Among them, the task type includes but is not limited to content generation, content recommendation, etc., which are not limited to this.
[0051] Based on this, the data processing request of the decentralized application can be responded to, and the target model matching the request type of the data processing request can be obtained through the index network, and the target index node matching the request type of the data processing request can be obtained to ensure the accuracy of the obtained target model and improve the efficiency of determining the target model. It should be understood that the index nodes in the index network can also handle different task types, so the target index node matching the request type of the data processing request can also be obtained to execute the data processing request, which is in line with the processing capacity of the target index node and can improve the data processing efficiency to a certain extent.
[0052] In some optional embodiments, in response to a data processing request from a decentralized application, the data processing request is forwarded to the indexing network through a gateway, and the data processing result can also be returned to the decentralized application through the gateway. By forwarding messages between the decentralized application and the indexing network through the gateway, it can be ensured that the data can be reached accurately and accurately.
[0053] In an exemplary embodiment, if Figure 5 As shown, executing a data processing request based on a target model to obtain a data processing result, and returning the data processing result to a decentralized application may include:
[0054] Step S510: Obtain the data inference result of the target model executing the data processing request.
[0055] Use the target model to reason about data processing requests, such as content generation, content recommendation, etc., and obtain corresponding data reasoning results.
[0056] Step S520: Determine the payment result according to the type of the target model and / or the processing complexity information of the target model executing the data processing request.
[0057] Different types of target models can affect the payment results of users for data requests. The correspondence between different model types (such as text generation, content recommendation) and payment information can be pre-set, and then the payment result corresponding to the type of target model can be obtained based on the correspondence. The processing complexity information of the target model executing the data processing request can be determined by the number of layers and neurons of the model. These indicators directly affect the expressiveness and computational complexity of the large model. The more layers, the stronger the expressiveness of the model, but the higher the computational complexity; the more neurons, the stronger the learning ability of the model, and the greater the demand for computing resources. Therefore, the processing complexity information can be determined in combination with the number of layers and neurons of the model. For example, the number of layers and neurons can be summed, weighted summed, etc. to obtain a total value, and then the payment result corresponding to the total value can be obtained according to the correspondence between the pre-set numerical data and the payment information.
[0058] Optionally, the payment result may be determined only according to the type of the target model, that is, the payment result corresponding to the type of the target model is used as the final payment result. Optionally, the payment result determined by the processing complexity information of the data processing request may be used as the final payment result. Optionally, the two types of payment results may be combined to obtain the final payment result, for example, by summing the two, weighted summing, etc.
[0059] Step S530: Determine the data processing result based on the data inference result and the payment result, and return the data processing result to the decentralized application.
[0060] After obtaining the data inference result and the payment result, the data inference result and the payment result can be determined as the data processing result corresponding to the data processing request, and the data processing result can be returned to the decentralized application.
[0061] By integrating artificial intelligence analysis modules (target models) into the decentralized index network, users can obtain the required data processing results in real time on a pay-as-you-go basis, such as business trend predictions, user behavior predictions, etc. Since the target model is obtained using blockchain data as the training data source, blockchain data can provide data support for business decisions. At the same time, it expands the functionality of the decentralized index network and achieves a leap from data retrieval to intelligent analysis.
[0062] In an exemplary embodiment, a method for implementing an improved target network in an index network is also provided. Specifically, a preset decision model is trained based on blockchain data, the preset decision model is used to generate policy information, and the policy information is used to control the data processing process of the target model.
[0063] Among them, the preset decision model is a reinforcement learning model (reinforcement learning agent), and reinforcement learning is a method of machine learning, which can be used to train a decision model for controlling the action decision of a target object in a target environment. The training process of the preset decision model includes: using a neural network model based on reinforcement learning to learn the action decision of the target object, and learning to control the target object to adapt to the target environment to obtain a preset decision model. The exemplary embodiment of the present disclosure can use the preset decision model obtained by training to perform action strategy control on the target object in the target environment, that is, to generate policy information based on the user behavior feature data of the decentralized application to control the update of the target model, that is, to achieve control of the data processing process of the target model.
[0064] The strategy information refers to the weight parameters of the preset decision model. The preset decision model can be represented by a neural network, and the strategy information is the weight parameter in the neural network. By continuously adjusting the strategy information, the preset decision model can gradually optimize its decision-making ability. The exemplary embodiments of the present disclosure do not specifically limit the network structure of the preset decision model.
[0065] By using blockchain data to train preset decision-making models, the rich data advantages can improve the accuracy of preset decision-making models.
[0066] Based on this, executing the data processing request based on the target model to obtain the data processing result, and returning the data processing result to the decentralized application may also include:
[0067] First, collect user behavior feature data of decentralized applications. Second, use the user behavior feature data to adjust the policy information of the preset decision model through the index network. Finally, based on the policy information generated by the preset decision model after adjusting the decision parameters, control the data processing process of the target model.
[0068] Specifically, user behavior feature data is a type of user feedback feature data, that is, feedback information from users on the data processing results obtained by the target model, which is used to reflect the performance of the data processing results generated by the target model. For example, the number of likes, comments, and shares of the text content generated by the target model. The strategy information of the preset decision model is adjusted according to the obtained user behavior feature data, which is similar to the way the reinforcement learning model adjusts the strategy information (decision parameters). The following takes a social decentralized application (evaluating social attention) as an example to illustrate the process of adjusting the parameters of the preset decision model.
[0069] Among them, the preset decision model gains more attention by testing different content changes (such as language style, topic keywords, emotions, etc.). Each change in the content is regarded as an action, and the actual user feedback (number of likes) is used as a reward signal to optimize the strategy of generating content. Based on the preset decision model, the target model can continuously learn new user interaction data and adjust the generated suggestions. For example, if certain words or content forms can bring more attention, the model can weight such content.
[0070] Specifically, we first define states and actions. t Represents the content of the user's post and the current performance of the post at time t, such as the post's subject, language features, number of likes, number of comments, etc. Action a t Indicates possible modifications to the post content in its current state, such as adjusting the sentiment, adding certain keywords, or changing the sentence structure.
[0071] Secondly, the reward function R(s t ,a t ). The reward function represents the contribution of each action to the number of likes. The reward function can be defined as the following formula 1:
[0072] R(s t ,a t ) = likes increment + α comments increment + β shares increment (1)
[0073] Among them, the increment of the number of likes, the increment of the number of comments, and the increment of the number of shares respectively represent the amount of improvement of these indicators after the action. α and β are adjustment coefficients, ranging from [0, 1], which are used to control the weight of the indicator and can be adjusted according to the importance of the indicator. For example, if the contribution of increasing the increment of the number of comments is greater than the contribution of increasing the increment of the number of shares, then α is greater than β, otherwise, α is less than β. The exemplary embodiments of the present disclosure do not limit the specific values of α and β.
[0074] Next, we can define the Q function, Q function Q(s t ,a t ) means in state s t , take action a t After that, the expected cumulative reward can be expressed by the following formula 2:
[0075]
[0076] Wherein, γ is a discount factor used to control the weight of future rewards, and the range is [0,1]. If a high contribution degree of future rewards is required, the value of γ can be increased. The exemplary embodiments of the present disclosure do not limit the specific value of γ. R(s t+k ,a t+k ) represents the accumulated reward starting from time t.
[0077] Furthermore, the Q value can be updated by the following formula 3:
[0078] Q(s t ,a t )←Q(s t ,a t )+a[R(s t ,a t )+b maxQ(s t+1 ,a′)-Q(s t ,a t )] (3)
[0079] Among them, Q(s t ,a t ) is the state s t Next action a t The new Q value on the right side is Q(st ,a t ) is the original Q value; R is the execution action a t The reward obtained after maxQ(s t+1 ,a') is the maximum Q value when the optimal action is selected at time t+1; parameters 0≤a≤1, 0≤b≤1.
[0080] Finally, policy optimization. The policy gradient method can be used to adjust the policy information of the preset decision model based on the updated Q value, thereby controlling the data processing process of the target model, such as increasing the like rate of generated content by optimizing the generated content.
[0081] It should be noted that the details of the reinforcement learning of the exemplary embodiment of the present disclosure are similar to the related art and are not described in more detail here. The embodiment of the present disclosure can use blockchain data to implement the training of the preset decision model, and optimize the preset decision model and the target model based on the collected user feedback data, provide personalized data processing results for centralized applications, and further improve the user experience of decentralized applications.
[0082] In an exemplary embodiment, the index nodes in the index network are edge nodes, which use edge computing to sink data processing capabilities to the user side, support business systems and decentralized applications to efficiently implement data reasoning based on blockchain data and target models, and provide users with real-time personalized suggestions (such as business trends or content optimization, etc.). By integrating blockchain data and artificial intelligence, it provides strong support for the intelligent development of the Web3 ecosystem.
[0083] In the technical solution provided by the exemplary embodiment of the present disclosure, on the one hand, the on-chain data of the blockchain is used as the data source for training the model. Unlike the centralized method, the model trained using the index network can be based on the on-chain data, which can benefit from the advantages of public and open source, ensuring that the data can be audited. This method ensures data transparency and traceability of query results, ensures data integrity, and thus improves the training accuracy of the model. On the other hand, it can quickly respond to decentralized data processing requests, use the target index node in the index network to load the target model for processing, and provide personalized data processing results to users in real time, further improve data processing capabilities, so as to provide better data processing services. Therefore, the exemplary embodiment of the present disclosure can fully mine the on-chain data, realize the deep integration of blockchain data and artificial intelligence, improve the data processing capabilities and data traceability of the decentralized index network based on the blockchain network, and can not only help users obtain personalized prediction suggestions in real time, but also significantly improve the application potential of blockchain data, and provide data support for business decisions.
[0084] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0085] For further reference, Figure 6 As shown, in an exemplary embodiment of the present disclosure, a blockchain-based data processing device 600 is provided, including a model determination module 610 and a data processing module 620.
[0086] in:
[0087] The model determination module 610 is used to respond to the data processing request of the decentralized application, and determine the target model corresponding to the data processing request through the index network, and the target model is trained based on the on-chain data of the blockchain; the data processing module 620 is used to load the target model through the target index node in the index network, and execute the data processing request based on the target model to obtain the data processing result, so as to return the data processing result to the decentralized application.
[0088] In an exemplary embodiment of the present disclosure, the model determination module 610 is further configured to execute: obtaining a data description file, the data description file is used to describe the required blockchain data and data processing events; obtaining target data from the blockchain network according to the data description file through the index network, and based on the data processing events, using the target data to train at least one model to be trained to obtain at least one candidate model.
[0089] In an exemplary embodiment of the present disclosure, the model determination module 610 is further configured to execute: determining, according to the request type, the correspondence between different request types and candidate models; wherein different candidate models have their own corresponding task types.
[0090] In an exemplary embodiment of the present disclosure, the model determination module 610 is configured to perform: responding to a data processing request of a decentralized application, forwarding the data processing request to an index network through a gateway; obtaining a target model that matches a request type of the data processing request through the index network, and obtaining a target index node that matches the request type of the data processing request.
[0091] In an exemplary embodiment of the present disclosure, the data processing module 620 is configured to perform: obtaining the data inference result of the target model executing the data processing request; determining the payment result based on the type of the target model and / or the processing complexity information of the target model executing the data processing request; determining the data processing result based on the data inference result and the payment result, so as to return the data processing result to the decentralized application.
[0092] In an exemplary embodiment of the present disclosure, the model determination module 610 is also configured to perform: training a preset decision model based on blockchain data, the preset decision model is used to generate policy information, and the policy information is used to control the data processing process of the target model; executing a data processing request based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application, and also includes: collecting user behavior feature data of the decentralized application; adjusting the policy information of the preset decision model by using the user behavior feature data through the index network; and controlling the data processing process of the target model based on the policy information generated by the preset decision model after adjusting the decision parameters.
[0093] In an exemplary embodiment of the present disclosure, the index nodes in the index network are edge nodes.
[0094] Since the detailed contents of each functional module of the blockchain-based data processing device of the exemplary embodiment of the present disclosure have been recorded in the exemplary embodiment of the blockchain-based data processing method mentioned above, they will not be repeated here.
[0095] It should be noted that although several modules or units of the blockchain-based data processing device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units for embodiment.
[0096] The exemplary embodiments of the present disclosure also provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned blockchain-based data processing method is implemented.
[0097] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0098] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0099] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0100] The computer program can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device can convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program runs on the electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device can execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned blockchain-based data processing method.
[0101] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0102] Refer to the following Figure 7 hereinafter describes an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0103] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0104] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 721 and / or a cache storage unit 722, and may further include a read-only storage unit (ROM) 723. The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.
[0105] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0106] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0107] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0108] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0109] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A data processing method based on blockchain, characterized in that: The method comprises: In response to a data processing request of a decentralized application, a target model corresponding to the data processing request is determined through an index network, where the target model is trained based on on-chain data of the blockchain; The target model is loaded through a target index node in the index network, and the data processing request is executed based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application.
2. The method according to claim 1, characterized in that: The method further comprises: Obtain a data description file, wherein the data description file is used to describe the required blockchain data and data processing events; The target data is obtained from the blockchain network according to the data description file through the index network, and based on the data processing event, at least one model to be trained is trained using the target data to obtain at least one candidate model.
3. The method according to claim 2, characterized in that The step of training at least one to-be-trained model based on the target data to obtain at least one candidate model further includes: According to the request type, determine the corresponding relationship between different request types and candidate models; Among them, different candidate models have their own corresponding task types.
4. The method according to claim 1, characterized in that: The responding to the data processing request of the decentralized application program and determining the target model corresponding to the data processing request through the index network includes: In response to a data processing request of the decentralized application, forwarding the data processing request to the indexing network through a gateway; A target model matching the request type of the data processing request is obtained through the index network, and a target index node matching the request type of the data processing request is obtained.
5. The method according to claim 1, characterized in that The executing the data processing request based on the target model to obtain a data processing result, and returning the data processing result to the decentralized application, includes: Obtaining a data inference result of executing the data processing request by the target model; Determine a payment result according to the type of the target model and / or the processing complexity information of the target model executing the data processing request; The data processing result is determined according to the data inference result and the payment result, so as to return the data processing result to the decentralized application.
6. The method according to claim 1, characterized in that The method further comprises: Training a preset decision model based on blockchain data, wherein the preset decision model is used to generate policy information, and the policy information is used to control the data processing process of the target model; The executing the data processing request based on the target model to obtain a data processing result, and returning the data processing result to the decentralized application, further includes: Collecting user behavior characteristic data of the decentralized application; By means of the index network, the strategy information of the preset decision model is adjusted using the user behavior feature data; Based on the strategy information generated by the preset decision model after adjusting the decision parameters, the data processing process of the target model is controlled.
7. The method according to any one of claims 1 to 6, characterized in that The index nodes in the index network are edge nodes.
8. A data processing device based on blockchain, characterized in that: The device comprises: A model determination module, used to respond to a data processing request of a decentralized application, and determine a target model corresponding to the data processing request through an index network, wherein the target model is trained based on on-chain data of the blockchain; A data processing module is used to load the target model through a target index node in the index network, and execute the data processing request based on the target model to obtain a data processing result, so as to return the data processing result to the decentralized application.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.