WO2021227319A1 - 一种工程协作区块链数据结构及应用方法 - Google Patents

一种工程协作区块链数据结构及应用方法 Download PDF

Info

Publication number
WO2021227319A1
WO2021227319A1 PCT/CN2020/115018 CN2020115018W WO2021227319A1 WO 2021227319 A1 WO2021227319 A1 WO 2021227319A1 CN 2020115018 W CN2020115018 W CN 2020115018W WO 2021227319 A1 WO2021227319 A1 WO 2021227319A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
node
temporary
project
side chain
Prior art date
Application number
PCT/CN2020/115018
Other languages
English (en)
French (fr)
Inventor
戴照恩
徐晓城
Original Assignee
南京东垚建筑科技研究院有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 南京东垚建筑科技研究院有限公司 filed Critical 南京东垚建筑科技研究院有限公司
Publication of WO2021227319A1 publication Critical patent/WO2021227319A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention relates to an engineering collaboration block chain data structure and an application method, and belongs to the technical field of engineering block chains.
  • the blockchain system has the characteristics of permanent and safe storage of data and data traceability.
  • the bottom layer of the blockchain is based on a point-to-point distributed network, and traditional blockchain data requires the consensus of the entire network to be updated, resulting in its efficiency And the adaptability is not high.
  • Blockchain technology can effectively control the authenticity of data and trace historical data.
  • version management multiple versions are often synchronized in the project. If all these versions of specific data are stored on the entire network using traditional blockchain technology, it will consume a lot of resources, most of which may have no effect in actual production and supervision. If only the key version is used for blockchain storage, then only when a new block is generated, the nodes of the entire network can know the version changes from the previous version to the present, so that real-time information sharing cannot be achieved.
  • the technical problem to be solved by the present invention is to provide an engineering collaboration blockchain data structure.
  • the present invention designs an engineering collaboration blockchain data structure, including a main chain and various side chains, wherein the main chain is used to maintain the common relationship between the various engineering projects. Data object, each side chain corresponds to a project;
  • the MRT tree of project basic information and the MRT tree of project member addresses are set on the main chain.
  • the basic information of each project is realized Storage on the corresponding leaf node;
  • project member address MRT tree based on the correspondence between the corresponding address of each project and each leaf node, realize the storage of the member address list in each project on the corresponding leaf node;
  • the member address MPT tree and the application data MRT tree are respectively set on each side chain. Among them, on the member address MPT tree, based on the corresponding relationship between the corresponding address of each member and each leaf node, the corresponding application data Hash of each member is realized The value is stored in the current_version field in the corresponding leaf node; the value field of the leaf node on the application data MRT tree contains at least one name field and a field for storing application data or a field for application data location pointers;
  • each side chain defines each block sequentially generated along the time sequence on the side chain as a permanent block, and introduce each temporary block between adjacent permanent blocks based on the time sequence; After obtaining the latest permanent block, use the permanent block as a demarcation block.
  • each The iterative generation of temporary blocks, and finally at the preset time of intervention, through the preset consensus mechanism the merger of the temporary blocks is realized, and the next permanent block is obtained, and the permanent block contains the information of the merged temporary blocks.
  • Information, and so on, are executed in order to realize the generation of blockchain on the side chain.
  • the block header of each temporary block includes the parent block Hash, the Number field of the corresponding demarcation block serial number, the Hierarchy Number field, the application data version ID, the author signature public key, and the version Abstract Hash, version summary Hash is used to describe the updated data or record the third-party link, and is not limited to the data upload format in the permanent block specified by the side chain;
  • the block header of the permanent block contains the parent block Hash, the Number field of the corresponding demarcation block serial number, the Hierarchy Number field, the author's signature public key, and the temporary version tree root Hash, and the Hierarchy Number field in the permanent block is always Is 0.
  • the technical problem to be solved by the present invention is to provide an application method of the engineering collaboration blockchain data structure.
  • the corresponding engineering landing system architecture is built for application, which improves the engineering field for various purposes. Collaboration and management performance improve the efficiency of actual production and engineering development.
  • the present invention designs an application method of engineering collaboration blockchain data structure, including a side chain update temporary block method, that is, each side chain is executed according to the following steps:
  • Step A1 Generate a permanent block on the side chain, set the block chain status of the side chain to 0, and set that any node in the distributed network with the authority of the side chain is allowed to generate temporary blocks at this time, and it is not allowed At this time, any node initiates a consensus on a permanent block, and at the same time, the network composed of all nodes with the authority of the side chain is called the entire network of the target project.
  • the terminals of all nodes monitor the submission of temporary blocks in the entire network of the target project, and then Go to step A2;
  • Step A2 Use the newly generated permanent block on the side chain as the demarcation block, and then proceed to step A3;
  • Step A3 When member X1 completes an application data update, the node where member X1 is located sends the application data update event to the entire network of the target project, requesting to update the temporary block, where the application data update event includes the Number field in the boundary block , And the maximum value of the Hierarchy Number field of the temporary block in the entire network of the target project, and then go to step A4;
  • Step A4. The other nodes in the entire network of the target project respectively receive the application for updating the temporary block. For the received application data update event, the other nodes respectively compare the information in the application data update event with the information on the temporary block in their own node. Comparison, according to the following different comparison results, perform different further processing respectively;
  • the Number field is the same as the Number field and Hierarchy on the temporary block in its own node.
  • the Number fields are consistent, it means that the data on the node is consistent with the data in the application data update event sent by the node where the member X1 is located, and the node returns TRUE to the member X1 and proceeds to step A6;
  • the Number field is greater than the Hierarchy Number field on the temporary block in its own node, indicating that the node where the data lags behind the node where the member X1 is sending the data in the application data update event, then the node requests the application data from the node where the member X1 is located, until the node is temporarily
  • the Hierarchy Number field on the block is consistent with the Hierarchy Number field in the application data update event, and then the node returns TRUE to the member X1 and proceeds to step A6;
  • Hierarchy Number field in the application data update event is less than the Hierarchy Number field on the temporary block in its own node, it means that the node where the data is ahead of member X1 sends the data in the application data update event, and the node returns FALSE to member X1 , And go to step A5;
  • Step A5. The node where the member X1 is located requests synchronization data from the node that sent FALSE, and returns to step A3;
  • Step A6 The node where member X1 is located obtains the parent version of the latest updated application data, and obtains the Hash of the parent block in the updated temporary block.
  • the node where member X1 is located is for the temporary block Hierarchy in the entire network of the target project The maximum value of the Number field is increased by 1 to obtain the Hierarchy in the updated temporary block The value of the Number field, and generate the application data version ID in the updated temporary block according to the preset format, and then go to step A7;
  • Step A7 Based on the node where member X1 is located and based on the version ID and version summary Hash, confirm and sign all the information, and then combine the value of the Number field of the demarcation block to generate a temporary block and broadcast it to the entire network of the target project. Each node receives the temporary block and updates the temporary block of the node itself.
  • step A4 when any other node receives the request for updating the temporary block and returns TRUE to the node where the member X1 is located, the node enters the state of waiting for update, and no longer Send an update request.
  • the system based on the generation of the temporary block in the step A7, according to the reference of the temporary block to the parent block, the system also includes a disjoint collective forest constructed for all temporary blocks .
  • each side chain is executed according to the following steps:
  • Step B1 The node of the project decision maker corresponding to the side chain sends a permanent block update application event to the entire network of the target project, and other nodes in the entire network of the target project pass the method from step A4 to step A5, and set the side chain
  • the blockchain status is 1, no more new block update events are accepted, and step B2 is entered;
  • Step B2 The node where the project decision maker is located calls the query function, obtains the collective forest of the temporary block to which the current boundary block belongs, and generates the temporary version tree root Hash, and then proceeds to step B3;
  • Step B3 The node where the project decision maker is located uploads the latest complete application data that needs to update the official version, combines the obtained temporary version tree root Hash to generate the current permanent block, and then proceeds to step B4;
  • Step B4 The node where the project decision maker is located realizes the inheritance of the current permanent block from the temporary block collective forest corresponding to the previous permanent block, and then proceeds to step B5;
  • Step B5. The node where the project decision maker is located broadcasts the current permanent block and the temporary block collective forest inherited by the current permanent block to the entire network of the target project, and then proceeds to step B6;
  • Step B6 Specify the broadcast of the node where the project decision maker is located, obtain the multi-party signature of the node where each member is specified in advance, and then proceed to step B7;
  • Step B7 After other nodes in the entire network of the target project receive the broadcast, they will use the preset consensus algorithm to verify the data consistency of the nodes in the entire network of the target project. If the verification is passed, proceed to step B9; if the verification fails, proceed to step B8;
  • Step B8 All nodes in the network-wide synchronization of the target project maintain the original data state, and set the block chain state of the side chain to 0;
  • Step B9 The node where the project decision maker is located synchronizes the current permanent block on the entire network of the target project, and sets the current permanent block as the new demarcation block, and then the block chain status of the side chain is 0, and then enters the step B10;
  • Step B10 Link the temporary block collection forest inherited in Step B4 to the current permanent block.
  • step B2 according to the Hierarchy in each temporary block Number field values are sorted in ascending order.
  • step B3 after the current permanent block is generated, in the application data MRT tree of the side chain, the current permanent block updates the application data from the previous official version to the current official version. Version.
  • the node where the project decision-maker is located deletes the tree about the old version of the application data in the temporary block set forest under the previous permanent block, and for the remaining trees, press Hierarchy Number sorting, starting from the root block of the tree, relinking to the current permanent block, realizing the inheritance of the current permanent block from the temporary block set forest corresponding to the previous permanent block, and then proceeding to step B5.
  • the data structure and application method of the engineering collaboration blockchain designed by the present invention is aimed at engineering projects, introducing blockchain technology, and designing the main chain to maintain common data objects between various engineering projects, and each side chain corresponds to an engineering project.
  • the data structure and application method of the engineering collaboration blockchain designed by the present invention is aimed at engineering projects, introducing blockchain technology, and designing the main chain to maintain common data objects between various engineering projects, and each side chain corresponds to an engineering project.
  • Through the collaborative synchronization of various engineering projects based on the blockchain the efficiency of data security, permanent storage, and traceability is realized, and the corresponding project landing system is built with data structure design, and the specific application method is constructed, including the temporary area of side chain update
  • the block method and the side chain update permanent block method are designed through each group of specific logical steps to improve the collaboration and management performance of each engineering project in the engineering field, and improve the efficiency of actual production and engineering development.
  • Figure 1 is a schematic diagram of the personnel structure of multiple companies and multiple people participating in the development of the same project
  • Figure 2 is a schematic diagram of a main multi-side structure
  • Figure 3 is a schematic diagram of temporary version iterations that may appear between a certain official version and the next official version;
  • Figure 4 is a schematic diagram of part of the key data contained in the respective block headers of the permanent block and the temporary block;
  • Figure 5 is a schematic diagram of the improved project side chain block structure
  • Figure 6 is a schematic diagram of the status and steps of the side chain updating temporary block method
  • Figure 7 is a schematic diagram of the status and steps of the side chain updating permanent block method.
  • the consensus mechanism adopts the Byzantine fault-tolerant consensus algorithm (ie PBFT, abbreviations are used uniformly when mentioned below).
  • PBFT Byzantine fault-tolerant consensus algorithm
  • the data that the project needs to manage is the CAD design drawing as an example.
  • the reason for adopting the above assumption is that in practical applications, most project partners have a certain degree of trust, rather than completely unfamiliar objects, so the alliance chain structure will be a more representative example.
  • the CAD drawing is also a typical data type that requires frequent changes and multiple versions in parallel, and the data volume is large.
  • Project A is jointly developed by companies X and Y, and the data involved is mainly CAD drawings.
  • the development team of company X has three members X1, X2, and X3, and the development team of company Y has two members Y1 and Y2.
  • the two companies have their own internal data platforms 1 and 2, but they are obviously out of confidentiality considerations.
  • the data status is not updated in real time between platforms 1 and 2.
  • company X has made an update to the shared design drawing and needs to notify Y, a member of X needs to send the drawing to Y through the intermediary software.
  • the present invention designs an engineering collaboration blockchain data structure, as shown in Figure 2, including a main chain and various side chains.
  • the main chain is used to maintain common data objects between various engineering projects.
  • Each side chain corresponds to an engineering project.
  • the MRT tree of project basic information and the MRT tree of project member addresses are set on the main chain.
  • each project is realized based on the correspondence between the corresponding address of each project and each leaf node.
  • the basic information of the project is stored on the corresponding leaf node;
  • the project member address MRT tree based on the corresponding relationship between the corresponding address of each project and each leaf node, realizes that the member address list in each project is on the corresponding leaf node Storage:
  • the project A is created, an address is generated for it, and the Hash value corresponding to its basic information and a member address list are stored in the MPT leaf node or branch node (2) corresponding to the address.
  • the founding block of the side chain of project A is also generated at the same time.
  • the side chain will have different data structures.
  • the system will search the list of members corresponding to Project A on the main chain to verify its authority.
  • the member address MPT tree and the application data MRT tree are respectively set on each side chain. Among them, on the member address MPT tree, based on the corresponding relationship between the corresponding address of each member and each leaf node, the corresponding application data Hash of each member is realized The value is stored in the current_version field in the corresponding leaf node; the value field of the leaf node on the application data MRT tree contains at least one name field and a field for storing application data or a field for application data location pointers; in actual applications, On the side chain of project A, a member address MPT tree and an application data MRT tree are maintained.
  • the application data MRT tree is the drawing version MPT tree.
  • the node value value of the member address MPT tree contains a current_version field, and the drawing version
  • the node value value of the MPT tree contains at least a name field and a field for storing a specific drawing file or its position pointer.
  • each side chain define each block sequentially generated along the time sequence of the side chain as a permanent block, and introduce each temporary block between adjacent permanent blocks based on the time sequence; after obtaining the latest permanent block , The permanent block is regarded as the demarcation block, and the iterative generation of each temporary block is realized based on each update of the corresponding application data by each member in the side chain and each synchronization of the application data between each member in the side chain.
  • the merging of the temporary blocks is realized, and the next permanent block is obtained, and the permanent block contains the information of the merged temporary blocks, and the sequence is executed by analogy. Realize the generation of blockchain on the side chain.
  • the block header of each temporary block includes the parent block Hash, the Number field of the corresponding demarcation block serial number, the Hierarchy Number field, the application data version ID, the author’s signature public key, and the version summary Hash.
  • the version summary Hash is used to update The data is recorded as text description or third-party link, not limited to the data upload format in the permanent block designated by the side chain.
  • the block header of the permanent block contains the parent block Hash, the Number field of the corresponding demarcation block serial number, the Hierarchy Number field, the author's signature public key, and the temporary version tree root Hash, and the Hierarchy Number field in the permanent block is always Is 0.
  • member X1 completes a drawing update, and he uses his address to generate a new block.
  • this block he uses the data corresponding to the new drawing to calculate the Hash value, and updates the value value of the corresponding leaf node of the drawing version MPT tree.
  • other members in the project can view the specific data of the update according to the corresponding Hash value.
  • he updates the current_version field under his address in the member's MPT tree to the Hash value of the version of the drawing.
  • He can write the Mercle tree root (1) composed of multiple Hash values at one time to represent the update of multiple drawings.
  • the system starts from the last block, finds the corresponding author by the signature of the generated block, finds the position of one or more drawings of the last update in the current_version field under it, and determines which ones by the name field The drawings are updated, and continue to go back until the founding block, so as to obtain a complete drawing version update path.
  • the mechanism of the retrospective version is actually basically similar to the mechanism of retrospecting the account balance through transaction Hash.
  • this mechanism will encounter problems in practical engineering applications. Since transactions are irreversible, the balance of the account will actually have a single and clear path when backtracking.
  • the blockchain is designed to avoid the possibility of double-spending attacks. The system will not allow a node to choose more than two different development paths for the same chain.
  • the design version in engineering is likely to have a temporary state of multiple parallel versions, and the sharing of these parallel version information is also important for project collaboration.
  • the new side chain allows two different blocks, namely temporary blocks and permanent blocks; in the block header of the temporary block, in addition to the Number field that displays the block number, there is another Display the Hierarchy Number field of the temporary block level.
  • the block header contains a version summary field, allowing the uploader of the block to only make a text description of the updated content or record the third-party link, not limited to the side The upload format of the design drawing data in the permanent block designated by the chain.
  • the block header of the permanent block also contains the Hierarchy Number field, the difference is that this field is always 0 in the permanent block.
  • the block header also contains a temporary version tree root Hash value. The calculation method of this value will be explained in the following content.
  • the block header of the temporary block contains a version ID field.
  • the value of this field is generated by the system according to a fixed logic.
  • the new project A side chain structure is divided into two parts, with the last permanent block as the demarcation block, which has the largest value of the Number field in all blocks and the value of the Hierarchy Number field is 0 Block.
  • the blocks before this boundary are permanent blocks, forming a single chain, and the blocks after the boundary are temporary blocks, and all temporary blocks are equal to the value of the number field of the boundary block and the Hierarchy Number by retrieving the Number field value.
  • the block whose field value is not 0 is determined.
  • the present invention designs an application method for the engineering collaboration blockchain data structure, including a side chain updating temporary block method and a side chain updating permanent block method, wherein the side chain updating temporary block method, such as As shown in Figure 6, each side chain is executed as follows: Step A1 to Step A7.
  • Step A1 Generate a permanent block on the side chain, set the block chain status of the side chain to 0, and set that any node in the distributed network with the authority of the side chain is allowed to generate temporary blocks at this time, and it is not allowed At this time, any node initiates a consensus on a permanent block, and at the same time, the network composed of all nodes with the authority of the side chain is called the entire network of the target project.
  • the terminals of all nodes monitor the submission of temporary blocks in the entire network of the target project, and then Go to step A2.
  • Step A2. Use the newly generated permanent block on the side chain as the demarcation block, and then proceed to step A3.
  • Step A3 When member X1 completes an application data update, the node where member X1 is located sends the application data update event to the entire network of the target project, requesting to update the temporary block, where the application data update event includes the Number field in the boundary block , And the maximum value of the Hierarchy Number field of the temporary block in the entire network of the target project, and then go to step A4.
  • Step A4. The other nodes in the entire network of the target project respectively receive the application for updating the temporary block. For the received application data update event, the other nodes respectively compare the information in the application data update event with the information on the temporary block in their own node. Comparison, according to the following different comparison results, respectively perform different further processing.
  • the Number field is the same as the Number field and Hierarchy on the temporary block in its own node.
  • the Number fields are consistent, it means that the data on the node is consistent with the data in the application data update event sent by the node where the member X1 is located, and the node returns TRUE to the member X1 and proceeds to step A6.
  • the Number field is greater than the Hierarchy Number field on the temporary block in its own node, indicating that the node where the data lags behind the node where the member X1 is sending the data in the application data update event, then the node requests the application data from the node where the member X1 is located, until the node is temporarily
  • the Hierarchy Number field on the block is consistent with the Hierarchy Number field in the application data update event, and then the node returns TRUE to the member X1 and proceeds to step A6.
  • any other node When any other node receives the request to update the temporary block and returns TRUE to the node where the member X1 is located, the node enters a state of waiting for update and no longer sends an update request.
  • Hierarchy Number field in the application data update event is less than the Hierarchy Number field on the temporary block in its own node, it means that the node where the data is ahead of member X1 sends the data in the application data update event, and the node returns FALSE to member X1 , And go to step A5.
  • Step A5. The node where the member X1 is located requests synchronization data from the node that sent FALSE, and returns to step A3.
  • Step A6 The node where member X1 is located obtains the parent version of the latest updated application data, and obtains the Hash of the parent block in the updated temporary block.
  • the node where member X1 is located is for the temporary block Hierarchy in the entire network of the target project The maximum value of the Number field is increased by 1 to obtain the Hierarchy in the updated temporary block The value of the Number field is generated and the application data version ID in the updated temporary block is generated according to the preset format, and then step A7 is entered.
  • Step A7 Based on the node where member X1 is located and based on the version ID and version summary Hash, confirm and sign all the information, and then combine the value of the Number field of the demarcation block to generate a temporary block and broadcast it to the entire network of the target project. Each node receives the temporary block and updates the temporary block of the node itself.
  • the system In the generation of the temporary block in step A7, based on the reference of the temporary block to the parent block, the system also includes a disjoint collective forest constructed for all temporary blocks.
  • each side chain is executed according to the following steps B1 to B10.
  • Step B1 The node of the project decision maker corresponding to the side chain sends a permanent block update application event to the entire network of the target project, and other nodes in the entire network of the target project pass the method from step A4 to step A5, and set the side chain
  • the blockchain status is 1, no more new block update events are accepted, and step B2 is entered.
  • Step B2. The node where the project decision maker is located calls the query function, obtains the collective forest of the temporary block to which the current boundary block belongs, and generates the temporary version tree root Hash, and then proceeds to step B3.
  • the generation of the root Hash of the temporary version tree is based on the Hierarchy in each temporary block Number field values are sorted in ascending order. First, divide a group by two, calculate and generate the Hash value between the application data corresponding to the two temporary blocks in each group, obtain each intermediate Hash value, and then calculate the adjacent ones in order for each intermediate Hash value. The Hash value between the intermediate Hash values until the final Hash value is obtained as the root Hash of the temporary version tree.
  • Step B3 The node where the project decision maker is located uploads the latest complete application data that needs to update the official version, and combines the obtained temporary version tree root Hash to generate the current permanent block, and then in the application data MRT tree of the side chain, the current permanent area
  • the block updates the application data from the previous official version to the current official version, and then proceeds to step B4.
  • Step B4 The node where the project decision-maker is located deletes the tree about the old version of the application data in the temporary block set forest under the previous permanent block, and sorts the remaining trees by Hierarchy Number, starting from the root block of the tree, and restarting Link to the current permanent block to realize the inheritance of the current permanent block from the temporary block collective forest corresponding to the previous permanent block, and then proceed to step B5.
  • Step B5. The node where the project decision maker is located broadcasts the current permanent block and the temporary block collective forest inherited by the current permanent block to the entire network of the target project, and then proceeds to step B6.
  • Step B6 Specify the broadcast of the node where the project decision maker is located, obtain the multi-party signature of the node where each member is specified in advance, and then proceed to step B7.
  • Step B7 After other nodes in the entire network of the target project receive the broadcast, they will use the preset consensus algorithm to verify the data consistency of the nodes in the entire network of the target project. If the verification is passed, proceed to step B9; if the verification fails, proceed to step B8.
  • Step B8 All nodes in the network-wide synchronization of the target project maintain the original data state, and set the blockchain state of the side chain to 0.
  • Step B9 The node where the project decision maker is located synchronizes the current permanent block on the entire network of the target project, and sets the current permanent block as the new demarcation block, and then the block chain status of the side chain is 0, and then enters the step B10.
  • Step B10 Link the temporary block collection forest inherited in Step B4 to the current permanent block.
  • This technical scheme designs engineering collaboration blockchain data structure and application methods.
  • blockchain technology is introduced, and the main chain is designed to maintain common data objects between engineering projects.
  • Each side chain corresponds to an engineering project.
  • the efficiency of data security, permanent storage, and traceability is realized, and the corresponding project landing system is built with data structure design, and the specific application method is constructed, including the temporary area of side chain update
  • the block method and the side chain update permanent block method are designed through each group of specific logical steps to improve the collaboration and management performance of each engineering project in the engineering field, and improve the efficiency of actual production and engineering development.

Abstract

一种工程协作区块链数据结构及应用方法,针对工程项目,引入区块链技术,设计主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目,通过各工程项目基于区块链的协同同步,实现了数据安全、永久存储、以及可追溯的效率,并以数据结构设计,搭建相应工程落地系统,具体构建应用方法,包括侧链更新临时区块方法和侧链更新永久区块方法,分别通过各组具体化的逻辑步骤设计,改善了工程领域针对各工程项目的协作和管理性能,提高实际生产和工程开发的效率。

Description

一种工程协作区块链数据结构及应用方法 技术领域
本发明涉及一种工程协作区块链数据结构及应用方法,属于工程区块链技术领域。
背景技术
区块链系统具有永久安全存储数据,数据可追溯的特点,但是由于区块链的底层是基于点对点的分布式网络,且传统的区块链数据需要全网络的共识才可以更新,导致其效率和适应性不高。
工程领域中,数据安全是非常重要的一环,但是同时,灵活的版本管理也是一个工程应用必须要具备的条件。
区块链技术可以有效地管控数据的真实性,回溯历史数据,但是在版本管理时,工程中经常会出现多版本同步的情况。如果所有这些版本的具体数据都用传统的区块链技术作全网存储,则会耗费大量资源,其中的大部分数据可能在实际生产和监管中没有任何作用。而如果只在关键版本做区块链存储,那么只有当新区块生成时,全网的节点才能够知道上个版本至今的版本变化,这样无法达成信息的实时共享。
另一方面,工程领域经常涉及跨公司的协作,不同公司间的工程系统存在差异,虽然可以互传固定格式的数据,却没有办法实时同步版本。既要能够灵活地管理工程信息的版本,跨系统同步这些信息,同时又要能够对重要信息做到安全存证可追溯,这就需要对现有的区块链数据结构做一定的改进。
技术问题
本发明所要解决的技术问题是提供一种工程协作区块链数据结构,应用区块链技术确保数据安全和可追溯的前提下,改善工程领域针对各项目的协作和管理性能,提高实际生产和工程开发的效率。
技术解决方案
本发明为了解决上述技术问题采用以下技术方案:本发明设计了一种工程协作区块链数据结构,包括主链、以及各条侧链,其中,主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目;
主链上设定项目基本信息MRT树和项目成员地址MRT树,其中,项目基本信息MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目基本信息在相应树叶节点上的存储;项目成员地址MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目中成员地址列表在在相应树叶节点上的存储;
各条侧链上分别设定成员地址MPT树和应用数据MRT树,其中,成员地址MPT树上,基于各成员所对应地址与各树叶节点之间的对应关系,实现各成员所对应应用数据Hash值在相应树叶节点中current_version字段的存储;应用数据MRT树上树叶节点的value字段内至少包含一个name字段、以及一个用于存储应用数据的字段或应用数据位置指针的字段;
基于侧链中成员对相应应用数据的更新,实现侧链上成员地址MPT树和应用数据MRT树的更新,以及实现主链上项目基本信息MRT树和项目成员地址MRT树的更新。
作为本发明的一种优选技术方案:分别针对各侧链,定义侧链上沿时序依次生成的各区块分别为永久区块,并基于时序在相邻永久区块之间引入各临时区块;在获得最新永久区块后,将该永久区块作为分界区块,基于侧链中各成员对相应应用数据的每次更新、以及侧链中各成员之间应用数据的每次同步,实现各临时区块的迭代生成,最后在预设介入时间点,通过预设共识机制,实现各临时区块的合并,获得下一个永久区块,且该永久区块中包含所合并各临时区块的信息,依次类推顺序执行,实现侧链上区块链的生成。
作为本发明的一种优选技术方案:所述各临时区块的区块头包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、应用数据版本ID、作者签名公钥、版本摘要Hash,版本摘要Hash用于对更新数据做文字描述或第三方链接的记录,而不限于侧链所指定永久区块内的数据上传格式;
所述永久区块的区块头中包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、作者签名公钥、临时版本树根Hash,且永久区块中该Hierarchy Number字段始终为0。
与上述相对应,本发明还要解决的技术问题是提供一种工程协作区块链数据结构的应用方法,基于设计数据结构,搭建相应工程落地系统架构进行应用,改善了工程领域针对各项目的协作和管理性能,提高实际生产和工程开发的效率。
本发明为了解决上述技术问题采用以下技术方案:本发明设计了一种工程协作区块链数据结构的应用方法,包括侧链更新临时区块方法,即各个侧链分别按如下步骤执行:
步骤A1. 侧链上生成永久区块,设定该侧链的区块链状态为0,并设定此时允许分布式网络内任何具有该侧链权限的节点生成临时区块,并且不允许此时任何节点发起永久区块的共识,同时将具有该侧链权限的所有节点组成的网络称为目标项目全网,所有节点的终端在目标项目全网内监听临时区块的提交申请,然后进入步骤A2;
步骤A2. 将侧链上最新生成的永久区块作为分界区块,然后进入步骤A3;
步骤A3. 当成员X1完成一次应用数据的更新,成员X1所在节点向目标项目全网发送该应用数据更新事件,申请更新临时区块,其中,应用数据更新事件中包括分界区块中的Number字段、以及目标项目全网中临时区块的Hierarchy Number字段的最大值,然后进入步骤A4;
步骤A4. 目标项目全网中其他各个节点分别接收更新临时区块申请,针对所接收应用数据更新事件,其他各节点分别将应用数据更新事件中的信息与自身节点中临时区块上的信息进行比较,根据如下不同比较结果,分别执行不同进一步处理;
若应用数据更新事件中的Number字段、Hierarchy Number字段分别与自身节点中临时区块上的Number字段、Hierarchy Number字段均一致时,表示该节点上数据与成员X1所在节点发送应用数据更新事件中的数据一致,该节点向成员X1返回TRUE,并进入步骤A6;
若应用数据更新事件中的Hierarchy Number字段大于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据滞后成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1所在节点请求应用数据,直到节点中临时区块上的Hierarchy Number字段与应用数据更新事件中的Hierarchy Number字段相一致,然后该节点向成员X1返回TRUE,并进入步骤A6;
若应用数据更新事件中的Hierarchy Number字段小于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据超前成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1返回FALSE,并进入步骤A5;
步骤A5. 成员X1所在节点向发送FALSE的节点请求同步数据,并返回步骤A3;
步骤A6. 成员X1所在节点获得最新更新应用数据的父版本,并获得更新临时区块中父区块Hash,成员X1所在节点针对目标项目全网中临时区块Hierarchy Number字段的最大值进行加1,获得所更新临时区块中Hierarchy Number字段的值,并按预设格式生成所更新临时区块中应用数据版本ID,然后进入步骤A7;
步骤A7. 基于成员X1所在节点并基于版本ID、版本摘要Hash,对全部信息进行确认,并签名,然后结合分界区块的Number字段的值,生成临时区块,并向目标项目全网广播,各个节点接收该临时区块,并对节点自身的临时区块进行更新。
作为本发明的一种优选技术方案:所述步骤A4中,当任何其他节点在收到更新临时区块申请、并向成员X1所在节点返回TRUE后,该节点就进入等待更新的状态,不再发送更新请求。
作为本发明的一种优选技术方案:基于所述步骤A7中,临时区块的生成,根据临时区块对父区块的引用,系统还包括针对所有临时区块构建组成的一个不相交集合森林。
作为本发明的一种优选技术方案:还包括侧链更新永久区块方法,即各个侧链分别按如下步骤执行:
步骤B1. 侧链所对应工程项目决策者所在节点向目标项目全网发送永久区块更新申请事件,目标项目全网中其他各节点通过步骤A4至步骤A5的方法,并设定该侧链的区块链状态为1,不再接受任何新区块更新事件,进入步骤B2;
步骤B2. 工程项目决策者所在节点调用查询功能,获得当前分界区块所属临时区块的集合森林,并生成临时版本树根Hash,然后进入步骤B3;
步骤B3. 工程项目决策者所在节点上传需要更新正式版本的最新完整应用数据,结合所获临时版本树根Hash,生成当前永久区块,然后进入步骤B4;
步骤B4. 工程项目决策者所在节点实现当前永久区块对上一永久区块所对应临时区块集合森林的继承,然后进入步骤B5;
步骤B5. 工程项目决策者所在节点向目标项目全网广播当前永久区块、以及当前永久区块所继承的临时区块集合森林,然后进入步骤B6;
步骤B6. 指定工程项目决策者所在节点的广播,获得预先指定各成员所在节点的多方签名,然后进入步骤B7;
步骤B7. 目标项目全网中其他节点收到广播后,通过预设共识算法实现目标项目全网中节点数据一致性的验证,若验证通过,则进入步骤B9;若验证不通过,则进入步骤B8;
步骤B8. 目标项目全网同步中所有节点保持原数据状态,并将该侧链的区块链状态为0;
步骤B9. 工程项目决策者所在节点在目标项目全网同步当前永久区块,并将当前永久区块设置为新的分界区块,再将该侧链的区块链状态为0,然后进入步骤B10;
步骤B10. 将步骤B4中所继承的临时区块集合森林链接到当前永久区块。
作为本发明的一种优选技术方案:所述步骤B2中,按照各临时区块中Hierarchy Number字段值的升序排序,首先两两划分一组,分别计算生成各组两临时区块所对应应用数据之间的Hash值,获得各个中级Hash值,然后针对各个中级Hash值,顺序计算相邻中级Hash值之间的Hash值,直至获得最终Hash值,作为临时版本树根Hash。
作为本发明的一种优选技术方案:所述步骤B3中,生成当前永久区块后,在该侧链的应用数据MRT树中,当前永久区块将应用数据由上一正式版本更新为当前正式版本。
作为本发明的一种优选技术方案:所述步骤B4中,工程项目决策者所在节点删除上一永久区块下临时区块集合森林中关于旧版本应用数据的树,并针对剩余的树,按Hierarchy Number排序,从树的根区块开始,重新链接到当前永久区块,实现当前永久区块对上一永久区块所对应临时区块集合森林的继承,然后进入步骤B5。
有益效果
本发明所设计工程协作区块链数据结构及应用方法,针对工程项目,引入区块链技术,设计主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目,通过各工程项目基于区块链的协同同步,实现了数据安全、永久存储、以及可追溯的效率,并以数据结构设计,搭建相应工程落地系统,具体构建应用方法,包括侧链更新临时区块方法和侧链更新永久区块方法,分别通过各组具体化的逻辑步骤设计,改善了工程领域针对各工程项目的协作和管理性能,提高实际生产和工程开发的效率。
附图说明
图1是多企业多人参与同一项目开发的人员结构示意图;
图2是一主多侧结构的示意图;
图3是在某个正式版本到下个正式版本间可能出现的临时版本迭代示意图;
图4是永久区块与临时区块各自区块头中包含的一部分关键数据示意图;
图5是改进后的项目侧链区块结构示意图;
图6是侧链更新临时区块方法的状态和步骤示意图;
图7是侧链更新永久区块方法的状态和步骤示意图。
本发明的实施方式
下面结合说明书附图对本发明的具体实施方式作进一步详细的说明。
假设区块链的性质是联盟链,共识机制采用拜占庭容错共识算法(即PBFT,下文提到时统一使用缩写)。项目需要管理的数据以CAD设计图纸作为示例。
之所以采用如上的假设,是考虑到在实际应用中,大多数项目的合作者之间都具有一定的信任,而非完全的陌生对象,所以联盟链结构会是更具有代表性的示例。而CAD图纸也是一个需要经常改动,多版本并行的典型数据种类,且数据体量较大。
首先,我们构想一个多方合作项目的人员结构。如图1所示,项目A由公司X与Y共同开发,涉及到的数据主要是CAD图纸。公司X的开发小组有三位成员X1、X2和X3,公司Y的开发小组有两位成员Y1和Y2,两个公司有各自内部的数据平台1和2,但是很显然出于一定的保密性考虑,平台1和2之间并非实时更新数据状态。当公司X做出了对共有设计图纸的更新需要通知Y时,X的某位成员需要将图纸通过中介软件发送给Y。
很显然,一条具有基础结构的联盟链就可以解决简单的数据版本同步问题。
因此,本发明设计了一种工程协作区块链数据结构,如图2所示,包括主链、以及各条侧链,其中,主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目。
具体来说,主链上设定项目基本信息MRT树和项目成员地址MRT树,其中,项目基本信息MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目基本信息在相应树叶节点上的存储;项目成员地址MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目中成员地址列表在在相应树叶节点上的存储;当工程项目A被创建时,为其生成一个地址,并在该地址对应的MPT树叶节点或分支节点(2)存储其基本信息对应的Hash值以及一个成员地址列表。
当工程项目A对应的地址value第一次被写入数据时,工程项目A侧链的创始区块也同时生成,根据不同的基本信息,侧链会有不同的数据结构。当有成员试图在工程项目A侧链上写入数据时,系统都会在主链上搜索工程项目A对应的成员列表以校验其权限。
各条侧链上分别设定成员地址MPT树和应用数据MRT树,其中,成员地址MPT树上,基于各成员所对应地址与各树叶节点之间的对应关系,实现各成员所对应应用数据Hash值在相应树叶节点中current_version字段的存储;应用数据MRT树上树叶节点的value字段内至少包含一个name字段、以及一个用于存储应用数据的字段或应用数据位置指针的字段;实际应用中,在工程项目A侧链上,维护一棵成员地址MPT树和一棵应用数据MRT树,这里应用数据MRT树即图纸版本MPT树,成员地址MPT树的节点value值内包含一个current_version字段,而图纸版本MPT树的节点value值内至少包含一个name字段和一个用于存储具体图纸文件或其位置指针的字段。
基于侧链中成员对相应应用数据的更新,实现侧链上成员地址MPT树和应用数据MRT树的更新,以及实现主链上项目基本信息MRT树和项目成员地址MRT树的更新。
应用中,分别针对各侧链,定义侧链上沿时序依次生成的各区块分别为永久区块,并基于时序在相邻永久区块之间引入各临时区块;在获得最新永久区块后,将该永久区块作为分界区块,基于侧链中各成员对相应应用数据的每次更新、以及侧链中各成员之间应用数据的每次同步,实现各临时区块的迭代生成,最后在预设介入时间点,通过预设共识机制,实现各临时区块的合并,获得下一个永久区块,且该永久区块中包含所合并各临时区块的信息,依次类推顺序执行,实现侧链上区块链的生成。
所述各临时区块的区块头包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、应用数据版本ID、作者签名公钥、版本摘要Hash,版本摘要Hash用于对更新数据做文字描述或第三方链接的记录,而不限于侧链所指定永久区块内的数据上传格式。
所述永久区块的区块头中包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、作者签名公钥、临时版本树根Hash,且永久区块中该Hierarchy Number字段始终为0。
假设成员X1完成一次图纸的更新,他用自己的地址生成了一个新区块,在这个区块中,他用新图纸对应数据计算出Hash值,并更新图纸版本MPT树相应叶节点的value值,那么项目中的其他成员按照对应的Hash值就可以查看到该次更新的具体数据。同时,他更新成员MPT树中自己地址下的current_version字段为该版本图纸Hash值。他可以一次写入多个Hash值构成的Mercle树根(1)来代表多个图纸的更新。
当需要查询图纸更新信息时,系统从最后一个区块开始,由生成区块的签名找到对应的作者,在其下的current_version字段找到最后一次更新的一个或多个图纸位置,通过name字段判定哪些图纸存在更新,并不断向前回溯,直到创始区块,从而获得一条完整的图纸版本更新路径。
可以看到,回溯版本的机制实际上和通过交易Hash回溯账号余额的机制是基本相似的。但是这种机制在实际工程应用中会遇到问题,由于交易都是不可逆的,所以账号的余额实际上在回溯时也会有单一明确的路径。区块链在设计时就特意避免了双花攻击的可能,系统不会允许一个节点对同一条链选择两条以上不同的发展路径。然而工程上设计版本却很有可能出现多版并行的临时状态,而这些并行版本信息的共享对于项目的协作同样重要。
所以,需要在上述提到的一主多侧形式上,对区块生成方法与数据结构进行一定的调整。
如图3所示,先定义一种项目A上可能出现的版本迭代情形:在正式版本v01和v02之间,存在6个不同的临时版本,他们之间的父子关系如图三所示,而每个版本都对应不同的作者。
观察这个可能出现的版本迭代情形,不难得出改进后的结构需要具备的一些特性:第一,由于v01.4版本和其父版本v01.1分别由两个公司的成员完成,那么链上数据就仍然需要具有实时性,即成员X1在完成v01.1之后能够立即在项目A侧链上更新该信息。第二,正式版本与正式版本之间具有唯一的路径,而正式版本到临时版本应该允许一对多的路径。第三,临时版本的更新不应该受共识机制约束。
那么,如图4所示,新的侧链允许出现两种不同的区块,分别是临时区块与永久区块;临时区块的区块头中除了显示区块序号的Number字段,还有一个显示临时区块层级的Hierarchy Number字段。同时,为了更快地同步信息且减小链上数据的数据量,区块头中包含版本摘要字段,允许区块的上传者仅对更新内容做文字描述或第三方链接的记录,而不限于侧链指定的永久区块内的设计图纸数据上传格式。
永久区块的区块头中同样包含Hierarchy Number字段,区别是该字段在永久区块中始终为0。区块头中还包含一个临时版本树根Hash值,该值的计算方式会在后续内容说明。
除此之外,临时区块的区块头包含一个版本ID的字段。该字段值由系统根据固定的逻辑生成。
如图5所示,新的项目A侧链结构分为两个部分,以最后一个永久区块为分界区块,该永久区块是所有区块中Number字段值最大且Hierarchy Number字段值为0的区块。在这个分界之前的区块都是永久区块,形成一条单链,而分界之后的区块都是临时区块,而所有临时区块通过检索Number字段值等于分界区块Number字段值且Hierarchy Number字段值不为0的区块确定。
现在假设分界区块的Number值是N,在这个区块上对应某个项目A的设计图纸的当前正式版本是如图三所示的v01。接下来,我们在上述改进过的结构下描述版本迭代的过程。
基于上述设计,本发明设计了一种工程协作区块链数据结构的应用方法,包括侧链更新临时区块方法和侧链更新永久区块方法,其中,侧链更新临时区块方法中,如图6所示,各个侧链分别按如下步骤A1至步骤A7执行。
步骤A1. 侧链上生成永久区块,设定该侧链的区块链状态为0,并设定此时允许分布式网络内任何具有该侧链权限的节点生成临时区块,并且不允许此时任何节点发起永久区块的共识,同时将具有该侧链权限的所有节点组成的网络称为目标项目全网,所有节点的终端在目标项目全网内监听临时区块的提交申请,然后进入步骤A2。
步骤A2. 将侧链上最新生成的永久区块作为分界区块,然后进入步骤A3。
步骤A3. 当成员X1完成一次应用数据的更新,成员X1所在节点向目标项目全网发送该应用数据更新事件,申请更新临时区块,其中,应用数据更新事件中包括分界区块中的Number字段、以及目标项目全网中临时区块的Hierarchy Number字段的最大值,然后进入步骤A4。
步骤A4. 目标项目全网中其他各个节点分别接收更新临时区块申请,针对所接收应用数据更新事件,其他各节点分别将应用数据更新事件中的信息与自身节点中临时区块上的信息进行比较,根据如下不同比较结果,分别执行不同进一步处理。
若应用数据更新事件中的Number字段、Hierarchy Number字段分别与自身节点中临时区块上的Number字段、Hierarchy Number字段均一致时,表示该节点上数据与成员X1所在节点发送应用数据更新事件中的数据一致,该节点向成员X1返回TRUE,并进入步骤A6。
若应用数据更新事件中的Hierarchy Number字段大于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据滞后成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1所在节点请求应用数据,直到节点中临时区块上的Hierarchy Number字段与应用数据更新事件中的Hierarchy Number字段相一致,然后该节点向成员X1返回TRUE,并进入步骤A6。
当任何其他节点在收到更新临时区块申请、并向成员X1所在节点返回TRUE后,该节点就进入等待更新的状态,不再发送更新请求。
若应用数据更新事件中的Hierarchy Number字段小于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据超前成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1返回FALSE,并进入步骤A5。
步骤A5. 成员X1所在节点向发送FALSE的节点请求同步数据,并返回步骤A3。
步骤A6. 成员X1所在节点获得最新更新应用数据的父版本,并获得更新临时区块中父区块Hash,成员X1所在节点针对目标项目全网中临时区块Hierarchy Number字段的最大值进行加1,获得所更新临时区块中Hierarchy Number字段的值,并按预设格式生成所更新临时区块中应用数据版本ID,然后进入步骤A7。
步骤A7. 基于成员X1所在节点并基于版本ID、版本摘要Hash,对全部信息进行确认,并签名,然后结合分界区块的Number字段的值,生成临时区块,并向目标项目全网广播,各个节点接收该临时区块,并对节点自身的临时区块进行更新。
步骤A7中临时区块的生成,根据临时区块对父区块的引用,系统还包括针对所有临时区块构建组成的一个不相交集合森林。
实际应用中,侧链更新永久区块方法,如图7所示,各个侧链分别按如下步骤B1至步骤B10执行。
步骤B1. 侧链所对应工程项目决策者所在节点向目标项目全网发送永久区块更新申请事件,目标项目全网中其他各节点通过步骤A4至步骤A5的方法,并设定该侧链的区块链状态为1,不再接受任何新区块更新事件,进入步骤B2。
步骤B2. 工程项目决策者所在节点调用查询功能,获得当前分界区块所属临时区块的集合森林,并生成临时版本树根Hash,然后进入步骤B3。
其中关于临时版本树根Hash的生成,按照各临时区块中Hierarchy Number字段值的升序排序,首先两两划分一组,分别计算生成各组两临时区块所对应应用数据之间的Hash值,获得各个中级Hash值,然后针对各个中级Hash值,顺序计算相邻中级Hash值之间的Hash值,直至获得最终Hash值,作为临时版本树根Hash。
步骤B3. 工程项目决策者所在节点上传需要更新正式版本的最新完整应用数据,结合所获临时版本树根Hash,生成当前永久区块,然后在该侧链的应用数据MRT树中,当前永久区块将应用数据由上一正式版本更新为当前正式版本,然后进入步骤B4。
步骤B4. 工程项目决策者所在节点删除上一永久区块下临时区块集合森林中关于旧版本应用数据的树,并针对剩余的树,按Hierarchy Number排序,从树的根区块开始,重新链接到当前永久区块,实现当前永久区块对上一永久区块所对应临时区块集合森林的继承,然后进入步骤B5。
步骤B5. 工程项目决策者所在节点向目标项目全网广播当前永久区块、以及当前永久区块所继承的临时区块集合森林,然后进入步骤B6。
步骤B6. 指定工程项目决策者所在节点的广播,获得预先指定各成员所在节点的多方签名,然后进入步骤B7。
步骤B7. 目标项目全网中其他节点收到广播后,通过预设共识算法实现目标项目全网中节点数据一致性的验证,若验证通过,则进入步骤B9;若验证不通过,则进入步骤B8。
步骤B8. 目标项目全网同步中所有节点保持原数据状态,并将该侧链的区块链状态为0。
步骤B9. 工程项目决策者所在节点在目标项目全网同步当前永久区块,并将当前永久区块设置为新的分界区块,再将该侧链的区块链状态为0,然后进入步骤B10。
步骤B10. 将步骤B4中所继承的临时区块集合森林链接到当前永久区块。
本技术方案设计工程协作区块链数据结构及应用方法,针对工程项目,引入区块链技术,设计主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目,通过各工程项目基于区块链的协同同步,实现了数据安全、永久存储、以及可追溯的效率,并以数据结构设计,搭建相应工程落地系统,具体构建应用方法,包括侧链更新临时区块方法和侧链更新永久区块方法,分别通过各组具体化的逻辑步骤设计,改善了工程领域针对各工程项目的协作和管理性能,提高实际生产和工程开发的效率。
上面结合附图对本发明的实施方式作了详细说明,但是本发明并不限于上述实施方式,在本领域普通技术人员所具备的知识范围内,还可以在不脱离本发明宗旨的前提下做出各种变化。

Claims (10)

  1. 一种工程协作区块链数据结构,其特征在于:包括主链、以及各条侧链,其中,主链用于维护各工程项目之间的共同数据对象,各条侧链分别对应一个工程项目;
    主链上设定项目基本信息MRT树和项目成员地址MRT树,其中,项目基本信息MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目基本信息在相应树叶节点上的存储;项目成员地址MRT树上,基于各工程项目所对应地址与各树叶节点之间的对应关系,实现各工程项目中成员地址列表在在相应树叶节点上的存储;
    各条侧链上分别设定成员地址MPT树和应用数据MRT树,其中,成员地址MPT树上,基于各成员所对应地址与各树叶节点之间的对应关系,实现各成员所对应应用数据Hash值在相应树叶节点中current_version字段的存储;应用数据MRT树上树叶节点的value字段内至少包含一个name字段、以及一个用于存储应用数据的字段或应用数据位置指针的字段;
    基于侧链中成员对相应应用数据的更新,实现侧链上成员地址MPT树和应用数据MRT树的更新,以及实现主链上项目基本信息MRT树和项目成员地址MRT树的更新。
  2. 根据权利要求1所述一种工程协作区块链数据结构,其特征在于:分别针对各侧链,定义侧链上沿时序依次生成的各区块分别为永久区块,并基于时序在相邻永久区块之间引入各临时区块;在获得最新永久区块后,将该永久区块作为分界区块,基于侧链中各成员对相应应用数据的每次更新、以及侧链中各成员之间应用数据的每次同步,实现各临时区块的迭代生成,最后在预设介入时间点,通过预设共识机制,实现各临时区块的合并,获得下一个永久区块,且该永久区块中包含所合并各临时区块的信息,依次类推顺序执行,实现侧链上区块链的生成。
  3. 根据权利要求2所述一种工程协作区块链数据结构,其特征在于:所述各临时区块的区块头包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、应用数据版本ID、作者签名公钥、版本摘要Hash,版本摘要Hash用于对更新数据做文字描述或第三方链接的记录,而不限于侧链所指定永久区块内的数据上传格式;
    所述永久区块的区块头中包含父区块Hash、所对应分界区块序号的Number字段、Hierarchy Number字段、作者签名公钥、临时版本树根Hash,且永久区块中该Hierarchy Number字段始终为0。
  4. 一种针对权利要求3所述工程协作区块链数据结构的应用方法,其特征在于,包括侧链更新临时区块方法,即各个侧链分别按如下步骤执行:
    步骤A1. 侧链上生成永久区块,设定该侧链的区块链状态为0,并设定此时允许分布式网络内任何具有该侧链权限的节点生成临时区块,并且不允许此时任何节点发起永久区块的共识,同时将具有该侧链权限的所有节点组成的网络称为目标项目全网,所有节点的终端在目标项目全网内监听临时区块的提交申请,然后进入步骤A2;
    步骤A2. 将侧链上最新生成的永久区块作为分界区块,然后进入步骤A3;
    步骤A3. 当成员X1完成一次应用数据的更新,成员X1所在节点向目标项目全网发送该应用数据更新事件,申请更新临时区块,其中,应用数据更新事件中包括分界区块中的Number字段、以及目标项目全网中临时区块的Hierarchy Number字段的最大值,然后进入步骤A4;
    步骤A4. 目标项目全网中其他各个节点分别接收更新临时区块申请,针对所接收应用数据更新事件,其他各节点分别将应用数据更新事件中的信息与自身节点中临时区块上的信息进行比较,根据如下不同比较结果,分别执行不同进一步处理;
    若应用数据更新事件中的Number字段、Hierarchy Number字段分别与自身节点中临时区块上的Number字段、Hierarchy Number字段均一致时,表示该节点上数据与成员X1所在节点发送应用数据更新事件中的数据一致,该节点向成员X1返回TRUE,并进入步骤A6;
    若应用数据更新事件中的Hierarchy Number字段大于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据滞后成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1所在节点请求应用数据,直到节点中临时区块上的Hierarchy Number字段与应用数据更新事件中的Hierarchy Number字段相一致,然后该节点向成员X1返回TRUE,并进入步骤A6;
    若应用数据更新事件中的Hierarchy Number字段小于自身节点中临时区块上的Hierarchy Number字段,表示该节点上数据超前成员X1所在节点发送应用数据更新事件中的数据,则该节点向成员X1返回FALSE,并进入步骤A5;
    步骤A5. 成员X1所在节点向发送FALSE的节点请求同步数据,并返回步骤A3;
    步骤A6. 成员X1所在节点获得最新更新应用数据的父版本,并获得更新临时区块中父区块Hash,成员X1所在节点针对目标项目全网中临时区块Hierarchy Number字段的最大值进行加1,获得所更新临时区块中Hierarchy Number字段的值,并按预设格式生成所更新临时区块中应用数据版本ID,然后进入步骤A7;
    步骤A7. 基于成员X1所在节点并基于版本ID、版本摘要Hash,对全部信息进行确认,并签名,然后结合分界区块的Number字段的值,生成临时区块,并向目标项目全网广播,各个节点接收该临时区块,并对节点自身的临时区块进行更新。
  5. 根据权利要求4所述一种工程协作区块链数据结构的应用方法,其特征在于:所述步骤A4中,当任何其他节点在收到更新临时区块申请、并向成员X1所在节点返回TRUE后,该节点就进入等待更新的状态,不再发送更新请求。
  6. 根据权利要求4所述一种工程协作区块链数据结构的应用方法,其特征在于:基于所述步骤A7中,临时区块的生成,根据临时区块对父区块的引用,系统还包括针对所有临时区块构建组成的一个不相交集合森林。
  7. 根据权利要求6所述一种工程协作区块链数据结构的应用方法,其特征在于:还包括侧链更新永久区块方法,即各个侧链分别按如下步骤执行:
    步骤B1. 侧链所对应工程项目决策者所在节点向目标项目全网发送永久区块更新申请事件,目标项目全网中其他各节点通过步骤A4至步骤A5的方法,并设定该侧链的区块链状态为1,不再接受任何新区块更新事件,进入步骤B2;
    步骤B2. 工程项目决策者所在节点调用查询功能,获得当前分界区块所属临时区块的集合森林,并生成临时版本树根Hash,然后进入步骤B3;
    步骤B3. 工程项目决策者所在节点上传需要更新正式版本的最新完整应用数据,结合所获临时版本树根Hash,生成当前永久区块,然后进入步骤B4;
    步骤B4. 工程项目决策者所在节点实现当前永久区块对上一永久区块所对应临时区块集合森林的继承,然后进入步骤B5;
    步骤B5. 工程项目决策者所在节点向目标项目全网广播当前永久区块、以及当前永久区块所继承的临时区块集合森林,然后进入步骤B6;
    步骤B6. 指定工程项目决策者所在节点的广播,获得预先指定各成员所在节点的多方签名,然后进入步骤B7;
    步骤B7. 目标项目全网中其他节点收到广播后,通过预设共识算法实现目标项目全网中节点数据一致性的验证,若验证通过,则进入步骤B9;若验证不通过,则进入步骤B8;
    步骤B8. 目标项目全网同步中所有节点保持原数据状态,并将该侧链的区块链状态为0;
    步骤B9. 工程项目决策者所在节点在目标项目全网同步当前永久区块,并将当前永久区块设置为新的分界区块,再将该侧链的区块链状态为0,然后进入步骤B10;
    步骤B10. 将步骤B4中所继承的临时区块集合森林链接到当前永久区块。
  8. 根据权利要求7所述一种工程协作区块链数据结构的应用方法,其特征在于:所述步骤B2中,按照各临时区块中Hierarchy Number字段值的升序排序,首先两两划分一组,分别计算生成各组两临时区块所对应应用数据之间的Hash值,获得各个中级Hash值,然后针对各个中级Hash值,顺序计算相邻中级Hash值之间的Hash值,直至获得最终Hash值,作为临时版本树根Hash。
  9. 根据权利要求7所述一种工程协作区块链数据结构的应用方法,其特征在于:所述步骤B3中,生成当前永久区块后,在该侧链的应用数据MRT树中,当前永久区块将应用数据由上一正式版本更新为当前正式版本。
  10. 根据权利要求7所述一种工程协作区块链数据结构的应用方法,其特征在于:所述步骤B4中,工程项目决策者所在节点删除上一永久区块下临时区块集合森林中关于旧版本应用数据的树,并针对剩余的树,按Hierarchy Number排序,从树的根区块开始,重新链接到当前永久区块,实现当前永久区块对上一永久区块所对应临时区块集合森林的继承,然后进入步骤B5。
PCT/CN2020/115018 2020-05-15 2020-09-14 一种工程协作区块链数据结构及应用方法 WO2021227319A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010413778.0A CN111625598B (zh) 2020-05-15 2020-05-15 一种工程协作区块链数据结构及应用方法
CN202010413778.0 2020-05-15

Publications (1)

Publication Number Publication Date
WO2021227319A1 true WO2021227319A1 (zh) 2021-11-18

Family

ID=72259033

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/115018 WO2021227319A1 (zh) 2020-05-15 2020-09-14 一种工程协作区块链数据结构及应用方法

Country Status (2)

Country Link
CN (1) CN111625598B (zh)
WO (1) WO2021227319A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643292A (zh) * 2022-12-21 2023-01-24 中科航迈数控软件(深圳)有限公司 一种基于双层区块链的机床能耗数据追踪方法及装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625598B (zh) * 2020-05-15 2023-08-25 南京东垚建筑科技研究院有限公司 一种工程协作区块链数据结构及应用方法
CN112766740B (zh) * 2021-01-22 2021-11-02 湖南工商大学 一种基于侧链的公共安全应急情报区块链共享模型及方法
CN113656771B (zh) * 2021-10-20 2022-01-04 湖南宸瀚信息科技有限责任公司 一种基于区块链技术的群组产品协同设计数据协同系统
CN113868231B (zh) * 2021-12-03 2022-03-18 南昌龙旗信息技术有限公司 数据结构的更新方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993656A (zh) * 2019-03-11 2019-07-09 杭州复杂美科技有限公司 树形区块链处理方法、设备和存储介质
US20190347088A1 (en) * 2017-01-26 2019-11-14 Huawei Technologies Co., Ltd. Data Configuration Method and Data Configuration Apparatus
CN110471795A (zh) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 区块链状态数据恢复方法及装置、电子设备
CN110490562A (zh) * 2019-07-10 2019-11-22 布比(北京)网络技术有限公司 一种多区块链的跨链数据处理方法和系统
CN111625598A (zh) * 2020-05-15 2020-09-04 南京东垚建筑科技研究院有限公司 一种工程协作区块链数据结构及应用方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117097B (zh) * 2018-09-05 2020-06-12 深圳正品创想科技有限公司 一种基于区块链的数据存储方法及系统
CN109584071B (zh) * 2018-11-28 2023-01-10 青岛逸海蓝图信息科技有限公司 区块链处理方法和电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190347088A1 (en) * 2017-01-26 2019-11-14 Huawei Technologies Co., Ltd. Data Configuration Method and Data Configuration Apparatus
CN109993656A (zh) * 2019-03-11 2019-07-09 杭州复杂美科技有限公司 树形区块链处理方法、设备和存储介质
CN110490562A (zh) * 2019-07-10 2019-11-22 布比(北京)网络技术有限公司 一种多区块链的跨链数据处理方法和系统
CN110471795A (zh) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 区块链状态数据恢复方法及装置、电子设备
CN111625598A (zh) * 2020-05-15 2020-09-04 南京东垚建筑科技研究院有限公司 一种工程协作区块链数据结构及应用方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643292A (zh) * 2022-12-21 2023-01-24 中科航迈数控软件(深圳)有限公司 一种基于双层区块链的机床能耗数据追踪方法及装置

Also Published As

Publication number Publication date
CN111625598A (zh) 2020-09-04
CN111625598B (zh) 2023-08-25

Similar Documents

Publication Publication Date Title
WO2021227319A1 (zh) 一种工程协作区块链数据结构及应用方法
JP7362654B2 (ja) 分割されたブロックチェーンネットワークにおけるブロックチェーンのブロックの維持管理
CN107528886B (zh) 区块链全网拆分方法与系统
CN110046894B (zh) 一种基于纠删码的分组可重构区块链建立方法
CN112835612A (zh) 一种基于区块链的电子文档版本管理方法及装置
CN111611315A (zh) 面向金融大数据的多叉树结构区块链集成优化存储方法
CN109948003B (zh) 一种同构双模主副链的区块链系统及其区块生产方法
CN111931220B (zh) 区块链网络的共识处理方法、装置、介质及电子设备
CN113157733A (zh) 一种面向多链数据关联性的高效溯源查询方法
CN111798234B (zh) 一种轻量级区块链系统及构造方法
CN112579261A (zh) 退出跨片事务的方法和系统、主链节点和目标分片节点
CN111858105A (zh) 基于改进多层pbft的个人档案许可链管理系统及方法
WO2023050986A1 (zh) 维护区块链系统的网络架构信息
CN114938292B (zh) 一种基于节点可信度的多层次优化pbft共识方法
JP2022551874A (ja) セキュアな共生(Symbiosis)マイニングのための方法および装置
Fan et al. Dlbn: Group storage mechanism based on double-layer blockchain network
Tamassia et al. Efficient content authentication in peer-to-peer networks
CN112261160A (zh) 包含分片的区块链系统中退出跨片事务的方法及系统
CN115221558B (zh) 一种面向多主体科技资源的数字对象高效存证方法和系统
CN114157550B (zh) 一种基于无冲突事务合并的联盟区块链系统
CN113810185B (zh) 一种抗陷门泄露的链上数据修复系统及方法
CN115664682A (zh) 基于联盟链主从多链的医疗数据共享的共识方法
CN112906069B (zh) 一种区块链登记管理过程的可信计算方法
CN117478300B (zh) 基于节点确定的跨链共识方法、装置和计算机设备
Zhang et al. Sharding Technologies in Blockchain: Basics, State of the Art, and Challenges

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20935847

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20935847

Country of ref document: EP

Kind code of ref document: A1