CN110086856B - Control method and device of block chain node, storage medium and electronic equipment - Google Patents

Control method and device of block chain node, storage medium and electronic equipment Download PDF

Info

Publication number
CN110086856B
CN110086856B CN201910258290.2A CN201910258290A CN110086856B CN 110086856 B CN110086856 B CN 110086856B CN 201910258290 A CN201910258290 A CN 201910258290A CN 110086856 B CN110086856 B CN 110086856B
Authority
CN
China
Prior art keywords
block
new
new node
node
target
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
CN201910258290.2A
Other languages
Chinese (zh)
Other versions
CN110086856A (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.)
Cloudminds Shanghai Robotics Co Ltd
Original Assignee
Cloudminds Robotics 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 Cloudminds Robotics Co Ltd filed Critical Cloudminds Robotics Co Ltd
Priority to CN201910258290.2A priority Critical patent/CN110086856B/en
Publication of CN110086856A publication Critical patent/CN110086856A/en
Application granted granted Critical
Publication of CN110086856B publication Critical patent/CN110086856B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a method and an apparatus for controlling a blockchain node, a storage medium, and an electronic device, so that a new node can rapidly provide a service function after joining a blockchain system. The control method is applied to a new node added into a block chain system and comprises the following steps: inquiring a target block with the largest block number in the blockchain system from a target full node in the blockchain system, wherein the new node is connected with the target full node; synchronizing the target block from the target full node to the new node; after the target block is synchronized to the new node, the service function which can be executed in the block chain system and is configured by the new node is started.

Description

Control method and device of block chain node, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for controlling blockchain nodes, a storage medium, and an electronic device.
Background
The block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and is a distributed account book which is guaranteed in a cryptographic mode and is not falsifiable, counterfeitable, completely traceable and decentralized. With the rapid development of distributed applications based on intelligent contracts, new nodes are continuously added into a block chain system.
In the related art, when a new node joins the blockchain system, the new node needs to synchronize all blocks in the blockchain system to start various service functions such as broadcasting. However, as the number of blocks increases with the increase of transactions and data in the blockchain system, a new node needs to spend more time synchronizing all blocks in the blockchain system, so that a long time is required from adding the new node to the blockchain system to starting a service function, and the blockchain system cannot be expanded quickly.
Disclosure of Invention
The present disclosure is directed to a method, an apparatus, a storage medium, and an electronic device for controlling a blockchain node, which are used to solve the problem in the related art that a new node needs a long time from joining a blockchain system to providing a service function.
In order to achieve the above object, in a first aspect, the present disclosure provides a method for controlling a blockchain node, which is applied to a new node joining a blockchain system, and includes:
inquiring a target block with the largest block number in the blockchain system from a target full node in the blockchain system, wherein the new node is connected with the target full node;
synchronizing the target block from the target full node to the new node;
after the target block is synchronized to the new node, the service function which can be executed in the block chain system and is configured by the new node is started.
In a second aspect, the present disclosure further provides a device for controlling a blockchain node, where the device is applied to a new node joining a blockchain system, and the device includes:
a query module, configured to query, from a target full node in the blockchain system, a target block with a largest block number in the blockchain system, where the new node is connected to the target full node;
a synchronization module to synchronize the target block from the target full node to the new node;
and the starting module is used for starting the service functions which can be executed in the block chain system and are configured by the new node after the target block is synchronized to the new node.
In a third aspect, the present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspect.
In a fourth aspect, the present disclosure also provides an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspect.
Through the technical scheme, the target block with the largest block number in the blockchain system can be inquired from the target whole node in the blockchain system, then the target block is synchronized to the new node from the target whole node, and finally after the target block is synchronized to the new node, the service function which can be executed in the blockchain system and is configured by the new node is started. That is to say, the method for controlling a blockchain node provided by the present disclosure can start a service function that can be executed in a blockchain system and is configured by a new node after the new node synchronizes a target block.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flowchart illustrating a control method of a blockchain node according to an exemplary embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating an application process of a control method of a blockchain node according to an exemplary embodiment of the present disclosure;
FIG. 3 is a block diagram illustrating a block link point control arrangement according to an exemplary embodiment of the present disclosure;
fig. 4 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
First, terms related to the embodiments of the present disclosure will be described.
All nodes: nodes with all data in the blockchain system.
New block servicing: a node in a blockchain system generates a service function for a new block. When providing a new block service in the related art, all the blockchain data of the node is required, and therefore, all the nodes can provide the new block service.
Broadcast service: nodes in the blockchain system broadcast data to the service functions of the whole blockchain system.
And (3) query service: the method is used for inquiring the business functions of the data such as the zone data, the contract code result and the like in the block chain system.
Forward synchronization: and synchronizing the data from front to back according to the arrangement sequence of the blocks.
Backward synchronization: and synchronizing the data from back to front according to the arrangement sequence of the blocks.
In the related art, when a new node joins a blockchain system, the new node needs to synchronize all blocks in the blockchain system to start various service functions such as broadcasting. For example, in the block chain system including a plurality of blocks from block 1 to block N, according to the scheme in the related art, the new node needs to start various service functions by sequentially synchronizing to block N from block 1 according to the block arrangement order.
However, as the number of blocks increases with the increase of transactions and data in the blockchain system, a new node needs to spend more time synchronizing all blocks in the blockchain system, so that the process from adding the blockchain system to starting a service function by the new node is long, and the expansion of the blockchain system is affected.
In order to solve the foregoing technical problem, embodiments of the present disclosure provide a method and an apparatus for controlling a blockchain node, a storage medium, and an electronic device, so that a new node can quickly provide a service function after joining a blockchain system, and the blockchain system can be quickly expanded.
Fig. 1 is a flowchart illustrating a control method of a blockchain node according to an exemplary embodiment of the present disclosure. Referring to fig. 1, the control method may be applied to a new node joining a blockchain system, including:
step S101, querying a target block with the largest block number in the blockchain system from the target full node in the blockchain system, wherein the new node is connected to the target full node.
For example, the target full node may be one or multiple, and the embodiment of the present disclosure does not limit this. In the case where there is one target full node, the process of querying the target block may be to use the block with the largest block number in the target node as the target block. In the case that the target node is plural, the process of querying the target block may be to query the blocks with the largest block numbers from the plural target nodes, and then determine the block with the largest block number as the target block among the queried blocks.
It should be understood that the target block with the largest block number in the embodiments of the present disclosure refers to the block with the latest data in the blockchain system, and therefore, in order to ensure that the queried target block is the block with the latest data in the blockchain system, i.e. to ensure the accuracy of the query result, the target full node may preferably be multiple.
Step S102, the target block is synchronized from the target full node to the new node.
For example, synchronizing the target block from the target full node to the new node may be implemented by traversing branches of the hash tree root of the block header of the target block, and the specific implementation manner is similar to that in the related art and is not described herein again. Alternatively, the target block may be synchronized from the target full node to the new node in other manners, which is not limited in the embodiment of the present disclosure.
Step S103, after the target block is synchronized to the new node, the service function that can be executed in the blockchain system and that is already configured by the new node is started.
For example, the synchronization of the target block to the new node may be the synchronization of all data of the target block to the new node, or may be the synchronization of part of the data of the target block to the new node. In the former case, after the data traversed by the root of the merkel tree in the target block is synchronized to the new node, the new node is started to configure the business function which can be executed in the blockchain system. For the latter case, when the target block is synchronized with the new node, the configured query service function of the new node is started first, and then, as the synchronization process continues, after the partial data of the target block is synchronized with the new node, the configured broadcast service function and the configured new block service function of the new node are started.
Illustratively, the service functions that the new node has configured to be able to perform in the blockchain system include a broadcast service function, a new-block service function for generating a new block, and a query service function. That is to say, in the embodiment of the present disclosure, after the target block is synchronized to the new node, the broadcast service function, the new block service function, and the query service function provided by the new node may be started.
In a possible manner, the starting of the service function that can be executed in the blockchain system and is configured by the new node may be to determine whether a new block with a block number greater than that of the target block exists in the blockchain system, if a new block with a block number greater than that of the target block exists in the blockchain system, take the block with the largest block number in the new block as the new target block, and start the service function that can be executed in the blockchain system and is configured by the new node after the new target block is synchronized to the new node.
In the blockchain system, as the transaction data is continuously generated, the blocks are also continuously generated, so that in order to ensure the reliability of the service function provided by the new node, that is, to ensure that the new node is synchronized with the block with the latest data when the service function is started, it can be further determined whether the target block is the latest block in the current blockchain system before the service function of the new node is started.
For example, it may be determined whether there is a new block in the blockchain system with a block number greater than the target block. If a new block with a block better than the target block exists in the blockchain system, the target block is not the latest block in the current blockchain system. In this case, the new block may be used as a new target block, and then after the new target block is synchronized to the new node, the service function that can be executed in the blockchain system and that has been configured by the new node is started, so as to ensure that the new node is synchronized with the latest block in the blockchain system.
In other cases, if there is no new block with a block number greater than that of the target block in the blockchain system, it indicates that the target block is the latest block in the current blockchain system, and then the service function that can be executed in the blockchain system and is configured for the new node can be directly started.
After initiating the service function that the new node has configured to be able to execute in the blockchain system, it may be determined whether the data required to verify the transaction is included in the currently synchronized block data of the new node when the transaction is received, and if the currently synchronized block data of the new node includes the data required to verify the transaction, the broadcast service function and the new block service function may be executed for the transaction.
In the embodiment of the present disclosure, when the service function is started, the new node synchronizes all or part of the data of the target block in the blockchain system, but not all the data in the blockchain system, so that the new node performs a limited service function on the received transaction, that is, the new node can check the received transaction, and perform a corresponding service function on the transaction when the check is passed.
For example, the target block includes balance data for account X and account Y, and the balance for account X is 10 yen and the balance for account Y is 20 yen. After the new node synchronizes the target block to the new node, that is, under the condition that the currently synchronized block data of the new node includes balance data of an account X and an account Y, when the new node receives a transfer transaction of 5-bit account X transfer to the account Y, the new node firstly determines whether the currently synchronized block data can inquire the balance data respectively corresponding to the account X and the account Y, that is, the new node firstly determines whether the currently synchronized block data includes data for verifying the transfer transaction.
In this case, since the block data currently synchronized by the new node includes the balances of account X and account Y, i.e., the data currently synchronized by the new node includes data required to verify the transaction, the new node may perform the broadcast service function and the new block service function on the transfer transaction. Specifically, the new node may broadcast the transfer transaction to the entire blockchain system. Also, the new node may package the transfer transaction as a new block, where the new block includes data for account X balance of 5 and account Y balance of 25.
Through the mode, when the new node receives the transaction, the transaction can be verified, the corresponding business function is executed on the transaction when the verification is passed, and the business function is not executed for the transaction which is not verified, so that the data security in the block chain system can be ensured.
Further, in order to enhance the capability of the new node to perform the service function, in the embodiment of the present disclosure, in the process of starting the service function of the new node, other blocks in the blockchain system except for the target block may be synchronized to the new node, so that the new node may eventually synchronize all blocks in the blockchain system.
In one possible approach, a block with a block number larger than the target block in the block chain system may be synchronized to the new node by the longest chain mechanism; and if the block head of the blocks with the block numbers smaller than that of the target block in the block chain system passes the validity verification, synchronizing the blocks with the block heads passing the validity verification to the new node.
That is, synchronizing other blocks in the blockchain system except the target block to the new node may be a bidirectional synchronization process, i.e., performing forward synchronization and backward synchronization simultaneously. The forward synchronization process (for a block with a block number greater than the target block) can be implemented by a longest chain mechanism, and the specific implementation process is similar to that in the related art and is not described herein again.
In the backward synchronization process (for a block with a block number smaller than the target block), validity verification may be performed on the block headers of a plurality of blocks with block numbers smaller than the target block in the block chain system, and then the plurality of blocks with block headers that pass the validity verification may be synchronized to the new node.
For example, the new node may first obtain a plurality of consecutive block headers from a block with a block number smaller than the target block, then obtain a plurality of consecutive block headers with the same identifier (e.g., the same block number) as the plurality of consecutive block headers from any whole node in the block chain system, and compare the plurality of consecutive block headers obtained from the whole node with the plurality of consecutive block headers obtained from a block with a block number smaller than the target block. If the comparison is consistent, the validity verification of the block head is passed, so that the block corresponding to the block head can be synchronized to the new node.
In another case, if the comparison is inconsistent, it indicates that the validity verification of the block header fails, so to ensure data security, the block corresponding to the block header is not synchronized to the new node, and the block whose validity verification of the block header fails may be discarded at the next data synchronization, and the synchronization process may be continued from the last block whose validity verification of the block header passed last time. For example, a plurality of consecutive block headers are acquired as block 5, block 4, and block 3, respectively, and when the validity verification of the block header is performed, the validity verification of the block header of block 4 fails, and then the validity verification of block 3, block 2, and block 1 may be continuously acquired in the next synchronization process.
By the method, other blocks except the target block in the blockchain system can be synchronized to the new node through bidirectional synchronization, so that the new node can more quickly synchronize all the blocks in the blockchain system, and the capability of the new node for executing service functions is enhanced.
In another possible way, when synchronizing other blocks in the blockchain system except the target block to the new node, if the new node is in the connectible state, a synchronized block with the smallest block number and a target block of the current blockchain system may be determined among the blocks synchronized to the new node, and then when the new node is in the connectible state, if a new block with a block number larger than the target block exists in the blockchain system, all blocks between the block with the largest block number in the new block and the target block are synchronized to the new node, and all blocks with a block number smaller than the synchronized block are synchronized to the new node.
In the process of synchronizing blocks other than the target block to a new node in the blockchain system, a new node may be dropped (in an unconnected state). For this case, when the new node comes online again (in a connectable state), the data that was not synchronized before the new node dropped may be synchronized continuously, and the data that was synchronized before the new node dropped may not need to repeat the data synchronization process. And, if a new block is generated during the drop of the new node, i.e. there is a new block with a block number greater than the target block in the blockchain system, all blocks between the block with the largest block number in the new block and the target block can be synchronized to the new node.
For example, the new node drops after synchronizing the data of blocks 10, 9, 8, 7, 6, in which case the synchronized block with the smallest block number in the blocks synchronized to the new node is block 6, the target block of the current blockchain system is block 10, and new blocks 11, 12, 13 are generated during the dropping of the new node. Thus, when the new node comes back on line, all blocks between block 13 (the block with the largest block number in the new block) and block 10 (the target block) can be synchronized to the new node, and all blocks with block numbers smaller than block 6 (the synchronized block) can continue to be synchronized to the new node.
By the method, when the new node is recovered to a connectable state from a non-connectable state, the unsynchronized data in the blockchain system can be continuously synchronized, and the synchronized data does not need to repeat the synchronization process again, so that the data synchronization process of the new node is accelerated, all data in the blockchain system can be synchronized more quickly by the new node, and the capability of the new node in executing the service function is enhanced.
The following describes a method for controlling a blockchain node according to the present disclosure by using a complete embodiment.
Referring to fig. 2, nodes a, B, and C are all nodes including all block data (block 1 to block N) of the current blockchain system, node E is a new node added to the blockchain system, and block N is a target block having a largest block number in the current blockchain system. After the new node E joins the blockchain system, the target block with the largest block number in the current blockchain system can be queried from the whole node a. In this case, the new node may query the target block as block N. Then, the new node E synchronizes the block N from the full node a to the new node, and after the synchronization of the block N to the new node E is completed, the service function that can be executed in the blockchain system and that has been configured by the new node may be started.
At this point, if a transaction F is made which is "Account X transfers 5 Meta to New Account Y" and is sent to the New node E. Since node E has synchronized the data in block N for "account X balance 10", new node E can verify the transaction F and can perform the business function on the transaction F. For example, the new node E may broadcast the transaction F to all neighboring nodes a and C. Alternatively, new node E may package transaction F as block N +1 and broadcast to the entire blockchain system, with data for "account X balance 5" and "account Y balance 5" at block N + 1.
Through the technical scheme, after the new node synchronizes the target block, the service function which can be executed in the block chain system and is configured by the new node can be started, namely, the service provided by the new node is started.
Based on the same inventive concept, the embodiment of the present disclosure further provides a management apparatus 300 for a blockchain node, which can be applied to a new node added to a blockchain system. Referring to fig. 3, the apparatus 300 may include:
a query module 301, configured to query a target block with a largest block number in the blockchain system from a target full node in the blockchain system, where the new node is connected to the target full node;
a synchronization module 302 for synchronizing the target block from the target full node to the new node;
a starting module 303, configured to start a service function that can be executed in the blockchain system and that is configured by the new node after the target block is synchronized to the new node.
Optionally, the starting module 303 is configured to determine whether a new block with a block number greater than that of the target block exists in the blockchain system, when the new block with the block number greater than that of the target block exists in the blockchain system, take the block with the largest block number in the new block as a new target block, and start a service function that can be executed in the blockchain system and is configured by the new node after the new target block is synchronized to the new node.
Optionally, the apparatus 300 further comprises:
a forward synchronization module, configured to synchronize, to the new node, a block in the block chain system whose block number is greater than the target block through a longest chain mechanism; and
and the backward synchronization module is used for synchronizing the blocks with the block heads passing the validity verification to the new node when the block heads of the blocks with the block numbers smaller than the target block in the block chain system pass the validity verification.
Optionally, the apparatus 300 further comprises:
a determining module, configured to determine, when other blocks in the blockchain system except the target block are synchronized to the new node and the new node is in an unconnected state, a synchronized block with a smallest block number and the target block of the current blockchain system from among the blocks synchronized to the new node;
and a synchronization execution module, configured to synchronize, to the new node, all blocks between a block with a largest block number in the new block and the target block, and synchronize, to the new node, all blocks with a block number smaller than the synchronized block, when the new node is in a connectable state and a new block with a block number larger than the target block exists in the blockchain system.
Optionally, the service functions that the new node has configured to be executable in the blockchain system include a broadcast service function, a new block service function, and an inquiry service function, where the new block service function is used to generate a new block.
Optionally, the apparatus 300 further comprises:
a second determining module, configured to determine, when a transaction is received after a service function that can be executed in the blockchain system and that is configured by the new node is started, whether data required for verifying the transaction is included in currently synchronized blockdata of the new node;
and the execution module is used for executing a broadcasting service function and a new block service function on the transaction when the block data synchronized currently by the new node comprises the data required for verifying the transaction, and the new block service function is used for generating a new block.
The specific manner in which each module performs operations has been described in detail in relation to the embodiments of the method with respect to any of the apparatuses in the above embodiments, and will not be elaborated upon here.
Through any one of the control devices, after the new node synchronizes the target block, the service function which can be executed in the blockchain system and is configured by the new node can be started, that is, the service provided by the new node is started.
Based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the control method of any blockchain node described above.
In one possible approach, a block diagram of the electronic device may be as shown in fig. 4. Referring to fig. 4, the electronic device 400 may include: a processor 401 and a memory 402. The electronic device 400 may also include one or more of a multimedia component 403, an input/output (I/O) interface 404, and a communications component 405.
The processor 401 is configured to control the overall operation of the electronic device 400, so as to complete all or part of the steps in the above method for controlling a blockchain node. The memory 402 is used to store various types of data to support operations at the electronic device 400, such as instructions for any application or method operating on the electronic device 400 and application-related data, such as block numbers, block headers, and so forth.
The Memory 402 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk.
The multimedia components 403 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 402 or transmitted through the communication component 405. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 404 provides an interface between the processor 401 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons.
The communication component 405 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 407 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, and is used for executing the control method of the above-mentioned block chain node.
In another exemplary embodiment, there is also provided a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described method of controlling a blockchain node. For example, the computer readable storage medium may be the memory 402 comprising program instructions executable by the processor 401 of the electronic device 400 to perform the above-described control method of the blockchain node.
Through the electronic device or the storage medium, after the new node synchronizes the target block, the service function which is configured by the new node and can be executed in the block chain system can be started, that is, the service provided by the new node is started.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A method for controlling blockchain nodes is applied to a new node added to a blockchain system, and the method comprises the following steps:
querying a target block with a largest block number in the blockchain system from a target full node in the blockchain system, wherein the new node is connected with the target full node;
synchronizing the target block from the target full node to the new node;
after the target block is synchronized to the new node, the service function which can be executed in the block chain system and is configured by the new node is started.
2. The method of claim 1, wherein the initiating the configured service function that can be performed in the blockchain system of the new node comprises:
determining whether there is a new block in the blockchain system with a block number greater than the target block;
and if a new block with a block number larger than that of the target block exists in the block chain system, taking the block with the largest block number in the new block as a new target block, and after the new target block is synchronized to the new node, starting a service function which can be executed in the block chain system and is configured by the new node.
3. The method of claim 1, further comprising:
synchronizing blocks in the block chain system with block numbers larger than the target block to the new node through a longest chain mechanism; and
if the block head of the blocks with the block number smaller than that of the target block in the block chain system passes the validity verification, synchronizing the blocks with the block heads passing the validity verification to the new node.
4. The method according to any one of claims 1-3, further comprising:
when synchronizing other blocks in the blockchain system except the target block to the new node, if the new node is in a non-connectable state, determining a synchronized block with a minimum block number and the target block of the current blockchain system from among the blocks synchronized to the new node;
when the new node is in a connectable state, if a new block having a block number greater than the target block exists in the blockchain system, all blocks between the block having the largest block number in the new block and the target block are synchronized to the new node, and all blocks having a block number less than the synchronized block are synchronized to the new node.
5. A method according to any of claims 1-3, wherein the service functions that the new node has configured to be executable in the blockchain system include a broadcast service function, a new block service function and a query service function, the new block service function being used to generate a new block.
6. A method according to any of claims 1-3, wherein after initiating the service function that the new node has configured to be executable in the blockchain system, the method further comprises:
when a transaction is received, determining whether the block data synchronized currently by the new node comprises data required for verifying the transaction;
and if the block data synchronized currently by the new node comprises the data required for verifying the transaction, executing a broadcasting service function and a new block service function on the transaction, wherein the new block service function is used for generating a new block.
7. A device for controlling a blockchain node, applied to a new node joining a blockchain system, the device comprising:
a query module, configured to query a target block with a largest block number in the blockchain system from a target full node in the blockchain system, where the new node is connected to the target full node;
a synchronization module to synchronize the target block from the target full node to the new node;
and the starting module is used for starting the service functions which can be executed in the block chain system and are configured by the new node after the target block is synchronized to the new node.
8. The apparatus of claim 7, wherein the initiation module is configured to:
determining whether there is a new block in the blockchain system with a block number greater than the target block;
and if a new block with a block number larger than that of the target block exists in the block chain system, taking the block with the largest block number in the new block as a new target block, and after the new target block is synchronized to the new node, starting a service function which can be executed in the block chain system and is configured by the new node.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN201910258290.2A 2019-04-01 2019-04-01 Control method and device of block chain node, storage medium and electronic equipment Active CN110086856B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910258290.2A CN110086856B (en) 2019-04-01 2019-04-01 Control method and device of block chain node, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910258290.2A CN110086856B (en) 2019-04-01 2019-04-01 Control method and device of block chain node, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110086856A CN110086856A (en) 2019-08-02
CN110086856B true CN110086856B (en) 2022-02-01

Family

ID=67413964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910258290.2A Active CN110086856B (en) 2019-04-01 2019-04-01 Control method and device of block chain node, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110086856B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110598456B (en) * 2019-09-24 2021-04-30 腾讯科技(深圳)有限公司 Data storage method and device, electronic equipment and storage medium
CN111131399B (en) * 2019-12-03 2021-11-26 北京海益同展信息科技有限公司 Method and device for dynamically increasing consensus nodes in block chain
CN112463889A (en) * 2020-12-08 2021-03-09 北京众享比特科技有限公司 Block chain data storage method, device, equipment and medium
CN113032485B (en) * 2021-03-16 2024-08-09 上海图灵加佳网络科技有限公司 Data storage device and data storage method of block chain node

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040594A (en) * 2017-04-12 2017-08-11 山大地纬软件股份有限公司 The method and device of license block chain node access based on PBFT
CN107040585A (en) * 2017-02-22 2017-08-11 阿里巴巴集团控股有限公司 A kind of method and device of business verification
CN107079058A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 The business of block chain node performs method, device and node device
CN107104816A (en) * 2017-03-07 2017-08-29 阿里巴巴集团控股有限公司 A kind of information change monitoring method and device
CN108124505A (en) * 2017-12-19 2018-06-05 深圳前海达闼云端智能科技有限公司 Method and device for acquiring trusted node, storage medium and block link node
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109189853A (en) * 2018-08-08 2019-01-11 众安信息技术服务有限公司 Method of data synchronization and device between a kind of block chain
CN109246084A (en) * 2018-08-13 2019-01-18 中国联合网络通信集团有限公司 New block generation method, device, electronic equipment and storage medium
CN109274754A (en) * 2018-10-11 2019-01-25 上海保险交易所股份有限公司 For the method for synchrodata, equipment and storage medium in block chain network
CN109426949A (en) * 2017-08-29 2019-03-05 华为技术有限公司 Across the chain method of commerce of one kind and device
CN109522362A (en) * 2018-10-17 2019-03-26 北京瑞卓喜投科技发展有限公司 Incomplete markets synchronous method, system and equipment based on block chain data

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170031676A1 (en) * 2015-07-27 2017-02-02 Deja Vu Security, Llc Blockchain computer data distribution
US11568703B2 (en) * 2016-06-08 2023-01-31 Sichuan Energy Internet Res. Inst., Tsinghua Univ. Systems and methods for wireless charging stations
US11276038B2 (en) * 2016-08-07 2022-03-15 Verifi Media, Inc. Distributed data store for managing media
US10922692B2 (en) * 2017-04-05 2021-02-16 Samsung Sds Co., Ltd. Method for calculating confirmation reliability for blockchain based transaction and blockchain network monitoring system for performing the method
US10812270B2 (en) * 2017-04-07 2020-10-20 Citizen Hex Inc. Techniques for increasing the probability that a transaction will be included in a target block of a blockchain
CN109218348B (en) * 2017-06-29 2020-12-01 华为技术有限公司 Method for determining blocks in block chain and node equipment
GB201717499D0 (en) * 2017-10-24 2017-12-06 Copa Fin Ltd Data storage and verification

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107079058A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 The business of block chain node performs method, device and node device
CN107040585A (en) * 2017-02-22 2017-08-11 阿里巴巴集团控股有限公司 A kind of method and device of business verification
CN107104816A (en) * 2017-03-07 2017-08-29 阿里巴巴集团控股有限公司 A kind of information change monitoring method and device
CN107040594A (en) * 2017-04-12 2017-08-11 山大地纬软件股份有限公司 The method and device of license block chain node access based on PBFT
CN109426949A (en) * 2017-08-29 2019-03-05 华为技术有限公司 Across the chain method of commerce of one kind and device
CN108124505A (en) * 2017-12-19 2018-06-05 深圳前海达闼云端智能科技有限公司 Method and device for acquiring trusted node, storage medium and block link node
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109189853A (en) * 2018-08-08 2019-01-11 众安信息技术服务有限公司 Method of data synchronization and device between a kind of block chain
CN109246084A (en) * 2018-08-13 2019-01-18 中国联合网络通信集团有限公司 New block generation method, device, electronic equipment and storage medium
CN109274754A (en) * 2018-10-11 2019-01-25 上海保险交易所股份有限公司 For the method for synchrodata, equipment and storage medium in block chain network
CN109522362A (en) * 2018-10-17 2019-03-26 北京瑞卓喜投科技发展有限公司 Incomplete markets synchronous method, system and equipment based on block chain data

Also Published As

Publication number Publication date
CN110086856A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110086856B (en) Control method and device of block chain node, storage medium and electronic equipment
CN108200210B (en) Block chain-based chain management method, block chain-based chain management device and computer-readable medium
CN109656873B (en) Block chain-based data archiving method and device and terminal equipment
WO2020069411A1 (en) High throughput blockchain consensus systems and methods with low finalization time
CN110597918B (en) Account management method, account management device and computer readable storage medium
WO2020199713A1 (en) Data verification method, system, apparatus, and device
CN110690974B (en) Block chain based data verification method, device, equipment and readable storage medium
WO2020199711A1 (en) Data storage method, system, device and apparatus
CN112714158A (en) Transaction processing method, relay network, cross-link gateway, system, medium, and device
CN113841359A (en) Method and apparatus for propagating tiles in a blockchain network
CN110602108A (en) Data communication method, device, equipment and storage medium based on block chain network
JP7494205B2 (en) Preventing the accidental transmission of copies of data records to the distributed ledger system
CN111683118A (en) Block chain-based consensus method and device, master node equipment and slave node equipment
KR20180005542A (en) Apparatus and method for verifing data integrity
CN110989934B (en) Block chain link point data storage method, block chain system and block chain node
CN113269542A (en) Consensus method, device and storage medium for block chain system
CN111061813B (en) Method, apparatus and computing device for data synchronization in blockchain network
CN110692078A (en) Transaction data processing method, device and storage medium based on block chain
CN114882628B (en) Data processing method and device, electronic equipment and computer readable medium
CN111404897A (en) Message distribution method and device, storage medium and electronic equipment
CN103259639A (en) Clock synchronization method of stacking equipment and stacking equipment
CN112398640B (en) Optimized block chain consensus algorithm
CN111475572B (en) Block generation method, device, equipment and medium
EP4256750A1 (en) Methods and systems for streaming block templates with cross-references
CN113283891A (en) Information processing method and device and electronic equipment

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
TA01 Transfer of patent application right

Effective date of registration: 20210304

Address after: 201111 2nd floor, building 2, no.1508, Kunyang Road, Minhang District, Shanghai

Applicant after: Dalu Robot Co.,Ltd.

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: Shenzhen Qianhaida Yunyun Intelligent Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 201111 Building 8, No. 207, Zhongqing Road, Minhang District, Shanghai

Patentee after: Dayu robot Co.,Ltd.

Address before: 201111 2nd floor, building 2, no.1508, Kunyang Road, Minhang District, Shanghai

Patentee before: Dalu Robot Co.,Ltd.

CP03 Change of name, title or address