CN109034809B - Block chain generation method and device, block chain node and storage medium - Google Patents

Block chain generation method and device, block chain node and storage medium Download PDF

Info

Publication number
CN109034809B
CN109034809B CN201810936522.0A CN201810936522A CN109034809B CN 109034809 B CN109034809 B CN 109034809B CN 201810936522 A CN201810936522 A CN 201810936522A CN 109034809 B CN109034809 B CN 109034809B
Authority
CN
China
Prior art keywords
block chain
block
transaction data
processed
service type
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
CN201810936522.0A
Other languages
Chinese (zh)
Other versions
CN109034809A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810936522.0A priority Critical patent/CN109034809B/en
Publication of CN109034809A publication Critical patent/CN109034809A/en
Application granted granted Critical
Publication of CN109034809B publication Critical patent/CN109034809B/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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

The application provides a block chain generation method, a block chain generation device, a block chain node and a storage medium, wherein the method comprises the following steps: acquiring transaction data to be processed, wherein the transaction data to be processed comprises transaction data of at least one service type, determining a corresponding target block chain identifier according to the transaction data to be processed of each service type, and generating a new block on a block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type. The method and the device realize that each block chain link point in one block chain network can commonly maintain a plurality of block chains, thereby writing the transaction data of different service types into different block chains for management, providing better flexibility and manageability and improving the efficiency of data management.

Description

Block chain generation method and device, block chain node and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a block chain generation method and apparatus, a block chain node, and a storage medium.
Background
With the rapid development of scientific technology, data security is more and more important, and the blockchain technology plays more and more important functions along with the characteristics that the blockchain technology cannot be tampered and counterfeited and the like.
In the prior art, each block link point in the same block chain network maintains a block chain together for storing transaction data.
However, the conventional block chaining technology has a slow writing speed, which results in low data processing efficiency.
Disclosure of Invention
The application provides a block chain generation method and device, a block chain node and a storage medium, which aim to overcome the defects of low data processing efficiency and the like of the block chain in the prior art.
A first aspect of the present application provides a method for generating a block chain, including:
acquiring transaction data to be processed, wherein the transaction data to be processed comprises transaction data of at least one service type;
determining a target block chain identifier corresponding to the transaction data to be processed of each service type according to the transaction data to be processed of each service type;
and generating a new block on the block chain corresponding to the target block chain identification according to the transaction data to be processed of each service type.
A second aspect of the present application provides an apparatus for generating a block chain, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring transaction data to be processed, and the transaction data to be processed comprises transaction data of at least one service type;
the processing module is used for determining a corresponding target block chain identifier according to the transaction data to be processed of each service type;
and the processing module is further configured to generate a new block on the block chain corresponding to the target block chain identifier according to the to-be-processed transaction data of each service type.
A third aspect of the present application provides a block link point, comprising: at least one processor and memory;
the memory stores a computer program; the at least one processor executes the computer program stored by the memory to implement the method provided by the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed, implements the method provided by the first aspect.
According to the block chain generation method and device, the block chain link points and the storage medium, transaction data to be processed are obtained, the transaction data to be processed comprise transaction data of at least one service type, a target block chain identification corresponding to the transaction data to be processed of each service type is determined according to the transaction data to be processed of each service type, and a new block is generated on the block chain corresponding to the target block chain identification according to the transaction data to be processed of each service type. The method and the device realize that each block chain link point in one block chain network can commonly maintain a plurality of block chains, thereby writing the transaction data of different service types into different block chains for management, providing better flexibility and manageability and improving the efficiency of data management.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a block chain generation method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a block chain generation method according to another embodiment of the present application;
fig. 4 is a schematic diagram illustrating a relationship between a block chain, a merkle tree and key-value data according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a block chain generation apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a blockchain node according to an embodiment of the present disclosure.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms referred to in this application are explained first:
and (4) service type: the data is classified according to the content related to the transaction data, for example, the transaction data is commodity order data, commodity information traceability data, supply chain financial data, commodity basic data, inventory data, and the like, that is, the business type may include commodity order data, commodity information traceability data, supply chain financial data, commodity basic data, inventory data, and the like, and other business types may also be set. The specific service type can be set according to actual requirements, and the application is not limited.
The operation type is as follows: the type of the information contained in the transaction data, the merkle tree, or the block is referred to, for example, a transaction data includes specific transaction information, account information, verification information, and the like, and the account information may include information such as a block chain address, a public key, a certificate, an identity, and the like. The merkle tree includes types such as a root node, a middle node, a leaf node, etc., the block may include types such as block header information, block body information, etc., or the block header information includes timestamp information, random number information, a hash value of the root node of the corresponding merkle tree, etc., the operation type may be set according to an actual requirement, and the specific partition granularity may also be set according to the actual requirement, which is not limited in the present application.
Creating a world block: refers to the first block generated when the block chain is generated, i.e., the first block of the block chain.
Consensus: refers to a process in which blockchain nodes in a blockchain network endorse consensus on submitted transaction data to be processed to allow new blocks to be generated.
merkle tree: a merkle Tree, also commonly referred to as a Hash Tree, is, as the name implies, a Tree that stores Hash values. A leaf (or leaf node) of a merkle tree is a hash value of a data block (e.g., a file or a collection of files). A non-leaf node is a hash of the series string of its corresponding child nodes. In the embodiment of the application, the leaf node of the merkle tree is a hash value of each granularity data of the transaction data to be processed after the granularity is refined.
Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
The block chain generation method provided by the embodiment of the application is suitable for the following scenes: fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present invention. The blockchain system may include a plurality of blockchain nodes, each of which collectively form a blockchain network. In practical application, a user may initiate a transaction request to a block link point in a block link network through a terminal, and submit transaction data to be processed, where the block link point performs corresponding data processing according to the transaction data to be processed, for example, requests other block link points to perform consensus processing on the transaction data to be processed, generate a new block, store data, and the like.
Example one
The embodiment provides a block chain generation method, which is used for generating a block chain. The execution subject of the embodiment is a block chain generation device, which may be disposed in a block chain node.
As shown in fig. 2, a schematic flow chart of a method for generating a block chain provided in this embodiment is shown, where the method includes:
step 101, transaction data to be processed is obtained, wherein the transaction data to be processed comprises transaction data of at least one service type.
And 102, determining a corresponding target block chain identifier according to the to-be-processed transaction data of each service type.
And 103, generating a new block on the block chain corresponding to the target block chain identification according to the transaction data to be processed of each service type.
The service type refers to classifying according to the content related to the transaction data, for example, the transaction data is commodity order data, commodity information traceability data, supply chain financial data, commodity basic data, inventory data, and the like, that is, the service type may include commodity order data, commodity information traceability data, supply chain financial data, commodity basic data, inventory data, and the like, and other service types may also be set. The specific service type can be set according to actual requirements, and the application is not limited.
The transaction data to be processed is the transaction data which is submitted by the user through the terminal and needs to generate the block chain. The transaction data to be processed may include transaction data of one service type or transaction data of multiple service types, and the transaction data of each service type may include one transaction or multiple transactions, which is not limited in this embodiment.
Each type of transaction data may include a service type corresponding to the transaction data, and specifically may include a corresponding service type identifier. The service type identifier may be a service type assigned to the user when the user submits the transaction data to be processed, for example, a service type option is set on a user interface for the user to select, and a specific display manner is not limited in this embodiment. The transaction data to be processed acquired by the terminal carries the corresponding service type identifier. The terminal submits the transaction data to be processed carrying the service type identifier to a block chain node for corresponding processing, the block chain node acquires the transaction data to be processed carrying the service type identifier, the transaction data to be processed can be divided into transaction data of different service types according to the service type identifier, and a target block chain identifier corresponding to the transaction data can be determined, so that a new block needs to be generated in which block chain.
After the block link point determines the corresponding target block chain identifier according to the transaction data to be processed of each service type, a new block can be generated on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type. The specific manner of generating the new block may be any implementable manner in the prior art, and the embodiment is not limited. The difference is that the information contained in the generated new block is different from the prior art, for example, the block header information of each block may include the block chain identifier of the block chain in which it is located. The information contained in the block may be set according to actual requirements, and this embodiment is not limited.
The target block chain identifier may be information for identifying the block chain generated for the block chain when the created block of the corresponding block chain is created, and may be generated for the block chain according to some existing unique identifier generation methods. The specific way of generating the blockchain identifier is not limited.
In the method for generating a block chain provided by this embodiment, transaction data to be processed is obtained, where the transaction data to be processed includes transaction data of at least one service type, a target block chain identifier corresponding to the transaction data to be processed of each service type is determined according to the transaction data to be processed of each service type, and a new block is generated on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, so that each block chain link point in one block chain network can commonly maintain multiple block chains, and thus transaction data of different service types can be written into different block chains for management, which can provide better flexibility and manageability, and improve efficiency of data management.
Example two
The present embodiment further supplements the method provided in the first embodiment.
As shown in fig. 3, a schematic flow chart of the block chain generation method provided in this embodiment is shown.
As a practical way, on the basis of the first embodiment, optionally before the step 101, the method may further include:
in step 2011, at least two sets of initial parameters are obtained, where each set of initial parameters corresponds to a different service type.
Specifically, the initial parameter may include information used to create a created block, such as an initial account and a random number, and may set a service type corresponding to the initial parameter, that is, a service type of transaction data managed by a block chain corresponding to the created block, so that a block chain for managing transaction data of different service types may be created. Each blockchain may be referred to as an ledger.
The primary account may include related information such as a blockchain address, a public key, a certificate, an identity, and the like, and may be specifically set according to actual requirements.
Step 2012, for each group of initial parameters, a corresponding created block is created according to the initial parameters, and a block chain identifier is determined for the block chain corresponding to the created block.
Specifically, after at least two sets of initial parameters are obtained, a corresponding created block, that is, the first block of at least two block chains, may be created according to each set of initial parameters.
For the blockchain corresponding to each created block, a blockchain identifier may be set for the blockchain, and the blockchain identifier may be generated for the blockchain according to some existing unique identifier generation methods, which is not limited in the embodiment of the present application.
Illustratively, a commodity order blockchain, a commodity information traceability blockchain, a supply chain financial blockchain, and the like may be created.
Alternatively, a hash value generated from the block information included in the created block may be used as the block chain identifier of the block chain corresponding to the created block. Specifically, any practicable hash algorithm may be used to generate the hash value of the block information included in the created block. The block information included in the created block may include information such as block header information and block body information, where the block header information may further include initial account information, random number information, and some other security information, and the like. For the concrete embodiment of various types of information, the embodiment of the present application is also not limited, and for example, the information may be encrypted or hash-calculated, and may be set according to actual requirements.
Optionally, determining a block chain identifier for a block chain corresponding to the created block may specifically include:
generating a hash value corresponding to the created block according to the block information included in the created block; and taking the hash value corresponding to the created block as the block chain identifier of the block chain corresponding to the created block.
Specifically, any practicable hash algorithm may be used to generate the hash value of the block information included in the created block. The block information included in the created block may include information such as block header information and block body information, where the block header information may further include initial account information, random number information, and some other security information, and the like. For the concrete embodiment of various types of information, the embodiment of the present application is also not limited, and for example, the information may be encrypted or hash-calculated, and may be set according to actual requirements.
Optionally, before generating a new block on the block chain corresponding to the target block chain identifier, the method may further include:
and carrying out consensus processing on the to-be-processed transaction data corresponding to different target block chain identifications in parallel.
Specifically, since the method of the embodiment of the present application can generate a plurality of block chains, although one block chain needs to be generated block by block according to a time sequence, the block chains can be generated in parallel between different block chains. Therefore, for the transaction data to be processed with different service types, the consensus processing can be performed in parallel according to the different target block chain identifications included in the transaction data, so that the transaction data can be input in parallel. The management of different block chains can be independent and not influenced mutually, and the efficiency of block chain data management is further improved.
For example, the pending transaction data of multiple service types may be sent in parallel to initiate a consensus request, that is, sent in parallel to other blockchain nodes in the blockchain network, and the consensus is achieved by the other blockchain nodes. The specific consensus operation may be the prior art, and is not described herein.
Optionally, the transaction data to be processed of each service type corresponds to a plurality of operation types; correspondingly, step 103 may specifically include:
and step 1031, for the transaction data to be processed of each service type, generating a mercker merkle tree according to the transaction data to be processed and the operation type corresponding to the transaction data to be processed.
And step 1032, generating a new block on the block chain corresponding to the target block chain identification according to the hash value of the root node of the merkle tree.
The operation type refers to a type of transaction data, a merkle tree, or information included in the block, for example, a type of transaction data includes specific transaction information, account information, verification information, and the like, and the account information may include information such as a block chain address, a public key, a certificate, an identity, and the like. The merkle tree includes types such as a root node, a middle node, a leaf node, etc., the block may include types such as block header information, block body information, etc., or the block header information includes timestamp information, random number information, a hash value of the root node of the corresponding merkle tree, etc., the operation type may be set according to an actual requirement, and the specific partition granularity may also be set according to the actual requirement, which is not limited in the present application.
For the to-be-processed transaction data of each service type, for example, the to-be-processed transaction data of a commodity order service type, it may include specific transaction information (commodity information, commodity quantity, customer information, etc.), account information (block chain address, public key, certificate, etc.), verification information (identity information, signature information), etc. operation types, and may perform fine-grained division on the to-be-processed transaction data according to these operation types, and generate a merkle tree according to the divided granularity, where the merkle tree represents index information of the divided granularity data. And generating a new block on the block chain corresponding to the target block chain identification according to the hash value of the root node of the merkle tree, wherein the block header information of the generated new block comprises the hash value of the root node of the merkle tree. Illustratively, a hash value is generated together as the block header information of the new block according to the hash value of the parent block referenced by the new block, the hash value of the root node of the merkle tree, a timestamp, a random number, and the like. Of course, the generated block header information may also include some other related information, such as information for security measures, and the like, which may be specifically set according to actual requirements, and the embodiment of the present application is not limited.
The specific generation manner of the merkle tree is the same as or similar to that of the merkle tree in the prior art, and is not described herein again.
Optionally, each piece of granularity data after the transaction data to be processed is finely divided may be stored in KEY VALUE data, that is, KEY-VALUE data is stored in a distributed manner. And generating a KEY for each piece of granularity data, wherein the specific granularity data is used as the VALUE corresponding to the KEY.
Fig. 4 is a schematic diagram illustrating a relationship between a block chain, a merkle tree and key-value data provided in this embodiment. K represents KEY, V represents VALUE, and K can uniquely identify V, namely one V can be uniquely determined according to one K. G0-G3 respectively indicate root nodes corresponding to the respective tiles, Y indicates leaf nodes, and M indicates intermediate nodes. V1 and V2 represent two versions of the same granularity data, namely V2 after a change is made to a certain granularity data V1. The specific KEY-VALUE association relationship is the prior art and is not described herein again. Each block corresponds to a root node of a merkle tree, and as the number of blocks increases, a root node corresponding to a previous block may become a child node of a next block adjacent to the previous block, so that the merkle tree increases as the number of blocks increases, the integrity of block chain data is maintained in this way, and the relationship between the block and each piece of granularity data after the transaction data to be processed is divided is conveniently maintained, for example, a hash value of the root node corresponding to the block can be obtained from the block, hash values of two child nodes (possibly middle nodes) below the root node can be obtained from the hash value of the root node, hash values of two child nodes below the child nodes can be obtained from the hash values of the child nodes until hash values of leaf nodes are obtained, a hash value of each piece of granularity data, such as a hash value of a key value to KV, can be obtained from the hash values of the leaf nodes, therefore, the key value pair can be obtained from the hash value of the key value pair, that is, one piece of granularity data can be obtained.
Alternatively, the data may be stored in the form of identification-data or some other implementable form for each granularity, not limited to key-value pair form.
As another practical manner, on the basis of the first embodiment, optionally, after determining a block chain identifier for a block chain corresponding to a created block, the method may further include:
and storing the related data of the block chains corresponding to different block chain identifications in a classified manner according to the block chain identifications.
Specifically, the related data of the blockchain may include data of the blockchain itself and some data other than the data written in the block, for example, the hash value of only the root node of the merkle tree is written in the block, while the merkle tree and the transaction data to be processed are not written in the block and need to be stored, and the specific related data may be set according to actual requirements. Since a plurality of block chains can be generated, each block chain has a corresponding block chain identifier, in order to facilitate management of relevant data corresponding to each block chain, such as query, update, and the like, the relevant data of each block chain can be stored in a sorted manner according to the block chain identifiers. The specific storage form may be any implementable form, and this embodiment is not limited, as long as the related data of different blockchains are stored in a classified manner, and the corresponding data can be conveniently found according to the blockchain identifier.
It should be noted that the respective implementable modes in the present embodiment may be implemented individually, or may be implemented in combination in any combination without conflict, and the present application is not limited thereto.
In the method for generating a block chain provided by this embodiment, transaction data to be processed is obtained, where the transaction data to be processed includes transaction data of at least one service type, a target block chain identifier corresponding to the transaction data to be processed of each service type is determined according to the transaction data to be processed of each service type, and a new block is generated on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, so that each block chain link point in one block chain network can commonly maintain multiple block chains, and thus transaction data of different service types can be written into different block chains for management, which can provide better flexibility and manageability, and improve efficiency of data management. And a plurality of block chains are generated in a block chain network formed by a group of block chain link points, so that the resources of the block chain nodes can be multiplexed, and more cost is not required to be generated while better flexibility and manageability are obtained. And the consensus processing can be performed in parallel, so that the data processing efficiency is further improved. The transaction data to be processed can be divided in a fine-grained manner, a merkle tree is generated, only the hash value of the root node of the corresponding merkle tree needs to be stored in the block, and all the transaction data blocks to be processed do not need to be stored, so that the flexibility of data management is further improved.
EXAMPLE III
The present embodiment provides a device for generating a block chain, which is used to execute the method for generating a block chain in the first embodiment.
As shown in fig. 5, a schematic structural diagram of a block chain generation apparatus provided in this embodiment is shown. The block chain generating device 30 includes an obtaining module 31 and a processing module 32.
The acquiring module 31 is configured to acquire transaction data to be processed, where the transaction data to be processed includes transaction data of at least one service type; the processing module 32 is configured to determine a target blockchain identifier corresponding to the transaction data to be processed according to each service type; the processing module 32 is further configured to generate a new block on the block chain corresponding to the target block chain identifier according to the to-be-processed transaction data of each service type.
The specific manner in which the respective modules perform operations has been described in detail in relation to the apparatus in this embodiment, and will not be elaborated upon here.
According to the device for generating the block chain provided by the embodiment, by acquiring the transaction data to be processed, wherein the transaction data to be processed includes the transaction data of at least one service type, determining the corresponding target block chain identifier according to the transaction data to be processed of each service type, and generating a new block on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, it is realized that each block chain link point in one block chain network can commonly maintain a plurality of block chains, so that the transaction data of different service types can be written into different block chains for management, better flexibility and manageability can be provided, and the efficiency of data management is improved.
Example four
The present embodiment further supplements the description of the apparatus provided in the third embodiment.
As an implementable manner, on the basis of the third embodiment, optionally, the obtaining module is further configured to obtain at least two sets of initial parameters, where each set of initial parameters corresponds to a different service type; and the processing module is also used for creating a corresponding created block according to the initial parameters for each group of initial parameters and determining a block chain identifier for the block chain corresponding to the created block.
Optionally, the processing module is specifically configured to:
generating a hash value corresponding to the created block according to the block information included in the created block; and taking the hash value corresponding to the created block as the block chain identifier of the block chain corresponding to the created block.
Optionally, the obtaining module is further configured to obtain to-be-processed transaction data, where the to-be-processed transaction data includes transaction data of at least one service type; the processing module is also used for determining a corresponding target block chain identifier according to the transaction data to be processed of each service type; and the processing module is also used for generating a new block on the block chain corresponding to the target block chain identification according to the transaction data to be processed of each service type.
Optionally, the processing module is further configured to perform consensus processing on the to-be-processed transaction data corresponding to different target blockchain identifiers in parallel.
Optionally, the transaction data to be processed of each service type corresponds to multiple operation types, and the operation types at least include a block header, a transaction and an account; correspondingly, the processing module is specifically configured to:
for the transaction data to be processed of each service type, generating a Mercker merkle tree according to the transaction data to be processed and the operation type corresponding to the transaction data to be processed; and generating a new block on the block chain corresponding to the target block chain identification according to the hash value of the root node of the merkle tree.
As another implementable manner, on the basis of the third embodiment, optionally, the processing module is further configured to store, in a classified manner, related data of the blockchains corresponding to different blockchain identifiers according to the blockchain identifier.
The specific manner in which the respective modules perform operations has been described in detail in relation to the apparatus in this embodiment, and will not be elaborated upon here.
It should be noted that the respective implementable modes in the present embodiment may be implemented individually, or may be implemented in combination in any combination without conflict, and the present application is not limited thereto.
According to the block chain generation device of the embodiment, by acquiring the transaction data to be processed, wherein the transaction data to be processed comprises the transaction data of at least one service type, determining the corresponding target block chain identifier according to the transaction data to be processed of each service type, and generating a new block on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, each block chain link point in one block chain network can commonly maintain a plurality of block chains, so that the transaction data of different service types can be written into different block chains for management, better flexibility and manageability can be provided, and the efficiency of data management is improved. And a plurality of block chains are generated in a block chain network formed by a group of block chain link points, so that the resources of the block chain nodes can be multiplexed, and more cost is not required to be generated while better flexibility and manageability are obtained. And the consensus processing can be performed in parallel, so that the data processing efficiency is further improved. The transaction data to be processed can be divided in a fine-grained manner, a merkle tree is generated, only the hash value of the root node of the corresponding merkle tree needs to be stored in the block, and all the transaction data blocks to be processed do not need to be stored, so that the flexibility of data management is further improved.
EXAMPLE five
The present embodiment provides a blockchain node, which is configured to perform the method provided in the foregoing embodiment.
As shown in fig. 6, a schematic structural diagram of a blockchain node provided in this embodiment is shown. The block link point 50 includes: at least one processor 51 and memory 52;
the memory stores a computer program; at least one processor executes the computer program stored in the memory to implement the methods provided by the above-described embodiments.
According to the block chain node of the embodiment, by acquiring the transaction data to be processed, the transaction data to be processed includes transaction data of at least one service type, determining the corresponding target block chain identifier according to the transaction data to be processed of each service type, and generating a new block on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, it is achieved that each block chain link point in one block chain network can commonly maintain a plurality of block chains, so that the transaction data of different service types can be written into different block chains for management, better flexibility and manageability can be provided, and the efficiency of data management is improved. And a plurality of block chains are generated in a block chain network formed by a group of block chain link points, so that the resources of the block chain nodes can be multiplexed, and more cost is not required to be generated while better flexibility and manageability are obtained. And the consensus processing can be performed in parallel, so that the data processing efficiency is further improved. The transaction data to be processed can be divided in a fine-grained manner, a merkle tree is generated, only the hash value of the root node of the corresponding merkle tree needs to be stored in the block, and all the transaction data blocks to be processed do not need to be stored, so that the flexibility of data management is further improved.
EXAMPLE six
The present embodiment provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed, the method provided by any one of the above embodiments is implemented.
According to the computer-readable storage medium of the embodiment, by acquiring the transaction data to be processed, which includes the transaction data of at least one service type, determining the corresponding target block chain identifier according to the transaction data to be processed of each service type, and generating a new block on the block chain corresponding to the target block chain identifier according to the transaction data to be processed of each service type, each block chain link point in one block chain network can commonly maintain a plurality of block chains, so that the transaction data of different service types can be written into different block chains for management, better flexibility and manageability can be provided, and the efficiency of data management is improved. And a plurality of block chains are generated in a block chain network formed by a group of block chain link points, so that the resources of the block chain nodes can be multiplexed, and more cost is not required to be generated while better flexibility and manageability are obtained. And the consensus processing can be performed in parallel, so that the data processing efficiency is further improved. The transaction data to be processed can be divided in a fine-grained manner, a merkle tree is generated, only the hash value of the root node of the corresponding merkle tree needs to be stored in the block, and all the transaction data blocks to be processed do not need to be stored, so that the flexibility of data management is further improved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A block chain generation method is characterized by comprising the following steps:
acquiring at least two groups of initial parameters, wherein each group of initial parameters corresponds to different service types;
for each group of initial parameters, creating a corresponding created block according to the initial parameters, and determining a block chain identifier for a block chain corresponding to the created block;
acquiring transaction data to be processed, wherein the transaction data to be processed comprises transaction data of at least one service type;
determining a target block chain identifier corresponding to the transaction data to be processed of each service type according to the transaction data to be processed of each service type;
the transaction data to be processed of each service type corresponds to a plurality of operation types;
for the transaction data to be processed of each service type, generating a Mercker merkle tree according to the transaction data to be processed and the operation type corresponding to the transaction data to be processed;
and generating a new block on the block chain corresponding to the target block chain identification according to the hash value of the root node of the merkle tree.
2. The method of claim 1, wherein determining a blockchain identifier for a blockchain corresponding to the created block comprises:
generating a hash value corresponding to the created block according to the block information included in the created block;
and taking the hash value corresponding to the created block as a block chain identifier of a block chain corresponding to the created block.
3. The method of claim 1, wherein before generating a new block on the block chain corresponding to the target block chain identifier, the method further comprises:
and performing consensus processing on the to-be-processed transaction data corresponding to different target blockchain identifications in parallel.
4. The method of claim 1, wherein after determining the blockchain identifier for the blockchain corresponding to the created block, the method further comprises:
and storing the related data of the block chains corresponding to different block chain identifications in a classified manner according to the block chain identifications.
5. An apparatus for generating a block chain, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring transaction data to be processed, and the transaction data to be processed comprises transaction data of at least one service type;
the processing module is used for determining a corresponding target block chain identifier according to the transaction data to be processed of each service type, wherein the transaction data to be processed of each service type corresponds to a plurality of operation types;
the processing module is further configured to generate a mercker merkle tree for the to-be-processed transaction data of each service type according to the to-be-processed transaction data and the operation type corresponding to the to-be-processed transaction data;
generating a new block on a block chain corresponding to the target block chain identification according to the hash value of the root node of the merkle tree;
the acquisition module is further configured to acquire at least two sets of initial parameters, where each set of initial parameters corresponds to a different service type;
the processing module is further configured to, for each group of initial parameters, create a corresponding created block according to the initial parameters, and determine a block chain identifier for a block chain corresponding to the created block.
6. The apparatus of claim 5, wherein the processing module is specifically configured to:
generating a hash value corresponding to the created block according to the block information included in the created block;
and taking the hash value corresponding to the created block as a block chain identifier of a block chain corresponding to the created block.
7. The apparatus of claim 5, wherein the processing module is further configured to perform consensus processing on the pending transaction data corresponding to different target blockchain identifiers in parallel.
8. The apparatus of claim 5, wherein the processing module is further configured to store related data of blockchains corresponding to different blockchain identifiers in a sorted manner according to the blockchain identifiers.
9. A block link point, comprising: at least one processor and memory;
the memory stores a computer program; the at least one processor executes the memory-stored computer program to implement the method of any of claims 1-4.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when executed, implements the method of any of claims 1-4.
CN201810936522.0A 2018-08-16 2018-08-16 Block chain generation method and device, block chain node and storage medium Active CN109034809B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810936522.0A CN109034809B (en) 2018-08-16 2018-08-16 Block chain generation method and device, block chain node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810936522.0A CN109034809B (en) 2018-08-16 2018-08-16 Block chain generation method and device, block chain node and storage medium

Publications (2)

Publication Number Publication Date
CN109034809A CN109034809A (en) 2018-12-18
CN109034809B true CN109034809B (en) 2021-08-17

Family

ID=64631789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810936522.0A Active CN109034809B (en) 2018-08-16 2018-08-16 Block chain generation method and device, block chain node and storage medium

Country Status (1)

Country Link
CN (1) CN109034809B (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109687953B (en) * 2018-12-24 2021-12-31 杭州复杂美科技有限公司 Transaction classification method, apparatus and storage medium
CN109803000A (en) * 2018-12-29 2019-05-24 莆田市烛火信息技术有限公司 A kind of account book accounting system of the shared block chain network for calculating power of multichain
CN109684880A (en) * 2019-01-07 2019-04-26 江西金格科技股份有限公司 A kind of web data guard method based on block chain
CN109903193A (en) * 2019-01-17 2019-06-18 平安城市建设科技(深圳)有限公司 The distribution method of commission, device, equipment and storage medium in house prosperity transaction
CN109785136A (en) * 2019-01-30 2019-05-21 北京京东尚科信息技术有限公司 A kind of transaction processing method of block chain, client and block chain network
CN109784956B (en) * 2019-02-25 2023-05-30 重庆邮电大学 Agricultural product tracing method based on block chain technology
SG11202002614XA (en) 2019-09-12 2020-04-29 Alibaba Group Holding Ltd Log-structured storage systems
WO2019228572A2 (en) * 2019-09-12 2019-12-05 Alibaba Group Holding Limited Log-structured storage systems
CN110633323B (en) * 2019-09-16 2023-10-20 腾讯科技(深圳)有限公司 Service data storage method, device, storage medium and computer equipment
CN110602222B (en) * 2019-09-18 2022-06-28 腾讯科技(深圳)有限公司 Joint monitoring method and device based on block chain and computer storage medium
CN110602246B (en) * 2019-09-26 2022-04-15 腾讯科技(深圳)有限公司 Resource distribution method and device based on block chain and block chain system
CN110708390A (en) * 2019-10-16 2020-01-17 腾讯科技(深圳)有限公司 Data processing method, device, apparatus and medium based on inter-node data sharing
CN110852800A (en) * 2019-11-07 2020-02-28 深圳前海点金保理有限公司 Method for integrating trade information, terminal device and storage medium
CN110912707B (en) * 2019-11-22 2021-09-10 腾讯科技(深圳)有限公司 Block chain-based digital certificate processing method, device, equipment and storage medium
CN110958324B (en) * 2019-12-12 2023-12-19 度小满科技(北京)有限公司 Data processing method and device of block chain network
CN111311284B (en) * 2020-02-20 2021-10-08 台州市凌亚塑胶模具有限公司 Cosmetics traceability platform system based on block chain
CN111541756B (en) * 2020-04-17 2021-10-15 腾讯科技(深圳)有限公司 Block generation method, block generation device, node equipment and storage medium
CN111723094B (en) * 2020-06-18 2022-08-05 清华大学 Block data distribution storage method and system based on scene
CN111475501B (en) * 2020-06-24 2020-10-30 支付宝(杭州)信息技术有限公司 Data cleaning method and device for block chain network
CN111478829B (en) * 2020-06-24 2020-10-30 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN112910724B (en) * 2020-06-24 2022-08-09 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN112102081B (en) * 2020-08-19 2024-04-09 天星数科科技有限公司 Method, device, readable storage medium and blockchain network for generating blockchain
CN112000973A (en) * 2020-08-26 2020-11-27 杭州甘道智能科技有限公司 Blood data storage method, device, node server and storage medium
CN112182111B (en) * 2020-10-13 2022-07-19 齐鲁云商数字科技股份有限公司 Block chain based distributed system layered processing method and electronic equipment
CN113031883A (en) * 2021-02-26 2021-06-25 广东核电合营有限公司 Label data printing method, label data printing device, computer equipment and storage medium
CN113177227A (en) * 2021-04-26 2021-07-27 中国联合网络通信集团有限公司 Information verification method and device based on block chain
CN113407624A (en) * 2021-06-05 2021-09-17 广东辰宜信息科技有限公司 Block chain automatic grouping method and device and computer readable storage medium
CN113836147A (en) * 2021-11-26 2021-12-24 广东辰宜信息科技有限公司 Chain identifier generation method and device, chain cluster management method, system and medium
CN114510736A (en) * 2022-04-18 2022-05-17 武汉龙津科技有限公司 Information processing method, device, terminal and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4342278B2 (en) * 2003-11-18 2009-10-14 アジア航測株式会社 Water management system
CN106886560A (en) * 2016-12-29 2017-06-23 北京瑞卓喜投科技发展有限公司 The generation method and system of tree-like block chain
CN106775497A (en) * 2017-01-19 2017-05-31 郑志超 Distributed storage method and equipment based on block chain
CN106899680B (en) * 2017-03-09 2019-07-30 深圳壹账通智能科技有限公司 The fragment treating method and apparatus of multi-tiling chain
CN107360206B (en) * 2017-03-29 2020-03-27 创新先进技术有限公司 Block chain consensus method, equipment and system
CN107368259B (en) * 2017-05-25 2020-07-10 创新先进技术有限公司 Method and device for writing service data into block chain system
CN107291862A (en) * 2017-06-12 2017-10-24 腾讯科技(深圳)有限公司 Business datum storage method, device, storage medium and electronic equipment
CN108156232A (en) * 2017-12-22 2018-06-12 王轶捷 Data sharing method and device

Also Published As

Publication number Publication date
CN109034809A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109034809B (en) Block chain generation method and device, block chain node and storage medium
CN108932348B (en) Block chain merging processing method and device, block chain node and storage medium
CN109255056B (en) Data reference processing method, device, equipment and storage medium of block chain
JP7362654B2 (en) Maintenance and management of blockchain blocks in a divided blockchain network
CN110868440B (en) Block chain male chain
EP3678346B1 (en) Blockchain smart contract verification method and apparatus, and storage medium
US20200167366A1 (en) Data processing method and device
CN105243067B (en) A kind of method and device for realizing real-time incremental synchrodata
CN109165221A (en) Date storage method, device, block chain node and the storage medium of block chain
CN108846753B (en) Method and apparatus for processing data
CN109298835B (en) Data archiving processing method, device, equipment and storage medium of block chain
AU2015347304B2 (en) Testing insecure computing environments using random data sets generated from characterizations of real data sets
JP7133647B2 (en) DATA PROCESSING METHOD, APPARATUS AND COMPUTER-READABLE STORAGE MEDIUM
CN102170440A (en) Method suitable for safely migrating data between storage clouds
CN108319661A (en) A kind of structured storage method and device of spare part information
CN111506589B (en) Block chain data service system, access method and storage medium based on alliance chain
CN105812175B (en) Resource management method and resource management equipment
CN102202087A (en) Method for identifying storage equipment and system thereof
WO2022083436A1 (en) Data processing method and apparatus, and device and readable storage medium
CN110597922A (en) Data processing method, device, terminal and storage medium
CN111538786A (en) Block chain data desensitization and tracing storage method and device
CN106649602A (en) Way, device and server of processing business object data
CN110910143A (en) Identity identification generation method, device, related node and medium
CN114127724A (en) Integrity audit for multi-copy storage
CN110119947B (en) Method and apparatus for shared workload proof computing power generation of symbiotic blockchains

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