CN111400399A - Account book synchronization method and device of block chain system and hardware equipment - Google Patents

Account book synchronization method and device of block chain system and hardware equipment Download PDF

Info

Publication number
CN111400399A
CN111400399A CN202010155381.6A CN202010155381A CN111400399A CN 111400399 A CN111400399 A CN 111400399A CN 202010155381 A CN202010155381 A CN 202010155381A CN 111400399 A CN111400399 A CN 111400399A
Authority
CN
China
Prior art keywords
block
node
account book
space
data
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.)
Granted
Application number
CN202010155381.6A
Other languages
Chinese (zh)
Other versions
CN111400399B (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.)
Liannong Shenzhen Information Technology Co ltd
Original Assignee
Liannong Shenzhen 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 Liannong Shenzhen Information Technology Co ltd filed Critical Liannong Shenzhen Information Technology Co ltd
Priority to CN202010155381.6A priority Critical patent/CN111400399B/en
Publication of CN111400399A publication Critical patent/CN111400399A/en
Application granted granted Critical
Publication of CN111400399B publication Critical patent/CN111400399B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a block chain system account book synchronization method, device and hardware equipment, relates to the technical field of block chains, and is used for reducing block account books stored in the block chain system and improving the operation efficiency of the block chain system. The main technical scheme of the invention is as follows: receiving a block account book, and determining a block node corresponding to the data type according to the block abstract information; taking a block node of a data type corresponding to the block abstract information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table; calculating the network bandwidth required by the transmission block account book according to the data of the space size required by the block and the important grade information of the block; taking a first block node of which the residual space of the block is larger than the size of the space required by the block as a second block node; taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block account book to the target node.

Description

Account book synchronization method and device of block chain system and hardware equipment
Technical Field
The invention relates to the technical field of block chains, in particular to an account book synchronization method and device of a block chain system and hardware equipment.
Background
The block chain is a recording technology different from the traditional centralized accounting mode, participates in nodes on the block chain system, possibly does not belong to the same organization and does not need to trust each other; the blockchain data is maintained by all nodes together, and each node participating in maintenance can obtain a copy of the complete record. Compared with the traditional accounting technology, the method has the characteristics that: maintaining a chain which grows continuously, only adding records possibly, and the records which occur cannot be tampered; can achieve the consensus without centralized control.
As the number of the block chain link points is increased, the operation efficiency of the block chain is reduced, and the computational cost charged to the user is increased, which has seriously influenced the application development of the block chain technology. In the blockchain platform, in order to ensure the security of data storage, data of any one node needs to be synchronously stored to other nodes after being updated, however, as the stored data is more and more, the data needing to be synchronized between the nodes is more and more, which results in longer time consumption for each synchronization, and as the nodes are more and more, the time required for a latest data to be synchronized to all the nodes is more and more, which results in lower efficiency of blockchain operation.
Disclosure of Invention
The invention provides a method and a device for synchronizing accounts of a block chain system, computer equipment and a storage medium, which are used for reducing block accounts stored in the block chain system and improving the operation efficiency of the block chain system.
An embodiment of the present invention provides an account book synchronization method for a block chain system, where the block chain system includes a plurality of block nodes and a block synchronization center node corresponding to the plurality of block nodes, and the method is applied to the block synchronization center node, and the method includes:
receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type;
taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table, wherein the preset block node residual space table dynamically stores block residual spaces respectively corresponding to different block nodes;
calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block;
taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system;
taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
An embodiment of the present invention provides an account book synchronization apparatus for a block chain system, where the block chain system includes a plurality of block nodes and a block synchronization center node corresponding to the plurality of block nodes, and the apparatus is applied to the block synchronization center node, and the apparatus includes:
the receiving module is used for receiving and storing a block account book sent by a block generating node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
the determining module is used for determining block nodes corresponding to data types according to the block abstract information, and each block node correspondingly stores a block account book of one data type;
an obtaining module, configured to use a block node of a data type corresponding to the block summary information as a first block node, and obtain, from a preset block node remaining space table, the first block node having a block remaining space larger than the data of the size of the space required by the block, where block remaining spaces respectively corresponding to different block nodes are dynamically stored in the preset block node remaining space table;
the calculation module is used for calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the information of the importance level of the block;
the obtaining module is further configured to obtain a network bandwidth of a second block node in the block chain system by using a first block node, as the second block node, where the remaining space of the block is larger than the data of the size of the space required by the block;
a synchronization module, configured to use a block node that meets a network bandwidth required by the block book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the ledger synchronization method of the blockchain system when executing the computer program.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the ledger synchronization apparatus of the above-described blockchain system.
The invention provides a block chain system account book synchronization method, a device, computer equipment and a storage medium, which are used for receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block important grade information; determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type; taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table; calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block; taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system; taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node. According to the embodiment of the invention, the target node is selected from the plurality of block nodes based on the block abstract information, the data of the space size required by the block and the block importance level information, and then the block account book is synchronized to the target node, so that the block account book stored in the block chain system can be reduced, and the operation efficiency of the block chain system is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart of a method for book synchronization in a blockchain system according to an embodiment of the present invention;
FIG. 2 is a flow chart of determining a block node of a data type corresponding to a block ledger in an embodiment of the present invention;
FIG. 3 is a flow chart of calculating the network bandwidth required for a block ledger in an embodiment of the present invention;
FIG. 4 is a schematic block diagram of an account book synchronization apparatus of the blockchain system according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
In an embodiment, as shown in fig. 1, there is provided a book synchronization method for a blockchain system, where the blockchain system includes a plurality of block nodes and a blockchain synchronization center node corresponding to the plurality of block nodes, and the blockchain synchronization center node is configured to uniformly manage book synchronization work of each block node, and the method is applied to the blockchain synchronization center node, and includes the following steps:
and S10, receiving and storing the block account book sent by the block generation node.
The block account book comprises block abstract information, data of the size of space required by the block and block important level information, wherein the block abstract information is an abstract of the content contained in the block account book, the data of the size of space required by the block is used for describing the data storage space occupied by the block account book, and a user of the block important level information represents the important degree of the block account book. In the embodiment of the present invention, the block ledger in the block generation node is generated according to all the intelligent contracts in the packaged consensus time, that is, the block production node packages all the intelligent contracts in the consensus time to generate the block ledger, and then sends the block ledger to the block synchronization center node, so that the block synchronization center node selectively synchronizes the block ledger to other block nodes.
It should be noted that, in the process of packaging the intelligent contract, the block generation node needs to determine corresponding block summary information and block importance level information according to the content of the packaged intelligent contract, then counts the size of the storage space required by the packaged intelligent contract, and packages the block summary information, the data of the size of the space required by the block, and the block importance level information as a block header together with the intelligent contract in the consensus time to obtain a block ledger.
And S20, determining the block node corresponding to the data type according to the block summary information.
Each block node correspondingly stores a block book of a data type, and the data type may be specifically set according to an actual situation, for example, the data type may be a bank data type, an insurance data type, a shopping data type, a dining data type, and the like. In the embodiment of the present invention, the block node of the corresponding data type may be determined according to the block summary information of the block ledger, specifically, the block node of the data type corresponding to the block ledger may be determined by a keyword recognition technology, and if the keyword recognition is performed on the block summary information, a keyword "insurance" is obtained, that is, the corresponding data type may be determined to be an insurance data type by the keyword, so that the block node of the insurance data type corresponding to the block ledger is obtained.
As shown in fig. 2, in one embodiment of the present invention, step S20: the determining the block node corresponding to the data type according to the block summary information includes:
s201, converting the block summary information into a text feature vector.
S202, inputting the text feature vector into a data type identification model to obtain a data type corresponding to the block summary information.
The data type identification model is obtained by training according to a large amount of sample data, namely the data type identification model is obtained by training according to a large amount of block abstract sample information and the corresponding data types thereof. In the embodiment of the invention, the text feature vector is input into the pre-trained data type identification model to obtain the data type corresponding to the block abstract information, and the data type identification model is trained according to a large amount of sample data, so that the data type corresponding to the block abstract information can be accurately obtained through the data type identification model.
S30, using the block node of the data type corresponding to the block summary information as the first block node, and obtaining the first block node whose block remaining space is larger than the data of the space size required by the block from the preset block node remaining space table.
Wherein, the block residual space corresponding to different block nodes is dynamically stored in the preset block node residual space table; namely, the block residual space corresponding to each block node is dynamically updated and stored in real time according to the real-time storage condition of the block node.
In the embodiment of the present invention, the first block node, which obtains the data that the block remaining space is larger than the size of the space required by the block from the preset block node remaining space table, is to obtain the block node, which can have enough storage space to store the block book, from the first block node.
And S40, calculating the network bandwidth required for transmitting the block book according to the data of the space size required by the block and the information of the importance level of the block.
In the embodiment of the invention, the larger the data of the space size required by the block is, the higher the important grade information of the block is, the higher the requirement of the block account book on the required network bandwidth is; conversely, the smaller the data of the size of the space required by the block is, the lower the information of the importance level of the block is, and the lower the requirement of the block book on the required network bandwidth is.
As shown in fig. 3, in an embodiment of the present invention, step S40: the calculating the network bandwidth required for transmitting the block account book according to the data of the space size required by the block and the information of the importance level of the block comprises the following steps:
s401, determining the transmission time required by the block account book according to the block importance level information; different block importance level information corresponds to different block account book transmission times.
The block important level information can be used for expressing the transmission time of the block account book, and the higher the block important level information is, the shorter the required transmission time of the block account book is; the lower the block importance level information, the longer the required transmission time of the block ledger is. Specifically, the determining the transmission time required by the block book according to the block importance level information includes: and determining transmission time corresponding to the important grade information of the block according to a block grade information table, wherein the transmission time corresponding to different important grade information of the block is stored in the block grade information table. For example, if the block importance level information is 3, the required transmission time is 1 minute; if the block importance level information is 2, the required transmission time is 2 minutes; if the block importance level information is 3, the required transmission time is 3 minutes, and the embodiment of the present invention is not limited in detail.
S402, determining a network bandwidth required by the block account according to a ratio of the data of the required space size of the block to the transmission time.
In the embodiment of the present invention, the transmission time required by the block ledger is determined according to the block importance level information, and then the network bandwidth required by the block ledger is determined according to the ratio of the data of the space size required by the block to the transmission time. Because the network bandwidth is determined according to the ratio of the data of the space size required by the block to the transmission time, the embodiment of the invention can accurately determine the network bandwidth required by transmitting the block account book, so that a second block node meeting the network bandwidth is selected from the first block nodes in the subsequent steps according to the determined network bandwidth.
S50, using the first block node whose remaining space of the block is larger than the size of the space required by the block as a second block node, and obtaining the network bandwidth of the second block node in the block chain system.
S60, regarding a block node satisfying the network bandwidth required by the block book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
In the embodiment of the invention, after receiving a block account book, a block synchronization center node firstly determines a block node needing to store the block account book according to block abstract information of the block account book, then selects a first block node with a block residual space larger than data of the size of the space required by the block from the block nodes selected based on the block abstract information, and then takes the first block node with the block residual space larger than the data of the size of the space required by the block as a second block node to acquire the network bandwidth of the second block node in a block chain system; taking a block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node. According to the embodiment of the invention, the target node is selected from the plurality of block nodes based on the block abstract information, the data of the space size required by the block and the block importance level information, and then the block account book is synchronized to the target node, so that the block account book stored in the block chain can be reduced, and the operation efficiency of the block chain is improved.
For the embodiment of the present invention, in order to update the block remaining space corresponding to the block node in the preset block node remaining space table in real time, after synchronizing the block ledger to the target node, the embodiment of the present invention further needs to acquire the block remaining space of the target node, and then update the block remaining space of the corresponding block node in the preset block node remaining space table according to the block remaining space of the target node, so as to implement dynamic update of data in the preset block node remaining space table, and thus, in the subsequent process, the block node meeting the space required by the block ledger can be accurately selected according to the preset block node remaining space table.
In one embodiment provided by the present invention, after taking a block node satisfying the network bandwidth in the second block nodes as a target node, the method further includes: sending a query request to the target node, wherein the query request is used for querying partial content of a target block in the target node; receiving partial contents of the target blocks fed back by a plurality of target nodes; determining the reliability of each target node by comparing the partial content of the target block fed back by each target node with the partial content of the target block stored locally; correspondingly, the synchronizing the block book to the target node includes: and synchronizing the block account book to the target node with the reliability degree larger than a threshold value. Wherein, the partial content of the target block is: some transaction information in the target block, a target field value in a block of the target block, and the like, which are not specifically limited in the embodiments of the present invention.
It should be noted that, in the embodiment of the present invention, the reliability of the target node may be specifically determined according to the text similarity, that is, the partial content of the target block fed back by the target node and the partial content of the local target block are compared by a text similarity algorithm, the reliability of each target node is determined, that is, the similarity between the partial content of the target block fed back by the target node and the partial content of the local target block is determined, and then the block ledger is synchronized to the target node whose similarity is greater than the threshold.
The invention provides an account book synchronization method of a block chain system, which is used for receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type; taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table; calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block; taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system; taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node. According to the embodiment of the invention, the target node is selected from the plurality of block nodes based on the block abstract information, the data of the space size required by the block and the block importance level information, and then the block account book is synchronized to the target node, so that the block account book stored in the block chain system can be reduced, and the operation efficiency of the block chain system is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment of the present invention, an account book synchronization apparatus of a blockchain system is provided, where the account book synchronization apparatus of the blockchain system corresponds to the account book synchronization method of the blockchain system in the above embodiments one to one. As shown in fig. 4, the block chain system includes a plurality of block nodes and a block synchronization center node corresponding to the plurality of block nodes, and the apparatus is applied to the block synchronization center node, and the book synchronization apparatus of the block chain system includes: the device comprises a receiving module 10, a determining module 20, an obtaining module 30, a calculating module 40 and a synchronizing module 50. The functional modules are explained in detail as follows:
the receiving module 10 is configured to receive and store a block account book sent by a block generation node, where the block account book includes block summary information, data of space size required by a block, and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
a determining module 20, configured to determine, according to the block summary information, block nodes corresponding to data types, where each block node stores a block ledger of one data type correspondingly;
an obtaining module 30, configured to use a block node of a data type corresponding to the block summary information as a first block node, and obtain, from a preset block node remaining space table, the first block node whose block remaining space is larger than the data of the size of the space required by the block, where block remaining spaces respectively corresponding to different block nodes are dynamically stored in the preset block node remaining space table;
a calculating module 40, configured to calculate, according to the data of the size of the space required by the block and the information of the importance level of the block, a network bandwidth required for transmitting the block account book;
the obtaining module 30 is further configured to use a first block node whose remaining space of the block is larger than the size of the space required by the block as a second block node, and obtain a network bandwidth of the second block node in the block chain system;
a synchronization module 50, configured to use a block node, which satisfies the network bandwidth required by the block book, in the second block node as a target node; and synchronizing the block ledger to the target node.
Further, the apparatus further comprises:
the obtaining module 30 is further configured to obtain a block remaining space of the target node,
an updating module 60, configured to update the block remaining space of the corresponding block node in the preset block node remaining space table according to the block remaining space of the target node.
Further, the apparatus further comprises:
a sending module 70, configured to send a query request to the target node, where the query request is used to query partial content of a target block in the target node;
the receiving module 10 is further configured to receive partial content of the target block fed back by a plurality of target nodes;
the determining module 20 is further configured to determine the reliability of each target node by comparing the partial content of the target block fed back by each target node with the partial content of the target block stored locally;
the synchronization module 50 is specifically configured to synchronize the block ledger to the target node with the reliability greater than the threshold.
Specifically, the determining module 20 includes:
the conversion unit is used for converting the block abstract information into a text feature vector;
and the calculation unit is used for inputting the text feature vectors into a data type recognition model to obtain the data types corresponding to the block abstract information, and the data type recognition model is obtained by training according to a large amount of block abstract sample information and the data types corresponding to the block abstract sample information.
Specifically, the calculating module 40 includes:
the determining unit is used for determining the transmission time required by the block account book according to the block importance level information; different important grade information of the blocks corresponds to different block account book transmission time;
the determining unit is further configured to determine, according to a ratio of the size data of the space required by the block to the transmission time, a network bandwidth required by the block book.
The determining unit is further configured to determine transmission times corresponding to the block importance level information according to a block level information table, where transmission times corresponding to different pieces of block importance level information are stored in the block level information table.
For specific limitations of the ledger synchronization apparatus of the blockchain system, reference may be made to the above limitations of the ledger synchronization method of the blockchain system, and details thereof are not repeated here. The modules in the book synchronization apparatus of the above-described blockchain system may be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a ledger synchronization method for a blockchain system.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type;
taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table, wherein the preset block node residual space table dynamically stores block residual spaces respectively corresponding to different block nodes;
calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block;
taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system;
taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type;
taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table, wherein the preset block node residual space table dynamically stores block residual spaces respectively corresponding to different block nodes;
calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block;
taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system;
taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
It will be understood by those of ordinary skill in the art that all or a portion of the processes of the methods of the embodiments described above may be implemented by a computer program that may be stored on a non-volatile computer-readable storage medium, which when executed, may include the processes of the embodiments of the methods described above, wherein any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will 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 technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. An account book synchronization method for a block chain system, wherein the block chain system comprises a plurality of block nodes and a block synchronization center node corresponding to the plurality of block nodes, and the method is applied to the block synchronization center node, and is characterized in that the method comprises the following steps:
receiving and storing a block account book sent by a block generation node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
determining block nodes corresponding to the data types according to the block abstract information, wherein each block node correspondingly stores a block account book of one data type;
taking a block node of a data type corresponding to the block summary information as a first block node, and acquiring the first block node of which the block residual space is larger than the data of the space size required by the block from a preset block node residual space table, wherein the preset block node residual space table dynamically stores block residual spaces respectively corresponding to different block nodes;
calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the important grade information of the block;
taking a first block node of which the block residual space is larger than the data of the space size required by the block as a second block node, and acquiring the network bandwidth of the second block node in the block chain system;
taking the block node meeting the network bandwidth required by the block account book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
2. The book synchronization method of a blockchain system according to claim 1, wherein after synchronizing the block book to the target node, the method further comprises:
and acquiring the block residual space of the target node, and updating the block residual space of the corresponding block node in the preset block node residual space table according to the block residual space of the target node.
3. The book synchronization method of a blockchain system according to claim 1, wherein after a block node satisfying the network bandwidth among the second block nodes is taken as a target node, the method further comprises:
sending a query request to the target node, wherein the query request is used for querying partial content of a target block in the target node;
receiving partial contents of the target blocks fed back by a plurality of target nodes;
determining the reliability of each target node by comparing the partial content of the target block fed back by each target node with the partial content of the target block stored locally;
the synchronizing the block ledger to the target node comprises:
and synchronizing the block account book to the target node with the reliability degree larger than a threshold value.
4. The book synchronization method of a blockchain system according to claim 1, wherein the determining the block nodes of the corresponding data types according to the block summary information comprises:
converting the block summary information into a text feature vector;
and inputting the text feature vector into a data type recognition model to obtain a data type corresponding to the block abstract information, wherein the data type recognition model is obtained by training according to a large amount of block abstract sample information and the corresponding data type.
5. The book synchronization method of a blockchain system according to claim 4, wherein the calculating the network bandwidth required for transmitting the block book according to the data of the size of the space required by the block and the information of the importance level of the block includes:
determining the transmission time required by the block account book according to the block importance level information; different important grade information of the blocks corresponds to different block account book transmission time;
and determining the network bandwidth required by the block account book according to the ratio of the space size data required by the block to the transmission time.
6. The method of claim 5, wherein the determining the transmission time required for the block ledger according to the block importance level information comprises:
and determining transmission time corresponding to the important grade information of the block according to a block grade information table, wherein the transmission time corresponding to different important grade information of the block is stored in the block grade information table.
7. An account book synchronization apparatus for a block chain system, the block chain system including a plurality of block nodes and a block synchronization center node corresponding to the plurality of block nodes, the apparatus being applied to the block synchronization center node, the apparatus comprising:
the receiving module is used for receiving and storing a block account book sent by a block generating node, wherein the block account book comprises block abstract information, data of space size required by a block and block importance level information; the block account book in the block generating node is generated according to all intelligent contracts in the packaging consensus time;
the determining module is used for determining block nodes corresponding to data types according to the block abstract information, and each block node correspondingly stores a block account book of one data type;
an obtaining module, configured to use a block node of a data type corresponding to the block summary information as a first block node, and obtain, from a preset block node remaining space table, the first block node having a block remaining space larger than the data of the size of the space required by the block, where block remaining spaces respectively corresponding to different block nodes are dynamically stored in the preset block node remaining space table;
the calculation module is used for calculating the network bandwidth required by transmitting the block account book according to the data of the space size required by the block and the information of the importance level of the block;
the obtaining module is further configured to obtain a network bandwidth of a second block node in the block chain system by using a first block node, as the second block node, where the remaining space of the block is larger than the data of the size of the space required by the block;
a synchronization module, configured to use a block node that meets a network bandwidth required by the block book in the second block nodes as a target node; and synchronizing the block ledger to the target node.
8. The ledger synchronization apparatus of a block chain system according to claim 7, characterized in that the apparatus further comprises:
the obtaining module is further configured to obtain a block remaining space of the target node,
and the updating module is used for updating the block residual space of the corresponding block node in the preset block node residual space table according to the block residual space of the target node.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the ledger synchronization method of the blockchain system of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the ledger synchronization method of the blockchain system according to any one of claims 1 to 6.
CN202010155381.6A 2020-03-04 2020-03-04 Ledger synchronization method, device and hardware equipment of blockchain system Active CN111400399B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010155381.6A CN111400399B (en) 2020-03-04 2020-03-04 Ledger synchronization method, device and hardware equipment of blockchain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010155381.6A CN111400399B (en) 2020-03-04 2020-03-04 Ledger synchronization method, device and hardware equipment of blockchain system

Publications (2)

Publication Number Publication Date
CN111400399A true CN111400399A (en) 2020-07-10
CN111400399B CN111400399B (en) 2023-11-14

Family

ID=71432276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010155381.6A Active CN111400399B (en) 2020-03-04 2020-03-04 Ledger synchronization method, device and hardware equipment of blockchain system

Country Status (1)

Country Link
CN (1) CN111400399B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645278A (en) * 2021-07-23 2021-11-12 湖南大学 Cross-chain message transmission method, device and storage medium of block chain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108305056A (en) * 2018-03-27 2018-07-20 搜游网络科技(北京)有限公司 Data processing method, device based on block chain and block chain meshed network
CN109446273A (en) * 2018-12-04 2019-03-08 深圳前海环融联易信息科技服务有限公司 Method of data synchronization, device, computer equipment and the storage medium of block chain
CN109981794A (en) * 2019-04-09 2019-07-05 广州蚁比特区块链科技有限公司 Processing method, device and electronic equipment based on block chain meshed network
US20190223089A1 (en) * 2018-01-16 2019-07-18 Cisco Technology, Inc. USING A BLOCKCHAIN FOR OPTIMIZED FAST-SECURE ROAMING ON WLANs
CN110059136A (en) * 2019-04-17 2019-07-26 江苏全链通信息科技有限公司 Information storage means, equipment and storage medium based on domain name block chain
CN110661822A (en) * 2018-06-28 2020-01-07 厦门本能管家科技有限公司 Decentralized distributed data storage method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190223089A1 (en) * 2018-01-16 2019-07-18 Cisco Technology, Inc. USING A BLOCKCHAIN FOR OPTIMIZED FAST-SECURE ROAMING ON WLANs
CN108305056A (en) * 2018-03-27 2018-07-20 搜游网络科技(北京)有限公司 Data processing method, device based on block chain and block chain meshed network
CN110661822A (en) * 2018-06-28 2020-01-07 厦门本能管家科技有限公司 Decentralized distributed data storage method and device
CN109446273A (en) * 2018-12-04 2019-03-08 深圳前海环融联易信息科技服务有限公司 Method of data synchronization, device, computer equipment and the storage medium of block chain
CN109981794A (en) * 2019-04-09 2019-07-05 广州蚁比特区块链科技有限公司 Processing method, device and electronic equipment based on block chain meshed network
CN110059136A (en) * 2019-04-17 2019-07-26 江苏全链通信息科技有限公司 Information storage means, equipment and storage medium based on domain name block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FEDERICO MATTEO BENČIĆ等: "Aurora: A Robust and Trustless Verification and Synchronization Algorithm for Distributed Ledgers", 《2019 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN (BLOCKCHAIN》, pages 1 - 2 *
李嶒: "基于以太坊平台的DNS设计与实现", 《黄河科技学院学报》, vol. 22, no. 2, pages 57 - 63 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645278A (en) * 2021-07-23 2021-11-12 湖南大学 Cross-chain message transmission method, device and storage medium of block chain
CN113645278B (en) * 2021-07-23 2022-09-20 湖南大学 Cross-chain message transmission method, device and storage medium of block chain

Also Published As

Publication number Publication date
CN111400399B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
US8904149B2 (en) Parallelization of online learning algorithms
CN110737664A (en) block link point synchronization method and device
CN109815344B (en) Network model training system, method, apparatus and medium based on parameter sharing
CN111522874B (en) Block chain consensus method, apparatus, computer device and storage medium
CN110930152B (en) Data processing method based on block chain and related equipment
CN110008206A (en) A kind of data processing method and device based on block catenary system
CN112118133B (en) Method for facilitating quick upgrade of intelligent contracts of Ethernet based on custom structure data
CN111026767A (en) Data storage method and device of block chain and hardware equipment
CN110599175A (en) Block processing method and related equipment
CN114239060A (en) Data acquisition method and device, electronic equipment and storage medium
CN112685391B (en) Service data migration method and device, computer equipment and storage medium
CN111400399A (en) Account book synchronization method and device of block chain system and hardware equipment
US11120513B2 (en) Capital chain information traceability method, system, server and readable storage medium
CN111368060B (en) Self-learning method, device and system for conversation robot, electronic equipment and medium
CN110737425A (en) billing platform system application program establishing method and device
CN112488835A (en) Service processing method, electronic device and readable storage medium
CN109242680B (en) Method for dynamically adjusting block chain consensus
CN113779116A (en) Object sorting method, related equipment and medium
CN111339089B (en) Data storage and acquisition method and device applied to blockchain
CN111737729A (en) Evaluation data storage method and system based on service data block chain
CN111831678A (en) Privacy protection method and device based on block chain and electronic equipment
CN110147278A (en) Data processing method and device
CN109032804A (en) Data processing method and device, server
CN115640360A (en) Dynamic compression type distributed data storage method, storage system and device
CN110889040B (en) Method and device for pushing information

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