Blockchain-based data processing method, device, terminal and medium
Data is obtained and clustered from multiple application objects through terminals, weights are determined and applied to smart contracts, which solves the problems of low efficiency and unreliability in the blockchain network of smart contract data acquisition, and achieves efficient and reliable data transmission.
Patent Information
- Application Number
- CN201911139847.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-19
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2040-01-23
AI Technical Summary
Blockchain networks cannot actively obtain off-chain data. The data acquisition efficiency of smart contracts is inefficient and unreliable. External network data is required through oracle contracts and multiple consensus verifications are required.
The terminal obtains the data to be analyzed from multiple application objects, performs clustering processing and weight determination, and directly applies the most reliable data to smart contracts to simplify the consensus verification process.
It improves the efficiency and reliability of smart contracts to acquire data, reduces the complexity of data verification and node participation.
Smart Images

Figure CN110930254B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, terminal and medium based on blockchain. Background Art
[0002] Blockchain is a new application of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database, that is, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of the transaction information and generate the next block. However, blockchain is a closed environment, and the chain cannot actively obtain data from the real world outside the chain. This is mainly because the blockchain cannot actively initiate network calls, and the smart contract on the chain passively receives data. Secondly, smart contracts are not actually "smart". They are programs that reach the trigger state only when the corresponding conditions are met. Smart contracts need to obtain external data to determine whether the corresponding conditions are currently met.
[0003] When an existing smart contract needs to obtain data, it needs to send a request to the oracle contract deployed in the blockchain network. After the oracle contract receives the access request sent by the smart contract, it goes to the external network to obtain data, and then uploads the data to the blockchain network, so that the smart contract can obtain data from the blockchain again. Because the participation of multiple consensus nodes is required to complete the chain operation, the efficiency of smart contracts in obtaining data is low. Summary of the invention
[0004] The embodiments of the present invention provide a data processing method, device, terminal and medium based on blockchain, which can filter out the most reliable data from multiple acquired data and send them to smart contracts, thereby improving the efficiency and reliability of smart contracts in acquiring data.
[0005] In a first aspect, an embodiment of the present invention provides a data processing method based on blockchain, which is applied to a blockchain network, wherein a smart contract is configured in the blockchain network, and the method includes:
[0006] Obtain multiple data to be analyzed from multiple application objects;
[0007] Performing clustering processing on the plurality of data to be analyzed to obtain a plurality of data sets to be analyzed, each of the data sets to be analyzed storing data to be analyzed of the same category;
[0008] Determining a weight of each of the plurality of data sets to be analyzed, and selecting a target data set to be analyzed from the plurality of data sets to be analyzed according to the weight;
[0009] Any data to be analyzed is selected from the target data set to be analyzed as target data, and the target data is applied to the smart contract.
[0010] In a second aspect, an embodiment of the present invention provides a blockchain-based data processing device, which is applied to a blockchain network, wherein a smart contract is configured in the blockchain network, and the device includes:
[0011] An acquisition module is used to acquire multiple data to be analyzed from multiple application objects;
[0012] A processing module, configured to perform clustering processing on the plurality of data to be analyzed to obtain a plurality of data sets to be analyzed, each of which stores data to be analyzed of the same type;
[0013] A determination module, configured to determine a weight of each of the plurality of data sets to be analyzed;
[0014] A selection module, configured to select a target data set to be analyzed from the plurality of data sets to be analyzed according to the weight;
[0015] The selection module is further used to select any one of the to-be-analyzed data from the target to-be-analyzed data set as the target data;
[0016] An application module is used to apply the target data to the smart contract.
[0017] In a third aspect, an embodiment of the present invention provides a terminal, comprising a processor, an input interface, an output interface and a memory, wherein the processor, input interface, output interface and memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method described in the first aspect.
[0019] In an embodiment of the present invention, the terminal obtains multiple data to be analyzed from multiple application objects, and clusters the multiple data to be analyzed to obtain multiple data sets to be analyzed. The terminal determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight; the terminal selects any one data to be analyzed from the target data set to be analyzed as the target data, and applies the target data to the smart contract. In the above manner, the most reliable data can be screened out from the multiple acquired data and sent to the smart contract without being sent to other nodes for consensus verification, which simplifies the data verification process and improves the efficiency and reliability of smart contract data acquisition. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0021] Figure 1 It is a flowchart of a data processing method based on blockchain provided by an embodiment of the present invention;
[0022] Figure 2 It is a flowchart of another data processing method based on blockchain provided by an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of a consensus verification process provided by an embodiment of the present invention;
[0024] Figure 4 It is a schematic diagram of the structure of a blockchain network provided by an embodiment of the present invention;
[0025] Figure 5 It is a schematic diagram of the structure of a blockchain provided by an embodiment of the present invention;
[0026] Figure 6 It is a structural schematic diagram of a blockchain-based data processing device provided by an embodiment of the present invention;
[0027] Figure 7 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0029] Blockchain is a new application of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database, that is, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of the transaction information and generate the next block. However, blockchain is a closed environment, and the chain cannot actively obtain data from the real world outside the chain. This is mainly because the blockchain cannot actively initiate network calls, and the smart contract on the chain passively receives data. Secondly, smart contracts are not actually "smart". They are programs that reach the trigger state only when the corresponding conditions are met. Smart contracts need to obtain external data to determine whether the corresponding conditions are currently met.
[0030] When an existing smart contract needs to obtain data, it needs to send a request to the oracle contract deployed in the blockchain network. After the oracle contract receives the access request sent by the smart contract, it goes to the external network to obtain data, and then uploads the data to the blockchain network, so that the smart contract can obtain data from the blockchain again. Because the participation of multiple consensus nodes is required to complete the chain operation, the efficiency of smart contracts in obtaining data is low. In addition, the oracle contract cannot verify the reliability of the obtained data, which may cause the smart contract to obtain unreliable data.
[0031] Based on the above description, an embodiment of the present invention provides a data processing method based on blockchain, which is mainly implemented based on blockchain technology, wherein blockchain is a new application of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database, that is, a string of data blocks generated by cryptographic methods, each of which contains a batch of transaction information, which is used to verify the validity of the transaction information and generate the next block. The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the corresponding relationship between the user's real identity and the blockchain address (authority management). The specific implementation steps may include: the terminal obtains multiple data to be analyzed from multiple application objects, and clusters the multiple data to be analyzed to obtain multiple data sets to be analyzed; the terminal determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight; the terminal selects any one data to be analyzed from the target data set to be analyzed as the target data, and applies the target data to the smart contract.
[0032] In summary, by adopting the above-mentioned data processing method based on blockchain, when the smart contract needs to obtain data, the terminal directly obtains the corresponding data externally, and determines the target set based on the weight of the set composed of data obtained from different data sources, and selects the data required by the smart contract from the target set, and directly returns the data to the smart contract after determining the data, so that the smart contract determines whether the triggering condition is met based on the received data. By implementing the above method, the terminal can directly verify the obtained data, and send the data to the smart contract after the verification is passed, which simplifies the process of consensus verification of data by other nodes and improves the efficiency and reliability of smart contract data acquisition.
[0033] Based on the above description, the embodiment of the present invention provides a data processing method based on blockchain, see Figure 1 , the blockchain-based data processing process may include the following steps S101-S104:
[0034] S101: A terminal obtains a plurality of data to be analyzed from a plurality of application objects.
[0035] In the embodiment of the present invention, the terminal may be any node in the blockchain network, including a mobile phone, a computer, a tablet computer, etc. A smart contract is deployed in the blockchain network, and an oracle contract is deployed in the terminal. The oracle contract may obtain a data acquisition request generated based on the smart contract. The data acquisition request includes information of multiple application objects. The application object may be an application program, such as a weather application program, a ball game broadcast application program, etc. The data acquisition request may be used to obtain target data that meets preset requirements. In a specific implementation, the application object in the data acquisition request may include multiple applications of the same type, and each application object may provide corresponding data that meets the requirements of the smart contract. The data that meets the requirements of the smart contract stored by different application objects may be the same or different. For example, the data acquisition request sent by the smart contract is used to obtain the score of Team A in the first quarter of the game. The data provided by the first application object is "15", the data provided by the second application object is "15", and the data provided by the third application object is "16". The specific reason for the difference may be that the time when each data source object provides data is different, and the data will change over time, resulting in deviations in the data provided by each data source object.
[0036] Specifically, when setting up a smart contract, the user can set the contract trigger conditions in the smart contract. The contract trigger conditions can be the temperature is 30 degrees, the game is in the fourth quarter, etc. The smart contract will execute the task corresponding to the smart contract only when it detects that the above trigger conditions are met. The task can be A transfers 100 yuan to B, B sends goods to A, etc. However, the smart contract needs to obtain external target data (such as the current temperature or the status of the game) to determine whether the contract trigger conditions are currently met. Therefore, the smart contract can send a data acquisition request to the oracle contract in the terminal, and the terminal obtains multiple data to be analyzed from multiple application objects according to the data acquisition request received by the oracle contract.
[0037] It should be noted that each node in the blockchain network provided by the embodiment of the present invention can be deployed with a oracle contract for receiving a data acquisition request generated based on a smart contract. The terminal is any node in the blockchain network. The specific way for the terminal to obtain the data acquisition request generated based on the smart contract can be that the blockchain network generates a data acquisition request based on the smart contract regularly, and sends the data acquisition request to the oracle contract of the terminal, so that the terminal can obtain the data acquisition request generated based on the smart contract regularly, or the blockchain network can also generate a data acquisition request based on the smart contract when a trigger event is detected, and send the data acquisition request to the oracle contract of the terminal, wherein the trigger event can be a transaction between nodes in the blockchain network, a node in the network is added or withdrawn, etc., which can be set by the user in advance in the smart contract in the blockchain network. Alternatively, multiple data acquisition nodes for data acquisition can be set in advance in the blockchain network, and the data acquisition node regularly obtains the data acquisition request generated based on the smart contract from the blockchain network, and the terminal is any one of the data acquisition nodes. After the terminal obtains the data acquisition request sent by the smart contract, it will obtain multiple data to be analyzed from the multiple application objects carried by the data acquisition request.
[0038] Furthermore, after the terminal obtains the data acquisition request generated based on the smart contract, it will obtain the data to be analyzed from each application object according to the data acquisition request. For example, the data acquisition request is used to obtain the score of Team A in the first quarter of the game. The application objects include ball game application 1, ball game application 2, and ball game application 3. The terminal can obtain the current score of Team A from ball game application 1 as the first score, obtain the current score of Team A from ball game application 2 as the second score, and obtain the current score of Team A from ball game application 3 as the third score, and determine the above three data as the three acquired data to be analyzed.
[0039] In one implementation, a oracle contract is pre-deployed in the terminal, and the oracle contract includes a data acquisition code. The terminal obtains the data to be analyzed from each application object according to the data acquisition request. The specific method of obtaining the data set to be analyzed can be that the terminal adds the information of each application object to the data acquisition code in the form of parameters to obtain the target data acquisition code; the terminal executes the target data acquisition code in the oracle contract to send a data acquisition request to each application object; and receives multiple data to be analyzed returned by each application object. Among them, the information of the application object can be the name or access address of the application object, that is, the terminal specifically obtains the corresponding data to be analyzed by the deployed oracle contract.
[0040] S102: The terminal performs clustering processing on a plurality of data to be analyzed to obtain a plurality of data sets to be analyzed.
[0041] In the embodiment of the present invention, after the terminal obtains multiple data to be analyzed, it will perform clustering processing on the obtained multiple data to be analyzed to obtain multiple data sets to be analyzed, wherein each data set to be analyzed stores the same type of data to be analyzed. If the content in the data to be analyzed is the same, the data to be analyzed is determined to be of the same type.
[0042] Specifically, the terminal obtains the content of each of the multiple data to be analyzed, and adds the data to be analyzed with the same content to the same set of data to be analyzed, thereby obtaining multiple sets of data to be analyzed. For example, if the data to be analyzed is temperature value data, and the contents of the multiple temperature value data obtained by the terminal are respectively "30, 30, 31, 29, 29, 31", then the terminal determines that there are 3 groups of data to be analyzed with the same content, and establishes 3 sets of data to be analyzed, namely the first set {29, 29}, the second set {30, 30} and the third set {31, 31}. For another example, if the data to be analyzed is the score of team A in the third quarter, and the contents of the multiple score values obtained by the terminal are respectively "22, 21, 22, 22, 22, 22", then the terminal determines that there are 2 groups of data to be analyzed with the same content, and establishes 2 sets of data to be analyzed, namely the first set {21} and the second set {22, 22, 22, 22, 22}.
[0043] It should be noted that, in order to ensure the reliability of the data to be analyzed, the data to be analyzed may also carry key information, which may specifically be a character string, fingerprint, etc. After the terminal obtains each data to be analyzed, it may also detect the reliability of the source of each data to be analyzed based on the key information carried by the data to be analyzed, specifically by verifying the key information carried in the data to be analyzed, and the specific verification method may be to verify whether the key information satisfies the preset arrangement rule, or to verify whether the key information matches the key information stored in the preset database, etc. If the verification result indicates that the verification is passed, the terminal determines that the source of the data to be analyzed is reliable, and clusters the data to be analyzed. If the verification result indicates that the key information carried by the target data to be analyzed fails to be verified, the terminal determines that the source of the target data to be analyzed is unreliable, and removes the target data to be analyzed from the multiple data to be analyzed before clustering the multiple data to be analyzed, so as to avoid the terminal clustering the unreliable data to be analyzed.
[0044] S103: The terminal determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight.
[0045] In the embodiment of the present invention, after the terminal performs clustering processing on the acquired multiple data to be analyzed and obtains multiple data sets to be analyzed, it determines the weight of each data set to be analyzed in the multiple data sets to be analyzed.
[0046] In one implementation, the weight is specifically determined by the number of data to be analyzed in the data set to be analyzed, that is, the specific method for the terminal to determine the weight of each data set to be analyzed in multiple data sets to be analyzed can be that the terminal obtains the number of data to be analyzed in each data set to be analyzed, and determines the weight of each data set to be analyzed based on the corresponding relationship between the number and the weight. Among them, the corresponding relationship between the number and the weight can be that the higher the number, the greater the weight, which can be pre-set by the research and development personnel. For example, the corresponding relationship between the number and the weight is that the number and the weight are the same. The terminal obtains two data sets to be analyzed based on the acquired 6 data to be analyzed "30, 30, 30, 29, 29, 30", including the first set {30, 30, 30, 30} and the second set {29, 29}. The number of data to be analyzed in the first set is 4, and the number of data to be analyzed in the second set is 2. Then the terminal determines that the weight of the first set is 4 and the weight of the second set is 2.
[0047] In one implementation, the specific method for the terminal to determine the weight of each data set to be analyzed in multiple data sets to be analyzed may also be that the terminal obtains each application object corresponding to each data to be analyzed in each data set to be analyzed, and determines the weighting factor corresponding to each data to be analyzed based on the correspondence between the application object and the weighting factor. The terminal determines the weight of the data set to be analyzed by the sum of the weighting factors corresponding to all the data to be analyzed in each data set to be analyzed, wherein the application object corresponding to the data to be analyzed is the application object providing the data to be analyzed, and the weighting factor corresponding to the data to be analyzed is the weighting factor corresponding to the application object providing the data to be analyzed.
[0048] The following is a specific description of the weight determination method of the first set of data to be analyzed among multiple sets of data to be analyzed, where the first set of data to be analyzed is any one of the multiple sets of data to be analyzed. Specifically, the terminal obtains each first application object corresponding to each data to be analyzed in the first set of data to be analyzed, and determines each first weighting factor corresponding to each first application object according to the corresponding relationship between the application object and the weighting factor; the terminal calculates the sum of each first weighting factor, and determines the calculated sum as the weight of the first set of data to be analyzed. For example, the first set of data to be analyzed includes data 1 to be analyzed, data 2 to be analyzed, and data 3 to be analyzed, wherein data 1 to be analyzed corresponds to application object 1, data 2 to be analyzed corresponds to application object 2, data 3 to be analyzed corresponds to application object 3, the weighting factor corresponding to application object 1 is 1, the weighting factor corresponding to application object 2 is 0.9, and the weighting factor corresponding to application object 3 is 0.8, then it can be determined that the weight corresponding to the first set of data to be analyzed is 1+0.9+0.8=2.7.
[0049] It should be noted that the correspondence between the application object and the weighting factor can be pre-set by the R&D personnel, or the terminal can also determine the weighting factor corresponding to the application object based on the accuracy of the historical data to be analyzed provided by the application object in history. Specifically, the terminal obtains the accuracy of the historical data to be analyzed provided by each application object in the multiple application objects of the historical records, and the accuracy is determined by the number of identical times between the historical data to be analyzed and the historical target data, which can be specifically the ratio between the number of identical times between the historical data to be analyzed provided by the application object and the historical target data and the total number of times the application object provides data to be analyzed. Among them, the historical data to be analyzed includes the data to be analyzed provided by the application object in history, and the historical target data includes the target data historically applied to the smart contract. For example, the application object historically provides 10 times of data to be analyzed, and 9 of the 10 times of data to be analyzed are the same as the target data finally applied to the smart contract, then the accuracy of the application object is determined to be 90%. Further, the terminal determines the weighting factor corresponding to each application object according to the accuracy of the historical data to be analyzed provided by each application object, and establishes the correspondence between the application object and the weighting factor. The higher the accuracy, the higher the corresponding weighting factor. For example, if the accuracy is the same as the weighting factor, then when the accuracy is 100%, the corresponding weighting factor is 1, and when the accuracy is 90%, the corresponding weighting factor is 0.9.
[0050] Further, after the terminal determines the weight of each data set to be analyzed, it selects a target data set to be analyzed from multiple data sets to be analyzed according to the weight. Specifically, the terminal can select the data set to be analyzed with the largest weight as the target data set to be analyzed. For example, after the terminal performs clustering processing on multiple data to be analyzed, two data sets to be analyzed are obtained, including a first set {30, 30, 30, 30} and a second set {29, 29}. The weight of the first set is 4, and the weight of the second set is 2. Then the terminal determines the first combination as the target data set to be analyzed. Optionally, if the terminal only obtains one data set to be analyzed after clustering the multiple data to be analyzed, the terminal can directly determine the data set to be analyzed as the target data set to be analyzed, and execute step S104.
[0051] S104: The terminal selects any data to be analyzed from the target data set to be analyzed as target data, and applies the target data to the smart contract.
[0052] In an embodiment of the present invention, after the terminal determines the target data set to be analyzed, it selects any one data to be analyzed from the target data set to be analyzed as the target data. For example, if the target data set to be analyzed is {30, 30, 30, 30}, the terminal can determine the data to be analyzed "30" as the target data. Further, the terminal applies the target data to the smart contract.
[0053] Specifically, the specific way for the terminal to apply the target data to the smart contract can be that the terminal directly returns the target data to the smart contract, so that the smart contract applies the target data, that is, it determines whether the task triggering condition is currently met based on the target data. For example, the smart contract is that when the temperature is greater than 20 degrees, A transfers 100 yuan to B, and the target data is 30, then the smart contract determines that the current temperature is greater than 20 degrees, and executes the task of A transferring 100 yuan to B to apply the target data. Specifically, the terminal can return the target data to the smart contract through the oracle contract deployed in the terminal.
[0054] In an embodiment of the present invention, the terminal obtains multiple data to be analyzed from multiple application objects, and clusters the multiple data to be analyzed to obtain multiple data sets to be analyzed. The terminal determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight; the terminal selects any one of the data to be analyzed from the target data set to be analyzed as the target data, and applies the target data to the smart contract. Through the above method, the terminal can perform clustering based on the data obtained from different data sources, and after obtaining the data set, determine the target data set based on the weight of the data set, and determine the data required by the smart contract from the target data set. Through the above method, the most reliable data can be screened out from the multiple data obtained and sent to the smart contract without sending it to other nodes for consensus verification, which simplifies the data verification process and improves the efficiency and reliability of smart contract data acquisition.
[0055] The present invention provides another data processing method based on blockchain. Figure 2 , the blockchain-based data processing process may include the following steps S201-S205:
[0056] S201. The terminal obtains a plurality of data to be analyzed from a plurality of application objects.
[0057] In an embodiment of the present invention, the terminal can be any node in the blockchain network, a smart contract is deployed in the blockchain network, and a oracle contract is deployed in the terminal. The oracle contract in the terminal can obtain the data acquisition request generated based on the smart contract sent by the blockchain network, and obtain multiple data to be analyzed from multiple application objects according to the obtained data acquisition request, wherein the data acquisition request is used to obtain target data that meets preset requirements, and the data acquisition request contains information of multiple application objects, and each application object can provide a data to be analyzed to the terminal. In one implementation method, the terminal can obtain the data acquisition request generated based on the smart contract from the blockchain network at regular intervals through the oracle contract configured in the terminal, and the user can pre-configure the interval length of the regular acquisition in the oracle contract.
[0058] In one implementation, each application object may specifically be each application. After the terminal obtains the data acquisition request generated based on the smart contract, it may detect whether it has access rights to each application in the data acquisition request. If there is a target application that does not have access rights, the terminal will feedback to the blockchain network that it does not have access rights to the target application, i.e., it cannot obtain the data to be analyzed provided by the target application. In the above situation, the blockchain network may automatically modify the data acquisition request generated based on the smart contract, i.e., remove the target application from the application objects included in the data acquisition request, and resend a new data acquisition request to the terminal, which does not include the target application, so that the terminal obtains the data to be analyzed from each application object according to the new data acquisition request. Alternatively, the terminal sends the data acquisition request to other nodes in the blockchain network that have access rights to the target application, so that other nodes obtain the data to be analyzed from the target application, and the terminal obtains the data to be analyzed provided by the target application from other nodes.
[0059] S202: The terminal performs clustering processing on a plurality of data to be analyzed to obtain a plurality of data sets to be analyzed.
[0060] In an embodiment of the present invention, after the terminal obtains multiple data to be analyzed, the multiple data to be analyzed are clustered to obtain multiple data sets to be analyzed. Each data set to be analyzed stores the same type of data to be analyzed. In a specific implementation, if the content in the data to be analyzed is the same, the data to be analyzed is determined to be of the same type. Specifically, the terminal obtains the content of each data to be analyzed in the multiple data to be analyzed, and adds the data to be analyzed with the same content to the same data set to be analyzed to obtain multiple data sets to be analyzed. Optionally, if the content of the multiple analysis data is all the same, the terminal clusters the multiple data to be analyzed into one data set to be analyzed.
[0061] S203: The terminal obtains the number of sets corresponding to the multiple data sets to be analyzed.
[0062] In an embodiment of the present invention, after the terminal performs clustering processing on the data to be analyzed, it will obtain the number of sets corresponding to multiple data sets to be analyzed. If the number of sets is less than a preset number, the terminal determines that most of the acquired data to be analyzed are consistent, and the target data required by the smart contract can be determined based on the acquired data to be analyzed, and step S204 is executed. If the number of sets is greater than or equal to the preset number, the terminal determines that the consistency of the acquired data to be analyzed is low. If the target data required by the smart contract is determined from the multiple data sets to be analyzed, the reliability of the obtained target data is low. The terminal can obtain multiple new analysis data from multiple application objects again, and select the target data required by the smart contract from the multiple new analysis data, wherein the target data can be the data to be analyzed with the highest frequency of occurrence in the new data to be analyzed. For example, the preset number is 4, and the data sets to be analyzed constructed by the multiple data to be analyzed acquired by the terminal include the first set {2, 2}, the second set {3}, the third set {4, 4}, the fourth set {5, 5}, and the fifth set {6}. The terminal determines that the number of data sets to be analyzed is greater than the preset number, and the data to be analyzed are inconsistent. The terminal re-acquires new data to be analyzed including "4, 4, 3, 4, 4, 4". The terminal determines that the data to be analyzed "4" with the highest frequency of occurrence among the multiple new data to be analyzed is the target data required by the smart contract.
[0063] S204: If the number of sets is less than the preset number, the terminal determines the weight of each of the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight.
[0064] In the embodiment of the present invention, after the terminal performs clustering processing on the acquired multiple data to be analyzed to obtain multiple data sets to be analyzed, if the number of sets is less than a preset number, the terminal will determine the weight of each data set to be analyzed in the multiple data sets to be analyzed.
[0065] In method 1, the weight is specifically determined by the number of data to be analyzed in the data set to be analyzed, that is, the specific method for the terminal to determine the weight of each data set to be analyzed in multiple data sets to be analyzed can be that the terminal obtains the number of data to be analyzed in each data set to be analyzed, and determines the weight of each data set to be analyzed based on the corresponding relationship between the number and the weight, wherein the corresponding relationship between the number and the weight can be that the number and the weight are the same.
[0066] In mode 2, the terminal may determine the weight of each of the multiple data sets to be analyzed in a specific manner as follows: the terminal obtains each application object corresponding to each of the data to be analyzed in each of the data sets to be analyzed, and determines the weighting factor corresponding to each of the data to be analyzed according to the corresponding relationship between the application object and the weighting factor; the terminal determines the weight of the data set to be analyzed by the sum of the weighting factors corresponding to all of the data to be analyzed in each of the data sets to be analyzed, wherein the application object corresponding to the data to be analyzed is the application object providing the data to be analyzed, and the weighting factor corresponding to the data to be analyzed is the weighting factor corresponding to the application object providing the data to be analyzed. The corresponding relationship between the application object and the weighting factor may be pre-set by the R&D personnel, or the terminal may determine the weighting factor corresponding to the application object based on the accuracy of the historical data to be analyzed provided by the application object in history. Specifically, the terminal obtains the accuracy of the historical data to be analyzed provided by each of the multiple application objects in the historical records, and the accuracy is determined by the number of identical times between the historical data to be analyzed and the historical target data, which may be the ratio between the number of identical times between the historical data to be analyzed provided by the application object and the historical target data and the total number of times the application object provides the data to be analyzed. Among them, the historical data to be analyzed includes the data to be analyzed historically provided by the application object, and the historical target data includes the target data historically applied to the smart contract.
[0067] Further, after the terminal determines the weight of each data set to be analyzed, it will select a target data set to be analyzed from multiple data sets to be analyzed according to the weight. Among them, the target data set to be analyzed can specifically be the data set to be analyzed with the largest weight. It should be noted that if the terminal uses method 1 to determine that there are at least two data sets to be analyzed with the same weight, the terminal can use method 2 to redetermine the weight of the data set to be analyzed, or if the terminal uses method 2 to determine that there are at least two data sets to be analyzed with the same weight, the terminal can use method 2 to redetermine the weight of the data set to be analyzed. If both methods 1 and 2 determine that there are at least two data sets to be analyzed with the same weight among multiple data sets to be analyzed, the terminal can obtain the data to be analyzed from other data objects again, and after the new data to be analyzed is obtained, the weights of the at least two data sets to be analyzed with the same weight are changed, and the target data set to be analyzed is selected based on the changed weight. For example, based on the acquired 6 data to be analyzed "30, 30, 30, 29, 29, 29", the terminal obtains 2 data sets to be analyzed, including the first set {30, 30, 30} and the second set {29, 29, 29}. The terminal determines that the weight of the first set is 3 and the weight of the second set is 3. At this time, the terminal again obtains new data to be analyzed "30" from the new application object, and adds the data to the first set, so that the weight of the first set increases, and the first set is determined as the target data set to be analyzed.
[0068] S205. The terminal selects any data to be analyzed from the target data set to be analyzed as target data, and applies the target data to the smart contract.
[0069] In an embodiment of the present invention, after the terminal determines the target data set to be analyzed, it will select any data to be analyzed from the target data set to be analyzed as the target data. For example, if the target data set to be analyzed is {30, 30, 30, 30}, the terminal can determine the data to be analyzed "30" as the target data. Furthermore, after the terminal determines the target data, it can directly return the target data to the smart contract so that the smart contract applies the target data, that is, it determines whether the task triggering condition is currently met based on the target data. Specifically, the terminal can return the target data to the smart contract through the oracle contract deployed in the terminal.
[0070] After the terminal applies the target data to the smart contract, the smart contract will determine whether the target data meets the contract trigger conditions, wherein the smart contract is pre-set with the contract trigger conditions, and the contract trigger conditions may be that the temperature is 20 degrees, the game is in the fourth quarter, etc. The smart contract will execute the task corresponding to the smart contract only when it detects that the above trigger conditions are met. The task may be that A transfers 100 yuan to B, B sends goods to A, etc. Further, when the smart contract determines that the target data meets the task trigger conditions, it will trigger the terminal to broadcast the target data and the task executed by the smart contract to at least one second node in the blockchain network, so that at least one second node in the blockchain network performs a consensus check on the target data. Specifically, the process of at least one second node performing a consensus check on the target data may be that each second node also obtains the second data to be analyzed from the application object, and detects whether the second target data obtained based on the second data to be analyzed is the same as the target data broadcast by the terminal. If they are the same, the verification result for the target data is determined to be a verification pass, such as Figure 3 As shown, the second node includes node 1, node 2, node 3 and node 4, the application objects carried by the data acquisition request include application object 1, application object 2, application object 3 and application object 4, and node 1, node 2, node 3 and node 4 can obtain corresponding data to be analyzed from each application object to complete the consensus verification of the target data.
[0071] If at least one second node in the blockchain network passes the verification of the target data, the terminal packages the target data into blocks and adds the blocks to the blockchain network. In this way, the smart contract uses the target data obtained from the outside and then uploads the external data to the blockchain, which improves the efficiency of the smart contract in acquiring data. In addition, at least one second node performs consensus verification on the target data based on the data obtained from the application object, which also simplifies the consensus verification process and improves the efficiency of data upload.
[0072] In an embodiment of the present invention, the terminal obtains multiple data to be analyzed from multiple application objects, and clusters the multiple data to be analyzed to obtain multiple data sets to be analyzed. If the number of data sets to be analyzed is less than the preset number, the terminal determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight; the terminal selects any one data to be analyzed from the target data set to be analyzed as the target data, and applies the target data to the smart contract. In the above manner, the most reliable data can be screened out from the multiple acquired data and sent to the smart contract without being sent to other nodes for consensus verification, which simplifies the data verification process and improves the efficiency and reliability of smart contract data acquisition.
[0073] like Figure 4 As shown, the blockchain network provided by the embodiment of the present invention is shown in Figure 4 The blockchain network shown, the blockchain network refers to a system for sharing data between nodes, and the blockchain network may include multiple nodes 401, and the multiple nodes 401 may refer to various terminals in the blockchain network. Each node can receive input information during normal operation, and maintain the shared data in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there may be an information connection between each node in the blockchain network, and the nodes can transmit information through the above information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the blockchain network are consistent.
[0074] Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes in the blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. Each node can maintain a node identifier list as shown in the following table, and store the node name and node identifier in the node identifier list accordingly. Among them, the node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address and any other information that can be used to identify the node. Table 1 only uses the IP address as an example for illustration.
[0075] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0076] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 5 , the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the version number of the input information, the hash value of the previous block and the Merkle root node, and the block body stores the input information; the next block of the genesis block uses the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the version number of the parent block, the hash value of the previous block and the Merkle root node, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block. In the specific implementation, each block can save the income information uploaded by each node.
[0077] When generating each block in the blockchain, the node where the blockchain is located verifies the input information when it receives it. After verification, it stores the input information in the memory pool and updates the hash tree used to record the input information. After that, it updates the update timestamp to the time when the input information is received, tries different random numbers, and calculates the eigenvalues multiple times so that the calculated eigenvalues can satisfy the following formula:
[0078] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0079] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.
[0080] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the blockchain network according to the node identification of other nodes in the blockchain network. Other nodes verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.
[0081] Based on the description of the above-mentioned blockchain-based data processing method embodiment, the embodiment of the present invention also discloses a blockchain-based data processing device, which can be a computer program (including program code) running in a terminal, or a physical device included in the terminal. The blockchain-based data processing device can execute Figure 1 or Figure 2 See the method shown in Figure 6 The blockchain-based data processing device 60 includes: an acquisition module 601, a processing module 602, a determination module 603, a selection module 604, and an application module 605.
[0082] The acquisition module 601 is used to acquire a plurality of data to be analyzed from a plurality of application objects;
[0083] The processing module 602 is used to perform clustering processing on the plurality of data to be analyzed to obtain a plurality of data sets to be analyzed, each of which stores data to be analyzed of the same type;
[0084] A determination module 603 is used to determine the weight of each of the plurality of data sets to be analyzed;
[0085] A selection module 604 is used to select a target data set to be analyzed from the multiple data sets to be analyzed according to the weight;
[0086] The selection module 604 is further used to select any one of the to-be-analyzed data from the target to-be-analyzed data set as the target data;
[0087] The application module 605 is used to apply the target data to the smart contract.
[0088] In one implementation, the determination module 603 is specifically configured to:
[0089] Acquire the content of each of the plurality of data to be analyzed;
[0090] The data to be analyzed with the same content are added to the same set of data to be analyzed to obtain multiple sets of data to be analyzed.
[0091] In one implementation, the processing module 602 is specifically configured to:
[0092] Acquire each first application object corresponding to each data to be analyzed in a first data set to be analyzed, where the first data set to be analyzed is any one data set to be analyzed among the multiple data sets to be analyzed;
[0093] Determining each first weighting factor corresponding to each first application object according to a correspondence between the application object and the weighting factor;
[0094] The sum of the first weighting factors is calculated, and the sum is determined as the weight of the first data set to be analyzed.
[0095] In one implementation, the determination module 603 is specifically configured to:
[0096] Obtaining an accuracy rate of historical data to be analyzed provided by each of the multiple application objects of the historical records, wherein the accuracy rate is determined by the number of identical times between the historical data to be analyzed and the historical target data, wherein the historical data to be analyzed includes the data to be analyzed historically provided by the application object, and the historical target data includes the target data historically applied to the smart contract;
[0097] The weighting factors corresponding to the respective application objects are determined according to the accuracy of the historical data to be analyzed provided by the respective application objects, and a corresponding relationship between the application objects and the weighting factors is established.
[0098] In one implementation, the determination module 603 is specifically configured to:
[0099] Obtaining the number of data to be analyzed in each of the data sets to be analyzed;
[0100] The weight of each of the data sets to be analyzed is determined according to the corresponding relationship between the quantity and the weight.
[0101] In one implementation, the processing module 602 is further configured to:
[0102] Obtaining the number of sets corresponding to the multiple data sets to be analyzed;
[0103] If the number of sets is less than the preset number, a step of determining a weight of each of the plurality of sets of data to be analyzed is performed.
[0104] In one implementation, the processing module 602 is further configured to:
[0105] If the number of sets is greater than or equal to a preset number, obtaining a plurality of new analysis data from the plurality of application objects again;
[0106] Target data to be applied to the smart contract is selected from the multiple new analysis data.
[0107] In an embodiment of the present invention, the acquisition module 601 acquires multiple data to be analyzed from multiple application objects, the processing module 602 performs clustering processing on the multiple data to be analyzed to obtain multiple data sets to be analyzed, the determination module 603 determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and the selection module 604 selects the target data set to be analyzed from the multiple data sets to be analyzed according to the weight; and selects any one of the data to be analyzed from the target data set to be analyzed as the target data, and the application module 605 applies the target data to the smart contract. In the above manner, the most reliable data can be screened out from the multiple acquired data and sent to the smart contract without being sent to other nodes for consensus verification, which simplifies the data verification process and improves the efficiency and reliability of smart contract data acquisition.
[0108] See also Figure 7 , is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. Figure 7As shown, the terminal includes: at least one processor 701, an input device 703, an output device 704, a memory 705, and at least one communication bus 702. The communication bus 702 is used to realize the connection and communication between these components. The memory 705 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 705 can also be at least one storage device located away from the aforementioned processor 701. The processor 701 can be combined with Figure 6 In the described apparatus, a set of program codes is stored in the memory 705, and the processor 701, the input device 703, and the output device 704 call the program codes stored in the memory 705 to perform the following operations:
[0109] Processor 701, used to obtain multiple data to be analyzed from multiple application objects;
[0110] The processor 701 is configured to perform clustering processing on the plurality of data to be analyzed to obtain a plurality of data sets to be analyzed, each of which stores data to be analyzed of the same type;
[0111] The processor 701 is configured to determine a weight of each of the plurality of data sets to be analyzed, and select a target data set to be analyzed from the plurality of data sets to be analyzed according to the weight;
[0112] The processor 701 is used to select any one of the to-be-analyzed data from the target to-be-analyzed data set as target data, and apply the target data to the smart contract.
[0113] In one implementation, the processor 701 is specifically configured to:
[0114] Acquire the content of each of the plurality of data to be analyzed;
[0115] The data to be analyzed with the same content are added to the same set of data to be analyzed to obtain multiple sets of data to be analyzed.
[0116] In one implementation, the processor 701 is specifically configured to:
[0117] Acquire each first application object corresponding to each data to be analyzed in a first data set to be analyzed, where the first data set to be analyzed is any one data set to be analyzed among the multiple data sets to be analyzed;
[0118] Determining each first weighting factor corresponding to each first application object according to a correspondence between the application object and the weighting factor;
[0119] The sum of the first weighting factors is calculated, and the sum is determined as the weight of the first data set to be analyzed.
[0120] In one implementation, the processor 701 is specifically configured to:
[0121] Obtaining an accuracy rate of historical data to be analyzed provided by each of the multiple application objects of the historical records, wherein the accuracy rate is determined by the number of identical times between the historical data to be analyzed and the historical target data, wherein the historical data to be analyzed includes the data to be analyzed historically provided by the application object, and the historical target data includes the target data historically applied to the smart contract;
[0122] The weighting factors corresponding to the respective application objects are determined according to the accuracy of the historical data to be analyzed provided by the respective application objects, and a corresponding relationship between the application objects and the weighting factors is established.
[0123] In one implementation, the processor 701 is specifically configured to:
[0124] Obtaining the number of data to be analyzed in each of the data sets to be analyzed;
[0125] The weight of each of the data sets to be analyzed is determined according to the corresponding relationship between the quantity and the weight.
[0126] In one implementation, the processor 701 is specifically configured to:
[0127] Obtaining the number of sets corresponding to the multiple data sets to be analyzed;
[0128] If the number of sets is less than the preset number, a step of determining a weight of each of the plurality of sets of data to be analyzed is performed.
[0129] In one implementation, the processor 701 is specifically configured to:
[0130] If the number of sets is greater than or equal to a preset number, obtaining a plurality of new analysis data from the plurality of application objects again;
[0131] Target data to be applied to the smart contract is selected from the multiple new analysis data.
[0132] In an embodiment of the present invention, the processor 701 obtains multiple data to be analyzed from multiple application objects, the processor 701 performs clustering processing on the multiple data to be analyzed to obtain multiple data sets to be analyzed, the processor 701 determines the weight of each data set to be analyzed in the multiple data sets to be analyzed, and the processor 701 selects a target data set to be analyzed from the multiple data sets to be analyzed according to the weight; and selects any one of the data to be analyzed from the target data set to be analyzed as the target data, and the processor 701 applies the target data to the smart contract. In the above manner, the most reliable data can be screened out from the multiple data obtained and sent to the smart contract without being sent to other nodes for consensus verification, which simplifies the data verification process and improves the efficiency and reliability of smart contract data acquisition.
[0133] The modules described in the embodiments of the present invention may be implemented by a general integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
[0134] It should be understood that in the embodiment of the present invention, the processor 701 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0135] The bus 702 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus 702 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.
[0136] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0137] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A data processing method based on blockchain, applied to a blockchain network, wherein a smart contract is configured in the blockchain network, characterized in that: The method comprises: Acquiring multiple data to be analyzed from multiple application objects, including: adding information of multiple application objects to the data acquisition code in the oracle contract in the form of parameters to obtain a target data acquisition code; executing the target data acquisition code, the target data acquisition code is used to send a data acquisition request to the multiple application objects; receiving multiple data to be analyzed returned by the multiple application objects according to the data acquisition request, the data to be analyzed is data that meets the requirements of the smart contract; Acquire the content of each of the plurality of data to be analyzed; Adding the data to be analyzed with the same content into the same set of data to be analyzed to obtain multiple sets of data to be analyzed, each of which stores the same type of data to be analyzed; Obtaining the number of sets corresponding to the multiple data sets to be analyzed; If the number of the sets is less than the preset number, obtaining the number of data to be analyzed in each of the sets of data to be analyzed; Determining the weight of each of the plurality of data sets to be analyzed according to the corresponding relationship between the quantity and the weight, and selecting a target data set to be analyzed from the plurality of data sets to be analyzed according to the weight; Select any one of the target data to be analyzed from the target data set to be analyzed as the target data, and apply the target data to the smart contract; If the number of sets is greater than or equal to a preset number, obtaining a plurality of new analysis data from the plurality of application objects again; Target data to be applied to the smart contract is selected from the multiple new analysis data.
2. The method according to claim 1, characterized in that The method further comprises: If the number of sets is less than the preset number, obtaining each first application object corresponding to each data to be analyzed in the first set of data to be analyzed, wherein the first set of data to be analyzed is any one of the multiple sets of data to be analyzed; Determining each first weighting factor corresponding to each first application object according to a correspondence between the application object and the weighting factor; Calculating a sum of the first weighting factors, and determining the sum as the weight of the first set of data to be analyzed; The weight of each of the plurality of data sets to be analyzed is determined.
3. The method according to claim 2, characterized in that Before determining each first weighting factor corresponding to each first application object according to the correspondence between the application object and the weighting factor, the method further includes: Obtaining an accuracy rate of historical data to be analyzed provided by each of the multiple application objects of the historical records, wherein the accuracy rate is determined by the number of identical times between the historical data to be analyzed and the historical target data, wherein the historical data to be analyzed includes the data to be analyzed historically provided by the application object, and the historical target data includes the target data historically applied to the smart contract; The weighting factors corresponding to the respective application objects are determined according to the accuracy of the historical data to be analyzed provided by the respective application objects among the plurality of application objects, and a corresponding relationship between the application objects and the weighting factors is established, wherein the plurality of application objects include the respective first application objects.
4. A data processing device based on blockchain, characterized in that: Applied in a blockchain network, wherein a smart contract is configured in the blockchain network, the device comprises: An acquisition module is used to acquire multiple data to be analyzed from multiple application objects, including: adding the information of multiple application objects to the data acquisition code in the oracle contract in the form of parameters to obtain a target data acquisition code; executing the target data acquisition code, the target data acquisition code is used to send a data acquisition request to the multiple application objects; receiving multiple data to be analyzed returned by the multiple application objects according to the data acquisition request, the data to be analyzed is data that meets the requirements of the smart contract; A processing module, used for obtaining the content of each data to be analyzed among the plurality of data to be analyzed, adding the data to be analyzed having the same content into the same set of data to be analyzed, so as to obtain a plurality of sets of data to be analyzed, each of which stores the same type of data to be analyzed; A determination module, configured to determine a weight of each of the plurality of data sets to be analyzed; The determining module, when determining the weight of each of the plurality of data sets to be analyzed, is specifically configured to obtain the number of data to be analyzed in each of the data sets to be analyzed, and determine the weight of each of the data sets to be analyzed according to the corresponding relationship between the number and the weight; A selection module, configured to select a target data set to be analyzed from the plurality of data sets to be analyzed according to the weight; The selection module is further used to select any one of the to-be-analyzed data from the target to-be-analyzed data set as the target data; An application module, used for applying the target data to the smart contract; The processing module is further configured to obtain the number of sets corresponding to the plurality of data sets to be analyzed, and if the number of sets is less than a preset number, the determination module is configured to perform a step of determining the weight of each data set to be analyzed in the plurality of data sets to be analyzed; The processing module is also used to obtain multiple new analysis data from the multiple application objects again if the number of sets is greater than or equal to a preset number, and select target data applied to the smart contract from the multiple new analysis data.
5. A terminal, characterized in that: The method comprises a processor, an input interface, an output interface and a memory, wherein the processor, the input interface, the output interface and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 3.
