Data exchange method, system and device based on block chain and computer equipment
By establishing a blockchain environment and smart contract management in a multi-node network, the problems of single point failure, data security and rights protection in the existing data exchange technology are solved, and decentralized, secure and trustworthy data exchange and fair rights and interests are achieved.
Patent Information
- Application Number
- CN202510183674.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-20
AI Technical Summary
The existing data exchange technology has problems such as single point of failure risk, difficulty in ensuring data security, difficulty in managing data ownership and usage rights, lack of a credible regulatory mechanism, and difficulty in realizing reasonable rights confirmation and profit distribution of data value.
By establishing a blockchain environment in a multi-node network, generating decentralized identification codes and key pairs, building a resource directory tree, performing data standardization processing and encrypting signatures, implementing permissions and access rules management based on smart contracts, using PBFT algorithm for transaction verification, and implementing refined control and full-process tracking of data access through contract deployment records, block proofs and access tokens.
It realizes a decentralized data exchange architecture, eliminates the risk of single points of failure, ensures the security and credibility of data exchange, clarifies the boundaries of rights and responsibilities for data use, and ensures the fairness of data exchange and the protection of the rights and interests of all parties.
Smart Images

Figure CN120181869A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and particularly to a data exchange method, system, device and computer equipment based on blockchain. Background Art
[0002] In the current digital economy era, the importance of data as a key production factor has become increasingly prominent, and the demand for data exchange among various industry institutions is growing continuously. Traditional data exchange methods mainly rely on centralized data exchange platforms or direct point-to-point transmissions. These methods achieve data sharing and exchange by establishing unified data format standards, building dedicated data transmission channels, implementing access control mechanisms, etc. At the same time, some solutions use technologies such as digital signatures and encrypted transmissions to protect data security, and track the data flow process through log records.
[0003] However, the existing data exchange technologies have many deficiencies. First of all, the centralized architecture is prone to single-point failures. Once the central node has problems, the entire data exchange network will not be able to operate normally. Secondly, it is difficult to guarantee the security of data during transmission and use, and there are risks of being tampered with, stolen or used without authorization. Moreover, it is difficult to effectively manage the ownership and usage rights of data, the rights and responsibilities of all parties for data are not clearly defined, and disputes are easily caused. In addition, the data exchange process lacks a credible supervision mechanism, it is difficult to accurately record and track the data flow situation, and the fairness of data exchange cannot be guaranteed. Most importantly, the existing technologies are difficult to achieve reasonable confirmation of data value and income distribution, which restricts the healthy development of the data factor market. Summary of the Invention
[0004] This application provides a data exchange method, system, device and computer equipment based on blockchain, which is used to achieve controllable sharing and fair exchange of data while ensuring data security and credibility, and at the same time ensure that the rights and interests of data providers are reasonably protected.
[0005] In a first aspect, the present application provides a blockchain-based data exchange method, and the blockchain-based data exchange method includes: establishing a blockchain environment through a multi-node network, generating a decentralized identification code and a key pair according to institutional qualifications and identity information, and constructing a resource directory tree based on data types and specifications; performing standardization processing on the data to be exchanged according to the decentralized identification code and the resource directory tree, calculating a data fingerprint using the SHA-256 algorithm, encrypting and signing the data block through the key pair, constructing a data exchange packet based on a timestamp and generating an exchange list; constructing a smart contract based on the decentralized identification code, the data exchange packet and the exchange list, implementing permissions and access rules through a hierarchical contract structure, and forming a contract deployment record; generating a transaction request based on the data exchange packet, the exchange list and the contract deployment record, performing verification using the PBFT algorithm combined with a weight mechanism, and obtaining a block proof through state update; generating an access token based on the contract deployment record, the decentralized identification code and the block proof, implementing data synchronization according to the data exchange packet, and forming a data operation log; performing integrity verification based on the block proof, the data operation log and the data fingerprint, and generating an equity distribution result based on the smart contract.
[0006] In a second aspect, the present application provides a blockchain-based data exchange system, and the blockchain-based data exchange system includes:
[0007] a establishing module, configured to establish a blockchain environment through a multi-node network, generate a decentralized identification code and a key pair according to institutional qualifications and identity information, and construct a resource directory tree based on data types and specifications;
[0008] a processing module, configured to perform standardization processing on the data to be exchanged according to the decentralized identification code and the resource directory tree, calculate a data fingerprint using the SHA-256 algorithm, encrypt and sign the data block through the key pair, construct a data exchange packet based on a timestamp and generate an exchange list;
[0009] an implementation module, configured to construct a smart contract based on the decentralized identification code, the data exchange packet and the exchange list, implement permissions and access rules through a hierarchical contract structure, and form a contract deployment record;
[0010] a generating module, configured to generate a transaction request based on the data exchange packet, the exchange list and the contract deployment record, perform verification using the PBFT algorithm combined with a weight mechanism, and obtain a block proof through state update;
[0011] a synchronization module, configured to generate an access token based on the contract deployment record, the decentralized identification code and the block proof, implement data synchronization according to the data exchange packet, and form a data operation log;
[0012] A verification module is used to perform integrity verification based on the block proof, data operation log, and data fingerprint, and generate an interest distribution result according to the smart contract.
[0013] The third aspect of this application provides a blockchain-based data exchange device, and the blockchain-based data exchange device includes: a blockchain-based data exchange system.
[0014] The fourth aspect of this application provides a computer device. The memory stores machine-readable instructions executable by the processor. When the computer device runs, the processor communicates with the memory through a bus. When the machine-readable instructions are executed by the processor, the steps of the above-mentioned blockchain-based data exchange method are executed.
[0015] In the technical solution provided by this application, a blockchain environment is established through a multi-node network, realizing a decentralized data exchange architecture, eliminating the risk of single-point failure, and improving the reliability of the system; based on the identity authentication mechanism of decentralized identification codes and key pairs, ensuring the authenticity and non-forgery of the identities of all parties in the data exchange; using a resource directory tree to manage data resources, realizing the standardized organization and efficient retrieval of data; by standardizing the data to be exchanged and calculating data fingerprints, combined with encrypted signatures and timestamps, a secure and trustworthy data exchange package is constructed, effectively preventing data tampering and forgery; based on the hierarchical structure of smart contracts, flexible permission control and access rule management are realized, and the rights and responsibilities boundaries of data use are clarified; the PBFT algorithm is combined with a weight mechanism for transaction verification, improving the consensus efficiency and ensuring transaction consistency; through the combined use of contract deployment records, block proofs, and access tokens, refined control and full-process tracking of data access are realized; the operation log record of the data synchronization process ensures the transparency and traceability of data flow; finally, the smart contract automatically executes interest distribution, ensuring the fairness of data exchange and the protection of the rights and interests of all parties, and solving key problems such as security, credibility, rights confirmation, and rights and interests protection in traditional data exchange. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for description in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a schematic diagram of an embodiment of the blockchain-based data exchange method in the embodiments of this application;
[0018] Figure 2 It is a schematic diagram of the data access hierarchical relationship in the embodiments of this application;
[0019] Figure 3 This is a schematic diagram of an embodiment of the blockchain-based data exchange system in the embodiments of the present application;
[0020] Figure 4 This is a schematic diagram of the structure of a computer device in the embodiments of the present application. Detailed implementation manners
[0021] The embodiments of the present application provide a blockchain-based data exchange method, system, device and computer device. Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of the present application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0022] For ease of understanding, the specific processes of the embodiments of the present application are described below. Please refer to Figure 1 An embodiment of the blockchain-based data exchange method in the embodiments of the present application includes:
[0023] Step S101: Establish a blockchain environment through a multi-node network, generate a decentralized identification code and a key pair according to institutional qualifications and identity information, and construct a resource directory tree based on data types and specifications;
[0024] Step S102: Standardize the data to be exchanged according to the decentralized identification code and the resource directory tree, calculate the data fingerprint using the SHA-256 algorithm, encrypt and sign the data block through the key pair, and construct a data exchange packet based on the timestamp and generate an exchange list;
[0025] Step S103: Construct a smart contract based on the decentralized identification code, the data exchange packet and the exchange list, implement permissions and access rules through a hierarchical contract structure, and form a contract deployment record;
[0026] Step S104: Generate a transaction request based on the data exchange packet, the exchange list and the contract deployment record, verify it using the PBFT algorithm combined with a weight mechanism, and obtain a block proof through status update;
[0027] Step S105: Generate an access token based on the contract deployment record, decentralized identification code, and block proof, implement data synchronization according to the data exchange package, and form a data operation log;
[0028] Step S106: Perform integrity verification based on the block proof, data operation log, and data fingerprint, and generate an equity distribution result according to the smart contract.
[0029] It can be understood that the execution entity of this application can be a blockchain-based data exchange system, or a terminal or a server. Specifically, it is not limited here. In this embodiment of the application, the server is used as the execution entity for illustration.
[0030] Specifically, deploy blockchain node programs in a multi-node network respectively, and configure the inter-node communication protocol. When participating institutions submit qualification documents and identity proof materials, generate a public-private key pair through the elliptic curve encryption algorithm. The private key is kept by the institution itself, and the public key is broadcast to the whole network. At the same time, generate a unique decentralized identification code based on the institution's identity information. This identification code adopts the Base58 encoding format and has a length of 32 bytes. For different types of data resources, divide them into three categories: structured data, unstructured data, and semi-structured data according to the preset data specifications, and establish a hierarchical resource directory tree. Each node records the data type, format, and access permissions. When performing data exchange, read the meta-information of the data to be exchanged, verify the identity of the data provider according to the decentralized identification code, and perform format standardization processing according to the data specifications in the resource directory tree. For the standardized data, calculate the data fingerprint using the SHA-256 hash algorithm. This fingerprint value serves as the unique identifier of the data. After the data is divided into blocks of a fixed size (such as 1MB), use the private key of the data provider to digitally sign each data block to ensure data integrity. Combine the data block, data fingerprint, signature information, and timestamp to construct a data exchange package, and generate an exchange list containing the exchange package index information.
[0031] Based on the information of the decentralized identification code, data exchange package, and exchange list, write the smart contract code. The contract adopts a hierarchical structure. The main contract is responsible for permission management and transaction verification, and the sub-contract is responsible for specific data access control. After the contract code is compiled, it is deployed to the blockchain network to generate a contract address and a deployment record. The permission rules in the contract include terms such as data access scope, usage period, and access frequency limit. During the data exchange process, combine the data exchange package, exchange list, and contract deployment record to generate a transaction request. Use an improved PBFT consensus algorithm for transaction verification, and introduce a trust weight mechanism, that is, calculate the trust degree according to the node's historical behavior. Nodes with a higher trust degree have a greater weight when voting. After the verification is passed, update the blockchain state, and generate a block proof containing the transaction hash, timestamp, and verifier's signature.
[0032] Based on the access rules in the contract deployment record, combined with the decentralized identification code and block proof, a temporary access token containing access rights and validity period is generated. The data recipient obtains the content in the data exchange package by virtue of the access token, and the system records the whole process of data access, transmission, and use to form a data operation log. By comparing the block proof, data operation log with the original data fingerprint, it is verified whether the data has been tampered with during the transfer process. The smart contract calculates the equity distribution ratio of each participating party according to the data usage situation and preset rules, and generates an equity distribution result.
[0033] For example, in the medical data exchange, a medical institution A needs to share patient test data with a research institution B. Both parties submit their institutional qualifications (such as the practicing license of medical institutions and the qualification certificates of research institutions) for identity authentication, and generate their respective decentralized identification codes and key pairs. Institution A organizes the test data in accordance with the unified medical data format specification, calculates the data fingerprint, and signs it with the private key. After the data is encrypted, it is packaged into a data exchange package. It is stipulated in the smart contract that institution B can only access the statistical data after removing the patient's privacy information, and the usage period is 6 months. When institution B initiates a data access request, the system verifies its access token, records the data usage situation, and distributes 90% of the data usage income to institution A and 10% to the data service platform according to the contract rules. Throughout the process, the transmission, access, and use of data are recorded on the blockchain to ensure the traceability and immutability of the entire data exchange process.
[0034] In the embodiments of this application, a blockchain environment is established through a multi-node network, realizing a decentralized data exchange architecture, eliminating the risk of single-point failure, and improving the reliability of the system; based on the identity authentication mechanism of decentralized identification codes and key pairs, it ensures the authenticity and non-forgery of the identities of all parties in the data exchange; uses a resource directory tree to manage data resources, realizing the standardized organization and efficient retrieval of data; by standardizing the data to be exchanged and calculating the data fingerprint, combined with encryption signature and timestamp, a secure and trustworthy data exchange package is constructed, effectively preventing data tampering and forgery; based on the hierarchical structure of the smart contract, flexible permission control and access rule management are realized, clarifying the responsibility boundaries of data usage; using the PBFT algorithm combined with the weight mechanism for transaction verification, improving the consensus efficiency and ensuring the consistency of transactions; through the combined use of contract deployment records, block proofs, and access tokens, refined control and full-track of data access are realized; the operation log record of the data synchronization process ensures the transparency and traceability of data flow; finally, the smart contract automatically executes the equity distribution, ensuring the fairness of data exchange and the protection of the rights and interests of all parties, and solving the key problems such as security, credibility, rights confirmation, and rights and interests protection in traditional data exchange.
[0035] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0036] (1) Receive institutional qualification and identity information, verify the legality of the institutional qualification through electronic certificate verification, and obtain an institutional verification result;
[0037] (2) Generate a root key according to the institutional verification result, generate a public-private key pair through the elliptic curve cryptography algorithm, and form a key pair;
[0038] (3) Construct an identity identification code based on the institutional verification result, generate a unique identification string through hash operation, and obtain a decentralized identification code;
[0039] (4) Classify and label the data types according to the preset data specifications, establish a hierarchical index based on the data format and data attributes, and generate an initial resource list;
[0040] (5) Organize and sort the initial resource list using a B+ tree structure, establish a resource association table through hierarchical relationship mapping, and form a resource structure diagram;
[0041] (6) Establish a tree-like hierarchical structure based on the resource structure diagram, determine the resource access path through node relationship mapping, and obtain a resource directory tree.
[0042] Specifically, the processing of institutional qualification and identity information involves the verification of digital certificates. Digital certificates contain fields such as institutional name, certificate serial number, public key information, and certificate validity period, and are encoded according to the X.509 certificate standard. In the verification process, first read the certificate content, parse the certificate chain, verify the digital signature level by level starting from the root certificate, and at the same time check whether the certificate is in the revocation list. After the certificate verification passes, extract the basic institutional information, including institutional code, registered capital, business scope, etc., to form an institutional verification result. When generating the root key based on the institutional verification result, a random number generator is used to create a 256-bit entropy value as the seed, and the seed is input into the key derivation function (KDF) to generate the root key. The root key is 256 bits long and is used to derive sub-keys subsequently. When generating the public-private key pair, the secp256k1 elliptic curve algorithm is used. The curve equation is y2 = x2 + 7, defined over a prime field, and the order is 256 bits. In the key generation process, a private key k is randomly selected, with a value range between 1 and n - 1 of the curve order, and then k is multiplied by the base point G to obtain the public key point P = kG. The private key is stored in hexadecimal format, and the public key uses a compressed format, only saving the x coordinate and a flag bit.
[0043] When constructing the decentralized identification code, the key fields in the institutional verification result (such as institutional code, timestamp, random number) are concatenated into a string, and a 256-bit hash value is calculated using the SHA-3 hash algorithm. The hash value is then converted through Base58 encoding to generate a unique identification string that is easy to display and transmit. Base58 encoding removes easily confused characters such as the number "0", the uppercase letter "O", the letter "l", and the symbols "+", " / ", etc., improving readability. The formed decentralized identification code consists of 58 characters and uniquely identifies the identity of a certain institution across the network. The classification and annotation of data types establish a unified data specification, including basic types such as numeric, text, time, enumeration, etc., as well as complex types such as arrays and objects. The format requirements for each data type are defined, such as numeric precision, text length, date format, etc. At the same time, tags such as access rights, privacy levels, and retention periods are set according to data attributes. The classified and annotated data is indexed according to the hierarchical relationship. The index structure includes data ID, data type, attribute tags, and parent-child relationships, generating an initial list containing all data resources.
[0044] When organizing the resource list using the B+ tree structure, each node contains an index entry and a pointer. The leaf nodes store the index information of the data records, and the intermediate nodes only store the index entries. The order of the B+ tree is set to 4, that is, each node can contain at most 4 child nodes. The index entries are established according to the lexicographical order of the data type codes, and the data of the same type is sorted according to the attribute tags. The node splitting and merging operations maintain the balance of the tree. The hierarchical relationship mapping between resources is established through the parent-child pointers to form a complete resource structure diagram. Based on the resource structure diagram, a tree-shaped hierarchical structure is constructed, and each node records the access path of the resource. The path information contains the complete access chain from the root node to the current node, using the path representation separated by " / ", such as " / numeric / transaction data / price". The relationship mapping between nodes includes direct parent-child relationships and indirect reference relationships. The parent-child relationship is directly reflected in the path, and the reference relationship is additionally recorded through pointers. The formed resource directory tree completely describes the types, attributes, and access methods of all data resources.
[0045] Taking financial data exchange as an example, a certain bank needs to establish a data exchange environment. Submit qualification documents such as financial institution licenses and business licenses, and generate an institutional verification result through certificate verification. Generate a root key based on the verification result, and create a dedicated key pair through the elliptic curve algorithm. Concatenate the institutional code "B0001" with the timestamp "20240115120000" and calculate the hash value, which is converted into a decentralized identification code. The bank's data resources include transaction records, customer information, product data, etc. These data are classified and labeled. For example, transaction records belong to the numerical type and contain fields such as transaction amounts and handling fees, and the access permission is set to the highest level. Use the B+ tree structure to organize these resources into a hierarchical structure. For example, under the transaction data, there are sub-nodes such as serial numbers, transaction types, and transaction times. The generated resource directory tree reflects the organizational structure of all data resources, facilitating quick positioning and access to the required data during subsequent data exchanges.
[0046] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0047] (1) Parse the format of the data to be exchanged, determine the data structure mapping relationship according to the resource directory tree, and obtain the standardized data;
[0048] (2) Divide the standardized data into data blocks of a fixed size, mark the data blocks with the decentralized identification code, and form data blocks with identifiers;
[0049] (3) Perform a hash calculation on the data blocks with identifiers through the SHA-256 algorithm to generate an independent data identification string, and obtain the data fingerprint;
[0050] (4) Perform an encryption operation on the data fingerprint based on the private key in the key pair, and generate an encrypted signature string through the digital signature algorithm to obtain the encrypted signature;
[0051] (5) Associate the data fingerprint and the encrypted signature with the timestamp information, form a data transaction unit through data combination, and construct a data exchange package;
[0052] (6) Sort and classify the data identifiers and signature information in the data exchange package, and generate a data transaction record through the directory index structure to form an exchange list.
[0053] Specifically, when processing the data to be exchanged, the format information of the original data file is read, including metadata such as the file header, field definitions, and encoding methods. According to the predefined standard format template in the resource directory tree, the mapping relationship from the source data structure to the target structure is established. Each data field is converted according to the mapping rules. For example, the date format is converted from "YYYY / MM / DD" to "YYYY-MM-DD", the precision of numerical types is uniformly adjusted, and the character encoding is unified to UTF-8 format. The converted data forms a standardized data set. The standardized data is divided into data blocks of a fixed size. Each data block is 1MB in size, and the data block numbers start incrementing from 0. When dividing the data blocks, data boundaries need to be considered to ensure that complete records are not split. Block header information is added to each data block, including the decentralized identification code, block sequence number, and timestamp. The decentralized identification code is embedded into each data block as the identity marker of the data provider, forming an identified data block. A separator is added between the block header and the data content for easy subsequent parsing.
[0054] The SHA-256 hash calculation is performed on the identified data block. The SHA-256 algorithm generates a 256-bit hash value through steps such as padding, chunking, and cyclic compression on input data of any length. The specific process includes: grouping the data block into 512-bit groups, performing 64 rounds of compression operations on each group, and each round of operation includes bit operations and modular addition operations. The results of each round of operation are combined to obtain the hash value of the data block, that is, the data fingerprint. The data fingerprint is represented in the form of a hexadecimal string with a length of 64 characters. The private key of the data provider is used to sign the data fingerprint, using the ECDSA (Elliptic Curve Digital Signature Algorithm). The hash value of the data fingerprint is calculated as the message to be signed. Then a random number k is generated, and the point R = kG (G is the base point) on the curve is calculated. The signature value s is calculated using the private key, message hash, random number k, and the coordinates of point R. The digital signature consists of the x coordinate of R and s, forming an encrypted signature string.
[0055] The data fingerprint, encrypted signature, and the current timestamp are combined into a data transaction unit. The timestamp uses the Unix timestamp format, accurate to milliseconds. The data transaction unit includes fields such as data block content, data fingerprint, signature information, timestamp, version number, etc. Multiple data transaction units are combined to form a data exchange package, and each data exchange package has a unique package identifier. When constructing the exchange list, the key information of each data transaction unit in the data exchange package is extracted, including data block identification, fingerprint value, signature, timestamp, etc. These information are organized in a hierarchical structure to form a directory index. The index structure uses a tree structure for easy quick location and retrieval of specific data blocks. The exchange list records the complete composition information of the data exchange package, serving as the index and voucher for data exchange.
[0056] Taking supply chain data exchange as an example: A certain manufacturer needs to share production plan data with its suppliers. The original data contains fields such as order number, material code, planned quantity, delivery date, etc. The data format is CSV and is encoded in GBK. According to the standard format definition in the resource catalog tree, the data is converted to JSON format, the encoding is changed to UTF-8, and the date format is unified to the ISO8601 standard. The converted standardized data is about 10MB and is divided into 10 data blocks. The decentralized identification code of the manufacturer, "DID:MFG:A123", is added as a marker to the header of each data block. The SHA-256 calculation is performed on the first data block to obtain the data fingerprint, and then the digital signature is generated using the manufacturer's private key. The data block content, fingerprint, signature, and timestamp "1641360000000" are combined into a data transaction unit. 10 data transaction units form a data exchange package, and the package identifier is "PKGID20240115001". An exchange list is generated, which records the location indexes, fingerprint values, and signature information of the 10 data blocks. The supplier can retrieve and verify the integrity of the data according to the list.
[0057] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0058] (1) Analyze the permission information in the decentralized identification code, perform mapping analysis on the access attributes of the data exchange package, and obtain a data permission table;
[0059] (2) Perform hierarchical processing on the exchange list according to the data permission table, and construct a permission rule set through the data access hierarchy relationship;
[0060] (3) Create smart contract code according to the permission rule set, divide the main contract and sub-contracts according to the data permission hierarchy relationship, and form a hierarchical contract structure;
[0061] (4) Compile the contract code in the hierarchical contract structure, and generate a deployable contract file through bytecode conversion;
[0062] (5) Broadcast the deployable contract file to nodes, and confirm the generation of deployment transaction information through network nodes;
[0063] (6) Associate and store the deployment transaction information with the decentralized identification code, and generate a contract deployment record through transaction record collation.
[0064] Specifically, during the process of constructing the smart contract, permission information is extracted from the decentralized identification code. The decentralized identification code is encoded in a specific format and contains information such as institution type, permission level, data access scope, etc. These fields are extracted through a decoding operation and mapped to the access attributes defined in the data exchange package. The access attributes include parameters such as data type, sensitivity level, usage period, access frequency limit, etc. The correspondence between the identification code permissions and the access attributes is organized into a data permission table, and each record in the table contains fields such as permission subject, permission object, operation type, constraint conditions, etc. The data permission table is used as input to classify the data blocks in the exchange list. The classification process classifies the data according to dimensions such as data sensitivity, access frequency, usage scope, etc. High-sensitivity data requires more stringent access control, and data with a high access frequency requires a more efficient processing mechanism.
[0065] As Figure 2 shown, it is a schematic diagram of the data access hierarchy relationship in the embodiment of the present application. Among them, the main contract is located at the top layer and is responsible for global permission management. Three sub-contracts are set up below to handle data access control at different levels. The primary data is the real-time power generation amount, allowing real-time access; the secondary data is the device status, allowing access once an hour; the tertiary data is the power quality, limited to access once a day. According to the classification results, the hierarchical relationship of data access is established, and the access rules for different levels of data are defined, including inheritance relationships, mutual exclusion rules, combination rules, etc. of access permissions. These rules are integrated into a permission rule set, which serves as the core logical basis of the smart contract.
[0066] The creation of the smart contract code adopts a hierarchical structure, converting the permission rule set into executable contract code. The main contract is responsible for global permission management and includes basic functions such as permission verification, access control, and audit logs. The sub-contract implements fine-grained permission control for specific data types and access scenarios. The interaction method between the main contract and the sub-contract is defined through an interface. The main contract can call the functions of the sub-contract, and the sub-contract needs to report the execution results to the main contract. The contract code is organized in an object-oriented manner and includes parts such as permission verification functions, data access functions, and event definitions. After the contract code is written, it is compiled to convert the high-level language code into bytecode that can be executed by the blockchain virtual machine. The compilation process includes steps such as syntax checking, code optimization, and interface verification. The generated bytecode file contains information such as the binary code of the contract, ABI interface description, deployment parameters, etc. The bytecode file undergoes format checking and security verification to ensure that there are no obvious vulnerabilities in the code, forming a deployable contract file.
[0067] The deployment of the contract file adopts a broadcast mechanism to send the contract file to all nodes in the blockchain network. After receiving the contract file, the nodes verify the integrity and signature of the file and check the legality of the contract code. The nodes confirm the deployment of the contract through a consensus mechanism. When more than a predetermined proportion of the nodes confirm, deployment transaction information is generated. The deployment transaction information includes content such as the contract address, deployment time, and list of confirmed nodes. The deployment transaction information is associated with the decentralized identification code to record the complete process of contract deployment. The associated information includes fields such as transaction hash, timestamp, and node signature. By sorting and classifying the transaction records, a contract deployment record is generated, which serves as the basis for subsequent contract calls and permission verification.
[0068] Taking the energy data transaction as an example: A power generation enterprise wants to share power generation data with a power distribution company. The decentralized identification code of the power generation enterprise contains permission information: the institutional type is "power generation enterprise", the permission level is "data provider", and the data access scope is "power production data". The data exchange package contains data such as real-time power generation, equipment status, and power quality, and these data have different access attributes. Map the identification code permissions to the data attributes to generate a data permission table. Classify the exchange list according to the permission table: the real-time power generation data is at level one and allows real-time access; the equipment status data is at level two and allows access once an hour; the power quality data is at level three and allows access once a day. Based on this classification relationship, construct a permission rule set, create a main contract to manage the overall permissions, and sub-contracts to handle the access control of the three types of data respectively. After the contract is compiled, it is deployed to the blockchain network to generate deployment transaction information. The formed contract deployment record is associated with the identification code of the power generation enterprise, recording the entire contract deployment process. The power distribution company accesses the required data by calling the contract functions at the corresponding levels according to the specified frequency and permissions.
[0069] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0070] (1) Match and check the data exchange package with the exchange list, and generate a data matching record through information consistency verification;
[0071] (2) Extract transaction rules from the contract deployment record, verify the data matching record according to the rules, and obtain a transaction data packet;
[0072] (3) Generate transaction description information according to the transaction data packet, and form a transaction request through data serialization processing;
[0073] (4) Conduct node consensus on the transaction request through the PBFT algorithm, allocate node voting weights by the weight mechanism, and generate a consensus result;
[0074] (5) Update the on-chain data for the consensus result, and generate block data through the update of the global state tree;
[0075] (6) Calculate the hash of the block data and associate it with the timestamp, and generate a block proof through digital signature.
[0076] Specifically, match and check the data exchange package with the exchange list. The data exchange package contains the actual data content and metadata information, while the exchange list records the indexes and feature values of data blocks. In the matching process, first read the data block identifiers in the exchange list and locate the corresponding data blocks in the data exchange package. For each data block, extract its metadata such as data fingerprint, signature information, and timestamp, and compare it with the information recorded in the exchange list. By verifying the data integrity, signature validity, and timestamp consistency, generate a data matching record containing the matching results. The contract deployment record contains the trading rules of the smart contract, and these rules define the conditions and constraints for data exchange. When extracting the rules, parse the contract address and interface definition in the contract deployment record, and then read the rule configuration in the contract. The rules include data access permissions, trading conditions, pricing strategies, etc. Apply these rules to the data matching record to verify whether the data exchange meets the rule requirements. The data that passes the verification is packaged into a transaction data packet, which contains information such as data content, trading rules, and verification results.
[0077] Generate a normalized transaction description information based on the transaction data packet. The description information includes the identities of the trading parties, the characteristics of the transaction data, the parameters of the trading rules, etc. Convert this information into a unified data format through data serialization processing. The serialization process uses the RLP (Recursive Length Prefix) encoding method to ensure the consistency of data during network transmission. The serialized data forms a transaction request, which is used as the input for the consensus process. When the PBFT algorithm processes the transaction request, the primary node broadcasts the request to all replica nodes. The consensus process of PBFT includes three stages: pre-prepare, prepare, and commit. In the pre-prepare stage, the primary node assigns a sequence number and broadcasts the request; in the prepare stage, the replica nodes verify the request and broadcast the prepare message; in the commit stage, the nodes collect enough prepare messages and then perform the commit. The weight mechanism assigns voting weights according to the reputation values of the nodes, and the reputation values are calculated based on the historical behaviors of the nodes. The formed consensus result records the voting situations of all participating nodes.
[0078] After consensus is reached, the transaction results need to be updated to the blockchain. The update process maintains a global state tree, which is a Merkle prefix tree structure that records the states of all accounts on the blockchain. Each account state contains information such as balance, contract code, and stored data. The state changes caused by the transaction execution results are applied to the state tree to generate a new state root hash. New transactions are packaged into block data, which includes a list of transactions, a state root, a timestamp, and other information. The block data is used to calculate the block hash through the SHA-256 algorithm, and the hash value is associated with the current UNIX timestamp. The block generation node signs the block using its private key, and the signing process uses the ECDSA algorithm. The generated block proof contains the block hash, timestamp, and node signature, serving as proof that the transaction has been confirmed.
[0079] Taking the exchange of agricultural product traceability data as an example: A certain farm wants to share agricultural product production data with a supermarket. The data exchange includes data blocks such as planting records, pesticide usage records, and harvest records, and each data block has a corresponding fingerprint and signature. The exchange list records the locations and characteristic values of these data blocks. After matching and verification, it is found that the integrity verification of all data blocks passes. The transaction rules are extracted from the smart contract, which stipulates data access rights (read-only) and confidentiality requirements. According to the rules, a transaction data packet is verified and generated, which contains the filtered agricultural product data. After generating a transaction request, consensus is reached among 10 verification nodes through the PBFT algorithm, and 3 nodes with higher reputation values have greater voting weights. After the consensus is passed, the state tree is updated to record the results of the data exchange. A block proof is generated to provide an immutable proof for the entire transaction process. In this way, the supermarket obtains reliable agricultural product production data, while the data security and rights of the farm are guaranteed.
[0080] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0081] (1) Associate and match the contract deployment record with the decentralized identification code, and generate access authorization information through permission verification;
[0082] (2) Combine the access authorization information with the block proof, and generate an access token through encryption processing;
[0083] (3) Extract the data content in the data exchange packet according to the access token, and generate a synchronization sequence through data block sorting;
[0084] (4) Distribute the synchronization sequence to nodes, and generate a synchronization task list through the data transmission protocol;
[0085] (5) Record the status of the data in the synchronization task list, and generate an operation record through synchronization progress tracking;
[0086] (6) Timestamp and sign the operation records, and generate data operation logs through log collation.
[0087] Specifically, during the data access control process, read the contract deployment records, and extract information such as contract addresses, interface definitions, and permission rules. At the same time, parse the decentralized identification code to obtain attributes such as the identity identification, permission level, and access scope of the requesting party. Associate and match the extracted contract information with the identification code information, and check whether the access request complies with the permission rules defined in the contract. After passing the match, generate access authorization information, which includes fields such as the authorized subject, authorized object, authorized scope, and validity period. The access authorization information needs to be combined with the block proof, which contains the confirmation information of this data exchange on the blockchain. During the combination process, extract information such as the transaction hash, timestamp, and node signature in the block proof, and perform encryption processing together with the authorization information. The encryption uses the AES-256 algorithm, and the key is generated by the public key of the data provider and the private key of the requesting party through the ECDH key exchange protocol. The encrypted data forms an access token, and the token uses the JWT format, which includes three parts: the header, payload, and signature.
[0088] According to the permission information in the access token, extract the corresponding data content from the data exchange package. During the data extraction process, verify the validity of the token, and then filter the data blocks according to the authorized scope. Sort the filtered data blocks according to the block number to ensure the continuity and integrity of the data. The sorted data blocks form a synchronization sequence, and the sequence records the dependency relationship and transmission order between the data blocks. The synchronization sequence needs to be distributed to each node in the blockchain network. During the distribution process, use the P2P transmission protocol to divide the synchronization sequence into multiple transmission tasks. Each task contains parameters such as the target node, transmitted data, bandwidth limit, and timeout time. These tasks are organized into a synchronization task list, and the list is organized in the form of a priority queue, and the priority is calculated based on the network status of the node and the urgency of the data.
[0089] Record the execution status of the synchronization tasks in real time. The recorded content includes information such as the task start time, transmission progress, and completion status. By regularly checking the task status, track the synchronization progress, and retry the failed tasks. The synchronization status information is organized into operation records, and the records reflect the complete process of data synchronization. The operation records need to be processed for security, adding a timestamp accurate to milliseconds to each record. Then use the private key of the data provider to digitally sign the record content to ensure the authenticity and non-repudiation of the record. Organize the records with timestamps and signatures in chronological order to form structured data operation logs.
[0090] Taking meteorological data sharing as an example: A meteorological station needs to provide meteorological observation data to a research institution. The meteorological station sets data access rules in a smart contract. The research institution applies for data access through the decentralized identification code "DID:RI:B789". After the contract verification is passed, authorization information is generated, allowing access to temperature, humidity, and air pressure data for the most recent 24 hours. The authorization information is combined and encrypted with the block proof to form an access token. 144 sets of observation data (one set every 10 minutes) are extracted from the data exchange package according to the token and arranged in chronological order to form a synchronization sequence. The sequence is distributed to 20 blockchain nodes, and each node is responsible for synchronizing a part of the data to generate a synchronization task list. The record shows that 18 nodes completed synchronization within 5 minutes, and 2 nodes completed after retrying due to network latency. These status information are recorded and signed to form a data operation log. In this way, the research institution obtains meteorological data within the authorized scope, and at the same time, the entire access process is completely recorded and witnessed by the blockchain network.
[0091] In a specific embodiment, the process of executing step S106 may specifically include the following steps:
[0092] (1) Compare the block proof and the data operation log in chronological order, and generate a data flow record through log correlation analysis;
[0093] (2) Extract data change information according to the data flow record, perform integrity comparison through data fingerprints, and generate a verification result;
[0094] (3) Classify and statistically analyze the verification results, and generate a transaction evaluation form through data weight calculation;
[0095] (4) Input the transaction evaluation form into the smart contract, and generate an interest calculation item through contract rule parsing;
[0096] (5) Perform numerical operations on the interest calculation items, and generate an interest distribution plan through proportional distribution;
[0097] (6) Conduct multi-party confirmation on the interest distribution plan, and generate an interest distribution result through consensus verification.
[0098] Specifically, in the integrity verification and rights and interests distribution stage of data exchange, the block proof is compared with the data operation log in terms of time sequence. The transaction timestamps recorded in the block proof are matched with the operation timestamps in the operation log to establish an event time sequence relationship. Key nodes such as data access, transmission, and use are identified through correlation analysis, and the data flow path between different nodes is recorded. The analysis results are integrated to generate a data flow record, which includes the complete link and timeline of data flow. The data change information of each link is extracted from the data flow record, including data content modification, format conversion, permission change, etc. The data before and after the change is compared with the original data fingerprint to verify whether the data maintains integrity during the flow process. A new fingerprint value is calculated for each data block and compared with the original fingerprint to generate a verification result containing the data consistency check result.
[0099] The verification results are classified and statistically analyzed according to dimensions such as data type, change type, and impact degree. Different weight values are assigned to different types of data, and the weight values are determined based on factors such as data importance, usage frequency, and market value. The transaction evaluation scores of various types of data are obtained through weighted calculation, and the evaluation scores and relevant statistical information are organized into a transaction evaluation table. The transaction evaluation table is input into the smart contract for processing. The smart contract parses the evaluation data and calculates the rights and interests that each party should obtain according to the preset rules. The contract rules consider factors such as data supply volume, data quality, and usage duration, and convert these factors into specific rights and interests calculation formulas. The rights and interests calculation items containing the rights and interests values of each party are generated through rule parsing. Detailed numerical operations are performed on the rights and interests calculation items to calculate the specific rights and interests shares of each participating party. The rights and interests distribution adopts a proportional system, and the distribution ratio is determined according to the contribution degree of each party and the contract rules. The calculation results form a preliminary rights and interests distribution plan, which clearly records the rights and interests amounts and distribution bases of each party.
[0100] The rights and interests distribution plan needs to be confirmed by all parties involved in the data exchange. The distribution plan is broadcast through the blockchain network, and each party reviews and confirms the plan. A multi-signature mechanism is adopted. When more than a predetermined proportion of the participating parties sign and confirm, the rights and interests distribution plan is converted into a rights and interests distribution result.
[0101] Taking traffic data exchange as an example: A navigation company shares real-time traffic condition data with the traffic department. The block proof records the time point when the data is uploaded to the blockchain, and the data operation log shows the situation where the data is accessed by multiple terminals. Through time series analysis, it is found that from data collection to sharing, the data has gone through processing such as data cleaning, desensitization, and format conversion. Data fingerprint comparison shows that all data blocks remain intact without being tampered with. The evaluation shows that the real-time traffic condition data has a high usage frequency and the traffic condition accuracy rate reaches the required standard, and based on this, a transaction evaluation score is generated. According to the smart contract rules, considering the data volume, accuracy rate, and usage frequency comprehensively, it is calculated that the navigation company should obtain a 70% share of the revenue, and the traffic department obtains a 30% share of the revenue. This distribution plan comes into effect after being signed and confirmed by both parties, completing the rights and interests distribution.
[0102] The above describes the blockchain-based data exchange method in the embodiments of the present application. Next, the blockchain-based data exchange system in the embodiments of the present application will be described. Please refer to Figure 3 , an embodiment of the blockchain-based data exchange system in the embodiments of the present application includes:
[0103] A building module 201, configured to establish a blockchain environment through a multi-node network, generate a decentralized identification code and a key pair according to institutional qualifications and identity information, and construct a resource directory tree according to data types and specifications;
[0104] A processing module 202, configured to perform standardization processing on the data to be exchanged according to the decentralized identification code and the resource directory tree, calculate the data fingerprint using the SHA-256 algorithm, encrypt and sign the data block through the key pair, and construct a data exchange packet based on the time stamp and generate an exchange list;
[0105] An implementation module 203, configured to construct a smart contract according to the decentralized identification code, the data exchange packet and the exchange list, implement permissions and access rules through a hierarchical contract structure, and form a contract deployment record;
[0106] A generation module 204, configured to generate a transaction request based on the data exchange packet, the exchange list and the contract deployment record, perform verification using the PBFT algorithm combined with a weight mechanism, and obtain a block proof through status update;
[0107] A synchronization module 205, configured to generate an access token according to the contract deployment record, the decentralized identification code and the block proof, and implement data synchronization according to the data exchange packet to form a data operation log;
[0108] A verification module 206, configured to perform integrity verification based on the block proof, the data operation log and the data fingerprint, and generate a rights and interests distribution result according to the smart contract.
[0109] Through the collaborative cooperation of the above-mentioned various components, a blockchain environment is established through a multi-node network, realizing a decentralized data exchange architecture, eliminating the risk of single-point failures, and improving the reliability of the system; based on the identity authentication mechanism of decentralized identification codes and key pairs, the authenticity and non-forgery of the identities of all parties in the data exchange are ensured; the resource directory tree is adopted to manage data resources, realizing the standardized organization and efficient retrieval of data; by standardizing the data to be exchanged and calculating data fingerprints, combined with encrypted signatures and timestamps, a secure and trustworthy data exchange package is constructed, effectively preventing data tampering and forgery; the hierarchical structure based on smart contracts realizes flexible permission control and access rule management, clarifying the responsibility boundaries for data use; the PBFT algorithm combined with the weight mechanism is used for transaction verification, improving the consensus efficiency and ensuring the consistency of transactions; through the combined use of contract deployment records, block proofs, and access tokens, fine-grained control and full-process tracking of data access are realized; the operation log recording during the data synchronization process ensures the transparency and traceability of data flow; finally, the smart contract automatically executes the rights and interests distribution, ensuring the fairness of data exchange and the protection of the rights and interests of all parties, and solving the key problems such as security, credibility, rights confirmation, and rights and interests protection in traditional data exchange.
[0110] The embodiment of the present application also provides a data exchange device based on blockchain. The data exchange device based on blockchain includes: a data exchange system based on blockchain.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a computer device. Referring to Figure 4 As shown, it is a schematic structural diagram of a computer device 300 provided by the embodiment of the present application, including a processor 301, a memory 302, and a bus 303. Among them, the memory 302 is used to store execution instructions, including an internal memory 3021 and an external memory 3022; here, the internal memory 3021 is also called the main memory, which is used to temporarily store the operation data in the processor 301 and the data exchanged with the external memory 3022 such as a hard disk. The processor 301 exchanges data with the external memory 3022 through the internal memory 3021. When the computer device 300 runs, the processor 301 communicates with the memory 302 through the bus 303.
[0112] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described system, system, and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0113] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0114] As described above, the above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of various embodiments of this application.
Claims
1. A data exchange method based on blockchain, characterized in that: The data exchange method based on blockchain includes: Establish a blockchain environment through a multi-node network, generate decentralized identification codes and key pairs based on institutional qualifications and identity information, and build a resource directory tree based on data types and specifications; The data to be exchanged is standardized according to the decentralized identification code and resource directory tree, the data fingerprint is calculated using the SHA-256 algorithm, the data block is encrypted and signed using the key pair, a data exchange package is constructed based on the timestamp, and an exchange list is generated; Constructing a smart contract based on the decentralized identification code, data exchange package and exchange list, implementing permissions and access rules through a layered contract structure, and forming a contract deployment record; Generate a transaction request based on the data exchange package, exchange list and contract deployment record, use the PBFT algorithm combined with the weight mechanism for verification, and obtain the block proof through status update; Generate an access token based on the contract deployment record, decentralized identification code and block proof, synchronize data based on the data exchange package, and form a data operation log; Integrity verification is performed based on the block proof, data operation log and data fingerprint, and the equity distribution result is generated according to the smart contract.
2. The data exchange method based on blockchain according to claim 1 is characterized in that: The blockchain environment is established through a multi-node network, a decentralized identification code and key pair are generated according to the institution's qualifications and identity information, and a resource directory tree is constructed according to the data type and specification, including: Receive the institution's qualifications and identity information, verify the legitimacy of the institution's qualifications through electronic certificate verification, and obtain the institution verification result; Generate a root key according to the verification result of the institution, generate a public-private key pair through an elliptic curve cryptography algorithm, and form the key pair; Constructing an identity code based on the verification result of the institution, generating a unique identification string through a hash operation, and obtaining the decentralized identification code; Classify and label the data types according to preset data specifications, establish a hierarchical index based on data formats and data attributes, and generate an initial resource list; The initial resource list is organized and sorted using a B+ tree structure, and a resource association table is established through hierarchical relationship mapping to form a resource structure diagram; A tree-like hierarchical structure is established according to the resource structure diagram, and a resource access path is determined through node relationship mapping to obtain the resource directory tree.
3. The data exchange method based on blockchain according to claim 1 is characterized in that: The method of standardizing the data to be exchanged according to the decentralized identification code and resource directory tree, calculating the data fingerprint using the SHA-256 algorithm, encrypting and signing the data block using the key pair, constructing a data exchange package based on the timestamp and generating an exchange list includes: Analyzing the format of the data to be exchanged, determining the data structure mapping relationship according to the resource directory tree, and obtaining standardized data; Dividing the standardized data into data blocks of fixed size, marking the data blocks by using the decentralized identification code to form data blocks with identification; Performing hash calculation on the identified data block using the SHA-256 algorithm to generate an independent data identification string to obtain the data fingerprint; Performing encryption operation on the data fingerprint based on the private key in the key pair, generating an encrypted signature string through a digital signature algorithm, and obtaining the encrypted signature; Associating the data fingerprint and the encrypted signature with the timestamp information, forming a data transaction unit through data combination, and constructing the data exchange package; The data identification and signature information in the data exchange package are sorted and classified, and a data transaction record is generated through a directory index structure to form the exchange list.
4. The data exchange method based on blockchain according to claim 1 is characterized in that: The smart contract is constructed based on the decentralized identification code, data exchange package and exchange list, and the permissions and access rules are implemented through a layered contract structure to form a contract deployment record, including: Parsing the permission information in the decentralized identification code, performing mapping analysis on the access attributes of the data exchange package, and obtaining a data permission table; The exchange list is hierarchically processed according to the data permission table, and a permission rule set is constructed through a data access hierarchical relationship; Creating smart contract code according to the permission rule set, dividing the main contract and sub-contracts according to the data permission hierarchy, and forming the hierarchical contract structure; Compiling the contract code in the hierarchical contract structure and generating a deployable contract file through bytecode conversion; Perform node broadcasting on the deployable contract file, and generate deployment transaction information through network node confirmation; The deployment transaction information is associated with the decentralized identification code and stored, and the contract deployment record is generated by arranging the transaction records.
5. The data exchange method based on blockchain according to claim 1 is characterized in that: The transaction request is generated based on the data exchange package, exchange list and contract deployment record, and the PBFT algorithm is used in combination with the weight mechanism for verification, and the block proof is obtained through status update, including: Matching and checking the data exchange package with the exchange list, and generating a data matching record through information consistency verification; Extracting transaction rules from the contract deployment record, performing rule verification on the data matching record, and obtaining a transaction data packet; Generate transaction description information according to the transaction data packet, and form the transaction request through data serialization processing; The transaction request is subject to node consensus through the PBFT algorithm, and the node voting weight is allocated by the weight mechanism to generate a consensus result; Update the on-chain data of the consensus result and generate block data through the global state tree update; The block data is hashed and associated with the timestamp, and the block certificate is generated through a data signature.
6. The data exchange method based on blockchain according to claim 1 is characterized in that: The access token is generated according to the contract deployment record, decentralized identification code and block proof, data synchronization is achieved according to the data exchange package, and a data operation log is formed, including: Associating and matching the contract deployment record with the decentralized identification code, and generating access authorization information through authority verification; Combining the access authorization information with the block certificate and generating the access token through encryption; Extracting data content in the data exchange packet according to the access token, and generating a synchronization sequence by sorting data blocks; Distributing the synchronization sequence to nodes, and generating a synchronization task list through a data transmission protocol; Record the status of the data in the synchronization task list and generate an operation record by tracking the synchronization progress; The operation record is timestamped and signed, and the data operation log is generated through log sorting.
7. The data exchange method based on blockchain according to claim 1 is characterized in that: The integrity verification is performed based on the block proof, data operation log and data fingerprint, and the equity distribution result is generated according to the smart contract, including: Compare the block proof with the data operation log in time sequence, and generate a data flow record through log correlation analysis; Extracting data change information according to the data flow record, performing integrity comparison through the data fingerprint, and generating a verification result; Classify and count the verification results, and generate a transaction evaluation table through data weight calculation; Input the transaction evaluation table into the smart contract, and generate equity calculation items through contract rule analysis; Performing numerical calculation on the equity calculation items, and generating an equity distribution plan through proportional distribution; The equity distribution plan is confirmed by multiple parties, and the equity distribution result is generated through consensus verification.
8. A data exchange system based on blockchain, used to implement the data exchange method based on blockchain as described in any one of claims 1 to 7, characterized in that: The blockchain-based data exchange system includes: Establish a module for establishing a blockchain environment through a multi-node network, generating decentralized identification codes and key pairs based on institutional qualifications and identity information, and building a resource directory tree based on data types and specifications; A processing module, used to perform standardization processing on the data to be exchanged according to the decentralized identification code and the resource directory tree, calculate the data fingerprint using the SHA-256 algorithm, encrypt and sign the data block using the key pair, construct a data exchange package based on the timestamp and generate an exchange list; An implementation module, used to construct a smart contract based on the decentralized identification code, data exchange package and exchange list, implement permissions and access rules through a hierarchical contract structure, and form a contract deployment record; A generation module, used to generate a transaction request based on the data exchange package, exchange list and contract deployment record, use the PBFT algorithm combined with the weight mechanism for verification, and obtain a block certificate through status update; A synchronization module, used to generate an access token based on the contract deployment record, decentralized identification code and block proof, realize data synchronization according to the data exchange package, and form a data operation log; The verification module is used to perform integrity verification based on the block proof, data operation log and data fingerprint, and generate the equity distribution result according to the smart contract.
9. A data exchange device based on blockchain, characterized in that: The blockchain-based data exchange device includes: a blockchain-based data exchange system as described in claim 8.
10. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate through the bus. When the machine-readable instructions are executed by the processor, the steps of the blockchain-based data exchange method as described in any one of claims 1 to 7 are performed.
Citation Information
Cited By
Credit investigation data processing method and device
CN121504599A