CN112417517B - A data standard management method based on blockchain - Google Patents
A data standard management method based on blockchain Download PDFInfo
- Publication number
- CN112417517B CN112417517B CN202011303107.5A CN202011303107A CN112417517B CN 112417517 B CN112417517 B CN 112417517B CN 202011303107 A CN202011303107 A CN 202011303107A CN 112417517 B CN112417517 B CN 112417517B
- Authority
- CN
- China
- Prior art keywords
- metadata
- blockchain
- organization
- data
- data standard
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6227—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Accounting & Taxation (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Finance (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域Technical field
本发明涉及数据标准管理和区块链技术领域,具体公开了一种基于区块链的数据标准管理方法。The invention relates to the technical fields of data standard management and blockchain, and specifically discloses a data standard management method based on blockchain.
背景技术Background technique
随着各行业信息化的进行,各系统都沉淀了大量的数据,要想把这些数据运用起来就需要统一的标准,于是就有了数据标准管理的需求。With the advancement of informatization in various industries, a large amount of data has accumulated in various systems. To use this data, unified standards are needed, so there is a need for data standard management.
数据标准是指保障数据的内外部使用和交换的一致性和准确性的规范性约束。数据标准的具体形态通常是一个或多个元数据的集合,即元数据是数据标准的基本单元。何为元数据,元数据即是用来描述数据的数据,如对一张数据表中各字段的名称、类型、长度等的描述数据就称为元数据。标准元数据又是什么,标准元数据即某一组织或团体共同制定和认可的元数据。在建立数据仓库的过程中作为规则来进行数据转换;数据在部门间共享和交换过程中,用于描述数据的格式,提高共享和交换效率。Data standards refer to normative constraints that ensure the consistency and accuracy of internal and external use and exchange of data. The specific form of data standards is usually a collection of one or more metadata, that is, metadata is the basic unit of data standards. What is metadata? Metadata is data used to describe data. For example, the description data of the name, type, length, etc. of each field in a data table is called metadata. What is standard metadata? Standard metadata is metadata jointly developed and recognized by an organization or group. In the process of establishing a data warehouse, it is used as a rule to perform data conversion; in the process of data sharing and exchange between departments, it is used to describe the format of the data and improve the efficiency of sharing and exchange.
由于数据标准中的元数据在数据治理过程中作用关键,因此对元数据就必须要求极高的统一性、认可度和可信度。传统数据标准管理,一般是由指定的部门或组织(比如IT部门)牵头,通过调研形成数据标准,数据标准包含了数据集、数据子类,具体地包含了描述数据子类的元数据,然后将元数据信息存放到中心库中,数据标准的维护和管理由指定的部门完成,这就是一种中心化的数据标准管理模式和系统。但是数据标准的使用各方难以参与数据标准的制定和维护升级,流程复杂,责权不清晰。往往一个组织花了大力气指定数据标准之后,随着业务的变化,数据标准很快就不适用了,修订数据标准的进度跟不上业务的变化速度,最终使得数据标准形同虚设。第二,大型组织或者是跨组织的环境中数据标准存在可信度问题,但是使用中心化模式的数据标准管理中的组织无法识别该元数据是否可信,只有无条件的信任中心库。需要一种分布式去中心化的数据标准管理方法和系统,使得数据标准中的元数据可信,并且数据标准中的元数据在制定和维护的过程中相关组织都能参与其中的。Since metadata in data standards plays a key role in the data governance process, metadata must require extremely high uniformity, recognition, and credibility. Traditional data standard management is generally led by designated departments or organizations (such as IT departments), and data standards are formed through research. Data standards include data sets, data subcategories, and specifically metadata describing data subcategories. Then Metadata information is stored in a central database, and data standard maintenance and management are completed by designated departments. This is a centralized data standard management model and system. However, it is difficult for all parties using data standards to participate in the formulation, maintenance and upgrade of data standards. The process is complicated and responsibilities and rights are unclear. Often after an organization spends great efforts to specify data standards, as the business changes, the data standards soon become no longer applicable. The progress of revising the data standards cannot keep up with the speed of changes in the business, eventually making the data standards useless. Second, there are credibility issues with data standards in large organizations or cross-organizational environments. However, organizations using centralized data standards management cannot identify whether the metadata is credible, and only have unconditional trust in the central database. A distributed and decentralized data standard management method and system is needed to make the metadata in the data standard credible, and relevant organizations can participate in the process of formulating and maintaining the metadata in the data standard.
发明内容Contents of the invention
本发明的目的在于,针对数据中心或数据仓库数据标准管理中,使用数据标准的各组织或业务部门无法识别数据标准中的元数据是否可信,也很难参与中心化的数据标准管理维护的现状,利用区块链数据不可篡改,可追溯的特点,提出了一种基于区块链的标准数据管理方法,包含基于区块链的元数据转换方法,实现了多方共同参与数据标准的创建维护。The purpose of this invention is to address the situation where organizations or business departments using data standards cannot identify whether the metadata in the data standard is trustworthy in data standard management in a data center or data warehouse, and it is difficult to participate in centralized data standard management and maintenance. Current situation, taking advantage of the characteristics of blockchain data that cannot be tampered with and are traceable, a standard data management method based on blockchain is proposed, including a metadata conversion method based on blockchain, which enables multiple parties to participate in the creation and maintenance of data standards. .
为了实现上述发明目的,本发明提供了以下技术方案:In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
一种基于区块链的数据标准管理方法,步骤包括:A data standard management method based on blockchain, the steps include:
A、创建元数据时,把元数据信息上传到区块链,获取每一条元数据信息的唯一标识编码;A. When creating metadata, upload the metadata information to the blockchain and obtain the unique identification code of each piece of metadata information;
B、在调用数据标准中的元数据的时候,根据唯一标识编码,对获取的元数据进行区块链上的验真,确定获取的元数据是否被篡改;B. When calling the metadata in the data standard, verify the obtained metadata on the blockchain based on the unique identification code to determine whether the obtained metadata has been tampered with;
步骤A具体包括:Step A specifically includes:
第一步,将原始的元数据转换为目标格式,得到目标格式的元数据;The first step is to convert the original metadata into the target format and obtain the metadata in the target format;
第二步,对目标格式的元数据进行运算,得到每条目标格式的元数据对应的字符串;The second step is to perform operations on the metadata in the target format to obtain the string corresponding to each piece of metadata in the target format;
第三步,对字符串进行加密,得到加密字符串;The third step is to encrypt the string and obtain the encrypted string;
第四步,将字符串、字符串相应的加密字符串、表名、相关的描述、更改前信息来源和当前元数据版本组合成区块链上的元数据信息,字符串相应的加密字符串是元数据信息的唯一标识编码。The fourth step is to combine the string, the encrypted string corresponding to the string, the table name, the relevant description, the source of information before the change and the current metadata version into the metadata information on the blockchain, and the encrypted string corresponding to the string. It is the unique identification code of metadata information.
进一步的,方法还包括步骤B,在调用数据标准中的元数据的时候,根据唯一标识编码,对获取的元数据进行区块链上的验真,确定获取的元数据是否被篡改;Further, the method also includes step B: when calling the metadata in the data standard, verify the obtained metadata on the blockchain according to the unique identification code to determine whether the obtained metadata has been tampered with;
具体包括以下步骤:Specifically, it includes the following steps:
当获取链下的元数据时,查找链下的元数据中的加密字符串;When obtaining off-chain metadata, look for the encrypted string in the off-chain metadata;
通过加密字符串,到区块链上查找是否有对应的链上元数据,如果有,获取的链下的元数据未被篡改,如果没有,获取的链下的元数据被篡改。By encrypting the string, search the blockchain to see if there is corresponding on-chain metadata. If so, the obtained off-chain metadata has not been tampered with. If not, the obtained off-chain metadata has been tampered with.
作为优选方案,步骤还包括:区块中元数据的维护方法,区块中元数据的维护方法包括以下步骤:1)数据的准备;2)链上共识的达成;3)链下数据同步更改。As a preferred solution, the steps also include: the maintenance method of metadata in the block. The maintenance method of metadata in the block includes the following steps: 1) Preparation of data; 2) Reaching consensus on the chain; 3) Synchronous changes of off-chain data .
进一步的,数据的准备具体包括以下步骤:Further, data preparation specifically includes the following steps:
找到需要进行更改的元数据更改前的加密字符串;Find the encrypted string before the metadata change that needs to be changed;
按照步骤A 的方法将更改后的元数据信息转换为链上数据结构,获的更改后的元数据信息;Follow the method in step A to convert the changed metadata information into an on-chain data structure to obtain the changed metadata information;
将更改前的加密字符串添加到更改后的元数据信息中的“更改前信息来源”字段中。Add the pre-change encrypted string to the "Pre-change information source" field in the post-change metadata information.
作为优选方案,链上共识的达成的步骤包括:As a preferred solution, the steps to reach consensus on the chain include:
C1、构建组织通道,组织通道包含多个组织节点,组织节点与使用数据标准中的元数据组织一一对应,并且元数据组织被许可在组织通道中发起元数据修改请求;C1. Build an organization channel. The organization channel contains multiple organization nodes. The organization nodes correspond one-to-one with the metadata organizations in the usage data standard, and the metadata organization is allowed to initiate metadata modification requests in the organization channel;
C2、其中一个组织节点发起修改数据标准中的元数据的请求,并构建修改提案;C2. One of the organization nodes initiates a request to modify the metadata in the data standard and constructs a modification proposal;
C3、组织通道中的背书节点根据修改提案的内容和组织通道的构建信息,对修改提案进行验证,当验证通过,则生成交易结果;C3. The endorsement node in the organization channel verifies the modification proposal based on the content of the modification proposal and the construction information of the organization channel. When the verification passes, the transaction result is generated;
C4、根据交易结果和背书节点的签名,生成提案响应;C4. Generate a proposal response based on the transaction results and the signature of the endorsement node;
C5、判断提案响应是否满足预先的背书策略,若满足,则将修改提案按照时间顺序打包成区块;C5. Determine whether the proposal response meets the pre-endorsement policy. If so, package the modified proposal into blocks in chronological order;
C6、每一个组织节点对区块中的修改提案进行验证,如果区块中的修改提案没变化,则区块的交易标记为有效;C6. Each organization node verifies the modification proposal in the block. If the modification proposal in the block has not changed, the transaction in the block is marked as valid;
C7、当区块的交易标记为有效时,对链上的元数据进行修改。C7. When the transaction of the block is marked as valid, the metadata on the chain is modified.
作为优选方案,组织通道和组织节点满足以下条件:As a preferred solution, the organization channels and organization nodes meet the following conditions:
1)组织节点相应的使用数据标准中的元数据的组织完成了所在元数据标准组织的注册和登记,并且获取了确认身份的加密材料;1) The organization node corresponding to the organization that uses the metadata in the data standard has completed the registration and registration of the metadata standard organization, and obtained the encryption material to confirm the identity;
2)被修改元数据的区块链设置了背书策略,并定义了修改元数据的方法;2) The blockchain whose metadata is modified has an endorsement policy and defines a method for modifying the metadata;
3)发起修改元数据请求的组织节点具有发起修改元数据的权限;3) The organization node that initiates the metadata modification request has the authority to initiate metadata modification;
4)组织通道上所有组织节点都同意的情况下,才能触发区块链对元数据进行修改。4) Only when all organization nodes on the organization channel agree, can the blockchain be triggered to modify the metadata.
作为优选方案,步骤C3中,对修改提案进行验证,验证的内容包括:As a preferred solution, in step C3, the modification proposal is verified. The verification content includes:
1)修改提案的格式是否完整;2)修改提案是否为首次提交;3)验证背书节点的签名是否有效的;4)构建修改提案的组织节点是否具有发起修改元数据的权限。1) Whether the format of the modification proposal is complete; 2) Whether the modification proposal is submitted for the first time; 3) Verify whether the signature of the endorsement node is valid; 4) Whether the organization node that constructed the modification proposal has the authority to initiate modification of metadata.
作为优选方案,交易结果包括响应值和写集,写集是待修改元数据的键值对。As a preferred solution, the transaction result includes the response value and the write set. The write set is the key-value pair of the metadata to be modified.
作为优选方案,预先的背书策略是组织通道中的所有节点都要背书。As a preferred solution, the pre-endorsement policy is that all nodes in the organization channel must endorse.
基于相同的构思,本发明还提出了一种基于区块链的数据标准管理系统,包括至少一个处理器,以及与至少一个处理器通信连接的存储器;存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述任一项的方法。Based on the same concept, the present invention also proposes a data standard management system based on blockchain, including at least one processor, and a memory communicatively connected to the at least one processor; the memory stores information that can be executed by at least one processor. Instructions are executed by at least one processor to enable at least one processor to execute any of the above methods.
与现有技术相比,本发明的有益效果:Compared with the existing technology, the beneficial effects of the present invention are:
1、本发明将元数据信息通过区块链技术进行数据转换上链,使得元数据可追溯、不可篡改,因此,使用的组织可以完全信任从中心库获得的标准元数据;1. The present invention converts metadata information onto the chain through blockchain technology, making the metadata traceable and non-tamperable. Therefore, the organizations using it can fully trust the standard metadata obtained from the central library;
2、本发明还将联盟链中的链码和通道引入元数据区块链中,实现数据的不可篡改,可追溯,多方共同参与数据标准创建维护。2. The present invention also introduces the chain code and channel in the alliance chain into the metadata blockchain to achieve data non-tamperability, traceability, and multi-party participation in the creation and maintenance of data standards.
附图说明:Picture description:
图1为本发明实施例1中的一种基于区块链的数据标准管理方法的流程图;Figure 1 is a flow chart of a blockchain-based data standard management method in Embodiment 1 of the present invention;
图2为本发明实施例1中的数据标准中的元数据信息在链下数据存储方式示意图;Figure 2 is a schematic diagram of the off-chain data storage method of metadata information in the data standard in Embodiment 1 of the present invention;
图3为本发明实施例1中的json字符串示意图;Figure 3 is a schematic diagram of the json string in Embodiment 1 of the present invention;
图4为本发明实施例1中的区块上的元数据信息结构图;Figure 4 is a structural diagram of metadata information on a block in Embodiment 1 of the present invention;
图5为本发明实施例1中的加入MD5加密字符串的元数据信息在链下数据存储方式示意图;Figure 5 is a schematic diagram of the off-chain data storage method of metadata information added to the MD5 encrypted string in Embodiment 1 of the present invention;
图6为本发明实施例1中的元数据在区块中的结构图;Figure 6 is a structural diagram of metadata in blocks in Embodiment 1 of the present invention;
图7为本发明实施例1中的将更改后的元数据信息转换为链上数据结构图;Figure 7 is a diagram of converting modified metadata information into on-chain data structure in Embodiment 1 of the present invention;
图8为本发明实施例1中的记账节点将接受到的数据放入区块中的过程图;Figure 8 is a process diagram for the accounting node to put the received data into the block in Embodiment 1 of the present invention;
图9为本发明实施例1中的Fabric链上共识的达成的具体步骤的流程图。Figure 9 is a flow chart of specific steps for reaching consensus on the Fabric chain in Embodiment 1 of the present invention.
具体实施方式Detailed ways
下面结合试验例及具体实施方式对本发明作进一步的详细描述。但不应将此理解为本发明上述主题的范围仅限于以下的实施例,凡基于本发明内容所实现的技术均属于本发明的范围。The present invention will be described in further detail below in conjunction with test examples and specific implementations. However, this should not be understood to mean that the scope of the above-mentioned subject matter of the present invention is limited to the following embodiments. All technologies implemented based on the contents of the present invention belong to the scope of the present invention.
实施例1Example 1
本发明的方案中,不完全摒弃中心库,只是在原来的基础上进行区块链的改造。以表1中元数据信息为例子,首先在创建数据标准中的元数据的时候,就把元数据信息上传到区块链中,在区块链中把元数据信息看着是一种资产,每条数据上传后就会得到一个唯一标志,把得到的唯一标志存到中心库对应的元数据上,如表2所示。因此,这样有人在使用这些元数据的时候,就可以拿着在区块上的唯一标识去获取在区块链上的数据进行比对,由于区块链的特性数据不可篡改,这样就解决了可信的问题。In the solution of the present invention, the central library is not completely abandoned, but the blockchain is transformed on the original basis. Taking the metadata information in Table 1 as an example, first when creating the metadata in the data standard, the metadata information is uploaded to the blockchain. In the blockchain, the metadata information is regarded as an asset. After each piece of data is uploaded, a unique identifier will be obtained, and the unique identifier will be stored in the corresponding metadata of the central library, as shown in Table 2. Therefore, when someone uses these metadata, they can use the unique identifier on the block to obtain the data on the blockchain for comparison. Since the characteristic data of the blockchain cannot be tampered with, this solves the problem. Credible questions.
表1元数据信息示例Table 1 Example of metadata information
表2带有区块标识的元数据格式示例Table 2 Example of metadata format with block identification
一种基于区块链的数据标准管理方法的流程图如图1所述,该方法包括以下步骤:The flow chart of a blockchain-based data standard management method is shown in Figure 1. The method includes the following steps:
创建元数据时,把元数据信息上传到区块链,获取每一条元数据信息的唯一标识编码。When creating metadata, upload the metadata information to the blockchain and obtain the unique identification code of each piece of metadata information.
第一步,将原始的元数据转换为json格式,得到json格式的元数据;The first step is to convert the original metadata into json format to obtain metadata in json format;
第二步,对json格式的元数据进行运算,得到每条json格式的元数据对应的json字符串;The second step is to perform operations on the metadata in json format to obtain the json string corresponding to each piece of metadata in json format;
第三步,对json字符串进行md5加密算法,得到md5加密字符串;The third step is to perform the md5 encryption algorithm on the json string to obtain the md5 encrypted string;
第四步,将json字符串、json字符串相应的md5加密字符串、表名、相关的描述、更改前信息来源和当前元数据版本组合成区块链上的元数据信息, json字符串相应的md5加密字符串是所述元数据信息的唯一标识编码。The fourth step is to combine the json string, the corresponding md5 encrypted string of the json string, the table name, the relevant description, the source of the information before the change and the current metadata version into the metadata information on the blockchain, and the corresponding json string The md5 encrypted string is a unique identification encoding of the metadata information.
换方法。元数据信息在链下数据存储方式如图2所示。每一条数据包括了九类数据,分别是“table_code”、“meta_code”、“meta_name”、“meta_cn_name”、“meta_type”、“meta_len”、“meta_constraint”、“meta_valuie_space”。Change the method. The way metadata information is stored off-chain is shown in Figure 2. Each piece of data includes nine types of data, namely "table_code", "meta_code", "meta_name", "meta_cn_name", "meta_type", "meta_len", "meta_constraint", and "meta_valuie_space".
第一步,通过将委员会表的元数据转换为json格式;The first step is by converting the metadata of the committee table into json format;
第二步,使用JSON.stringify(metaJson)函数得到每条数据对应的json字符串;In the second step, use the JSON.stringify(metaJson) function to get the json string corresponding to each piece of data;
第三步,对json字符串进行md5加密算法,得到md5加密字符串,例如:The third step is to perform the md5 encryption algorithm on the json string to obtain the md5 encrypted string, for example:
json字符串如图3所示,通过Var md5Str=md5(metaJsonStr)这一函数式,得到相应的md5加密字符串为:The json string is shown in Figure 3. Through the functional formula Var md5Str=md5(metaJsonStr), the corresponding md5 encrypted string is obtained:
md5Str = F5B89BEC77BD75374AED6F13BFD8798Dmd5Str = F5B89BEC77BD75374AED6F13BFD8798D
第四步,委员会表的元数据json字符串(data),及相应的MD5加密算法得到的加密串(tx_id),再加上表名(table_name)、相关的描述(desc)、从区块上的哪条元数据信息更改而来(update_from)、当前元数据版本(version)。这些信息共同组成区块上的元数据信息(也就是区块中的一个交易信息),其结构如图4所示。table_name定义为被元数据所描述的表名称;Desc定义为对元数据的描述;data定义为元数据的详细数据,采用json字符串的方式存储;tx_id是对元数据MD5加密后字符串,也是元数据在区块上的唯一标识;update_from是更新前的元数据tx_id,可用来寻找更新前的元数据信息地址;Version是当前元数据的版本信息。The fourth step is the metadata json string (data) of the committee table, and the encrypted string (tx_id) obtained by the corresponding MD5 encryption algorithm, plus the table name (table_name), related description (desc), and the data from the block. Which piece of metadata information was changed from (update_from), and the current metadata version (version). These information together constitute the metadata information on the block (that is, a transaction information in the block), and its structure is shown in Figure 4. table_name is defined as the name of the table described by the metadata; Desc is defined as the description of the metadata; data is defined as the detailed data of the metadata, stored in the form of a json string; tx_id is the MD5 encrypted string of the metadata, which is also The unique identifier of metadata on the block; update_from is the metadata tx_id before the update, which can be used to find the address of the metadata information before the update; Version is the version information of the current metadata.
作为优选方案,每次向链上新增的元数据信息时,update_from为null,每次对链上的元数据信息进行更改时,update_from保存元数据更新前的元数据tx_id。As a preferred solution, every time when metadata information is added to the chain, update_from is null. Every time when the metadata information on the chain is changed, update_from saves the metadata tx_id before the metadata is updated.
作为优选方案,新增元数据通过上述第一步到第四步,添加到区块链上之后,如图2所示的元数据信息增加tx_id字段,保存对元数据MD5加密后字符串,也即是保存元数据在区块上的唯一标识,存储格式如图5所示。As a preferred solution, after the new metadata is added to the blockchain through the above steps one to four, the metadata information shown in Figure 2 adds a tx_id field and saves the MD5 encrypted string of the metadata. That is, the unique identifier of the saved metadata on the block. The storage format is shown in Figure 5.
元数据在区块中的结构如图6所示,委员会表的元数据在区块中是一条交易数据,每次更改其元数据信息,就在区块中形成一个新的交易数据,可以通过update_from形成元数据更改链条,而链下可以使用链码通过tx_id对链上的元数据信息进行访问。如要访问TX02的元数据,调用fabric的链码get方法,并将tx_id=md-02作为参数传入,即可从链上查询出TX02中的元数据信息。The structure of metadata in the block is shown in Figure 6. The metadata of the committee table is a piece of transaction data in the block. Every time its metadata information is changed, a new transaction data is formed in the block, which can be passed update_from forms a metadata change chain, and the chain code can be used under the chain to access the metadata information on the chain through tx_id. If you want to access the metadata of TX02, call the fabric's chaincode get method and pass in tx_id=md-02 as a parameter to query the metadata information in TX02 from the chain.
当使用元数据的组织需要对获取的元数据进行验真时,具体方法如下:When an organization using metadata needs to verify the authenticity of the acquired metadata, the specific method is as follows:
如例子中的委员会表需要验证是否链下存储的数据是否被篡改,那么就查询出table_code为GXXX0201的所有元数据信息,把对应得tx_id内容获取到,然后到链上查询出对应的元数据信息,如果通过tx_id在链上没有成功获取到元数据信息,那么该链下的元数据就是被篡改过,如果成功获取到了,那么按照前面区块中元数据初始化的1、2、3步骤把线下元数据的md5加密后的字符串计算出来和下线存储的元数据进行比对,如果不一样说明数据被篡改,反之证明数据没被篡改过,能放心的使用该元数据信息。For example, the committee table in the example needs to verify whether the data stored off-chain has been tampered with, then query all metadata information with table_code GXXX0201, obtain the corresponding tx_id content, and then query the corresponding metadata information on the chain. , if the metadata information is not successfully obtained on the chain through tx_id, then the metadata under the chain has been tampered with. If it is successfully obtained, then follow steps 1, 2, and 3 of the metadata initialization in the previous block. Calculate the md5 encrypted string of the offline metadata and compare it with the metadata stored offline. If they are different, it means that the data has been tampered with. Otherwise, it proves that the data has not been tampered with, and you can use the metadata information with confidence.
作为优选方案,本发明还包括区块中元数据的维护,元数据维护主要分为三个步骤:As a preferred solution, the present invention also includes the maintenance of metadata in blocks. Metadata maintenance is mainly divided into three steps:
1)数据的准备1) Data preparation
2)链上共识的达成2) Reaching consensus on the chain
3)链下数据同步更改3) Synchronous changes to off-chain data
如委员会表的元数据中委员会职责字段的长度(meta_len)由200改为1000,其修改维护过程如下:For example, the length of the committee responsibility field (meta_len) in the metadata of the committee table is changed from 200 to 1000. The modification and maintenance process is as follows:
1)数据的准备1) Data preparation
a)找到要更改元数据的md5字符串,也就是tx_id,此处找到的tx_id为:a) Find the md5 string whose metadata you want to change, that is, tx_id. The tx_id found here is:
F5B89BEC77BD75374AED6F13BFD8798D,tx_id将用在新的链上元数据交易信息的update_from中。F5B89BEC77BD75374AED6F13BFD8798D, tx_id will be used in update_from of the new on-chain metadata transaction information.
b)按照元数据上链初始化过程将更改后的元数据信息转换为链上数据结构,如图7所示。b) Convert the changed metadata information into an on-chain data structure according to the metadata on-chain initialization process, as shown in Figure 7.
2)链上共识的达成2) Reaching consensus on the chain
当组织发起更改链上元数据的时,链上区块的机制就会询问其他背书组织是否允许修改,只有满足了背书策略中允许的条件后,通过排序节点将数据广播到各个记账节点上,记账节点将接受到的数据放入区块中,过程如图8所示。When an organization initiates changes to metadata on the chain, the mechanism of the block on the chain will ask other endorsing organizations whether modifications are allowed. Only when the conditions allowed in the endorsement policy are met, the data will be broadcast to each accounting node through the sorting node. , the accounting node puts the received data into the block, and the process is shown in Figure 8.
具体步骤的流程如图9所示,步骤包括:The specific step process is shown in Figure 9. The steps include:
C1、构建组织通道,组织通道包含多个组织节点,组织节点与使用数据标准中的元数据的组织一一对应,并且组织被许可在组织通道中发起元数据修改请求;C1. Build an organization channel. The organization channel contains multiple organization nodes. The organization nodes correspond one-to-one with organizations that use metadata in the data standard, and organizations are allowed to initiate metadata modification requests in the organization channel;
C2、其中一个组织节点发起修改元数据的请求,并构建修改提案;C2. One of the organization nodes initiates a request to modify metadata and constructs a modification proposal;
C3、组织通道中的背书节点根据修改提案的内容和组织通道的构建信息,对修改提案进行验证,当验证通过,则生成交易结果;C3. The endorsement node in the organization channel verifies the modification proposal based on the content of the modification proposal and the construction information of the organization channel. When the verification passes, the transaction result is generated;
C4、根据交易结果和背书节点的签名,生成提案响应;C4. Generate a proposal response based on the transaction results and the signature of the endorsement node;
C5、判断提案响应是否满足预先的背书策略,若满足,则将修改提案按照时间顺序打包成区块;C5. Determine whether the proposal response meets the pre-endorsement policy. If so, package the modified proposal into blocks in chronological order;
C6、每一个组织节点对区块中的修改提案进行验证,如果区块中的修改提案没变化,则区块的交易标记为有效;C6. Each organization node verifies the modification proposal in the block. If the modification proposal in the block has not changed, the transaction in the block is marked as valid;
C7、当区块的交易标记为有效时,对链上的元数据进行修改。C7. When the transaction of the block is marked as valid, the metadata on the chain is modified.
以图8为例具体说明联盟链实现链上审核和元数据更改的过程,过程如下:Taking Figure 8 as an example to specifically illustrate the process of the alliance chain implementing on-chain auditing and metadata changes, the process is as follows:
2.1、假设条件:2.1. Assumptions:
1)已经设置了一个通道MDChannel,该通道正常运行,通道上分别有组织org1、org2、org3、org4、org5,分别对应节点peerA、peerB、peerC、peerD、peerE,5个组织都已经使用组织的 CA 注册和登记完成,并且拿到了用于在网络中用确认身份的加密材料。1) A channel MDChannel has been set up. The channel is running normally. There are organizations org1, org2, org3, org4, and org5 on the channel, which correspond to nodes peerA, peerB, peerC, peerD, and peerE respectively. All five organizations have used the organization's The CA registration and registration are completed, and the encryption materials used to confirm identity in the network are obtained.
2)修改链上原始数据的链码MDChiancode均在peerA-peerE上安装完成了初始化,且都得到上述五个组织的认可,链码MDChiancode定义了修改元数据的方法,链码也设置了一个背书策略,该策略是每一次元数据修改都必须被五个组织的节点都签名。2) The chain code MDChiancode that modifies the original data on the chain has been installed and initialized on peerA-peerE, and has been recognized by the above five organizations. The chaincode MDChiancode defines the method of modifying metadata, and the chaincode also sets an endorsement. The policy is that every metadata modification must be signed by the nodes of the five organizations.
3)权限定义:org1和org2可发起元数据更改请求,org3、org4、org5仅能查看。3) Permission definition: org1 and org2 can initiate metadata change requests, org3, org4, and org5 can only view it.
4)修改元数据的请求只有在5个组织都同意的情况下,才会触发链码MDChiancode对元数据进行修改。4) A request to modify metadata will trigger the chain code MDChiancode to modify the metadata only if all five organizations agree.
2.2、组织org1发起一个修改元数据请求2.2. Organization org1 initiates a metadata modification request
组织org1发送一个元数据修改请求。该请求会到达peerA、peerB、peerC、peerD、peerE。然后,要构建一个修改提案。提案是带有确定输入参数的调用链码方法的请求。该请求的作用就是修改链码上的元数据。Organization org1 sends a metadata modification request. The request will reach peerA, peerB, peerC, peerD, peerE. Then, a revision proposal is constructed. A proposal is a request to invoke a chaincode method with certain input parameters. The purpose of this request is to modify the metadata on the chaincode.
2.3、背书节点验证签名并执行交易2.3. The endorsement node verifies the signature and executes the transaction
背书节点验证(1)修改提案的格式完整,(2)且验证该提案之前没有被提交过(3)验证签名是有效的(使用 MSP),(4)验证发起者(在这个例子中是org1)有权在该通道上执行该操作(也就是说,每个背书节点确保发起者满足通道 Writers 策略)。背书节点将提案输入作为调用的链码函数的参数。然后根据当前状态数据库执行链码,生成交易结果,包括响应值、写集(即表示要更新的元数据的键值对)。但并没有对账本进行更新。这些值以及背书节点的签名会一起作为“提案响应”返回到 SDK,SDK 会为应用程序解析该响应。The endorsing node verifies (1) that the format of the modified proposal is complete, (2) that the proposal has not been submitted before, (3) that the signature is valid (using MSP), and (4) that the initiator (org1 in this example) ) has the authority to perform the operation on the channel (that is, each endorsing node ensures that the initiator satisfies the channel Writers policy). The endorsing node takes the proposal input as an argument to the chaincode function called. Then the chain code is executed based on the current state of the database to generate transaction results, including response values and write sets (that is, key-value pairs representing the metadata to be updated). But the ledger was not updated. These values, along with the signature of the endorsing node, are returned to the SDK as a "proposal response", which is parsed by the SDK for the application.
2.4、检查提案响应,广播给排序服务2.4. Check the proposal response and broadcast to the sorting service
应用程序验证背书节点的签名,并比较这些修改提案响应,以确定其是否相同,是否满足指定的背书策略(即 peerA -peerE 都要背书)。满足条件后将修改提案给排序服务,排序服务接受提案,按时间排序并将其打包成区块。The application verifies the signature of the endorsing node and compares these modification proposal responses to determine whether they are identical and satisfy the specified endorsement policy (i.e. peerA -peerE all endorse). After the conditions are met, the modified proposal is sent to the sorting service. The sorting service accepts the proposal, sorts it by time and packages it into blocks.
2.5、验证和提交交易2.5. Verify and submit transactions
排序服务打包后的区块被“发送”给通道上的所有 Peer 节点。对区块内的修改提案进行验证,以确保满足背书策略,并确保从步骤3执行提案生成读集以来,读集中变量的账本状态没有变化。如果没有变化,块中的交易会被标记为有效。The blocks packaged by the ordering service are "sent" to all Peer nodes on the channel. Modification proposals within the block are verified to ensure that the endorsement policy is met and that the ledger status of the variables in the read set has not changed since step 3 when the proposal was executed to generate the read set. If there are no changes, the transactions in the block are marked as valid.
2.6、对链上的元数据进行修改2.6. Modify metadata on the chain
每个 Peer 节点都将区块追加到通道的链上,对于每个有效的修改,写集都提交到当前状态数据库。系统会发出一个事件,通知客户端应用程序本次元数据修改已被不可更改地附加到链上,同时还会通知交易验证结果是有效的。Each peer appends a block to the channel's chain, and for each valid modification, a write set is committed to the current state database. The system will emit an event to notify the client application that this metadata modification has been immutably attached to the chain, and will also notify the transaction verification result that it is valid.
以上方式就实现多方共同维护管理标准元数据,并且每一次对元数据的修改过程都会在链上被记录下来。The above method enables multiple parties to jointly maintain and manage standard metadata, and every modification process of metadata will be recorded on the chain.
1)链下数据同步更改1) Synchronous changes to off-chain data
链上数据修改完成后,fabric向链下发送结果消息,如果修改成功,链下数据一并修改,并把tx_id改为链上最新版本的tx_id,举例中就是把tx_id由After the on-chain data modification is completed, the fabric sends the result message to the off-chain. If the modification is successful, the off-chain data will be modified together, and the tx_id will be changed to the latest version of tx_id on the chain. In the example, tx_id will be changed from
F5B89BEC77BD75374AED6F13BFD8798DF5B89BEC77BD75374AED6F13BFD8798D
改为Change to
B19542B9C3A8D9EAD40401787415A653。B19542B9C3A8D9EAD40401787415A653.
以上所述仅为本发明的较佳实施例而己,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011303107.5A CN112417517B (en) | 2020-11-19 | 2020-11-19 | A data standard management method based on blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011303107.5A CN112417517B (en) | 2020-11-19 | 2020-11-19 | A data standard management method based on blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112417517A CN112417517A (en) | 2021-02-26 |
CN112417517B true CN112417517B (en) | 2023-11-28 |
Family
ID=74773123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011303107.5A Active CN112417517B (en) | 2020-11-19 | 2020-11-19 | A data standard management method based on blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112417517B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113469713A (en) * | 2021-07-21 | 2021-10-01 | 贵州大学 | Block chain-based food data anti-counterfeiting tracing method and system |
CN113469712A (en) * | 2021-07-21 | 2021-10-01 | 贵州大学 | Food multi-source heterogeneous data integration method and system based on block chain technology |
CN116596197A (en) * | 2023-07-18 | 2023-08-15 | 青岛博什兰物联技术有限公司 | Standard public service platform based on block chain technology |
CN117271528B (en) * | 2023-11-16 | 2024-02-06 | 佳瑛科技有限公司 | Table key character storage method and system based on block chain technology |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017136879A1 (en) * | 2016-02-08 | 2017-08-17 | Moloney Lindsay | A system and method for document information authenticity verification |
CN108664770A (en) * | 2018-05-22 | 2018-10-16 | 上海七印信息科技有限公司 | There are methods of proof for a kind of high confidence level based on block chain technology |
CN110691078A (en) * | 2019-09-25 | 2020-01-14 | 东北大学 | Block chain-based data dynamic reliability verification method |
CN110765205A (en) * | 2019-10-12 | 2020-02-07 | 中思博安科技(北京)有限公司 | Block chain based metadata management method, system and computer storage medium |
CN111563130A (en) * | 2020-07-15 | 2020-08-21 | 成都无右区块链科技有限公司 | Data credible data management method and system based on block chain technology |
-
2020
- 2020-11-19 CN CN202011303107.5A patent/CN112417517B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017136879A1 (en) * | 2016-02-08 | 2017-08-17 | Moloney Lindsay | A system and method for document information authenticity verification |
CN108664770A (en) * | 2018-05-22 | 2018-10-16 | 上海七印信息科技有限公司 | There are methods of proof for a kind of high confidence level based on block chain technology |
CN110691078A (en) * | 2019-09-25 | 2020-01-14 | 东北大学 | Block chain-based data dynamic reliability verification method |
CN110765205A (en) * | 2019-10-12 | 2020-02-07 | 中思博安科技(北京)有限公司 | Block chain based metadata management method, system and computer storage medium |
CN111563130A (en) * | 2020-07-15 | 2020-08-21 | 成都无右区块链科技有限公司 | Data credible data management method and system based on block chain technology |
Also Published As
Publication number | Publication date |
---|---|
CN112417517A (en) | 2021-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112417517B (en) | A data standard management method based on blockchain | |
US11921682B2 (en) | Extracting data from a blockchain network | |
US11201747B2 (en) | Federated data management between partner systems | |
CN112154434B (en) | Automatic data projection of smart contract groups on blockchain | |
CA3136622A1 (en) | Systems, devices, and methods for dlt-based data management platforms and data products | |
Chen et al. | DS2PM: A data-sharing privacy protection model based on blockchain and federated learning | |
US11880383B2 (en) | Federated data management between partner systems | |
CN114978684B (en) | PBFT consensus method based on improved condensation hierarchical clustering | |
Sasikumar et al. | Blockchain-assisted hierarchical attribute-based encryption scheme for secure information sharing in industrial internet of things | |
CN111680041A (en) | Safe and efficient access method for heterogeneous data | |
Manevich et al. | Endorsement in Hyperledger Fabric via service discovery | |
CN116467026A (en) | Cloud desktop data secure sharing and tracing method and system based on blockchain | |
Xu et al. | [Retracted] Urban Fruit Quality Traceability Model Based on Smart Contract for Internet of Things | |
Ruan et al. | LedgerView: access-control views on hyperledger fabric | |
CN116258309A (en) | Business object life cycle management and tracing method and device based on block chain | |
US20220114193A1 (en) | Systems and methods for data management | |
Lu et al. | ATMChain: Blockchain‐Based Security Framework for Cyber‐Physics System in Air Traffic Management | |
Zhu | [Retracted] Research on Real‐Time Tracking Algorithm of E‐Commerce Logistics Information Based on Blockchain Technology | |
Datta et al. | Blockchain-based secure and scalable supply chain management system to prevent drug counterfeiting | |
Ciatto et al. | Blockchain for trustworthy coordination: a first study with Linda and Ethereum | |
CN117640774A (en) | Data asset identification processing system | |
Lu et al. | Temporal Index Scheme of Hyperledger Fabric System in IoT | |
Barahmand et al. | Extensions of BG for testing and benchmarking alternative implementations of feed following | |
Fang et al. | Research on the application of blockchain in supply chain information sharing | |
WO2020123361A1 (en) | Systems and methods for data management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250305 Address after: 430000 Room 03, 30th Floor, Unit 1, Building 1, Weipengpenghu Bay Phase I, Culture Avenue, Daqiao New District, Jiangxia District, Wuhan City, Hubei Province Patentee after: Wuhan Yiwen Technology Co.,Ltd. Country or region after: China Address before: No. 1-2001-01, building 10, No. 399, west section of Fucheng Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610094 Patentee before: Chengdu Wuyou blockchain Technology Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250611 Address after: 310000 Zhejiang Province, Hangzhou City, Xihu District, Wen San Road 90, Building 5, 3rd Floor, North Room 303 Patentee after: Hangzhou Yixin Information Engineering Consulting Co.,Ltd. Country or region after: China Address before: 430000 Room 03, 30th Floor, Unit 1, Building 1, Weipengpenghu Bay Phase I, Culture Avenue, Daqiao New District, Jiangxia District, Wuhan City, Hubei Province Patentee before: Wuhan Yiwen Technology Co.,Ltd. Country or region before: China |