CN116248694A - Partition data synchronization method, device, equipment and medium in block chain network - Google Patents

Partition data synchronization method, device, equipment and medium in block chain network Download PDF

Info

Publication number
CN116248694A
CN116248694A CN202310202591.XA CN202310202591A CN116248694A CN 116248694 A CN116248694 A CN 116248694A CN 202310202591 A CN202310202591 A CN 202310202591A CN 116248694 A CN116248694 A CN 116248694A
Authority
CN
China
Prior art keywords
node
request
data
block
synchronization
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.)
Pending
Application number
CN202310202591.XA
Other languages
Chinese (zh)
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.)
Zhongchao Credit Card Industry Development Co ltd
China Banknote Printing and Minting Group Co Ltd
Original Assignee
Zhongchao Credit Card Industry Development Co ltd
China Banknote Printing and Minting Group 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 Zhongchao Credit Card Industry Development Co ltd, China Banknote Printing and Minting Group Co Ltd filed Critical Zhongchao Credit Card Industry Development Co ltd
Priority to CN202310202591.XA priority Critical patent/CN116248694A/en
Publication of CN116248694A publication Critical patent/CN116248694A/en
Pending legal-status Critical Current

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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)

Abstract

The application discloses a partition data synchronization method, device and equipment in a block chain network and a storage medium, and relates to the technical field of block chains. The method comprises the following steps: the response node acquires a block data confirmation request sent by a request node directly connected with the local; the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received; and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node. The partition data synchronization in the block chain network can be realized, and the problem of synchronization obstacle caused by node partition authority is prevented, so that the stability and the usability of the block chain network are improved.

Description

Partition data synchronization method, device, equipment and medium in block chain network
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for synchronizing partition data in a blockchain network.
Background
In the prior art, when a node in a blockchain network acquires partition data, the node needs to send a data request to the node directly connected with the node, and then waits for the other party to return the partition data, but if the directly connected node does not have the partition data or has the authority of the partition, the node cannot return the data, so that the node lacks data and the partition cannot normally operate. Therefore, how to synchronize partition data in a blockchain network is a current urgent problem to be solved.
Disclosure of Invention
Accordingly, the present invention is directed to a method, apparatus, device and medium for synchronizing partition data in a blockchain network, which can realize synchronization of partition data in a blockchain network, and prevent the occurrence of synchronization failure caused by node partition authority, thereby increasing stability and usability of the blockchain network. The specific scheme is as follows:
in a first aspect, the present application discloses a method for synchronizing partition data in a blockchain network, including:
the response node acquires a block data confirmation request sent by a request node directly connected with the local;
the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received;
and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node.
Optionally, forwarding the block data acknowledgement request to an upper node in the blockchain network by taking a location of a consensus node in the blockchain network as a final request direction, including:
judging whether block data corresponding to the block data confirmation request exists or not according to the block data confirmation request;
if so, directly sending the block data to the request node, and stopping executing the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as the final request direction.
And if the block data confirmation request does not exist, the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction is executed.
Optionally, after the block data confirmation request is forwarded to the upper node in the blockchain network by using the location of the consensus node in the blockchain network as the final request direction, the method further includes:
the upper node judges whether the upper node owns the authority of the partition corresponding to the block data confirmation request according to the block data confirmation request;
if the authority of the partition is possessed, judging whether the block data corresponding to the block data confirmation request exists or not;
and if the characteristic data exists, sending a first data confirmation result indicating the existence of the characteristic data to the response node, and if the characteristic data does not exist, sending a second data confirmation result indicating the nonexistence of the characteristic data to the response node.
Optionally, the determining, by the requesting node, the target synchronization node according to the data confirmation result includes:
the request node determines a target node meeting the partition data synchronization requirement from all traversed superior nodes according to the data confirmation result;
and randomly selecting one node from the target nodes as the target synchronous node.
Optionally, the block data confirmation request includes a partition identifier and block height requirement information corresponding to the block data to be synchronized.
Optionally, before the response node obtains the block data acknowledgement request sent by the request node directly connected to the local, the method further includes:
and the request node selects one node from all nodes directly connected with the request node as the response node, and sends a block data confirmation request to the response node.
Optionally, the process of forwarding the block data confirmation request to the upper node in the blockchain network by using the location of the consensus node in the blockchain network as the final request direction further includes:
a node in the block chain network queries a request path corresponding to a block data confirmation request according to the received block data confirmation request;
if the request path contains the self node, judging that malignant circulation abnormality exists and generating a corresponding alarm prompt.
In a second aspect, the present application discloses a partition data synchronization apparatus in a blockchain network, including:
the block data confirmation request acquisition module acquires a block data confirmation request sent by a request node directly connected with the local by using a response node;
the request forwarding module is used for forwarding the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction and receiving a data confirmation result fed back by the upper node;
and the data synchronization module is used for forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node and then realizes partition data synchronization according to the block data in the target synchronization node.
In a third aspect, the present application discloses an electronic device comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the partition data synchronization method in the block chain network.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by the processor, implements the partition data synchronization method in a blockchain network described above.
In the application, a response node acquires a block data confirmation request sent by a request node directly connected with a local area; the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received; and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node. Before sending the data synchronization request, the request node sends a block data confirmation request to the directly connected response node, and the response node forwards the block data request to the upper node step by step, so that the nodes in the block chain network are traversed step by step upwards to find out the target synchronization node with the needed synchronization data, and finally the data node to be synchronized realizes the partition data synchronization according to the block data in the target synchronization node. Therefore, the partition data synchronization among the multi-layer nodes in the blockchain network is optimized by modifying the logic and the network architecture of the data synchronization and using the node forwarding, so that the blockchain system can timely perform data interaction, and the problem of synchronization obstacle caused by the partition authority of the nodes can be prevented, thereby improving the stability and the usability of the blockchain network.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for synchronizing partition data in a blockchain network provided by the present application;
FIG. 2 is a schematic illustration of a specific node connection provided herein;
FIG. 3 is a flowchart of a method for synchronizing partition data in a particular blockchain network provided herein;
FIG. 4 is a schematic diagram of a partition data synchronization device in a blockchain network according to the present disclosure;
fig. 5 is a block diagram of an electronic device provided in the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, when a node in a blockchain network acquires partition data, the node needs to send a data request to the node directly connected with the node, and then waits for the other party to return the partition data, but if the directly connected node does not have the partition data or has the authority of the partition, the node cannot return the data, so that the node lacks data and the partition cannot normally operate. In order to overcome the technical problems, the application provides a partition data synchronization method in a blockchain network, which can realize partition data synchronization in the blockchain network and prevent the occurrence of synchronization obstacle problems caused by node partition authorities, thereby increasing the stability and the usability of the blockchain network.
The embodiment of the application discloses a partition data synchronization method in a blockchain network, which is shown in fig. 1, and can include the following steps:
step S11: the response node acquires a block data confirmation request sent by a request node directly connected with the local.
In this embodiment, the response node in the blockchain network obtains the block data acknowledgement request sent by the request node directly connected to the local. In this embodiment, before the response node obtains the block data acknowledgement request sent by the request node directly connected to the local, the method further includes: and the request node selects one node from all nodes directly connected with the request node as the response node, and sends a block data confirmation request to the response node.
It can be understood that the requesting node is a node needing data synchronization, for example, a newly opened node in the blockchain network needs to ask other nodes for historical block data until the requesting node and other nodes have the same data height and then join in the work. Therefore, the request node selects one node from all nodes directly connected with the request node as a response node, and sends a block data confirmation request to the response node, and the specific request node can send the block data confirmation request to a superior node directly connected with the request node.
Step S12: and forwarding the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction, and receiving a data confirmation result fed back by the upper node.
In this embodiment, according to the received block data confirmation request, the responding node forwards the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as the final request direction, and the upper node searches for its own data according to the block data confirmation request and returns the data confirmation result to the responding node step by step according to the block chain network structure.
It can be understood that the nodes in this embodiment are at least divided into two types, one is a consensus node and one is a read-only node. The read-only nodes are deployed in each cooperative company, and the respective data are transmitted to the consensus nodes for processing through the read-only nodes. Thus, the way to determine which of the two nodes is the upper node is to see which node is closer to the consensus node. For example, as shown in fig. 2, a- > B- > C- > D represents that a and B are connected, B and C are connected, and a is connected, C and B are connected, and D is a common node, and a and D are not connected, the node at the upper stage of a is B, and the node at the upper stage of B is C; if a is directly connected with D, then B is closer to node D than a, so the node a is D and the nodes a and C are D. That is, in this embodiment, the read-only node near the common node in the block chain network is an upper node of the read-only node far from the common node, and in this embodiment, the block data acknowledgement request is forwarded to the upper node step by step, which is essentially forwarding the block data acknowledgement request towards the direction of the common node.
In this embodiment, the forwarding the block data acknowledgement request to the upper node in the blockchain network with the location of the consensus node in the blockchain network as the final request direction may include: judging whether block data corresponding to the block data confirmation request exists or not according to the block data confirmation request; if so, directly sending the block data to the request node, and stopping executing the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as the final request direction. And if the block data confirmation request does not exist, the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction is executed. After receiving the block data confirmation request, the response node firstly checks whether corresponding data exists or not, and if so, the response node directly sends the corresponding block data to the request node. If the responding node cannot provide data, the request is forwarded to the node at the previous stage of the responding node, and then the returned message is forwarded to the requesting node which initiates the request.
In this embodiment, after the location of the consensus node in the blockchain network is taken as the final request direction and the blockdata confirmation request is forwarded to the upper node in the blockchain network, the method may further include: the upper node judges whether the upper node owns the authority of the partition corresponding to the block data confirmation request according to the block data confirmation request; if the authority of the partition is possessed, judging whether the block data corresponding to the block data confirmation request exists or not; and if the characteristic data exists, sending a first data confirmation result indicating the existence of the characteristic data to the response node, and if the characteristic data does not exist, sending a second data confirmation result indicating the nonexistence of the characteristic data to the response node. The node judges whether the block data corresponding to the block data confirmation request exists according to the block data confirmation request, if the first data confirmation result exists, which returns the corresponding characterization data, the second data confirmation result does not exist, which returns the corresponding characterization data.
In this embodiment, the block data confirmation request includes a partition identifier and block height requirement information corresponding to the block data to be synchronized. The partition ID can characterize the authority, namely, whether the node has the authority of the target partition or not is confirmed according to the partition ID, and meanwhile, whether the node meets the height of the data synchronization requirement or not is judged according to the height requirement information. The node receiving the block data confirmation request judges whether the node owns the authority of the partition corresponding to the block data confirmation request according to the partition ID contained in the block data confirmation request and the ID of the partition owning the authority; if the block data is authorized, whether the block data corresponding to the block data confirmation request exists or not is further broken according to the height requirement information contained in the block data confirmation request and the height information of the data owned by the block data; and if the data exists, returning the result of the data existence, and if the data does not exist or has no authority, returning the node where the data does not exist.
For example, as shown in fig. 3, the read-only node is set to be the data node to be synchronized, and the read-only node is set to be the upper node of the read-only node, i.e. the response node in this embodiment. When the node has needed synchronous data, firstly sending a block data confirmation request to the directly connected node D, and if the node D can provide corresponding data, directly returning the data to the node D. If the node D can not provide the data, the block data confirmation request is forwarded to the nodes C, B and F directly connected with the node D. The nodes return corresponding responses according to whether the data can be provided by the nodes or not, and the nodes in the blockchain network are traversed by analogy, and then the data confirmation result is forwarded to the node through the node D.
In this embodiment, in the process of forwarding the block data acknowledgement request to the upper node in the blockchain network by using the location of the consensus node in the blockchain network as the final request direction, the method may further include: a node in the block chain network queries a request path corresponding to a block data confirmation request according to the received block data confirmation request; if the request path contains the self node, judging that malignant circulation abnormality exists and generating a corresponding alarm prompt.
It will be appreciated that there may be problems in the prior art, such as the connection between nodes a- > B- > C- > D- > a shown in fig. 2, such that the nodes may request each other, resulting in all nodes requesting data but none of them being available, and that the node itself is unaware of this. That is, if a ring query is formed between some nodes in the blockchain network, i.e. the nodes are connected in a ring, then the blockdata acknowledgement request will be continuously circulated in the formed ring, and the vicious circle cannot be completed, at this time, the whole network can be considered as not providing the demand. The data request is not normal, the subsequent processing of the data can be perfected, but the node needs to know a result, otherwise, each node is blocked on the step of the request under the condition of circulating the request, and therefore, a corresponding alarm prompt needs to be generated. Specifically, after each node obtains the block data confirmation request, a request path corresponding to the block data confirmation request, namely, the node from which the block data confirmation request is initially initiated and the node passing by the block data confirmation request are queried, and if the request path comprises the self node, namely, the request is received before, the malignant cycle abnormality is determined. Therefore, the method can effectively and timely find and alarm under the condition that errors which cannot be processed, such as a plurality of lagged read-only nodes form a ring network to cause mutual requests.
Step S13: and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node.
In this embodiment, the responding node forwards the data confirmation result to the requesting node, and the requesting node determines the target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node. The method comprises the steps of selecting a target synchronous data node meeting data synchronous requirements according to data confirmation results fed back by all the upper nodes, directly sending a data synchronous request to the target synchronous node, and then realizing partition data synchronization according to corresponding block data fed back by the target synchronous node. The node can synchronize the block data more quickly and stably, the problem that the data cannot be synchronized due to partition authority can be prevented, and the problem that the block chain network cannot work normally due to the fact that partition data are frequently lost in the existing scheme is solved.
In this embodiment, the determining, by the requesting node, the target synchronization node according to the data confirmation result may include: the request node determines a target node meeting the partition data synchronization requirement from all traversed superior nodes according to the data confirmation result; and randomly selecting one node from the target nodes as the target synchronous node. Namely, each time of data synchronization request only initiates a request to one target synchronization node, the occupation of bandwidth can be reduced, and the utilization rate of the network can be increased.
From the above, in this embodiment, the response node obtains the block data confirmation request sent by the request node directly connected to the local area; the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received; and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node. Before sending the data synchronization request, the request node sends a block data confirmation request to the directly connected response node, and the response node forwards the block data request to the upper node step by step, so that the nodes in the block chain network are traversed step by step upwards to find out the target synchronization node with the needed synchronization data, and finally the data node to be synchronized realizes the partition data synchronization according to the block data in the target synchronization node. Therefore, the partition data synchronization among the multi-layer nodes in the blockchain network is optimized by modifying the logic and the network architecture of the data synchronization and using the node forwarding, so that the blockchain system can timely perform data interaction, and the problem of synchronization obstacle caused by the partition authority of the nodes can be prevented, thereby improving the stability and the usability of the blockchain network.
Correspondingly, the embodiment of the application also discloses a partition data synchronization device in the blockchain network, as shown in fig. 4, the device comprises:
a block data acknowledgement request obtaining module 11, configured to obtain, by a responding node, a block data acknowledgement request sent by a requesting node directly connected to the local;
the request forwarding module 12 is configured to forward the block data acknowledgement request to an upper node in the blockchain network with a location of a consensus node in the blockchain network as a final request direction, and receive a data acknowledgement result fed back by the upper node;
and the data synchronization module 13 is configured to forward the data confirmation result to the requesting node, so that the requesting node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node.
From the above, in this embodiment, the response node obtains the block data confirmation request sent by the request node directly connected to the local area; the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received; and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node. Before sending the data synchronization request, the request node sends a block data confirmation request to the directly connected response node, and the response node forwards the block data request to the upper node step by step, so that the nodes in the block chain network are traversed step by step upwards to find out the target synchronization node with the needed synchronization data, and finally the data node to be synchronized realizes the partition data synchronization according to the block data in the target synchronization node. Therefore, the partition data synchronization among the multi-layer nodes in the blockchain network is optimized by modifying the logic and the network architecture of the data synchronization and using the node forwarding, so that the blockchain system can timely perform data interaction, and the problem of synchronization obstacle caused by the partition authority of the nodes can be prevented, thereby improving the stability and the usability of the blockchain network.
In some embodiments, the request forwarding module 12 may specifically include:
the data judging unit is used for judging whether the block data corresponding to the block data confirmation request exists or not according to the block data confirmation request;
and the synchronization unit is used for directly transmitting the block data to the request node if the block data exists, stopping executing the operation of taking the position of the common node in the block chain network as the final request direction and transmitting the block data confirmation request to the upper node in the block chain network.
And the execution unit is used for executing the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as the final request direction if the block data does not exist.
In some specific embodiments, the upper node may specifically include:
the permission judging unit is used for judging whether the partition has the permission corresponding to the block data confirmation request according to the block data confirmation request;
the data judging unit is used for judging whether the block data corresponding to the block data confirmation request exists or not if the block data has the authority of the partition;
and the result sending unit is used for sending a first data confirmation result representing that the data exist to the response node if the block data exist, and sending a second data confirmation result representing that the data do not exist to the response node if the block data do not exist.
In some embodiments, the requesting node may specifically include:
the target node determining unit is used for determining target nodes meeting the partition data synchronization requirement from all traversed superior nodes according to the data confirmation result;
and the target synchronous node determining unit is used for randomly selecting one node from the target nodes as the target synchronous node.
In some embodiments, the block data acknowledgement request includes a partition identifier and block height requirement information corresponding to the block data to be synchronized.
In some embodiments, the requesting node may specifically include:
and the response node determining unit is used for randomly selecting one node from all nodes directly connected with the response node as the response node and sending a block data confirmation request to the response node.
In some embodiments, the partition data synchronization device in the blockchain network may specifically include:
a request path determining unit, configured to query a request path corresponding to a block data confirmation request according to the received block data confirmation request by a node in the blockchain network;
and the alarm unit is used for judging that the vicious circle abnormality exists and generating a corresponding alarm prompt if the request path contains the self node.
Further, the embodiment of the application further discloses an electronic device, and referring to fig. 5, the content in the drawing should not be considered as any limitation on the scope of use of the application.
Fig. 5 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the partition data synchronization method in the blockchain network disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223 including block data, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further comprise a computer program capable of performing other specific tasks in addition to the computer program capable of performing the method of partition data synchronization in a blockchain network executed by the electronic device 20 as disclosed in any of the previous embodiments.
Further, the embodiment of the application also discloses a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by a processor, the method steps for synchronizing partition data in the blockchain network disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above detailed description of the method, the device, the equipment and the medium for synchronizing partition data in a blockchain network provided by the invention applies specific examples to illustrate the principle and the implementation of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. A method for synchronizing partitioned data in a blockchain network, comprising:
the response node acquires a block data confirmation request sent by a request node directly connected with the local;
the position of a consensus node in the block chain network is taken as a final request direction, the block data confirmation request is forwarded to an upper node in the block chain network, and a data confirmation result fed back by the upper node is received;
and forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node, and then realizes partition data synchronization according to the block data in the target synchronization node.
2. The method for synchronizing partitioned data in a blockchain network of claim 1, wherein forwarding the blockdata acknowledgement request to an upper node in the blockchain network with a location of a consensus node in the blockchain network as a final request direction comprises:
judging whether block data corresponding to the block data confirmation request exists or not according to the block data confirmation request;
if so, directly sending the block data to the request node, and stopping executing the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as the final request direction.
And if the block data confirmation request does not exist, the operation of sending the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction is executed.
3. The method for synchronizing partitioned data in a blockchain network according to claim 1, wherein after forwarding the blockdata acknowledgement request to an upper node in the blockchain network with a location of a consensus node in the blockchain network as a final request direction, further comprising:
the upper node judges whether the upper node owns the authority of the partition corresponding to the block data confirmation request according to the block data confirmation request;
if the authority of the partition is possessed, judging whether the block data corresponding to the block data confirmation request exists or not;
and if the characteristic data exists, sending a first data confirmation result indicating the existence of the characteristic data to the response node, and if the characteristic data does not exist, sending a second data confirmation result indicating the nonexistence of the characteristic data to the response node.
4. The method for partitioning data synchronization in a blockchain network as in claim 1, wherein the requesting node determines a target synchronization node according to the data confirmation result, comprising:
the request node determines a target node meeting the partition data synchronization requirement from all traversed superior nodes according to the data confirmation result;
and randomly selecting one node from the target nodes as the target synchronous node.
5. The method of claim 1, wherein the block data acknowledgement request includes a block identifier and block height requirement information corresponding to the block data to be synchronized.
6. The method for synchronizing partition data in a blockchain network of claim 1, wherein before the responding node obtains the block data acknowledgement request sent by the requesting node directly connected to the local node, further comprising:
and the request node selects one node from all nodes directly connected with the request node as the response node, and sends a block data confirmation request to the response node.
7. The method for synchronizing partition data in a blockchain network according to any of claims 1-6, wherein the forwarding the blockdata acknowledgement request to an upper node in the blockchain network with the location of the consensus node in the blockchain network as the final request direction further comprises:
a node in the block chain network queries a request path corresponding to a block data confirmation request according to the received block data confirmation request;
if the request path contains the self node, judging that malignant circulation abnormality exists and generating a corresponding alarm prompt.
8. A partitioned data synchronization apparatus in a blockchain network, comprising:
the block data confirmation request acquisition module acquires a block data confirmation request sent by a request node directly connected with the local by using a response node;
the request forwarding module is used for forwarding the block data confirmation request to an upper node in the block chain network by taking the position of the consensus node in the block chain network as a final request direction and receiving a data confirmation result fed back by the upper node;
and the data synchronization module is used for forwarding the data confirmation result to the request node so that the request node determines a target synchronization node according to the data confirmation result, sends a data synchronization request to the target synchronization node and then realizes partition data synchronization according to the block data in the target synchronization node.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the partition data synchronization method in a blockchain network as in any of claims 1 to 7.
10. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements a partition data synchronization method in a blockchain network as in any of claims 1 to 7.
CN202310202591.XA 2023-03-06 2023-03-06 Partition data synchronization method, device, equipment and medium in block chain network Pending CN116248694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310202591.XA CN116248694A (en) 2023-03-06 2023-03-06 Partition data synchronization method, device, equipment and medium in block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310202591.XA CN116248694A (en) 2023-03-06 2023-03-06 Partition data synchronization method, device, equipment and medium in block chain network

Publications (1)

Publication Number Publication Date
CN116248694A true CN116248694A (en) 2023-06-09

Family

ID=86625864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310202591.XA Pending CN116248694A (en) 2023-03-06 2023-03-06 Partition data synchronization method, device, equipment and medium in block chain network

Country Status (1)

Country Link
CN (1) CN116248694A (en)

Similar Documents

Publication Publication Date Title
CN109474936B (en) Internet of things communication method and system applied among multiple lora gateways
CN107404512B (en) Resource subscription method, resource subscription device and resource subscription system
CN111865888B (en) Proxy subscription authorization method and device
CN113746928B (en) Cross-cloud service calling method, device and system
KR20110093087A (en) Method and apparatus for using service of home network device based on remote access
CN111163173A (en) Cluster configuration method and device, server and readable storage medium
EP3174318A1 (en) Method for realizing resource attribute notification, and common service entity
CN113076187B (en) Distributed lock management method and device
CN106790354B (en) Communication method and device for preventing data congestion
KR20210075898A (en) Integrated gateway for efficient OPC UA server data access and integration
CN116248694A (en) Partition data synchronization method, device, equipment and medium in block chain network
CN109344202B (en) Data synchronization method and management node
CN110063050B (en) Service scheduling method and system
CN114422520B (en) Cross-chain interaction method and device
US20230053967A1 (en) Group updating method, message sending method, and apparatuses
CN104796794A (en) Video transmission path determination method and device
CN114567524A (en) Communication system and method based on dynamic gateway
CN114090342A (en) Storage disaster tolerance link management method, message execution node and storage control cluster
CN114615248A (en) Remote operation control method and device, electronic equipment and storage medium
CN108093147B (en) Distributed multi-stage scheduling method and equipment
JP4440951B2 (en) Network system
CN111596933A (en) File processing method and device, electronic equipment and computer readable storage medium
CN114844961B (en) Distributed system protocol intercommunication method, device, equipment and storage medium
CN114079578B (en) Login information processing method and device, storage medium and electronic equipment
CN117687720A (en) Service processing method, device, equipment and storage medium

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