Alliance chain management method and system based on public chain code
By installing public chain codes on the public channels of the alliance chain network, the unreliability and security of data sharing in the alliance chain network are solved, the reliability and security of data sharing are achieved, and the immediate needs of organizations within the alliance chain are met.
Patent Information
- Application Number
- CN202110802707.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2041-07-15
AI Technical Summary
In the existing alliance chain network, the data sharing method between organizations has problems such as unreliable data transmission, poor security and additional system overhead.
Public chain code is used to share data on the public channels of the alliance chain network. By inviting the organization to analyze the new organization information, generate voting instructions and vote. If more than half of the organizations agree, the system chain code and public chain code will be updated. The new organization joins the network and uploads the information to the public chain code ledger.
It realizes the reliability and security of data sharing, meets the immediate needs of organizations within the alliance chain, has the characteristics of data traceability, tampering and decentralization, and supports private data and customization.
Smart Images

Figure CN115618370B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a consortium chain management method and system based on public chain code. Background Art
[0002] Organizations in a consortium blockchain network need to share data in a timely manner to manage the network. Typically, data sharing between organizations involves messaging, shared databases, and intermediary systems.
[0003] However, these methods all have some corresponding disadvantages: (1) Message communication: Message communication directly sends and receives the shared data through the network. This method has the problem of "reliable message delivery", that is, the data transmission message may not be received by the other party due to network problems. (2) Shared database: All organizations use the same database, which has obvious data security issues. (3) Intermediate system: In order to provide data storage and corresponding data operations, an additional intermediate system needs to be built for centralized management, which may also cause data security issues.
[0004] Of course, the drawbacks of these methods can be solved through some means, but compared with using public chain codes for data sharing, it is more troublesome.
[0005] Blockchain itself boasts data traceability, immutability, and decentralization, while smart contract chaincodes support privacy and customization. Therefore, to better manage consortium blockchain networks, installing a public chaincode for data sharing on the network's public channels is an optimal solution. Summary of the Invention
[0006] Based on the problems raised in the background technology, the present invention proposes a consortium chain management method based on public chain code, which specifically includes:
[0007] Responding to a proposal request from an inviting organization to invite a new organization to join the consortium chain, wherein the inviting organization parses the relevant information of the new organization to obtain a parsed result before initiating the request, and serializes the new organization;
[0008] Generate voting instructions based on the proposal request and send them to all organizations in the consortium chain based on the public chain code. All organizations vote. The public chain code is set in the public channel of the consortium chain network.
[0009] Obtain the voting results of all organizations. If the number of votes exceeds half, update the system chain code and public chain code in the alliance chain, generate a new organization invitation code and send it to the new organization;
[0010] Invite new organizations to join the alliance chain network based on the new organization invitation code, obtain the new organization's organizational information and network information, and join the public channel;
[0011] Upload the organizational information and network information of the new organization to the corresponding public chain code, where the corresponding public chain code is deployed based on the new organization.
[0012] Furthermore, before the inviting organization initiates the request, the relevant information of the new organization is parsed to obtain a parsing result, and the new organization is serialized, including the following steps:
[0013] The inviting organization obtains the new organization's identity information, parses the new organization's identity information, and generates MSP information;
[0014] Generate a certificate based on the new organization's information, including the organization name, sorting node information, and accounting node information.
[0015] Combine the sorting node information with the generated certificate to obtain the Raft consensus node object;
[0016] Obtain the information of the anchor node and the consensus model to obtain the serialization result of the new organization.
[0017] Furthermore, the newly created alliance chain network is still in its initial state and cannot accept applications from new organizations to join. It is necessary to add dynamic expansion functions for organizational members. The public channel is a type of application channel. As a channel for information transmission, it can provide a basis for the realization of its functions.
[0018] Furthermore, by pre-installing a public chain code in the channel, it is possible to apply for joining, review, and upgrade the consortium chain network;
[0019] The timely update of public chain code ledger information enables the consortium chain network to maintain the latest organizational information and provide basic information services for operations such as business chain creation and smart chain code creation.
[0020] Furthermore, the process of inviting a new organization to join the alliance chain network based on the new organization invitation code, obtaining the new organization's organizational information and network information, and joining the public channel includes the following steps:
[0021] Parse the invitation code of the new organization, obtain the genesis block of the system channel and public channel, and the information of the sorting node and accounting node of other organizations;
[0022] Use the obtained genesis block to create a consortium chain network, and use the information of the ordering nodes and accounting nodes obtained from other organizations to create corresponding routes;
[0023] Write the new organization's organizational information and network information into the public chain code ledger.
[0024] Furthermore, uploading the organizational information and network information of the new organization to the corresponding public chain code includes the following steps:
[0025] Parse the identity identification code to obtain the organizational information of the new organization;
[0026] Call the Get Channel Configuration Update method in the blockchain client to calculate the upgrade transaction and obtain the upgrade transaction information;
[0027] Call the request method in the blockchain client to upload the upgrade transaction information to the public chain code.
[0028] Furthermore, the public chain code is set in the public channel of the consortium chain network, including the following steps:
[0029] Create a public channel based on the public channel name, consortium chain name, management policy, write policy, read policy and organization information;
[0030] Add the public channel name and node information that needs to be added to the public channel to the public channel;
[0031] Find the public contract path, pass the contract name, path, and node information that needs to install the contract into the public channel, and install the public chain code.
[0032] Furthermore, the consortium chain initialization step includes: calling the initialization chain code method in the blockchain client, passing in the public chain code name, contract name, initialization parameters, accounting node information and sorting node information, and initializing the public chain code.
[0033] Furthermore, the steps for data sharing in the public chaincode include:
[0034] The sorting nodes of any organization in the consortium chain perform sorting consensus on all transactions in the public channel;
[0035] The organization's accounting node pulls the new block from its own sorting node and submits the new block to the local ledger;
[0036] If an organization's network node is unavailable, the organization's accounting node will continue to pull the previously missed blocks after the network is restored;
[0037] Responding to an organization's request to read the shared data it wants from the ledger;
[0038] If the organization is within the sharing scope of the data, the data can be read.
[0039] A consortium chain management system based on public chain code, specifically including a consortium chain network initialization module, a new organization joining consortium chain network module, a contract upgrade module, and a data sharing module;
[0040] The alliance chain network initialization module, the initial organization creates the alliance chain network, creates a public channel, installs the public chain code, and writes its own organizational information and network information into the public chain code ledger;
[0041] The new organization joins the alliance chain network module. The new organization submits a request to join the alliance chain network to an organization already in the alliance chain. The organization acts as the inviter, uploads the new organization's information to the alliance chain network, and initiates a proposal to invite the new organization.
[0042] All organizations within the alliance obtain the invitation proposal based on the public chain code and perform voting operations;
[0043] If more than half of the organizations vote in favor, the new organization will be allowed to join the alliance chain network and the system chain code and public chain code will be updated; otherwise, the new organization will be rejected.
[0044] The newly joined organization installs the public chain code and writes its own organizational information and network information into the public chain code ledger;
[0045] The contract upgrade module is used to upgrade smart contracts in public channels to meet the immediate needs of organizations within the alliance chain network;
[0046] Upload the smart contract upgrade request to the public chain code and collect signatures from each organization in the channel. If more than half of the organizations vote in favor, the contract will be upgraded; otherwise, the upgrade will fail.
[0047] The smart contract is a piece of executable code, and the smart contract installed in the public channel is the public chain code;
[0048] The data sharing module is used for data sharing among alliance chain organizations. Organizations within the alliance chain network share data by writing or reading public chain code ledgers to realize alliance chain management.
[0049] Furthermore, when data is shared between alliance chain organizations, if the network node of an organization is unavailable, causing block data to be out of sync, the accounting node of the organization will continue to pull the previously missed blocks after the network is restored to ensure the synchronization of data in the ledger.
[0050] Furthermore, public chain codes support data privacy and customization, and private data can be set according to the needs of organizations in the consortium chain network. When writing data to the ledger, organizations can set the data's operational scope and specify other organizations with read and write operation permissions.
[0051] A computer-readable storage medium stores a computer program, wherein the computer program implements any one of the method steps described above when executed by a processor.
[0052] A consortium chain management device based on a public chain code includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, any one of the method steps described above is implemented.
[0053] Compared to existing technologies, this invention utilizes a public chaincode installed on a consortium chain network, enabling consortium chain members to share data through a ledger. When data sharing is needed within the consortium chain, member organizations simply upload the information to the public chaincode ledger, eliminating the need for additional intermediary media. Furthermore, this invention incorporates smart contract upgrade capabilities to meet the immediate needs of organizations within the consortium chain. Blockchain inherently offers data traceability, immutability, and decentralization, while smart contract chaincode supports privacy and customization. Installing a public chaincode for data sharing ensures security and convenience for consortium chain organizations. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 Create a common channel flow chart for a specific embodiment;
[0056] Figure 2 A flowchart for installing a public chain code on a public channel in a specific embodiment;
[0057] Figure 3 Generate organizational information and upload a flowchart for a specific embodiment;
[0058] Figure 4 Analyze the new organizational information flow chart for a specific embodiment;
[0059] Figure 5 A flowchart for voting on an invitation proposal for a new organization in a specific embodiment;
[0060] Figure 6 A flowchart of smart contract upgrade in a specific embodiment;
[0061] Figure 7 This is an architectural diagram of a consortium chain network in a specific embodiment. DETAILED DESCRIPTION
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0063] In the description of this specification, the description with reference to the terms "an embodiment", "a specific embodiment", "an embodiment mode", and "for example" means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.
[0064] Example 1: Figure 1 As shown in the figure, a newly created consortium chain network requires a public channel as the information transmission channel of the consortium chain network. By pre-installing a series of public chain codes on this channel, the consortium chain network can be applied for, reviewed, and upgraded. The specific implementation is as follows:
[0065] Step 1: Call the create channel method in the blockchain client, pass in the public channel name, consortium chain name, management policy, write policy, read policy, and organization information to create a public channel;
[0066] Step 2: Call the join channel method in the blockchain client, pass in the public channel name and the node information that needs to join the public channel, and join the public channel.
[0067] In a specific embodiment, Figure 2 As shown in the figure, after the public channel is successfully created, a public chain code needs to be installed on the channel to maintain the latest organization information in the current consortium chain network. The specific implementation is as follows:
[0068] Step 1: Find the public contract path from the configuration file, call the install public chain code method in the blockchain client, pass in the contract name, path, and node information where the contract needs to be installed, and install the contract;
[0069] Step 2: Call the initialization chaincode method in the blockchain client, pass in the public chaincode name, contract name, initialization parameters, accounting node information, and sorting node information to initialize the contract.
[0070] In one embodiment, the organizational information is generated and uploaded, such as Figure 3 As shown, it mainly includes two parts:
[0071] 1) After the public chain code is created, you need to upload your own organization information to the public chain code. The specific implementation is as follows:
[0072] Step 1: Serialize the build result into Json format data;
[0073] Step 2: Call the request method in the blockchain client, pass in the public chain code name, contract name, organization information, accounting node information, and sorting node information, and upload the organization information to the chain.
[0074] 2) When a new organization applies to join the alliance, it needs to upload its organizational information. The specific implementation of serializing organizational information is as follows:
[0075] Step 1: Obtain information about the organization CA, organization name, sorting node, and accounting node, generate a certificate, and obtain identity information data;
[0076] Step 2: Get the organization's sorting node information and combine it with the generated certificate to obtain the Raft consensus node object.
[0077] Step 3: Get the information of anchor nodes and consensus mode;
[0078] Step 4: Finally, the obtained information is serialized to generate its own organizational information.
[0079] In a specific embodiment, Figure 4 As shown, if a new organization wants to join the alliance chain network, it must first submit an application to a member already in the alliance. As the inviting party, the organization must upload the new organization's organizational information to the alliance chain network for subsequent review. The specific implementation is as follows:
[0080] Step 1: Parse the identity code to obtain the organizational information of the new organization;
[0081] Step 2: Call the method in the blockchain client to obtain channel configuration updates and calculate the upgrade transaction.
[0082] Step 3: Call the request method in the blockchain client to upload the upgrade transaction information to the public chain code.
[0083] In a specific embodiment, Figure 5 As shown in the figure, when an organization within the alliance initiates an invitation proposal, alliance members can vote on the invitation proposal through message notification. When the number of votes exceeds 1 / 2, the system chain code and public chain code will be updated and an invitation code will be generated for the new organization. The new organization will join the alliance chain network through the invitation code. The specific implementation is as follows:
[0084] Step 1: Parse the invitation code and obtain the genesis blocks of the system channel and public channel;
[0085] Step 2: Get the information of the ordering nodes and accounting nodes of other organizations in the invitation code, which will be used to create the corresponding routes later.
[0086] Step 3: Use the genesis block obtained above to create a consortium chain network;
[0087] Step 4: Create routes for other organizations.
[0088] Step 5: Call the join channel method in the blockchain client, pass in the genesis block of the public channel and the accounting node information, and join the public channel;
[0089] Step 6: Call the install public chain code method in the blockchain client, pass in the public contract path, contract name, and accounting node information, and install the contract;
[0090] Step 7: Call the request method in the blockchain client, pass in the public chain code name, contract name, organization information, and method name AddOrgInfo, and upload the organization information to the public chain code.
[0091] In a specific embodiment, Figure 6 As shown, if an existing contract is to be upgraded, a request to upgrade the smart contract is uploaded to the public chaincode before the upgrade, and organizations in the public channel are invited to review and sign the instantiation request. The upgrade is allowed only when the number of signatures received exceeds half of the number of organizations in the public channel.
[0092] In a specific embodiment, the alliance chain network architecture is as follows Figure 7 As shown in the figure, each organization shares data among itself by joining a public channel and installing the public chain code.
[0093] Responding to an organization's request to write shared data to the ledger;
[0094] The sorting nodes of any organization in the consortium chain perform sorting consensus on all transactions in the public channel;
[0095] The organization's accounting node pulls the new block from its own sorting node and submits the new block to the local ledger;
[0096] If an organization's network node is unavailable, the organization's accounting node will continue to pull the previously missed blocks after the network is restored to ensure the synchronization of data in the ledger;
[0097] Responding to an organization's request to read the shared data it wants from the ledger;
[0098] If the organization is within the sharing scope of the data, the data can be read.
[0099] In a specific embodiment, the alliance chain management system based on the public chain code mainly includes an alliance chain network initialization module, a new organization joining the alliance chain network module, a contract upgrade module, and a data sharing module;
[0100] The alliance chain network initialization module, the initial organization creates the alliance chain network, creates a public channel, installs the public chain code, and writes its own organizational information and network information into the public chain code ledger;
[0101] The new organization joins the alliance chain network module. The new organization submits a request to join the alliance chain network to an organization already in the alliance chain. The organization acts as the inviter, uploads the new organization's information to the alliance chain network, and initiates a proposal to invite the new organization.
[0102] All organizations within the alliance obtain the invitation proposal based on the public chain code and perform voting operations;
[0103] If more than half of the organizations vote in favor, the new organization will be allowed to join the alliance chain network and the system chain code and public chain code will be updated; otherwise, the new organization will be rejected.
[0104] The newly joined organization installs the public chain code and writes its own organizational information and network information into the public chain code ledger;
[0105] The contract upgrade module is used to upgrade smart contracts in public channels to meet the immediate needs of organizations within the alliance chain network;
[0106] Upload the smart contract upgrade request to the public chain code and collect signatures from each organization in the channel. If more than half of the organizations vote in favor, the contract will be upgraded; otherwise, the upgrade will fail.
[0107] The smart contract is a piece of executable code, and the smart contract installed in the public channel is the public chain code;
[0108] The data sharing module is used for data sharing among alliance chain organizations. Organizations within the alliance chain network share data by writing or reading public chain code ledgers to realize alliance chain management.
[0109] In addition, it should be noted that the specific embodiments described in this specification may have different functional expressions and names in their programs. Any equivalent or simple changes made based on the structure, features, and principles described in the patent concept of the present invention are included in the scope of protection of the patent of the present invention. Those skilled in the art of the present invention may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should fall within the scope of protection of the present invention.
Claims
1. A consortium chain management method based on public chain code, characterized in that: The following steps are involved: Responding to a proposal request from an inviting organization to invite a new organization to join the consortium chain, wherein the inviting organization parses the relevant information of the new organization to obtain a parsed result before initiating the request, and serializes the new organization; Generate voting instructions based on the proposal request and send them to all organizations in the consortium chain based on the public chain code. All organizations vote. The public chain code is set in the public channel of the consortium chain network. Obtain the voting results of all organizations. If the number of votes exceeds half, update the system chain code and public chain code in the alliance chain, generate a new organization invitation code and send it to the new organization; Invite new organizations to join the alliance chain network based on the new organization invitation code, obtain the new organization's organizational information and network information, and join the public channel; Upload the organizational information and network information of the new organization to the corresponding public chain code, where the corresponding public chain code is deployed based on the new organization.
2. The alliance chain management method based on public chain code according to claim 1 is characterized in that: Before the inviting organization initiates the request, it parses the relevant information of the new organization to obtain a parsing result and performs serialization processing on the new organization, including the following steps: The inviting organization obtains the new organization's identity information, parses the new organization's identity information, and generates MSP information; Generate a certificate based on the new organization's information, including the organization name, sorting node information, and accounting node information. Combine the sorting node information with the generated certificate to obtain the Raft consensus node object; Obtain the information of the anchor node and the consensus model to obtain the serialization result of the new organization.
3. The alliance chain management method based on public chain code according to claim 1 is characterized in that: The process of inviting a new organization to join the alliance chain network based on the new organization invitation code, obtaining the new organization's organizational information and network information, and joining the public channel includes the following steps: Parse the invitation code of the new organization, obtain the genesis block of the system channel and public channel, and the information of the sorting node and accounting node of other organizations; Use the obtained genesis block to create a consortium chain network, and use the information of the ordering nodes and accounting nodes obtained from other organizations to create corresponding routes; Write the new organization's organizational information and network information into the public chain code ledger.
4. The alliance chain management method based on public chain code according to claim 1 or 3, characterized in that: Uploading the organizational information and network information of the new organization to the corresponding public chain code includes the following steps: Parse the identity identification code to obtain the organizational information of the new organization; Call the Get Channel Configuration Update method in the blockchain client to calculate the upgrade transaction and obtain the upgrade transaction information; Call the request method in the blockchain client to upload the upgrade transaction information to the public chain code.
5. The alliance chain management method based on public chain code according to claim 1 is characterized in that: The public chain code is set in the public channel of the consortium chain network, including the following steps: Create a public channel based on the public channel name, consortium chain name, management policy, write policy, read policy and organization information; Add the public channel name and node information that needs to be added to the public channel to the public channel; Find the public contract path, pass the contract name, path, and node information that needs to install the contract into the public channel, and install the public chain code.
6. The method for managing a consortium chain based on a public chain code according to claim 5, characterized in that: It also includes the initialization steps: Call the initialize chaincode method in the blockchain client, pass in the public chaincode name, contract name, initialization parameters, accounting node information, and sorting node information to initialize the public chaincode.
7. The method for managing a consortium chain based on a public chain code according to claim 5, characterized in that: It also includes the steps of data sharing in the public chain code: the sorting node of any organization in the consortium chain reaches a sorting consensus on all transactions in the public channel; The organization's accounting node pulls the new block from its own sorting node and submits the new block to the local ledger; If an organization's network node is unavailable, the organization's accounting node will continue to pull the previously missed blocks after the network is restored; Responding to an organization's request to read the shared data it wants from the ledger; If the organization is within the sharing scope of the data, the data can be read.
8. A consortium chain management system based on public chain code, characterized in that: Including alliance chain network initialization module, new organization joining alliance chain network module, contract upgrade module and data sharing module; The alliance chain network initialization module, the initial organization creates the alliance chain network, creates a public channel, installs the public chain code, and writes its own organizational information and network information into the public chain code ledger; The new organization joins the alliance chain network module. The new organization submits a request to join the alliance chain network to an organization already in the alliance chain. The organization acts as the inviter, uploads the new organization's information to the alliance chain network, and initiates a proposal to invite the new organization. All organizations within the alliance obtain the invitation proposal based on the public chain code and perform voting operations; If more than half of the organizations vote in favor, the new organization will be allowed to join the alliance chain network and the system chain code and public chain code will be updated; otherwise, the new organization will be rejected. The newly joined organization installs the public chain code and writes its own organizational information and network information into the public chain code ledger; The contract upgrade module is used to upgrade smart contracts in public channels to meet the immediate needs of organizations within the alliance chain network; Upload the smart contract upgrade request to the public chain code and collect signatures from each organization in the channel. If more than half of the organizations vote in favor, the contract will be upgraded; otherwise, the upgrade will fail. The smart contract is a piece of executable code, and the smart contract installed in the public channel is the public chain code; The data sharing module is used for data sharing among alliance chain organizations. Organizations within the alliance chain network share data by writing or reading public chain code ledgers to realize alliance chain management.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method steps according to any one of claims 1 to 6 are implemented.
10. A consortium chain management device based on a public chain code, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method steps according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
An enterprise resource management system based on a block chain
CN109698752A
Data processing method, device and equipment based on block chain and storage medium
CN110599181A