A multi-party trusted data interaction method and device based on blockchain
By using blockchain technology and the Hyperledger Fabric framework in data interaction between enterprises, we design a multi-party trusted data interaction method, solve the security loopholes and inconvenience problems in data interaction, and achieve efficient and credible data interaction and trust foundation between enterprises. , ensuring data integrity and non-tamperability.
Patent Information
- Application Number
- CN202210672617.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-06-14
AI Technical Summary
There are security loopholes and inconveniences in data interaction between enterprises, leading to risks of data leakage and tampering, limiting the efficiency of cooperation between enterprises and business growth.
Adopting a multi-party trusted data interaction method based on blockchain, by designing the data storage field structure, selecting appropriate storage methods, performing identity verification and data inspection, and using the Hyperledger Fabric framework to build a blockchain network to ensure data security and privacy. sex.
It realizes efficient and credible data interaction between enterprises, ensures the integrity and non-tamperability of data, provides a trust foundation and evidence support, reduces the risk of data leakage, and enhances cooperation trust.
Smart Images

Figure CN115189886B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of business data information security interaction, and in particular to a multi-party trusted data interaction method based on blockchain. Background Art
[0002] In recent years, with the continuous development of information technology, the level of informatization of enterprises has been continuously improved. The paperless office of enterprises has made more and more enterprises' business exchanges move online. While online business exchanges facilitate and accelerate business development, they also cause security and trust issues in data exchange between enterprises. Many companies are often willing to cooperate with a limited number of companies. For companies with fewer cooperation, they are worried about the authenticity of the data provided by them. At the same time, they are unwilling to provide too much of their own data to the other party for fear of data leakage. This situation greatly reduces the role of digitalization in improving the efficiency of cooperation between enterprises and business growth. At present, the interaction of data involved in business exchanges between enterprises is still transmitted through private hardware copies or through employees' private communication software. There are many security loopholes and inconveniences in this process. Data is easily leaked and tampered with, resulting in losses to the company. This is also the reason why companies are reluctant to cooperate too much with unfamiliar companies and are more willing to cooperate with familiar companies. Summary of the invention
[0003] The purpose of the present invention is to provide a multi-party trusted data interaction method based on blockchain to address the shortcomings of existing methods.
[0004] The object of the present invention is achieved through the following technical solutions: In the first aspect, the present invention provides a multi-party trusted data interaction method based on blockchain, comprising the following steps:
[0005] (1) Build a blockchain network and design the field structure DI (Data Information) for data storage. DI consists of multiple fields. Design corresponding fields according to different confidentiality, security and modification requirements; select the storage method according to the privacy level and security level of the data; after successful data storage, the index DId (Data Id) of this data will be returned;
[0006] (2) Based on the field structure DI of the data storage designed in step (1), select DId or corresponding field information according to the privacy level and security level of the data when storing the data, and perform corresponding data query;
[0007] (3) For the data stored in step (1), data verification can be performed based on the designed field structure DI of the data storage. There are three types of verification:
[0008] a. Verify whether a DId is valid: Specifically, determine whether there is data under the current DId. If there is data, the DId is valid and returns the public data description information in the DI. If the DId is invalid, an error message is returned.
[0009] b. Verify some of the non-encrypted content of DI: Specifically, verify whether the information of the non-encrypted content is consistent with the DI stored in the blockchain network, and obtain the corresponding result of the matching degree according to DId and the value to be verified;
[0010] c. Verify part of the encrypted content of DI: Specifically, combine the key and encryption and decryption algorithm to verify whether the data information to be checked is consistent with the encrypted segment data in DI, and judge whether the results match according to DId, the encryption algorithm and corresponding key used when storing the evidence, and the value of the field to be verified.
[0011] Furthermore, in step (1), the specific process of data storage is as follows:
[0012] (1) First, different index field combinations need to be designed for different data types to meet various storage needs. The corresponding storage form is designed for the content that needs to be stored. The accurate recording of information needs to be met, and corresponding fields are set according to different security, encryption, and business requirements. To meet the revision requirements, a revision mark field is added to record the revision history of the data.
[0013] (2) Before storing data, it is necessary to check the certificate proving its identity and verify whether the stored information is empty or other invalid information to prevent replay attacks. Before submitting the evidence, apply for a one-time random number, then use the private key to encrypt the random number as a signature and attach it to the information submitted for storage.
[0014] (3) Provide a unified interface service to prepare storage information in advance according to design requirements or generate it using conversion tools.
[0015] (4) Storage adopts idempotent rules. The same DI will return the same DId no matter how many times it is stored. For data with the same classification mark and no revision mark, if the information load is different when stored multiple times, an error message will be returned. For DI with revision marks, a new DId will be returned each time it is stored.
[0016] Furthermore, in step (2), the data query includes the following two types:
[0017] A. No identity authentication, no need to provide identity certificate and other verification information, you can directly query the corresponding data according to DId. When querying, the channel to which the data belongs is determined according to DId. If it is public data, it is returned directly. If it is private data, it verifies whether the current caller is the authorized object of this private data set. If not, the data query request is rejected. If yes, the corresponding data is returned.
[0018] B. Provide the corresponding searchable fields for the required data to query the required data.
[0019] Furthermore, in step (3), the method of verifying part of the non-encrypted content of DI in data verification is specifically as follows:
[0020] For the non-encrypted segment information that needs to be verified, enter the key-value pair and DId of the corresponding field. The found data will be checked internally against the provided key-value pair to match the data, and the corresponding result will be returned based on the degree of match, such as match, partial match or mismatch.
[0021] Furthermore, in step (1), the blockchain network is constructed using the Hyperledger Fabric framework, a new channel is created in the blockchain network, and nodes joining the channel are set as needed, and the chain codes required for storage and verification are installed.
[0022] Furthermore, in step (1), the storage method selected according to the privacy level and security level of the data is specifically: storing the data directly in the corresponding channel so that all members of the channel can obtain it, or storing it as private data only open to specific members of the channel, or encrypting the data payload at different levels and in different ways.
[0023] Furthermore, in step (2), when querying data, data that is publicly available in the blockchain network channel can be directly queried, and data in the channel private data set can be obtained if the person is an authorized object of the data set, otherwise he or she has no right to obtain it; for encrypted data, the queried data requires the corresponding key to decrypt it.
[0024] Furthermore, in step (3), the data verification can be used in scenarios where it is only necessary to verify the authenticity of the data and not the content of the data itself.
[0025] In a second aspect, the present invention provides a multi-party trusted data interaction device based on blockchain, comprising a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, the multi-party trusted data interaction method based on blockchain is implemented.
[0026] In a third aspect, the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the blockchain-based multi-party trusted data interaction method.
[0027] The beneficial effects of the present invention are as follows: based on the blockchain technology, the present invention enables enterprises that are not familiar with each other and have not established a credit foundation to carry out efficient, reliable and secure business exchanges and realize data intercommunication. In the blockchain network, there is no centralized management agency, and all participants are in an equal position. At the same time, the blockchain network developed with the Hyperledger Fabric framework will authenticate each organization that joins and provide corresponding certificates, thereby ensuring the trust foundation between participating enterprises. The specific storage information structure designed by the present invention can ensure the precise positioning of a piece of information, and on the basis of ensuring that the data will not be tampered with and permanently preserved, it provides an update function for historical data to meet the needs of enterprise modification. While ensuring that data security is not exposed, it provides a verification function for the correctness and integrity of the stored data information, so that the enterprise not only guarantees the security and confidentiality of the data submitted by itself, but also believes that the data provided by it has not been tampered with before and after consistency when cooperating with other enterprises without a trust foundation, and can also provide favorable evidence support if disputes arise. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flow chart is stored for the method of the present invention.
[0029] Figure 2 This is a flowchart for querying and checking the method of the present invention.
[0030] Figure 3 A schematic diagram of a multi-party trusted data interaction device based on blockchain provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and in combination with embodiments, but the present invention is not limited to the examples given.
[0032] like Figure 1 and Figure 2 As shown, the present invention provides a multi-party trusted data interaction method based on blockchain, comprising the following steps:
[0033] (1) Build a blockchain network using the Hyperledger Fabric framework, create a new channel in the blockchain network, set up nodes to join the channel as needed, and install the chain code required for storage and verification. Specifically, the blockchain contains the following structure:
[0034] 1. Node
[0035] The blockchain network has three nodes as peers. As entities holding blockchain ledgers, they install, review and run chain codes to verify the data on the chain. The Kafka algorithm is used to ensure that distributed consensus can be reached even if one node fails, ensuring data consistency. Any node can interact with the blockchain network to store and verify evidence. The node that saves the uploaded information is determined based on the selected strategy.
[0036] 2. Contract
[0037] Smart contracts use a programming business model to define business processes and determine the access process of evidence and verification operation data in the blockchain network. The contract is edited by the user according to certain specifications, and finally takes effect after node installation, review and submission. The code in the contract is written as needed and can be continuously upgraded and updated.
[0038] 3. Consensus
[0039] The consensus process of the blockchain network is divided into two parts: the endorsement process of the transaction and the global ordering of the transaction. Global ordering is the part where the consensus mechanism runs. Because it is a distributed system, the orderer cluster is required to globally order the transactions sent from different nodes. The consensus mechanism can ensure the consistency of data in the distributed system.
[0040] (2) Data storage design. Design the field structure DI (Data Information) for data storage. DI consists of multiple fields. Design the corresponding fields according to different confidentiality, security, modification and other needs. Select the storage method according to the privacy level and security level of the data. The data can be directly stored in the corresponding channel and all members of the channel can obtain it, or it can be used as private data storage only for specific members of the channel. The data load can also be encrypted at different levels and methods. After the data is successfully stored, the index DId (Data Id) of this data will be returned. The storage design details are described as follows:
[0041] Storage needs to meet the characteristics of security, simplicity and diverse storage methods.
[0042] 1. In order to support multiple storage and rich query and verification implementations, as well as to ensure that the evidence information and verification are in a strict logical closed loop, a storage data field DI with a clear structure and rich content is designed. First of all, a hierarchical index field combination needs to be designed for different data types to meet various storage needs, so that the stored information can be reasonably classified and quickly searched. For the content that needs to be stored, the corresponding storage form is designed to meet the accurate recording of information, and the corresponding fields are set according to different requirements such as security, encryption, and business. In order to meet the revision requirements, a revision mark field is added to record the revision history of the data.
[0043] 2. It is necessary to design logical steps to ensure security and ensure that the identity of the subject storing the data is legal. Before storing the data, it is necessary to check the certificate proving its identity and verify whether the stored information is empty or other invalid information to prevent replay attacks. Before submitting the evidence, apply for a one-time random number, and then use the private key to encrypt the random number as a signature and attach it to the information submitted for storage.
[0044] 3. The storage format is simple and convenient. In addition to providing the necessary identity information and storage data, no other additional data is required. It provides a unified interface service and does not require a lot of advance configuration. The storage information can be written in advance according to the design requirements, or it can be generated using the provided conversion tools.
[0045] 4. In order to improve the robustness in a distributed environment, the storage adopts the idempotent rule. The same DI will return the same DId no matter how many times it is stored. The current submission will not affect subsequent operations, and each storage behavior is isolated and unrelated. For data with the same classification mark and no revision mark, if the information load stored multiple times is different, an error prompt message will be returned. For DI with revision marks, a new DId will be returned each time it is stored. The specific process is: first obtain the signature of the data information to be stored, and then determine whether the Did of the data exists. If it exists, determine whether there is a revision mark; if it does not exist, call the smart contract for evidence, and then verify whether the storage is successful. If successful, return the evidence number Did; if unsuccessful, return an error code; when determining whether there is a revision mark, if there is a revision mark, call the smart contract for evidence to execute the subsequent process. If there is no revision mark, directly return an error code.
[0046] (3) Data query design: Based on the field structure DI of the data storage designed in step (1), select DId or the corresponding field information according to the privacy level and security level when storing data, and obtain data from the corresponding channel. Data that is publicly available in the channel can be queried directly. For data in the private data set of the channel, if you are the authorized object of the data set, you can obtain it, otherwise you have no right to obtain it. For encrypted data, the queried data requires the corresponding key to decrypt. Fast and convenient query can speed up the speed of data interoperability and realize data sharing among multiple parties. The details of the data query design are as follows:
[0047] 1. No identity authentication, no need to provide identity certificate and other verification information, you can directly query the corresponding data according to DId. When querying, the channel to which the data belongs will be automatically determined according to DId. If it is public data, it will be returned directly. If it is private data, it will verify whether the current caller is in the authorized object set of this private data set. If not, the request will be rejected. If so, the corresponding data will be returned.
[0048] 2. In order to enrich the query methods, in addition to querying data by providing DId, you can also provide the corresponding searchable fields of the required data to query the required data.
[0049] (4) Data verification design: Provide data verification technical support for scenarios where the data content itself is not needed and only the authenticity of the data needs to be verified. For example, user A provides a piece of data to user B (this data user A has previously stored in step (2)). User B wants to know whether the data obtained has been changed from the original data of user A. So he takes the data provided by user A and DId to verify and obtain a match or mismatch result. The verification is divided into non-encrypted and encrypted content verification according to whether user A has encrypted the data during storage. Specifically, it includes the following three verification forms:
[0050] ① Verify whether a DId is valid, determine whether there is data under the current DId, enter the DId, if there is data, this DId is valid, return the public data description information in the DI, including upload time, uploader, data description, etc., if this DId is invalid, return an error message;
[0051] ② Verify some of the non-encrypted content of DI to verify whether the information (non-encrypted content) is consistent with the DI stored in the blockchain network. Input DId and some values that need to be verified, and output the corresponding results according to the degree of matching;
[0052] ③ Verify part of the encrypted content of DI, combine the key and encryption and decryption algorithm to verify whether the data information to be checked is consistent with the encrypted segment data in DI, input DId, the encryption algorithm and corresponding key used when storing evidence, and the value of the field to be verified, and output whether the result matches. The details of the data verification design are as follows:
[0053] In addition to direct data query, data verification is also a highly demanded function. Verification does not directly return the original stored data, and different verification functions are provided according to the needs.
[0054] 1.DId verification
[0055] In some cases, it is necessary to verify whether a DId itself is valid. Enter the DId. If data has been stored under this id, partial description information will be returned, otherwise an error message will be returned.
[0056] 2. DI non-encrypted segment data verification
[0057] For the non-encrypted segment information that needs to be verified, enter the key-value pair and DId of the corresponding field. The found data will be checked internally against the provided key-value pair to match the data, and the corresponding result will be returned based on the degree of match, such as match, partial match or mismatch.
[0058] 3. DI encrypted segment data verification
[0059] Data saved in encrypted form during storage can also be verified. Enter the field to be verified, DId, and the salt entered during storage. The encrypted data will be verified as a whole and the corresponding results will be returned based on the comparison.
[0060] Corresponding to the aforementioned embodiment of the multi-party trusted data interaction method based on blockchain, the present invention also provides an embodiment of the multi-party trusted data interaction device based on blockchain.
[0061] See also Figure 3 An embodiment of the present invention provides a multi-party trusted data interaction device based on blockchain, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement the multi-party trusted data interaction method based on blockchain in the above embodiment.
[0062] The embodiments of the multi-party trusted data interaction device based on blockchain of the present invention can be applied to any device with data processing capability, which can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the processor of any device with data processing capability reads the corresponding computer program instructions in the non-volatile memory into the memory and runs them. From the hardware level, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where the multi-party trusted data interaction device based on blockchain of the present invention is located. Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0063] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0064] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0065] An embodiment of the present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the multi-party trusted data interaction method based on blockchain in the above embodiment is implemented.
[0066] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0067] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A multi-party trusted data interaction method based on blockchain, characterized in that: The following steps are involved: (1) Build a blockchain network. The blockchain network is built using the Hyperledger Fabric framework. Create a new channel in the blockchain network, set up nodes to join the channel as needed, and install the chain code required for storage and verification; design the field structure DI (Data Information) for data storage. DI consists of multiple fields. Design the corresponding fields according to different confidentiality, security and modification requirements; select the storage method according to the privacy level and security level of the data, specifically: store the data directly in the corresponding channel, which can be obtained by all members of the channel, or store it as private data only open to specific members of the channel, or encrypt the data payload at different levels and methods; after successful data storage, the index DId (DataId) of this data will be returned; the specific process of data storage is as follows: 1) First, different index field combinations need to be designed for different data types to meet various storage needs. The corresponding storage form is designed for the content that needs to be stored. The accurate recording of information needs to be met. The corresponding fields are set according to different security, encryption, and business requirements. To meet the revision requirements, a revision mark field is added to record the revision history of the data. 2) Before data is stored, it is necessary to check the certificate proving its identity, verify whether the stored information is invalid information to prevent replay attacks, apply for a one-time random number before submitting the evidence, and then use the private key to encrypt the random number as a signature and attach it to the information submitted for storage; 3) Provide unified interface services, write storage information in advance according to design requirements, or generate it using conversion tools; 4) The storage adopts the idempotent rule. The same DI will return the same DId no matter how many times it is stored. For data with the same classification mark and no revision mark, if the information load is different when stored multiple times, an error message will be returned. For DI with revision mark, each storage will return a new DId; (2) Based on the field structure DI of the data storage designed in step (1), perform corresponding data query according to the privacy level and security level of the data when storing the data and DId or the corresponding field information; (3) For the data stored in step (1), data verification can be performed based on the designed field structure DI of the data storage. There are three types of verification: a. Verify whether a DId is valid: Specifically, determine whether there is data under the current DId. If there is data, the DId is valid and returns the public data description information in the DI. If the DId is invalid, an error message is returned. b. Verify some of the non-encrypted content of DI: Specifically, verify whether the information of the non-encrypted content is consistent with the DI stored in the blockchain network, and obtain the corresponding result of the matching degree according to DId and the value to be verified; c. Verify part of the encrypted content of DI: Specifically, combine the key and encryption and decryption algorithm to verify whether the data information to be checked is consistent with the encrypted segment data in DI, and judge whether the results match according to DId, the encryption algorithm and corresponding key used when storing the evidence, and the value of the field to be verified.
2. According to a blockchain-based multi-party trusted data interaction method according to claim 1, it is characterized in that: In step (2), the data query includes the following two types: A. No identity authentication is required. No identity certificate is required. The corresponding data can be directly queried based on DId. When querying, the channel to which the data belongs is determined based on DId. If it is public data, it is returned directly. If it is private data, it verifies whether the current caller is the authorized object of this private data set. If not, the data query request is rejected. If yes, the corresponding data is returned. B. Provide the corresponding searchable fields for the required data to query the required data.
3. According to a blockchain-based multi-party trusted data interaction method according to claim 1, it is characterized in that: In step (3), the method of verifying part of the non-encrypted content of DI in data verification is specifically as follows: For the non-encrypted segment information that needs to be verified, enter the key-value pair and DId of the corresponding field. The found data will be checked internally against the provided key-value pair to match, and the corresponding result will be returned based on the degree of match, such as match, partial match or mismatch.
4. According to a blockchain-based multi-party trusted data interaction method according to claim 1, it is characterized in that: In step (2), when querying data, the data that is publicly available in the blockchain network channel can be directly queried. For data in the channel private data set, if you are the authorized object of the data set, you can obtain it, otherwise you have no right to obtain it; for encrypted data, the queried data requires the corresponding key to decrypt it.
5. According to a blockchain-based multi-party trusted data interaction method according to claim 1, it is characterized in that: In step (3), the data verification can be used in scenarios where it is only necessary to verify the authenticity of the data and not the content of the data itself.
6. A multi-party trusted data interaction device based on blockchain, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the processor executes the executable code, a multi-party trusted data interaction method based on blockchain is implemented as described in any one of claims 1 to 5.
7. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by the processor, the multi-party trusted data interaction method based on blockchain as described in any one of claims 1 to 5 is implemented.
