CN109165304B - Block chain construction method, medium and system - Google Patents

Block chain construction method, medium and system Download PDF

Info

Publication number
CN109165304B
CN109165304B CN201810713792.5A CN201810713792A CN109165304B CN 109165304 B CN109165304 B CN 109165304B CN 201810713792 A CN201810713792 A CN 201810713792A CN 109165304 B CN109165304 B CN 109165304B
Authority
CN
China
Prior art keywords
node
main chain
nodes
network
function
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
Application number
CN201810713792.5A
Other languages
Chinese (zh)
Other versions
CN109165304A (en
Inventor
吴胜文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ke'an (Xiamen) Technology Co.,Ltd.
Original Assignee
Tailian Xiamen Technology Co ltd
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 Tailian Xiamen Technology Co ltd filed Critical Tailian Xiamen Technology Co ltd
Priority to CN201810713792.5A priority Critical patent/CN109165304B/en
Publication of CN109165304A publication Critical patent/CN109165304A/en
Application granted granted Critical
Publication of CN109165304B publication Critical patent/CN109165304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a construction method of a block chain, which comprises the steps of configuring an initial connection file; after the initial main chain node is started, creating a created block, establishing connection between the initial main chain node and the initial function node according to the initial connection file, and configuring a function network name corresponding to the initial function node; configuring a main chain node address set to be connected through a local node to construct a main chain network; configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through a local node, connecting the function node to be connected to a corresponding function network, and connecting the function node to be connected to a corresponding main chain node; the invention also discloses a computer readable storage medium and a system for constructing the block chain, which can realize the division of the node functions, reduce the data volume needing to be transmitted in the whole block chain network, lighten the burden of the block chain network, and simultaneously, define the node functions and lighten the burden of each node.

Description

Block chain construction method, medium and system
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method, a medium, and a system for constructing a block chain.
Background
The blockchain is a P2P distributed database system participated by nodes, and is characterized in that data written into the blockchain cannot be tampered. In the existing block chain construction technology, the recording and broadcasting of operations and the generation and linking of blocks are mostly carried out in a single chain form; that is, when a node generates an operation, the operation file is broadcasted to synchronize the operation file throughout the blockchain network, and a block is generated after a condition is reached, and the block file is broadcasted to synchronize the block file throughout the blockchain network.
With the blockchain network constructed in this way, the whole blockchain network has a large amount of data to be transmitted, the network load is high, high loads are caused to each node, and the synchronization efficiency of blockchain files is low.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a method for constructing a blockchain, which can implement the division of node functions, reduce the amount of data to be transmitted in the entire blockchain network, thereby reducing the load of the blockchain network, and at the same time, clarify the node functions, and reduce the load of each node.
A second object of the invention is to propose a computer-readable storage medium.
A third objective of the present invention is to provide a system for constructing a block chain.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for constructing a block chain, including the following steps: configuring an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address; after an initial main chain node is started, creating a created block through a local node, after at least one initial function node to be connected is started, establishing connection between the initial main chain node and the at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in the initial connection file, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file; configuring a main chain node address set to be connected through a local node, and connecting the main chain node to be connected to a corresponding main chain node according to the main chain node address set to be connected after a main chain client corresponding to the main chain node to be connected is started so as to construct a main chain network; the method comprises the steps that a function node address set to be connected and a main chain node address set corresponding to a function node to be connected are configured through a local node, after a function client corresponding to the function node to be connected is started, the function node to be connected is connected to a corresponding function network according to the function node address set to be connected, and the function node to be connected is connected to the corresponding main chain node according to the main chain node address set corresponding to the function node to be connected.
According to the method for constructing the block chain, firstly, an initial connection file is configured through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address; then, after an initial main chain node is started, creating a created block through a local node, after at least one initial function node to be connected is started, establishing connection between the initial main chain node and the at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in an initial connection file, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file; then, configuring a main chain node address set to be connected through the local node, and connecting the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected after a main chain client corresponding to the main chain node to be connected is started so as to construct a main chain network; then, configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through a local node, connecting the function node to be connected to a corresponding function network according to the function node address set to be connected after a function client corresponding to the function node to be connected is started, and connecting the function node to be connected to the corresponding main chain node according to the main chain node address set corresponding to the function node to be connected; therefore, the node functions are divided, the data quantity required to be transmitted by the whole block chain network is reduced, the burden of the block chain network is reduced, and meanwhile, the node functions are determined, and the burden of each node is reduced.
In addition, the block chain construction method proposed according to the above embodiment of the present invention may further have the following additional technical features:
optionally, when any one of the functional nodes in the functional network operates, the functional node traverses the connected node, wherein when the connected node is traversed to be the main chain node, the main chain node is skipped; and when the connected nodes are traversed to be the functional nodes, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through an uploading node in the functional network.
Optionally, the uploading nodes in the functional network are determined by a dps consensus mechanism and randomly distributed in the functional network.
Optionally, any one main chain node in the main chain network acquires a stage operation collection package uploaded by an upload node in a corresponding functional network, broadcasts the stage operation collection package in the main chain network, and after a preset time, packs the stage operation collection package in the main chain network and the operation of the main chain node in the main chain network into a block by a main chain production node determined by a main chain consensus mechanism, and links the block into a main chain block chain.
Optionally, when any one of the main chain nodes in the main chain network initiates an operation on a specific function network, the main chain node traverses nodes connected to itself, wherein when the nodes connected to itself traversed are other main chain nodes, information is transmitted to other main chain nodes, so that when the nodes connected to itself traversed by other main chain nodes are nodes of the specific function network, the received information is sent to the specific function network for broadcasting; when the nodes connected with the nodes are traversed to be the nodes of the specific function network, the information is directly transmitted to the nodes of the specific function network, so that the nodes of the specific function network broadcast the received information in the specific function network; and when the nodes connected by traversing to the self are the nodes of other functional networks, the messages are forbidden to be transmitted to the nodes of other functional networks.
In order to achieve the above object, a second embodiment of the present invention provides a computer-readable storage medium, on which a building program of a block chain is stored, and the building program of the block chain, when executed by a processor, implements the building method of the block chain as described above.
In order to achieve the above object, an embodiment of a third aspect of the present invention provides a system for constructing a blockchain, including a configuration module, a first construction module, a second construction module, and a third construction module, where the configuration module is configured to configure an initial connection file through a local node, where the initial connection file includes function information and an initial function node address corresponding to at least one initial function node to be connected; the first construction module is used for creating a created block through a local node after an initial main chain node is started, establishing connection between the initial main chain node and at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in the initial connection file after the at least one initial function node to be connected is started, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file; the configuration module is also used for configuring a main chain node address set to be connected through the local node; the second construction module is used for connecting the main chain nodes to be connected to the corresponding main chain nodes according to the main chain node address set to be connected after the main chain client corresponding to the main chain nodes to be connected is started so as to construct a main chain network; the configuration module is also used for configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through the local node; and the third construction module is used for connecting the functional nodes to be connected to the corresponding functional network according to the address set of the functional nodes to be connected after the functional client corresponding to the functional nodes to be connected is started, and connecting the functional nodes to be connected to the corresponding main chain nodes according to the address set of the main chain nodes corresponding to the functional nodes to be connected.
The system for constructing the block chain comprises a configuration module, a first construction module, a second construction module and a third construction module, wherein the configuration module configures an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address; then, after an initial main chain node is started, a creating block is created through a local node by a first construction module, after at least one initial function node to be connected is started, connection between the initial main chain node and the at least one initial function node to be connected is established according to an initial function node address of the at least one initial function node to be connected in an initial connection file, and a function network name corresponding to the at least one initial function node to be connected is configured according to function information of the at least one initial function node to be connected in the initial connection file; then, the configuration module also configures a main chain node address set to be connected through the local node; then, after a main chain client corresponding to the main chain node to be connected is started, the second construction module connects the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected so as to construct a main chain network; then, the configuration module also configures a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through the local node; then, after a function client corresponding to the function node to be connected is started, the third construction module connects the function node to be connected to a corresponding function network according to the address set of the function node to be connected, and connects the function node to be connected to a corresponding main chain node according to the address set of the main chain node corresponding to the function node to be connected; therefore, the node functions are divided, the data quantity required to be transmitted by the whole block chain network is reduced, the burden of the block chain network is reduced, and meanwhile, the node functions are determined, and the burden of each node is reduced.
In addition, the construction system of the block chain proposed according to the above embodiment of the present invention may also have the following additional technical features:
optionally, when any one of the functional nodes in the functional network operates, the functional node traverses the connected node, wherein when the connected node is traversed to be the main chain node, the main chain node is skipped; and when the connected nodes are traversed to be the functional nodes, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through an uploading node in the functional network.
Optionally, any one main chain node in the main chain network acquires a stage operation collection package uploaded by an upload node in a corresponding functional network, broadcasts the stage operation collection package in the main chain network, and after a preset time, packs the stage operation collection package in the main chain network and the operation of the main chain node in the main chain network into a block by a main chain production node determined by a main chain consensus mechanism, and links the block into a main chain block chain.
Optionally, when any one of the main chain nodes in the main chain network initiates an operation on a specific function network, the main chain node traverses nodes connected to itself, wherein when the nodes connected to itself traversed are other main chain nodes, information is transmitted to other main chain nodes, so that when the nodes connected to itself traversed by other main chain nodes are nodes of the specific function network, the received information is sent to the specific function network for broadcasting; when the nodes connected with the nodes are traversed to be the nodes of the specific function network, the information is directly transmitted to the nodes of the specific function network, so that the nodes of the specific function network broadcast the received information in the specific function network; and when the nodes connected by traversing to the self are the nodes of other functional networks, the messages are forbidden to be transmitted to the nodes of other functional networks.
Drawings
Fig. 1 is a schematic flow chart of a block chain construction method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating uploading operation information by a functional network node according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating operation of a backbone network on a specific function network according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating a system for constructing a blockchain according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the existing block chain construction technology, a single chain form is mostly adopted for block chain construction, and the block chain constructed by the construction method has the defects of large data volume needing to be transmitted in a block chain network, high network load, high load of each node and low block chain file synchronization efficiency; the method for constructing the block chain includes the steps that firstly, an initial connection file is configured through a local node, an initial block chain network is configured according to the initial connection file, then, a main chain node address set is configured on the local node, a main chain network is constructed according to the main chain node address set, then, a function node address set and a main chain node address set corresponding to the function node are configured on the local node, and a function network and connection between the function network and the main chain network are constructed according to the function node address set and the main chain node address set corresponding to the function node; therefore, the node functions are divided, the data quantity required to be transmitted by the whole block chain network is reduced, the burden of the block chain network is reduced, and meanwhile, the node functions are determined, and the burden of each node is reduced.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a schematic flow chart of a method for constructing a blockchain in an embodiment of the present invention, and as shown in fig. 1, the method for constructing a blockchain includes the following steps:
s101, configuring an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address.
As an example, configuring an initial connection file by a local node, where the initial connection file is a file that stores function information corresponding to an initial function node to be connected and an address of the initial function node in a key value pair form; that is, the correspondence between the function information of the initial function node and the address of the initial function node is established in the form of a key-value pair.
S102, after an initial main chain node is started, creating a created block through a local node, after at least one initial function node to be connected is started, establishing connection between the initial main chain node and the at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in an initial connection file, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file.
That is to say, after the configuration of the initial connection file is completed, the initial main chain node is started, the creation block is created through the local node, after the initial function node to be connected is started, the connection between the initial main chain node and the initial function node is established according to the initial function node address of the initial function node in the initial connection file, and then, the function network name corresponding to the initial function node to be connected is configured according to the function information of the initial function node in the initial connection file.
Wherein, the functional node refers to a node which starts a functional client; for example, a client node that has initiated the blockchain community function is a community node; the client node that has initiated the blockchain game function is the game node.
The number of the initial function nodes can be one or more; the number can be determined according to the functions related to the block chain to be constructed; therefore, the number of initial functional nodes is not limited herein.
S103, configuring a main chain node address set to be connected through the local node, and connecting the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected after the main chain client corresponding to the main chain node to be connected is started so as to construct a main chain network.
That is, first, a main chain node address set to be connected is configured through the local node, then, a main chain client corresponding to the main chain node to be connected is started, and then, the main chain node to be connected, which has started the main chain client, is connected to the corresponding main chain node according to the main chain node address set to be connected, so as to construct the main chain network.
The main chain node address set to be connected includes, but is not limited to, the main chain node address to be connected and the main chain node address corresponding to the main chain node address. That is, the set of addresses of the main chain nodes to be connected includes both the node address of the newly added main chain node and the node address of the main chain node to be connected to the newly added main chain node.
S104, configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through the local node, connecting the function node to be connected to the corresponding function network according to the function node address set to be connected after the function client corresponding to the function node to be connected is started, and connecting the function node to be connected to the corresponding main chain node according to the main chain node address set corresponding to the function node to be connected.
That is to say, first, a function node address set to be connected and a main chain node address set corresponding to the function node to be connected are configured, then, a function client is started, a new function node is added to a corresponding function network according to the function node address set to be connected, and connection between the newly added function node and the corresponding main chain node is established according to the main chain node address set corresponding to the function node to be connected, so that the new function node is added to the main chain network.
According to the method for constructing the block chain, firstly, an initial connection file is configured through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address; then, after an initial main chain node is started, creating a created block through a local node, after at least one initial function node to be connected is started, establishing connection between the initial main chain node and the at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in an initial connection file, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file; then, configuring a main chain node address set to be connected through the local node, and connecting the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected after a main chain client corresponding to the main chain node to be connected is started so as to construct a main chain network; then, configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through a local node, connecting the function node to be connected to a corresponding function network according to the function node address set to be connected after a function client corresponding to the function node to be connected is started, and connecting the function node to be connected to the corresponding main chain node according to the main chain node address set corresponding to the function node to be connected; therefore, the node functions are divided, the data quantity required to be transmitted by the whole block chain network is reduced, the burden of the block chain network is reduced, and meanwhile, the node functions are determined, and the burden of each node is reduced.
In order to further improve the data processing efficiency of the block chain network and reduce the node burden of the block chain network; as shown in fig. 2, in some embodiments, the method for constructing a block chain according to an embodiment of the present invention further includes the following steps:
s201, when any functional node in the functional network operates, the functional node traverses the connected nodes; when the nodes connected by traversal are main chain nodes, executing step S202; when the connected nodes are traversed to be functional nodes, step S203 is executed.
That is, when a function node performs an operation, it is determined whether the connected node is a main chain node or a function node by traversing the connected node itself, so as to perform different operations.
S202, skipping the main chain node, (i.e., not passing the operation information.)
That is, when the nodes connected by traversal are main chain nodes, the operation information is not transmitted, and the main chain nodes are skipped directly, so that the operation information is not broadcast in the main chain network.
S203, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through the uploading node in the functional network.
That is, when the connected nodes are traversed to be the functional nodes, the operation information is transmitted to the connected functional nodes, so that each functional node in the functional network receives and records the operation information; when the time line is reached, the operation information is packaged and uploaded to a main chain network through an uploading node in the functional network; therefore, the operation generated in the network is broadcasted and recorded through the functional network, and the operation information in the time period is packaged and uploaded to the main chain network after the preset time is up, so that the burden of main chain node storage and operation can be reduced.
There are various ways to determine the upload node of the functional network, for example, the upload node is determined by a POW consensus mechanism, a POS consensus mechanism, or a PBFT consensus mechanism.
As an example, the determination of the upload node is performed through a dps consensus mechanism, specifically, each user in the functional network votes through its corresponding functional node, so as to elect the functional node as the upload node, and randomly sort the elected upload nodes, and arrange the upload operation information of the upload node according to the sort.
And S204, any one main chain node in the main chain network acquires the stage operation set packet uploaded by the uploading node in the corresponding functional network, and broadcasts the stage operation set packet in the main chain network.
And S205, after a preset time, packing the operation aggregate package of the stage operation in the main chain network and the operation of the main chain node in the main chain network into blocks by the main chain production node determined by the main chain consensus mechanism, and linking the blocks into the main chain block chain.
The operation collection packet refers to operation information in a preset time line packaged by the uploading node.
That is to say, after any one main chain node in the main chain network acquires the stage operation collection package uploaded by the uploading node in the functional network, the stage operation collection package is broadcasted in the main chain network, so that the stage operation collection package is synchronized in the main chain network, then, after a preset time, the main chain production node determined by the main chain common identification mechanism packs the node operation collection package in the main chain network and the operation of the main chain node into a block, and the block is linked into the main chain block chain.
In summary, in the method for constructing a block chain according to the embodiment of the present invention, after the functional network generates an operation, the connected nodes are traversed, and it is determined whether the connected nodes are main chain nodes or functional nodes; when the judgment result is the main chain node, the operation information is not transmitted, and when the judgment result is the function node, the operation information is transmitted, so that the operation information is synchronized in the function network; then, after the preset time line is reached, the operation information is packaged and uploaded to a main chain network by a commonly-identified uploading node; then, after a main chain node in the main chain network acquires a stage operation aggregate package uploaded by the functional node, broadcasting in the main chain network, and after a preset time is reached, packaging the stage operation aggregate package and the operation in the main chain to form a block, and linking the block into a main chain block chain; therefore, the function differentiation of each node is realized, and the burden and the redundancy of each node are reduced.
In order to realize the control of the main chain network on the functional network and not influence the normal operation of other functional networks in the process of controlling the specific functional network by the main chain network; as shown in fig. 3, in some embodiments, the method for constructing a block chain provided by the present invention further includes the following steps:
s301, when any one main chain node in the main chain network initiates an operation on a specific function network, the main chain node traverses nodes connected with the main chain node; when the nodes connected with the nodes traversed to the self are other main chain nodes, executing the step S302; when the nodes connected with the nodes traversed by the network are the nodes of the specific function network, executing the step S303; when the nodes connected to the node traversing to the node are nodes of other functional networks, step S304 is executed.
That is to say, when any one of the main chain nodes in the main chain network initiates an operation on a specific function network, the nodes connected to the main chain node are traversed first to distinguish that the nodes connected to the main chain node are nodes of the specific function network, main chain nodes or nodes of other function networks so as to perform different operations.
The determination of the specific functional network may be various, for example, each functional network is numbered, and when an operation on the specific functional network is initiated, a number corresponding to the specific functional network is appended to the operation message.
As an example, when the main chain initiates an operation on a specific function network, a binary identifier is set for each function network at an operation message header of operation information, and 1 represents passing operation information and 0 represents not passing operation information, so as to determine the specific function network which needs to perform operation information passing.
S302, the information is transmitted to other main chain nodes, so that the received information is sent to the specific function network for broadcasting when the other main chain nodes traverse the nodes connected with the main chain nodes to be the nodes of the specific function network.
That is, when the traversed node connected to the node itself is the main chain node, the operation message is transmitted, so that when other main chain nodes traverse the node connected to the node itself to be the node of the specific function network, the received information is sent to the specific function network for broadcasting.
S303, directly transmitting the information to the node of the specific function network, so that the node of the specific function network broadcasts the received information in the specific function network.
That is, when the traversed node connected to itself is a node of the specific function network, the operation message is passed so that the node of the specific function network broadcasts the received information in the specific function network.
S304, forbidding to transmit the message to the nodes of other functional networks.
That is, when the traversed node connected to itself is a node of another functional network, the operation information is not transmitted, so as to prevent the operation information from affecting the normal operation of the other functional network.
In summary, in the method for constructing a block chain provided in the embodiment of the present invention, first, when a main chain initiates an operation on a specific function network, nodes connected to the main chain are traversed; to judge the connected node attribute; then, when the judgment result is the main chain node, transmitting the operation information so that other main chain nodes traverse the connected nodes to issue the operation information; when the judgment result is the node of the specific function network, transmitting the operation information so that the node of the specific function network broadcasts the operation information and synchronizes the operation information in the specific function network; when the judgment result is the node of the other functional network, the operation information is not transmitted so as to avoid the influence of the operation information on the normal operation of the other functional network; therefore, the function differentiation of each node is realized, the functions of each node are simplified, and the burden and the data redundancy of each node are reduced.
To achieve the above embodiments, the embodiment of the present invention further provides a computer-readable storage medium, on which a building program of a blockchain is stored, and when the building program of the blockchain is executed by a processor, the building program of the blockchain implements the building method of the blockchain as described above.
Fig. 4 is a block diagram of a system for constructing a blockchain according to an embodiment of the present invention, as shown in fig. 4, the system for constructing a blockchain includes: the configuration module 10, the first construction module 20, the second construction module 30 and the third construction module 40.
The configuration module 10 is configured to configure an initial connection file through a local node, where the initial connection file includes function information and an initial function node address corresponding to at least one initial function node to be connected.
A first constructing module 20, configured to create a created block through a local node after an initial main chain node is started, establish a connection between the initial main chain node and at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in the initial connection file after the at least one initial function node to be connected is started, and configure a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file.
The configuration module 10 is further configured to configure a main chain node address set to be connected through the local node.
The second constructing module 30 is configured to connect the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected to construct the main chain network after the main chain client corresponding to the main chain node to be connected is started.
The configuration module 10 is further configured to configure, through the local node, a function node address set to be connected and a main chain node address set corresponding to the function node to be connected.
A third constructing module 40, configured to connect the function node to be connected to the corresponding function network according to the address set of the function node to be connected after the function client corresponding to the function node to be connected is started, and connect the function node to be connected to the corresponding main chain node according to the address set of the main chain node corresponding to the function node to be connected.
The system for constructing the block chain comprises a configuration module, a first construction module, a second construction module and a third construction module, wherein the configuration module configures an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address; then, after an initial main chain node is started, a creating block is created through a local node by a first construction module, after at least one initial function node to be connected is started, connection between the initial main chain node and the at least one initial function node to be connected is established according to an initial function node address of the at least one initial function node to be connected in an initial connection file, and a function network name corresponding to the at least one initial function node to be connected is configured according to function information of the at least one initial function node to be connected in the initial connection file; then, the configuration module also configures a main chain node address set to be connected through the local node; then, after a main chain client corresponding to the main chain node to be connected is started, the second construction module connects the main chain node to be connected to the corresponding main chain node according to the main chain node address set to be connected so as to construct a main chain network; then, the configuration module also configures a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through the local node; then, after a function client corresponding to the function node to be connected is started, the third construction module connects the function node to be connected to a corresponding function network according to the address set of the function node to be connected, and connects the function node to be connected to a corresponding main chain node according to the address set of the main chain node corresponding to the function node to be connected; therefore, the node functions are divided, the data quantity required to be transmitted by the whole block chain network is reduced, the burden of the block chain network is reduced, and meanwhile, the node functions are determined, and the burden of each node is reduced.
In some embodiments, when any one functional node in the functional network operates, the functional node traverses the connected nodes, wherein when the connected nodes are traversed to be the main chain nodes, the main chain nodes are skipped; and when the connected nodes are traversed to be the functional nodes, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through an uploading node in the functional network.
In some embodiments, any one main chain node in the main chain network acquires a stage operation set packet uploaded by an upload node in a corresponding functional network, broadcasts the stage operation set packet in the main chain network, and after a preset time, a main chain production node determined by a main chain consensus mechanism packs the stage operation set packet in the main chain network and operations of the main chain nodes in the main chain network into blocks and links the blocks into a main chain block chain.
In some embodiments, when any one of the main chain nodes in the main chain network initiates an operation on a specific function network, the main chain node traverses the nodes connected to itself, wherein when the nodes connected to itself traversed are other main chain nodes, information is transmitted to other main chain nodes, so that the received information is sent to the specific function network for broadcasting when the other main chain nodes traverse the nodes connected to itself as the nodes of the specific function network; when the nodes connected with the nodes are traversed to be the nodes of the specific function network, the information is directly transmitted to the nodes of the specific function network, so that the nodes of the specific function network broadcast the received information in the specific function network; and when the nodes connected by traversing to the self are the nodes of other functional networks, the messages are forbidden to be transmitted to the nodes of other functional networks.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method of constructing a blockchain, comprising the steps of:
configuring an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address;
after an initial main chain node is started, creating a created block through a local node, after at least one initial function node to be connected is started, establishing connection between the initial main chain node and the at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in the initial connection file, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file;
configuring a main chain node address set to be connected through a local node, and connecting the main chain node to be connected to a corresponding main chain node according to the main chain node address set to be connected after a main chain client corresponding to the main chain node to be connected is started so as to construct a main chain network;
the method comprises the steps that a function node address set to be connected and a main chain node address set corresponding to a function node to be connected are configured through a local node, after a function client corresponding to the function node to be connected is started, the function node to be connected is connected to a corresponding function network according to the function node address set to be connected, and the function node to be connected is connected to the corresponding main chain node according to the main chain node address set corresponding to the function node to be connected.
2. The method of constructing a blockchain according to claim 1, wherein any one of the functional nodes in the functional network, when operating, traverses its own connected nodes, wherein,
skipping the main chain node when the connected nodes are traversed to be the main chain nodes;
and when the connected nodes are traversed to be the functional nodes, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through an uploading node in the functional network.
3. The method of constructing a blockchain of claim 2, wherein the uploading nodes in the functional network are determined by a dpss consensus mechanism and randomly distributed in the functional network.
4. The method for constructing the block chain according to any one of claims 1 to 3, wherein any one of the main chain nodes in the main chain network acquires a phase operation set package uploaded by an upload node in a corresponding functional network, broadcasts the phase operation set package in the main chain network, and after a preset time, a main chain production node determined by a main chain consensus mechanism packs the phase operation set package in the main chain network and operations of the main chain nodes in the main chain network into blocks and chains the blocks into a main chain block chain.
5. The method of constructing a blockchain according to any one of claims 1 to 3, wherein when any one of the main chain nodes in the main chain network initiates an operation on a particular functional network, the main chain node traverses nodes connected to itself, wherein,
when the nodes connected with the main chain nodes are traversed to be other main chain nodes, the information is transmitted to the other main chain nodes, so that the received information is sent to the specific function network for broadcasting when the other main chain nodes traverse the nodes connected with the main chain nodes to be the nodes of the specific function network;
when the nodes connected with the nodes are traversed to be the nodes of the specific function network, the information is directly transmitted to the nodes of the specific function network, so that the nodes of the specific function network broadcast the received information in the specific function network;
and when the nodes connected by traversing to the self are the nodes of other functional networks, the messages are forbidden to be transmitted to the nodes of other functional networks.
6. A computer-readable storage medium, on which a building program of a blockchain is stored, which when executed by a processor implements the building method of a blockchain according to any one of claims 1 to 5.
7. A building system of a blockchain comprising an arrangement module, a first building module, a second building module and a third building module, the arrangement module being connected to the first building module, the second building module and the third building module, respectively, wherein,
the configuration module is used for configuring an initial connection file through a local node, wherein the initial connection file comprises function information corresponding to at least one initial function node to be connected and an initial function node address;
the first construction module is used for creating a created block through a local node after an initial main chain node is started, establishing connection between the initial main chain node and at least one initial function node to be connected according to an initial function node address of the at least one initial function node to be connected in the initial connection file after the at least one initial function node to be connected is started, and configuring a function network name corresponding to the at least one initial function node to be connected according to function information of the at least one initial function node to be connected in the initial connection file;
the configuration module is also used for configuring a main chain node address set to be connected through the local node;
the second construction module is used for connecting the main chain nodes to be connected to the corresponding main chain nodes according to the main chain node address set to be connected after the main chain client corresponding to the main chain nodes to be connected is started so as to construct a main chain network;
the configuration module is also used for configuring a function node address set to be connected and a main chain node address set corresponding to the function node to be connected through the local node;
and the third construction module is used for connecting the functional nodes to be connected to the corresponding functional network according to the address set of the functional nodes to be connected after the functional client corresponding to the functional nodes to be connected is started, and connecting the functional nodes to be connected to the corresponding main chain nodes according to the address set of the main chain nodes corresponding to the functional nodes to be connected.
8. The system for constructing a blockchain of claim 7, wherein any one functional node in the functional network, when operating, traverses its connected nodes, wherein,
skipping the main chain node when the connected nodes are traversed to be the main chain nodes;
and when the connected nodes are traversed to be the functional nodes, transmitting the operation information to the connected functional nodes so that each functional node in the functional network receives and records the operation information until the time line reaches, and packaging and uploading the operation information to the main chain network through an uploading node in the functional network.
9. The system for constructing a blockchain according to claim 8, wherein any one of the main chain nodes in the main chain network obtains a phase operation set package uploaded by an upload node in a corresponding functional network, broadcasts the phase operation set package in the main chain network, and after a preset time, a main chain production node determined by a main chain consensus mechanism packages the phase operation set package in the main chain network and operations of the main chain nodes in the main chain network into blocks and links the blocks into a main chain blockchain.
10. The system of building a blockchain of any one of claims 7 to 9, wherein when any one of the backbone nodes in the backbone network initiates an operation on a particular functional network, the backbone node traverses its connected nodes, wherein,
when the nodes connected with the main chain nodes are traversed to be other main chain nodes, the information is transmitted to the other main chain nodes, so that the received information is sent to the specific function network for broadcasting when the other main chain nodes traverse the nodes connected with the main chain nodes to be the nodes of the specific function network;
when the nodes connected with the nodes are traversed to be the nodes of the specific function network, the information is directly transmitted to the nodes of the specific function network, so that the nodes of the specific function network broadcast the received information in the specific function network;
and when the nodes connected by traversing to the self are the nodes of other functional networks, the messages are forbidden to be transmitted to the nodes of other functional networks.
CN201810713792.5A 2018-07-03 2018-07-03 Block chain construction method, medium and system Active CN109165304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810713792.5A CN109165304B (en) 2018-07-03 2018-07-03 Block chain construction method, medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810713792.5A CN109165304B (en) 2018-07-03 2018-07-03 Block chain construction method, medium and system

Publications (2)

Publication Number Publication Date
CN109165304A CN109165304A (en) 2019-01-08
CN109165304B true CN109165304B (en) 2020-08-14

Family

ID=64897244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810713792.5A Active CN109165304B (en) 2018-07-03 2018-07-03 Block chain construction method, medium and system

Country Status (1)

Country Link
CN (1) CN109165304B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110308962B (en) * 2019-07-04 2022-08-23 明链科技(深圳)有限公司 Method, electronic device, and medium for managing block chain network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656974B (en) * 2016-10-17 2019-07-16 江苏通付盾科技有限公司 The grouping common recognition method and system of block chain
CN107995120B (en) * 2016-11-22 2019-08-09 南京银链信息科技有限公司 Construct the method and multi-tiling catenary system of multi-tiling chain
WO2018112940A1 (en) * 2016-12-23 2018-06-28 深圳前海达闼云端智能科技有限公司 Service execution method and device for blockchain node, and node device
CN107682308B (en) * 2017-08-16 2019-12-13 北京航空航天大学 Electronic evidence preservation system based on block chain latent channel technology

Also Published As

Publication number Publication date
CN109165304A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
CN111539726B (en) Block chain consensus system and method
CN110866825A (en) Public link-based block chain information storage method and system
CN111182067B (en) Data writing method and device based on interplanetary file system IPFS
CN103023928A (en) P2P (peer-to-peer) node matching system and method
CN103581231B (en) UGC master/slave data synchronous method and its system
CN104537076A (en) File reading and writing method and device
CN101588287B (en) Method, device and system for scheduling and downloading peer-to-peer network data
CN109120669B (en) Method, medium, and system for building block chain based on P2P internet
CN110602250A (en) Data synchronization method and device, server and terminal equipment
CN103384211B (en) Data manipulation method with fault tolerance and distributed type data storage system
CN103581216A (en) Fragmentation data storage method, device and system
CN101702678B (en) Star-shaped stack system and method thereof
WO2021190179A1 (en) Synchronous processing method and related apparatus
CN112417001B (en) Data processing method based on block chain network and related equipment
CN109165304B (en) Block chain construction method, medium and system
CN109756566A (en) Date storage method, relevant device and storage medium based on block chain
CN107087032A (en) Realize the method and apparatus that cluster is set up
CN110071968B (en) Block chain based message storage method and device
CN107612753B (en) Wireless information processing method and device and wireless access equipment
CN110298031B (en) Dictionary service system and model version consistency distribution method
CN102447605A (en) Method for requesting obtainment of routing information and corresponding routing equipment
CN107577822A (en) A kind of method of data synchronization, data synchronization unit and mobile terminal
CN115167907A (en) Terminal equipment upgrading method, server, electronic equipment and storage medium
CN106712995B (en) A kind of acquisition methods and device of multi-hop neighbor node
CN114996350A (en) Block state synchronization method in block chain and first node

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 361000 B1F-065, Zone A, Huaxun Building, Software Park, Xiamen Torch Hi-tech Zone, Huli District, Xiamen City, Fujian Province

Patentee after: Ke'an (Xiamen) Technology Co.,Ltd.

Address before: B1f-065, zone a, Huaxun building, software park, torch hi tech Zone, Xiamen City, Fujian Province, 361000

Patentee before: TAILIAN (XIAMEN) TECHNOLOGY Co.,Ltd.