Blockchain-based multi-source trusted data production method, blockchain node and system
Patent Information
- Application Number
- CN202311189157.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-09-14
AI Technical Summary
[0006]针对现有技术的缺陷,本发明的目的在于提供一种基于区块链的多源可信数据生产方法、区块链节点及系统,旨在解决海量汇聚数据的可靠性、可信性和可用性的问题
本发明提供一种基于区块链的多源可信数据生产方法、区块链节点及系统,通过区块链对多源数据进行一致性比对,能够针对海量数据实现自动化验证、可追溯的多源数据可信生产,通过汇聚多源数据并抽取源数据中的最小数据单元进行数据组合后进行一致性比对,基于区块链网络的分布式网络存储。
Smart Images

Figure CN117171812B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data asset management technology, and more specifically, relates to a blockchain-based multi-source trusted data production method, blockchain node, and system. Background Technology
[0002] Trustworthy data requires determining its authenticity and credibility from the data production stage, including various data production attributes. For example, once trustworthy data becomes a record in a database, it faces risks such as attacks and damage, which could lead to the data being untrue or unreliable.
[0003] Government data refers to various data resources collected, generated, stored, and managed in accordance with the law by government departments at all levels and their technical support units in the course of performing their duties. Based on its dissemination scope, government data generally includes shareable government data, publicly accessible data, and government data that is not suitable for public sharing.
[0004] The foundation of open and shared government data is the output of credible data to safeguard government credibility. However, in promoting the sharing and opening of government data, provincial or municipal big data centers and other data management agencies face challenges in outputting credible data from multiple sources with discrepancies. The main reasons for this include: 1. Government data aggregates a large amount of data information. The existing database contains a large amount of untraceable original production information, which leads to low reliability of data records, difficulty in auditing, and affects the circulation and use of data. 2. If the database adopts a trusted data production traceability mechanism that couples and associates production information, then when processing large amounts of automated data, the data preprocessing system will have obvious performance and efficiency constraints and will not be able to provide a trusted endorsement for each data record. 3. Data conflict issues: The same data may be stored simultaneously in provincial databases, municipal databases, district and county databases, and business unit database nodes. These databases are deployed on different servers with different geographical locations and operating environments. Due to differences in data collection methods, data storage standards, and data storage structures, some data may have multiple sources and be inconsistent.
[0005] Therefore, the opening and sharing of government data requires the establishment of an automated verification and traceable multi-source trusted data production method for massive amounts of data, which can reduce the production cost of trusted data while ensuring high data trustworthiness. Summary of the Invention
[0006] In view of the shortcomings of existing technologies, the purpose of this invention is to provide a blockchain-based method for producing multi-source trusted data, a blockchain node and system, which aims to solve the problems of reliability, trustworthiness and availability of massive aggregated data.
[0007] To achieve the above objectives, in a first aspect, the present invention provides a multi-source trusted data production method based on blockchain, applied to blockchain nodes, wherein the blockchain nodes are connected to a blockchain network, and the blockchain network includes multiple blockchain nodes, comprising the following steps: S1, the blockchain node identifies the data source, obtains source data from multiple data sources, and obtains the source dataset; S2, the blockchain node performs data preprocessing on each source data in the source dataset; S3, the blockchain node extracts the smallest data unit from each source data in the preprocessed source dataset and combines the data to obtain the data to be verified. S4, All or some of the blockchain nodes compare the data to be verified based on smart contracts to confirm whether the corresponding blockchain node consensus has been passed; S5 obtains the consensus pass rate of all participating blockchain nodes, determines whether the data to be verified is trustworthy data, and if the result is yes, then stores the trustworthy data and related production information in the blockchain network.
[0008] It should be noted that this invention performs consistency comparison of multi-source data based on blockchain, which can achieve automated verification and traceable reliable production of multi-source data for massive amounts of data. It performs consistency comparison by aggregating multi-source data and extracting the smallest data unit from the source data, and then performing data combination based on the distributed network storage of the blockchain network.
[0009] In specific business scenarios, individual data records or field-level data combinations in the source data may not have data circulation value. In this invention, the data to be verified after splitting and reorganizing is data with special business attributes and circulation value. Based on this, the production of multi-source trusted data in this invention has application significance.
[0010] The verification, consensus, and trusted data storage processes of the aforementioned multi-source data are all conducted within the blockchain network, ensuring the transparency, reliability, trustworthiness, and availability of multi-source trusted data production.
[0011] In one possible implementation, step S2, the data preprocessing includes source data verification and source data cleaning, and step S2 includes the following sub-steps: S2.1, the blockchain node performs source data verification on each source data in the source dataset according to the data verification rules. The source data verification includes any one or more of the following: structure verification, duplication verification, missing value verification, and outlier value verification. S2.2 After the source data verification is passed, the blockchain node performs source data cleaning on each source data in the source dataset according to the data cleaning rules to obtain the cleaning result of each source data. The source data cleaning includes any one or more of the following: data deduplication, missing value handling, data transformation, and outlier handling. S2.3 After the source data is cleaned, the blockchain node determines whether the cleaned result of the source data meets the passing conditions in the data judgment rules according to the data judgment rules. If the passing conditions in the data judgment rules are met, it is marked as the first data to be processed and used as the source data after data preprocessing. If the pass conditions in the data judgment rules are not met, the operation is stopped, the cleaned source data is marked as the first data to be confirmed, and the first data to be confirmed is stored in the blockchain network. The data verification rules, data cleaning rules, and data judgment rules are data preprocessing rules, which are preset by blockchain nodes.
[0012] It is understood that the data preprocessing rules can be set and stored in advance by blockchain nodes, or they can be set and stored during this multi-source trusted data production process. Those skilled in the art can choose the appropriate timing according to actual needs.
[0013] Specifically, the above-mentioned evidence storage process is as follows: blockchain nodes preset data preprocessing rules, and after being approved by consensus among all blockchain nodes, the evidence is stored in the blockchain network.
[0014] Furthermore, the first piece of data to be confirmed also needs to be stored in the blockchain network; Furthermore, the first set of data to be confirmed can be centralized in a database, for example, by establishing a risk warning database and using the first set of data to be confirmed as risk data for risk warning.
[0015] In one possible implementation, step S3 includes the following sub-steps: S3.1, Blockchain nodes obtain pre-processed source data; S3.2, the blockchain node combines the smallest data unit of the preprocessed source data according to the data combination rules of the blockchain network consensus, obtains the data to be verified, and stores the data to be verified in the blockchain network; the smallest data unit refers to the combination of fields and field values of a certain data record in the data table of the source data.
[0016] It is understood that the data combination rules can be pre-set and stored by blockchain nodes, or they can be set and stored during this multi-source trusted data production process. Those skilled in the art can choose the appropriate timing according to actual needs.
[0017] Specifically, the above-mentioned evidence storage process is as follows: blockchain nodes configure data combination rules, and after consensus is reached by all blockchain nodes, the evidence is stored in the blockchain network.
[0018] In one possible implementation, step S4 includes the following sub-steps: S4.1 Based on the smart contract, the data to be verified is compared separately, including one of the following two methods: Method 1: All blockchain nodes act as execution nodes, and the multi-source verification rules are executed based on smart contracts to compare the data to be verified; Method 2: At least one blockchain node acts as the execution node, executing multi-source verification rules based on smart contracts to compare the data to be verified; at least one blockchain node acts as the participation node, only confirming whether the multi-source verification rules executed by the execution node meet the requirements based on smart contracts, without executing the multi-source verification rules to compare the data to be verified. S4.2 If the data to be verified meets the multi-source verification rules, the consensus of the corresponding blockchain nodes is passed; the multi-source verification rules are configured according to the key comparison fields and stored in the blockchain network; the key comparison fields are used to uniquely identify the data to be verified.
[0019] It is understood that the multi-source verification rules in step S4.1 can be pre-set and stored by the blockchain nodes, or they can be set and stored during the production of this multi-source trusted data. Those skilled in the art can choose the appropriate timing according to actual needs.
[0020] Specifically, the above-mentioned evidence storage process is as follows: the blockchain node determines the key comparison field, which is used to uniquely identify the data to be verified; the blockchain node configures multi-source verification rules according to the key comparison field, and after the multi-source verification rules are passed by consensus of all blockchain nodes, the evidence is stored in the blockchain network.
[0021] Furthermore, the verification process for the data to be verified can be carried out by any one or more blockchain nodes based on smart contracts to compare data from multiple sources. Other blockchain nodes do not participate in the multi-source data comparison calculation, but only participate in the consensus process of the multi-source verification rules to verify whether the multi-source verification rules are correct.
[0022] It should be noted that there can be one or more key comparison fields; multi-source verification rules can be comparison rules based on data types such as text, numbers, and dates, to determine whether the data to be verified generated from each source data in the source dataset is consistent.
[0023] In one possible implementation, step S5, determining whether the data to be verified is trustworthy data, includes: If the consensus pass rate is the first preset value or greater than the first preset value, the data to be verified is determined to be trustworthy data; otherwise, the data to be verified is determined to be untrustworthy data. After marking the determination result, the data to be verified is stored in the blockchain. If the consensus pass rate is between the second preset value and the first preset value, and the participants in the consensus pass include authoritative nodes, then the data to be verified is determined to be trustworthy data; the authoritative node is one or more of the blockchain nodes, and the authoritative node is the blockchain node where the original production source of the data corresponding to at least one key comparison field is located; If the consensus pass rate is between the second preset value and the first preset value, and the participants in the consensus pass do not include authoritative nodes, then the data to be verified is determined to be the second data to be confirmed. If the consensus pass rate is not greater than the second preset value, the data to be verified is determined to be unreliable data; the first preset value is greater than the second preset value.
[0024] It should be noted that when the consensus pass rate meets the preset conditions, the consensus is passed, and the data to be verified is considered reliable data.
[0025] Those skilled in the art can set the values of the first and second preset values according to actual needs. For example, the first preset value can be configured as 70%, 80%, 85%, 90%, 95%, 100%, or a value between 60% and 100%. The second preset value can be configured as 50%, 60%, 70%, 80%, 90%, or a value between 50% and 99%. Of course, the first and second preset values can also be set to other values.
[0026] In addition, the phrase "between" mentioned in the above description generally refers to values excluding the two ends.
[0027] In one possible implementation, step S5, determining whether the data to be verified is trustworthy data, further includes: The authoritative node receives the second data to be confirmed, and based on the smart contract, determines whether the second data to be confirmed is trustworthy according to the verification method of the second data to be confirmed stored in the blockchain network. The authoritative verification result is obtained and broadcast to the blockchain network for consensus. After the consensus is passed, the trustworthy data corresponding to the second data to be confirmed and the relevant production information of the trustworthy data are stored in the blockchain network. The verification method of the second data to be confirmed is created by the authoritative node, and is passed by consensus and stored in the blockchain network.
[0028] It is understandable that the second method for verifying the data to be confirmed can be pre-set and stored by the blockchain node, or it can be set and stored during the production of this multi-source trusted data. Those skilled in the art can choose the appropriate timing according to actual needs.
[0029] Specifically, the above-mentioned evidence storage process is as follows: the authoritative node receives the second data to be confirmed, creates a corresponding verification method for the second data to be confirmed based on the received second data to be confirmed, and submits it to the blockchain network for consensus. After the consensus is passed, the evidence is stored in the blockchain network.
[0030] Furthermore, the second method for verifying the data to be verified can be based on all historical versions of the data to be verified, and / or, data change rules. If the current change does not meet the preset data change rules, it is identified as unreliable data; otherwise, it is considered reliable data.
[0031] In one possible implementation, step S5 further includes the following sub-steps: When the data to be verified is trusted data, a preset algorithm is used to process the multi-source trusted data to obtain production information related to the multi-source trusted data. Then, the obtained production information is partially or completely stored in the blockchain network. The relevant production information includes: data source information, source data information, source data processing rule information, source data related data processing information, and blockchain network consensus information. The preset algorithm includes one or more of the following algorithms: Algorithm 1: Using a hash algorithm, the input information is combined and processed to obtain a hash value; For example, three input messages, represented as string1, string2, and string3 respectively, are combined to obtain a string "string1-string2-string3". The corresponding hash value is then obtained by using a hash algorithm such as SHA256.
[0032] Algorithm 2: Sort the input information by time, arrange it into a Merkle hash tree, and output the corresponding root hash value.
[0033] Specifically, the hash value associated with trusted data can be used as evidence of the relevant production information of trusted data.
[0034] Secondly, the present invention provides a blockchain node, comprising: The data source identification unit is used to identify data sources, obtain source data from multiple data sources, and obtain the source dataset; A data preprocessing unit is used to perform data preprocessing on each source data in the source dataset, the data preprocessing including source data verification and source data cleaning; The data combination unit is used to extract the smallest data unit from each source data in the preprocessed source dataset and combine them to obtain the data to be verified. The data verification unit is used to compare the data to be verified based on the smart contract. If the data to be verified meets the multi-source verification rules, the consensus is passed. The consensus unit is used to obtain the consensus pass rate of all blockchain nodes participating in the consensus and to determine whether the data to be verified is trustworthy data. The storage unit is used to store and prove the trusted data and related production information in the blockchain if the consensus verification by the consensus unit passes.
[0035] Thirdly, the present invention provides a blockchain system, comprising: The client is used to send data sources to blockchain nodes in the blockchain network. The blockchain nodes are used to identify data sources, obtain source data from multiple data sources to obtain source datasets; perform data preprocessing on each source data in the source dataset, including source data verification and source data cleaning; extract the smallest data unit from each source data in the preprocessed source dataset and combine the data to be verified; compare the data to be verified based on smart contracts, and if the data to be verified meets the multi-source verification rules, consensus is passed; then obtain the consensus pass rate of all participating blockchain nodes to determine whether the data to be verified is trustworthy data, and if the result is yes, instruct the blockchain network to store the trustworthy data and related production information.
[0036] Fourthly, the present invention provides an electronic device comprising: at least one processor and an interface circuit; the processor acquires program instructions through the interface circuit and executes the method described in the first aspect or any possible implementation thereof according to the program instructions.
[0037] Fifthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.
[0038] In a sixth aspect, the present invention provides a computer program product that, when run on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.
[0039] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art: This invention provides a blockchain-based method for producing multi-source trusted data, a blockchain node, and a system. By using blockchain to perform consistency comparisons on multi-source data, it can achieve automated verification and traceable trusted production of multi-source data for massive amounts of data. It aggregates multi-source data, extracts the smallest data unit from the source data, combines the data, and then performs consistency comparisons. It is based on distributed network storage of the blockchain network.
[0040] In specific business scenarios, individual data records or field-level data combinations in the source data may not have data circulation value. In this invention, the data to be verified after splitting and reorganizing is data with special business attributes and circulation value. Based on this, the production of multi-source trusted data in this invention has application significance.
[0041] The verification, consensus, and trusted data storage processes of the aforementioned multi-source data are all conducted within the blockchain network, ensuring the transparency, reliability, trustworthiness, and availability of multi-source trusted data production.
[0042] In a blockchain network, each blockchain node has a unique identity. Through the control of blockchain smart contracts, only authorized nodes and their corresponding participants can view, verify, and reach consensus on trusted data and its production process. This provides trust endorsement for the circulation and use of trusted data, lays the foundation for the use of trusted data, and enhances the circulation value of trusted data. Attached Figure Description
[0043] Figure 1 This is a flowchart of a blockchain-based multi-source trusted data production method provided in an embodiment of the present invention; Figure 2 This is an architecture diagram of a blockchain node provided in an embodiment of the present invention; Figure 3 This is an architecture diagram of the blockchain system provided in an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0045] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0046] First, the technical terms involved in the embodiments of the present invention will be introduced.
[0047] A blockchain is a chain-like data structure that sequentially links data blocks in chronological order, using cryptography to ensure the immutability and forgery resistance of these blocks. Each block in a blockchain is linked to the preceding block by including its cryptographic hash. Each block also includes a timestamp, its cryptographic hash, and one or more transactions. Transactions verified by nodes in the blockchain network are hashed to form a Merkle tree. In the Merkle tree, the data at the leaf nodes is hashed, and for each branch, all hash values of that branch are concatenated at the root. This process is repeated for the Merkle tree until the root node is reached. The root node of the Merkle tree stores the hash value representing all the data in the tree. When a hash value claims to be a transaction stored in the Merkle tree, it can be quickly verified by checking if the hash value matches the structure of the Merkle tree.
[0048] A blockchain network is a network of computing nodes used to manage, update, and maintain one or more blockchain structures. In this specification, a blockchain network may include a public blockchain network, a private blockchain network, or a consortium blockchain network.
[0049] In public blockchain networks, the consensus process is controlled by the nodes of the consensus network. For example, a public blockchain network can have thousands of entities collaborating, each operating at least one node within the network. Therefore, a public blockchain network can be considered a public network of participating entities. In some examples, a majority of entities (nodes) must sign each block sequentially and add the signed block to the blockchain of the network. Examples of public blockchain networks can include specific peer-to-peer payment networks.
[0050] Private blockchain networks are provided for use by specific entities. The read and write permissions of each node in a private blockchain network are strictly controlled. Therefore, private blockchain networks are often also called permissioned networks, which restrict who is allowed to participate in the network and the level of participation. Various types of access control mechanisms can be used in private blockchain networks.
[0051] Consortium blockchains fall between public and private blockchains in terms of network scope, typically used in environments with multiple member roles, such as interbank payment settlements and inter-enterprise logistics. These scenarios often involve members with varying permissions. Consortium blockchain systems generally have identity authentication and permission settings, and the number of nodes is usually fixed, making them suitable for transaction processing between enterprises or institutions. Consortium blockchains have the following characteristics: First, transaction costs are lower, as transactions only need to be verified by a few trusted, high-computing-power nodes, without requiring full network confirmation; second, nodes can connect well, failures can be quickly repaired through manual intervention, and consensus algorithms can be used to reduce block time; third, if read permissions are restricted, better privacy protection can be provided.
[0052] In related technologies, public, private, and consortium blockchains can all potentially offer smart contract functionality. A smart contract on a blockchain is a contract that can be triggered and executed by transactions on the blockchain system. Smart contracts can be defined in the form of code. The blockchain nodes run this code to determine which smart contracts need to be initiated. In one scenario, a transaction triggers the execution of a smart contract on a blockchain node, and the blockchain node cannot actively initiate the execution of the smart contract. In another scenario, it may be necessary to actively initiate the smart contract. For example, a blockchain node in a blockchain network can actively initiate a smart contract at a certain time, thereby completing a timed task by actively executing the smart contract at that specific moment.
[0053] Next, the technical solutions provided in the embodiments of the present invention will be introduced.
[0054] Example 1 like Figure 1 As shown, this embodiment of the invention provides a multi-source trusted data production method based on blockchain, applied to blockchain nodes. The blockchain nodes are connected to a blockchain network, which includes multiple blockchain nodes. The method includes the following steps: S1, the blockchain node identifies the data source, obtains source data from multiple data sources, and obtains the source dataset; S2, the blockchain node performs data preprocessing on each source data in the source dataset and records the data preprocessing information. The data preprocessing includes source data verification and source data cleaning. S3, After data preprocessing, the blockchain node extracts the smallest data unit from each source data in the source dataset and combines the data to obtain the data to be verified. S4, All or some of the blockchain nodes compare at least the data to be verified based on the smart contract to confirm whether the corresponding blockchain node consensus has been passed; S5 obtains the consensus pass rate of all participating blockchain nodes, determines whether the data to be verified is trustworthy data, and if the result is yes, then stores the trustworthy data and related production information in the blockchain network.
[0055] In this invention, the source data comes from multiple data sources. For the same data record, there may be data conflicts due to the source data coming from different data sources, resulting in low data reliability. Therefore, the method of this invention is needed to produce multi-source reliable data.
[0056] Example 2 This embodiment is a supplementary explanation of step S1 of embodiment 1, "Blockchain nodes identify data sources, obtain source data from multiple data sources, and obtain source datasets". Step S1 includes the following sub-steps: S1.1 Identify the data source, obtain source data from multiple data sources, obtain the source dataset, and record the data source information; The process of obtaining source data from multiple data sources includes the following steps: S1.1.1 If the data source is a database, then the connection and query are performed through the corresponding database client or through the library of the programming language. For example, the MySQL database is connected and queried through the MySQL client or the Python MySQLdb library, the MongoDB database is obtained through the MongoDBCompass client, and the PostgreSQL database is connected and queried through the Python psycopg2 library. S1.1.2 If the data source is an API, the API endpoint is accessed through the HTTP request library in the programming language and the returned data is obtained. The API endpoint is accessed through the Python Requests library to obtain the data. S1.1.3 If the data source is a file, the data is obtained through the file processing library in the programming language, such as obtaining file data through Python's csv and json modules; S1.1.4 If the data source is a website, then use a web crawler tool to crawl the data, such as using Python's BeautifulSoup to crawl website data; The data source information includes at least two of the following: database type, database connection information, data drive type, data source name, username, and user password; In a preferred embodiment, if access permissions or credentials are required to obtain source data, sensitive information about the data source is recorded; the sensitive information about the data source includes at least one of username, password, and API key.
[0057] In this invention, the acquisition process of source data can be verified through data source information, making it convenient to trace whether the acquisition of source datasets conforms to the actual business situation. For example, the computing power of the verification computer equipment, the amount of source data, and the verification time can be verified and judged.
[0058] Example 3 This embodiment is a supplementary explanation of step S2 of embodiment 1, which states that "the blockchain node performs data preprocessing on each source data in the source dataset, and the data preprocessing includes source data verification and source data cleaning." Step S2 includes the following sub-steps: S2.1, the blockchain node performs source data verification on each source data in the source dataset according to the data verification rules. The source data verification includes any one or more of the following: structure verification, duplication verification, missing value verification, and outlier value verification. The structure verification refers to checking whether the fields and data structure in the source data are consistent with expectations. If they are consistent, the structure verification passes; if they are inconsistent, the structure verification fails. The structure verification is used to ensure that all source data contains the necessary fields and that the types and names of the fields are correct. Accordingly, the structure verification information is recorded, which includes: 1. Whether the fields and data structure in the source data are consistent with expectations or inconsistent with expectations; 2. The start and end time of the structure verification; 3. The structure verification rules; 4. The blockchain node information that performed the structure verification.
[0059] The duplicate verification refers to checking whether there are duplicate records in the source data. If there are no duplicate records, the duplicate verification passes; if there are duplicate records, the duplicate verification fails. The duplicate verification is used to ensure that the source data provided by the source data does not contain duplicate data, thereby reducing the computational overhead of multiple participants on the same data in a blockchain network scenario. Accordingly, duplicate verification information is recorded, which includes: 1. Whether there are duplicate records in the source data or whether there are no duplicate records in the source data; 2. The start and end time of the duplicate verification; 3. The duplicate verification rules; 4. The blockchain node information that performs the duplicate verification.
[0060] The missing value verification refers to checking whether there are missing values in the source data. If there are no missing values, the missing value verification passes; if there are missing values, the missing value verification fails. Accordingly, the missing value verification information is recorded, which includes: 1. Whether there are missing values in the source data or not; 2. The start and end time of the missing value verification; 3. The missing value verification rules; 4. The blockchain node information that performs the missing value verification.
[0061] The outlier verification refers to checking whether there are outliers in the source data. If there are no outliers or unreasonable data, the outlier verification passes; if there are outliers or unreasonable data, the outlier verification fails. The outliers include invalid data or unreasonable data. Accordingly, outlier verification information is recorded, which includes: 1. Whether there are outliers in the source data or not; 2. The start and end time of the outlier verification; 3. The outlier verification rules; 4. The blockchain node information that performs the outlier verification.
[0062] For missing or outlier values, two processing schemes can be adopted: 1. If missing or outlier values are found in the source data, no further operations are performed; 2. If the blockchain node finds any non-compliant data in the source data verification, it initiates a data preprocessing proposal. After consensus, the specific data preprocessing scheme is confirmed, and the metadata is further deleted, corrected, or retained, and subsequent operations are performed.
[0063] The preferred approach is to obtain the Key-Value verification metadata corresponding to each source data after verifying the source data, and then store the verification metadata in the blockchain network. For example, for calculations based on data preprocessing rules, such as data records of Company A, the fields include: company name, company contact address, and unified social credit code; the corresponding field values include: Limited Liability Company Province city street Office building, 9142 5725 ZX.
[0064] The data preprocessing rules include: checking whether the enterprise name field is empty; checking whether the enterprise contact address is empty; and checking the length of the unified social credit code.
[0065] For example, the key-value verification metadata corresponding to a data record of Company A is as follows: The company name field must not be empty; Company contact address, must not be empty; Social credit code, length 15.
[0066] To save storage resources on the blockchain network, it is preferable to store only the hash value obtained by hash calculation for verifying metadata.
[0067] S2.2 After the source data verification is passed, the blockchain node performs source data cleaning on each source data in the source dataset according to the data cleaning rules to obtain the cleaning result of each source data. The source data cleaning includes any one or more of the following: data deduplication, missing value handling, data transformation, and outlier handling. The data deduplication process refers to removing duplicate data based on the data duplication verification results. Accordingly, the data deduplication process information includes the start and end times of the data deduplication process, the data deduplication process rules, and the blockchain node information that performs the data deduplication process.
[0068] The missing value handling refers to identifying the missing value verification result instead of using conventional methods such as deletion, filling, or interpolation to handle missing values. In a preferred scheme, a hash algorithm is used to identify data with missing values, which is recorded as source data missing information hash-qsz. Correspondingly, missing value handling information is recorded, including the start and end time of missing value handling, missing value handling rules, and blockchain node information that performs missing value handling.
[0069] The data conversion process refers to standardizing the data format based on the data structure verification results, such as date format, numerical format, string format, etc., and then further converting the data into a form suitable for further analysis, such as converting string type into numerical type. Correspondingly, the data conversion process information is recorded, including the start and end time of the data conversion process, the data conversion process rules, and the blockchain node information that performed the data conversion process.
[0070] The outlier handling refers to identifying outlier data without using conventional methods such as deletion, correction, or treating it as a missing value. Accordingly, outlier handling information is recorded, including the start and end times of outlier handling, outlier handling rules, and information about the blockchain nodes that performed the outlier handling.
[0071] The preferred approach is to obtain the cleaned metadata corresponding to each source data after verifying the source data, and then store the cleaned metadata on the blockchain network.
[0072] In a preferred embodiment of the present invention, the start and end times can be replaced by the completion timestamps of data processing operations or other steps.
[0073] S2.3 After the source data is cleaned, the blockchain node determines whether the cleaned result of the source data meets the passing conditions in the data judgment rules according to the data judgment rules. If the passing conditions in the data judgment rules are met, it is marked as the first data to be processed and used as the source data after data preprocessing. If the pass conditions in the data judgment rules are not met, the operation is stopped, the cleaned source data is marked as the first data to be confirmed, and the first data to be confirmed is stored in the blockchain network. S2.4 If the cleaning result of the source data meets the pass condition in the data judgment rule, it is marked as the first data to be processed and the next operation is executed. If it does not meet the pass condition in the data judgment rule, the operation is stopped and the cleaned source data is marked as the first data to be confirmed.
[0074] The data verification rules, data cleaning rules, and data judgment rules are data preprocessing rules, which are preset by blockchain nodes.
[0075] This invention first verifies the source data itself. If there are problems with the source data, subsequent operation steps cannot be performed, so as to ensure the authenticity and availability of the data and save limited blockchain computing resources.
[0076] Furthermore, the data processing of the present invention does not employ data transformation or other operations that alter the data itself, thereby improving the reliability of data processing and system efficiency.
[0077] Example 4 This embodiment is a supplementary explanation of step S3 of embodiment 1, which states that "the blockchain node extracts the smallest data unit from each source data in the preprocessed source dataset and combines the data to obtain the data to be verified." Step S3 includes the following sub-steps: S3.1, Blockchain nodes obtain pre-processed source data; S3.2, the blockchain node configures data combination rules. After the data combination rules are stored in the blockchain network consensus, the smallest data unit of the preprocessed source data is combined based on the data combination rules to obtain the data to be verified, and the data to be verified is stored in the blockchain network.
[0078] The smallest data unit of this invention refers to the combination of fields and field values of a certain data record in a data table; in some cases, since the data table or data record itself only stores a single combination of fields and field values, the data table or data record can also be regarded as the smallest data unit.
[0079] For example, a data record for Company A includes the following fields: Company Name, Company Contact Address, and Unified Social Credit Code; the corresponding field values include: Limited Liability Company Province city street Office building, 9142 5725 ZX; Among them, the data records with business circulation value include the company name and the unified social credit code. After obtaining the data record of company A from the company information record table, the company name and unified social credit code fields and their corresponding data values are extracted. Based on the data combination of the source data, the data to be verified is obtained.
[0080] In specific business scenarios, a single data record or field-level data combination in the source data may not have data circulation value. In this invention, the data to be verified after being split and reorganized is data that is preset, has business attributes, and has circulation value in one or more specific data circulation application scenarios. Based on this, the production of multi-source trusted data in this invention has application significance.
[0081] Example 5 This embodiment is a supplementary explanation of step S4 of embodiment 1, "All or some blockchain nodes compare the data to be verified based on smart contracts to confirm whether the corresponding blockchain node consensus has passed", and step S5, "Obtain the consensus pass rate of all participating blockchain nodes and determine whether the data to be verified is trustworthy data". Step S4 includes the following sub-steps: S4.1, the blockchain node determines the key comparison field, which is used to uniquely identify the data to be verified; The key comparison field can be one or more; for example, the key comparison field can be the key comparison field information Hash-ZD obtained by hashing the data record information through a hash algorithm; the data record information includes at least one of the data's business information, field information, and field value information; In practice, since data records are not stored, in order to reduce the amount of computation, business information, data fields and data values can be assembled and used directly as key comparison fields. Alternatively, the assembled information can be calculated using a hash algorithm and used as key comparison fields.
[0082] S4.2, the blockchain node configures multi-source verification rules based on key comparison fields and stores the multi-source verification rules in the blockchain network; The multi-source verification rules are used to compare the data to be verified. For example, the multi-source verification rules can be comparison rules based on data types such as text, numbers, and dates, to determine whether the data to be verified generated from each source data in the source dataset is consistent.
[0083] The multi-source verification rules can be one or more.
[0084] S4.3, Based on the smart contract, compare the data to be verified separately, and choose either method 1 or method 2: Method 1: All blockchain nodes act as execution nodes, and the multi-source verification rules are executed based on smart contracts to compare the data to be verified; Method 2: At least one blockchain node acts as the execution node, executing multi-source verification rules based on smart contracts to compare the data to be verified; at least one blockchain node acts as the participating node, only confirming whether the multi-source verification rules executed by the execution node meet the requirements based on smart contracts, without executing the multi-source verification rules to compare the data to be verified.
[0085] S4.4 If the data to be verified meets the multi-source verification rules, the consensus of the corresponding blockchain nodes is passed; the multi-source verification rules are configured according to the key comparison fields and stored in the blockchain network; the key comparison fields are used to uniquely identify the data to be verified.
[0086] In the first application scenario, when all blockchain nodes compare the data to be verified, the multi-source trusted data obtained by this method can be guaranteed to receive consistent confirmation from the corresponding entities of each blockchain node in the blockchain network during the circulation process, thereby ensuring the credibility of the multi-source trusted data. In the second application scenario, when all blockchain nodes in the blockchain network participate in data verification, with some being execution nodes and others being participating nodes, the effect of the first application scenario can also be achieved.
[0087] In the third application scenario, when some blockchain nodes in the blockchain network participate in data comparison and verification while others do not, the computational overhead and consensus conditions can be reduced and the efficient production and circulation of multi-source trusted data can be promoted when the entities corresponding to some blockchain nodes temporarily do not participate in the production or subsequent circulation of multi-source trusted data. Correspondingly, when the third part of the blockchain nodes that did not participate in the comparison and verification of the data need to participate in the sharing, circulation or use of multi-source trusted data, they can be reconfirmed through manual verification or by achieving secondary verification through blockchain network consensus.
[0088] In the fourth application scenario, in this invention, when all blockchain nodes in the blockchain network participate in data verification, the first part is the execution node, the second part is the participating node, and the third part does not participate in the comparison and verification process, the same effect as in the third application scenario can be achieved.
[0089] S4.5, any one or more blockchain nodes perform multi-source data comparison based on smart contracts. Other blockchain nodes that do not participate in the multi-source data comparison calculation only verify whether the multi-source verification rules are correct. If the multi-source verification rules are correct, and the data to be verified meets the multi-source verification rules, then the consensus of that blockchain node is passed.
[0090] It is understood that nodes participating in the comparison of data to be verified can be called execution nodes, which are used to execute multi-source verification rules based on smart contracts to compare the data to be verified; nodes participating in selecting multi-source verification rules and determining whether the multi-source verification rules meet the requirements for execution and comparison, that is, determining whether the multi-source verification rules can be used to compare the data to be verified, can be called participating nodes. This invention is based on the functional division of blockchain nodes, where nodes in the blockchain network include execution nodes and participating nodes. In some special cases, the nodes in the blockchain network may also include nodes other than execution nodes and participating nodes to perform other functions.
[0091] In one scenario, when there is only one key comparison field, such as Key01, the comparison is performed on: ① the field Key01; ② the field value Value01 corresponding to Key01; and ③ the hash value Hash01 of the data record. If the comparison results of ①, ②, and ③ for each piece of data to be verified are the same, that is, Key01, Value01, and hash value Hash01 from different data sources are consistent, it is confirmed that the multi-source data is consistent and identical, and the consensus of the blockchain node is passed.
[0092] In another scenario, when there are multiple key comparison fields, such as Key02, Key03, and Key04, the comparison is as follows: ④ The fields Key02, Key03, and Key04; ⑤ The field values corresponding to Key02, Key03, and Key04; ⑥ The hash value of the data record Hash01. If the comparison results in ④, ⑤, and ⑥ for each piece of data to be verified are the same, or if the comparison results in ④, ⑤, and ⑥ for each piece of data to be verified are the same, or if the comparison results in ④ and ⑥ for each piece of data to be verified are the same, or if the comparison results in ⑤ and ⑥ for each piece of data to be verified are the same, that is, the comparison results from different data sources are consistent, confirming that the multi-source data is consistent, then the consensus of the blockchain node is passed.
[0093] The determination of whether the data to be verified is trustworthy includes: Strong consensus is generated from multi-source trusted data: if the consensus pass rate Y=100%, the data to be verified is determined to be trusted data; otherwise, the data to be verified is determined to be untrustworthy data; after marking the determination result, the data to be verified is stored in the blockchain. In another example, the consensus pass rate for strong consensus can also be set to be greater than a certain probability, such as greater than 90%, greater than 95%, or greater than 98%, etc. In this case, the upper limit of subsequent consensus will also be adjusted accordingly.
[0094] Weak consensus for multi-source trusted data production: If 50% < consensus pass rate Y < 100% and the participants in the consensus pass include authoritative nodes, then the data to be verified is determined to be trusted data; the authoritative nodes are one or more of the blockchain nodes, and the authoritative node is the blockchain node where the original production source of the data corresponding to at least one key comparison field is located. If the consensus pass rate Y < 100% and the consensus pass participants do not include authoritative nodes, then the data to be verified is determined to be the second data to be confirmed. If the consensus pass rate Y ≤ 50%, the data to be verified is deemed unreliable.
[0095] For example, Table 1 shows the data records of a certain natural person, including those from the public security department, civil affairs department, and education department: Table 1
[0096] In Table 1: the public security department is the authoritative verification unit for the fields of name, gender, and ID number, and can be assigned the identifier "public security department + competent department" for the fields of "name, gender, and ID number"; the civil affairs department is the authoritative verification unit for the field of marital status, and can be assigned the identifier "civil affairs department + competent department" for the field of "marital status"; where "competent department" indicates that the department is the authoritative verification unit, and "public security department" or "civil affairs department" indicates the verification unit of the data record; the corresponding node is a blockchain node, and if the department is the authoritative verification unit, then the corresponding node is an authoritative node.
[0097] Furthermore, it should be specifically noted that the authoritative node mentioned in this invention is one or more blockchain nodes, and the authoritative node is the blockchain node where the original production source of the data corresponding to at least one key comparison field is located; for example, the civil affairs department is the original production department of "marital status information", and the public security department is the original production department of "name, gender, and ID number" information.
[0098] Referring to Table 1, the multi-source trusted data production strong consensus scheme means that only when the source data obtained from multiple data sources are completely consistent can it be confirmed as trusted data. In other words, these data sources provide consistent trust endorsement for the trusted data, reflecting the consistent results of blockchain consensus. Specifically, in Table 1, the field values corresponding to "Name, ID Number" can be confirmed as trusted data, while the data in "Gender, Age, Address" are judged as untrustworthy data because they are not completely consistent across the education department, public security department, and civil affairs department.
[0099] Referring to Table 1, in the scheme for generating weak consensus from multi-source trusted data, if it contains an authoritative node identifier and the verification by other participants meets the threshold conditions, it can be confirmed as trusted data; that is, if it does not contain an authoritative node identifier, it cannot be confirmed as trusted data.
[0100] As a further optional solution, a further determination of whether the second data to be confirmed is reliable data includes the following steps: The authoritative node receives the second data to be confirmed. Based on the received second data to be confirmed, it creates a corresponding verification method for the second data to be confirmed and submits it to the blockchain network for consensus. After the consensus is passed, the smart contract controls the determination of whether the second data to be confirmed is trustworthy according to the verification method. The authoritative verification result is obtained and broadcast to the blockchain network for consensus. After the consensus is passed, the evidence is stored.
[0101] The second method for verifying data to be confirmed includes preset rules and conditions for judging whether data changes are reasonable, such as the data value of the ID number field should remain the same, and the age should change with time. The second method for verifying the data to be confirmed includes the following steps: 1. Obtain all historical versions of the second set of data to be confirmed; 2. Based on the historical versions of the acquired data, automatically analyze whether the data changes meet the preset rule conditions to obtain authoritative verification results; if the data changes meet the preset rule conditions, then the second data to be confirmed is confirmed as reliable data; if the second data to be confirmed has no historical version, or the data changes do not meet the preset rule conditions, then the second data to be confirmed is marked as unreliable data.
[0102] This invention achieves automated verification and traceable production of reliable multi-source data by comparing the consistency of multi-source data. By aggregating and comparing multi-source data, the distributed network storage based on the blockchain network ensures the transparency and reliability of the data. Authorized users can view and verify the data, and the participants only verify the multi-source verification rules without participating in the calculation. This can reduce the production cost of reliable data while ensuring data reliability.
[0103] Example 6 This embodiment, based on embodiment 1, provides supplementary explanations for step 5, "If the result is determined to be yes, then store the credible data and related production information in the blockchain network," including sub-steps: S5.1 For the relevant process information of multi-source trusted data production, use Algorithm 1 or Algorithm 2 to process the input information respectively, and perform data trusted calculation to obtain the output information; Trusted data computing refers to the automatic computation controlled by smart contracts. Algorithm 1: Using a hash algorithm, the input information is combined and processed to obtain a hash value; Algorithm 2: Sort the input information by time, arrange it into a Merkle hash tree, and output the corresponding root hash value.
[0104] S5.2, deposit at least one output information into the blockchain network, or deposit all output information into the blockchain network.
[0105] Specifically, the input and output information corresponding to the production information of the credible data used for evidence storage is shown in Table 2.
[0106] In this invention, the production information of the trusted data includes various types of information such as data source information, source data information, source data processing rule information, source data related data processing information, and blockchain network consensus information. Based on the output information of the data identifier, an unforgeable multi-source trusted data production record information is constructed, ensuring the consistency of trusted verification for multiple source data and the atomicity of trusted verification. Data version control is performed on the production process and results of trusted data, which can track changes in data status and solve the problem of untrustworthy data assets caused by inconsistencies in multi-source data.
[0107] Table 2
[0108] This invention relates to a trusted data production and processing step based on a tightly coupled relationship. Through steps such as data preprocessing and trusted data computation, it ensures the high value, low cost, and traceability of trusted data production. Furthermore, it uses smart contract control to achieve automated multi-source data consistency comparison to calculate and produce trusted and reliable data, thereby improving the value of data circulation and use.
[0109] Example 7 This embodiment, based on embodiment 1, provides corresponding hardware devices such as blockchain nodes and blockchain networks to implement the methods described in the above embodiments.
[0110] Figure 2 This is an architecture diagram of a blockchain node provided in an embodiment of the present invention, such as... Figure 2 As shown, it includes: The data source identification unit 210 is used to identify data sources, obtain source data from multiple data sources, and obtain a source dataset; Data preprocessing unit 220 is used to perform data preprocessing on each source data in the source dataset, the data preprocessing including source data verification and source data cleaning; Data combination unit 230 is used to extract the smallest data unit from each source data in the preprocessed source dataset and combine the data to be verified. The data verification unit 240 is used to compare the data to be verified based on the smart contract. If the data to be verified meets the multi-source verification rules, the consensus is passed. Consensus Unit 250 is used to obtain the consensus pass rate of all blockchain nodes participating in the consensus and to determine whether the data to be verified is trustworthy data. Storage unit 260 is used to store and prove trusted data and production information related to trusted data in the blockchain if the consensus verification of consensus unit 250 is successful.
[0111] Figure 3 This is an architecture diagram of the blockchain system provided in an embodiment of the present invention, such as... Figure 3 As shown, it includes: The client is used to send data sources to blockchain nodes in the blockchain network. Blockchain nodes are used to identify data sources, obtain source data from multiple data sources to obtain source datasets; perform data preprocessing on each source data in the source dataset, including source data verification and source data cleaning; extract the smallest data unit from each source data in the preprocessed source dataset and combine the data to be verified; compare the data to be verified based on smart contracts, and if the data to be verified meets the multi-source verification rules, consensus is passed; then obtain the consensus pass rate of all participating blockchain nodes to determine whether the data to be verified is trustworthy, and if the result is yes, instruct the blockchain network to store the trustworthy data and related production information.
[0112] It should be understood that the blockchain nodes and blockchain network described above are used to execute the methods in the above embodiments. The corresponding program units in the device are implemented in a similar manner and have similar technical effects as described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, which will not be repeated here.
[0113] Based on the methods described in the above embodiments, this invention provides an electronic device. The device may include at least one memory for storing a program and at least one processor for executing the program stored in the memory. When the program stored in the memory is executed, the processor performs the methods described in the above embodiments.
[0114] Based on the methods in the above embodiments, this invention provides an electronic device, including: at least one processor and an interface circuit; the processor obtains program instructions through the interface circuit and executes the methods described in the above embodiments according to the program instructions.
[0115] Based on the methods in the above embodiments, this embodiment of the invention provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0116] Based on the methods in the above embodiments, this embodiment of the invention provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0117] It is understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.
[0118] The method steps in these embodiments of the invention can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0119] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0120] It is understood that the various numerical designations used in the embodiments of the present invention are merely for the convenience of description and are not intended to limit the scope of the embodiments of the present invention.
[0121] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for producing multi-source trusted data based on blockchain, applied to blockchain nodes, characterized in that, Includes the following steps: S1, the blockchain node identifies the data source, obtains source data from multiple data sources, and obtains the source dataset; S2, the blockchain node performs data preprocessing on each source data in the source dataset; S3, the blockchain node extracts the smallest data unit from each source data in the preprocessed source dataset and combines the data to obtain the data to be verified; the smallest data unit refers to the combination of fields and field values of a certain data record in the source data table; S4, All or some of the blockchain nodes compare the data to be verified based on the smart contract to confirm whether the corresponding blockchain node consensus has been passed; S5: Obtain the consensus pass rate of all participating blockchain nodes, determine whether the data to be verified is trustworthy data, and if the determination result is yes, then store the trustworthy data and related production information in the blockchain network. In step S5, determining whether the data to be verified is trustworthy data includes: If the consensus pass rate is the first preset value or greater than the first preset value, the data to be verified is determined to be trustworthy data; after marking the determination result, the data to be verified is stored in the blockchain; If the consensus pass rate is between the second preset value and the first preset value, and the participants in the consensus pass include authoritative nodes, then the data to be verified is determined to be trustworthy data; the authoritative node is one or more of the blockchain nodes, and the authoritative node is the blockchain node where the original production source of the data corresponding to at least one key comparison field is located; the first preset value is greater than the second preset value. If the consensus pass rate is between the second preset value and the first preset value, and the participants in the consensus pass do not include authoritative nodes, then the data to be verified is determined to be the second data to be confirmed. If the consensus pass rate is not greater than the second preset value, the data to be verified is determined to be unreliable data. Step S5, determining whether the data to be verified is reliable data, also includes: The authoritative node receives the second data to be confirmed, and based on the smart contract control, determines whether the second data to be confirmed is trustworthy according to the verification method of the second data to be confirmed stored in the blockchain network. The authoritative verification result is obtained and broadcast to the consensus in the blockchain network. After the consensus is passed, the trustworthy data corresponding to the second data to be confirmed and the relevant production information of the trustworthy data are stored in the blockchain network. The verification method of the second data to be confirmed is created by the authoritative node, and is passed by consensus in the blockchain network and stored.
2. The method according to claim 1, characterized in that, In step S2, the data preprocessing includes source data verification and source data cleaning. Step S2 includes the following sub-steps: S2.1, the blockchain node performs source data verification on each source data in the source dataset according to the data verification rules. The source data verification includes any one or more of the following: structure verification, duplication verification, missing value verification, and outlier value verification. S2.2 After the source data verification is passed, the blockchain node performs source data cleaning on each source data in the source dataset according to the data cleaning rules to obtain the cleaning result of each source data. The source data cleaning includes any one or more of the following: data deduplication, missing value handling, data transformation, and outlier handling. S2.3 After the source data is cleaned, the blockchain node determines whether the cleaned result of the source data meets the passing conditions in the data judgment rules according to the data judgment rules. If the passing conditions in the data judgment rules are met, it is marked as the first data to be processed and used as the source data after data preprocessing. If the pass conditions in the data judgment rules are not met, the operation is stopped, the cleaned source data is marked as the first data to be confirmed, and the first data to be confirmed is stored in the blockchain network. The data verification rules, data cleaning rules, and data judgment rules are data preprocessing rules, which are preset by blockchain nodes.
3. The method according to claim 1 or 2, characterized in that, Step S3 includes the following sub-steps: S3.1, Blockchain nodes obtain pre-processed source data; S3.2, the blockchain node combines the smallest data unit of the preprocessed source data according to the data combination rules of the blockchain network consensus, obtains the data to be verified, and stores the data to be verified in the blockchain network.
4. The method according to claim 1, characterized in that, Step S4 includes the following sub-steps: S4.1 Based on the smart contract, the data to be verified is compared separately, including one of the following two methods: Method 1: All blockchain nodes act as execution nodes, and the multi-source verification rules are executed based on smart contracts to compare the data to be verified; Method 2: At least one blockchain node acts as the execution node, executing multi-source verification rules based on smart contracts to compare the data to be verified; at least one blockchain node acts as the participation node, only confirming whether the multi-source verification rules executed by the execution node meet the requirements based on smart contracts, without executing the multi-source verification rules to compare the data to be verified. S4.2 If the data to be verified meets the multi-source verification rules, the consensus of the corresponding blockchain nodes is passed; the multi-source verification rules are configured according to the key comparison fields and stored in the blockchain network; the key comparison fields are used to uniquely identify the data to be verified.
5. The method according to claim 1, characterized in that, Step S5 also includes the following sub-steps: When the data to be verified is trusted data, a preset algorithm is used to process the multi-source trusted data to obtain production information related to the multi-source trusted data. Then, the obtained production information is partially or fully stored in the blockchain network. The relevant production information includes: data source information, source data information, source data processing rule information, and blockchain network consensus information; The preset algorithm includes one or more of the following algorithms: The input information is combined and processed by a hash algorithm to obtain a hash value. Alternatively, sort the input information by time, arrange the information, construct a Merkle hash tree, and output the corresponding root hash value.
6. A blockchain node for implementing the method according to any one of claims 1-5, characterized in that, include: The data source identification unit is used to identify data sources, obtain source data from multiple data sources, and obtain the source dataset; A data preprocessing unit is used to perform data preprocessing on each source data in the source dataset, the data preprocessing including source data verification and source data cleaning; The data combination unit is used to extract the smallest data unit from each source data in the preprocessed source dataset and combine them to obtain the data to be verified. The data verification unit is used to compare the data to be verified based on the smart contract. If the data to be verified meets the multi-source verification rules, the consensus is passed. The consensus unit is used to obtain the consensus pass rate of all blockchain nodes participating in the consensus and to determine whether the data to be verified is trustworthy data. The storage unit is used to store and prove the trusted data and related production information in the blockchain if the consensus verification by the consensus unit passes.
7. A blockchain system for implementing the method according to any one of claims 1-5, characterized in that, include: The client is used to send data sources to blockchain nodes in the blockchain network. The blockchain node is used to identify data sources, obtain source data from multiple data sources, and obtain the source dataset; Each source data in the source dataset is preprocessed separately, and the data preprocessing includes source data verification and source data cleaning. For each source data in the preprocessed source dataset, the smallest data unit is extracted and combined to obtain the data to be verified. The data to be verified is compared with the data to be verified based on the smart contract. If the data to be verified meets the multi-source verification rules, the consensus is passed. Then, the consensus pass rate of all blockchain nodes participating in the consensus is obtained to determine whether the data to be verified is trustworthy. If the result is yes, the blockchain network is instructed to store the trustworthy data and the production information related to the trustworthy data.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is run on the processor, it causes the processor to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Data accounting method, device and storage medium
CN109493203A
Data privacy and security protection method, device and equipment based on block chain
CN115714645A