WO2020233185A1 - Information synchronization method and device - Google Patents

Information synchronization method and device Download PDF

Info

Publication number
WO2020233185A1
WO2020233185A1 PCT/CN2020/076858 CN2020076858W WO2020233185A1 WO 2020233185 A1 WO2020233185 A1 WO 2020233185A1 CN 2020076858 W CN2020076858 W CN 2020076858W WO 2020233185 A1 WO2020233185 A1 WO 2020233185A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
information
nodes
synchronization
information synchronization
Prior art date
Application number
PCT/CN2020/076858
Other languages
French (fr)
Chinese (zh)
Inventor
张衡
周超
姚序明
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020233185A1 publication Critical patent/WO2020233185A1/en
Priority to US17/136,270 priority Critical patent/US11165864B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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
    • 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
    • Y02D30/00Reducing energy consumption in communication networks

Definitions

  • This application relates to the field of blockchain technology, and in particular to a method and device for information synchronization.
  • a distributed network system includes multiple connected nodes, and it is usually necessary to synchronize content between multiple nodes.
  • the node that has obtained the updated content needs to broadcast the updated content to other nodes in the network.
  • the node that has obtained the updated content randomly selects N neighboring nodes As the target node, it sends a Gossip message with updated content; after N neighboring nodes receive the Gossip message, they will use the updated content to update their own data, and generate a response (Response) message to send to the node that sent the Gossip message.
  • the N neighboring nodes are then used as the nodes that have obtained the updated content, and N neighboring nodes are randomly selected as the target node, and the Gossip message carrying the updated content is sent. After many times of the above operations, the purpose of synchronously updating the content of each node in the entire network is realized.
  • the main problem with the method for updating node content in the above distributed network system is that the node that has obtained the updated content randomly selects the target node to send the Gossip message, so it is easy to appear that the target node selected by different nodes is the same, resulting in the same target node.
  • Receiving Gossip messages from different nodes, and the update content carried in different Gossip messages is the same, which may lead to resource waste in the content update process; or individual nodes have not been selected as target nodes by any other node , Causing these individual nodes to always fail to receive Gossip messages and unable to update content, which may lead to incomplete synchronization problems.
  • the present application provides a method and device for information synchronization, which are used to avoid the problems of incomplete synchronization and waste of synchronization process resources that exist when the distributed network system of the prior art performs node content update.
  • an embodiment of the present application provides a method for information synchronization, including:
  • the first node with information synchronization capability determines, according to the first node information list and the second node information list, nodes in the node group where the first node is not performing information synchronization; wherein, in the first node information list The node information of all nodes in the node group is included, and the second node information list includes the node information of the nodes in the node group that have performed information synchronization; the first node has not synchronized information from the Select at least one second node from the nodes in, perform information synchronization on the at least one second node, and update the respective node information corresponding to the at least one second node to the second node information list.
  • the first node is a node that is selected for information synchronization from nodes that have not performed information synchronization. Therefore, the speed of information synchronization is accelerated, energy consumption is reduced, and the performance of the blockchain platform is improved.
  • the first node will determine the node corresponding to the node information included in the first node information list and not included in the second node information list as no information Synchronized node.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • a way to group nodes in the entire network system for information synchronization is provided, so that when the first node in the network system randomly selects nodes that have not been synchronized for information synchronization, the nodes in each group The first node only needs to synchronize the information of the nodes in the group where the content is not updated. Therefore, the first node does not need to determine the nodes that have not been updated in the entire distributed network system, so the first node needs to consider the unupdated content
  • the number of updated nodes is smaller and more targeted, and the first node in multiple groups simultaneously synchronizes the information of the nodes in the group where the information is not synchronized, which can achieve the effect of concurrent information synchronization and improve the efficiency of information synchronization.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in the 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the method further includes: if the first node determines that the second node information list includes all node information included in the first node information list, terminating information synchronization Or if the first node receives any response from the second node that the information synchronization fails, then terminates the information synchronization.
  • the method further includes: if the first node selects at least one second node from the nodes for which information is not synchronized as a round of selection operation, the first node continuously When the number of rounds for the selection operation reaches the first threshold, the information synchronization operation is suspended; the first node resumes the information synchronization operation after pausing for a preset period of time; wherein, the preset period of time is based on the accumulation of the first node The number of rounds for the selection operation is determined.
  • a solution for suspending information synchronization for part of the first nodes in the entire distributed network system is provided, thereby reducing the overall power consumption of the entire system and avoiding excessive power consumption of a node in the system.
  • an embodiment of the present application also provides a method for information synchronization, including:
  • the first node with information synchronization capability determines, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node The information list contains the node information of all nodes in the node group, and the second node information list contains the node information of the node that has been synchronized with the information learned by the first node; At least one second node is selected from the nodes that have not performed information synchronization, information synchronization is performed on the at least one second node, and the node information corresponding to the at least one second node is updated to the second node information list In; the first node sends the updated list of second node information to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node information The list updates the second node information list corresponding to itself.
  • the first node is a node that is selected for information synchronization from nodes that have not performed information synchronization. Therefore, the speed of information synchronization is accelerated, energy consumption is reduced, and the performance of the blockchain platform is improved.
  • the first node will determine the node corresponding to the node information included in the first node information list and not included in the second node information list as no information Synchronized node.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • a way to group nodes in the entire network system for information synchronization is provided, so that when the first node in the network system randomly selects nodes that have not been synchronized for information synchronization, the nodes in each group The first node only needs to synchronize the information of the nodes in the group where the content is not updated. Therefore, the first node does not need to determine the nodes that have not been updated in the entire distributed network system, so the first node needs to consider the unupdated content
  • the number of updated nodes is smaller and more targeted, and the first node in multiple groups simultaneously synchronizes the information of the nodes in the group where the information is not synchronized, which can achieve the effect of concurrent information synchronization and improve the efficiency of information synchronization.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in the 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the method further includes: if the first node determines that the second node information list includes all node information included in the first node information list, terminating information synchronization Or if the first node receives any response from the second node that the information synchronization fails, then terminates the information synchronization.
  • the method further includes: if the first node selects at least one second node from the nodes for which information is not synchronized as a round of selection operation, the first node continuously When the number of rounds for the selection operation reaches the first threshold, the information synchronization operation is suspended; the first node resumes the information synchronization operation after pausing for a preset period of time; wherein, the preset period of time is based on the accumulation of the first node The number of rounds for the selection operation is determined.
  • a solution for suspending information synchronization for part of the first nodes in the entire distributed network system is provided, thereby reducing the overall power consumption of the entire system and avoiding excessive power consumption of a node in the system.
  • an embodiment of the present application provides an information synchronization device, which can be used to perform the operations in the foregoing first aspect and any possible implementation manner of the first aspect.
  • the device may include a module unit for performing each operation in the foregoing first aspect or any possible implementation of the first aspect; and/or, the device may be used to perform the foregoing second aspect and any of the second aspects.
  • the apparatus may include a module unit for performing the above-mentioned second aspect or each operation in any possible implementation manner of the second aspect.
  • an embodiment of the present application provides an information synchronization device.
  • the device includes a processor, a transceiver, and optionally a memory.
  • the processor, transceiver, and memory communicate with each other through internal connection paths.
  • the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory.
  • the foregoing execution causes the apparatus to execute any method in the foregoing first aspect or any possible implementation of the first aspect; and/or causes the apparatus to execute the foregoing second aspect or second aspect Any of the possible implementations of.
  • the embodiments of the present application provide a chip system, including a processor, and optionally a memory; where the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that
  • the communication device of the chip system executes any method of the first aspect or any possible implementation of the first aspect; and/or, the communication device installed with the chip system executes the second aspect or any of the second aspects Any one of the implementation methods.
  • the embodiments of the present application provide a computer program product, the computer program product includes: computer program code, when the computer program code is run by the communication unit, processing unit or transceiver, or processor of the communication device, the communication device Perform any method in the foregoing first aspect or any possible implementation manner of the first aspect; and/or cause the communication device to perform any method in the foregoing second aspect or any possible implementation manner of the second aspect.
  • the embodiments of the present application provide a computer-readable storage medium, the computer-readable storage medium stores a program, and the program causes a communication device (for example, a terminal device or a network device) to execute the first aspect or the first aspect described above. Any method in any possible implementation manner; and/or, causing the communication device to execute the above-mentioned second aspect or any method in any possible implementation manner of the second aspect.
  • a communication device for example, a terminal device or a network device
  • the embodiments of the present application provide a computer program.
  • the computer program When the computer program is executed on a computer, it will enable the computer to implement the first aspect or any one of the possible implementations of the first aspect; And/or, cause the computer to implement the second aspect or any method in any possible implementation manner of the second aspect.
  • Figure 1 is a schematic diagram of an information synchronization system architecture provided by this application.
  • Figure 2 is a schematic diagram of the first information synchronization method provided by this application.
  • FIG. 3 is a schematic diagram of the second information synchronization method provided by this application.
  • FIG. 4 is a schematic diagram of a flow of information synchronization through grouping provided by this application.
  • Figure 5 is a schematic diagram of a source node randomly selecting some nodes from each group for information synchronization provided by this application;
  • Figure 6 is a schematic diagram of the first round of synchronization provided by this application for information synchronization
  • FIG. 7 is a schematic diagram of the second round of synchronization when performing information synchronization provided by this application.
  • FIG. 8 is a schematic diagram of the third round of synchronization when performing information synchronization provided by this application.
  • FIG. 9 is a schematic diagram of the fourth round of synchronization when performing information synchronization provided by this application.
  • FIG. 10 is a schematic diagram of the fifth round of synchronization when performing information synchronization provided by this application.
  • FIG. 11 is a schematic diagram of the first information synchronization device provided by this application.
  • FIG. 12 is a schematic diagram of the second information synchronization device provided by this application.
  • FIG. 13 is a schematic diagram of a third information synchronization device provided by this application.
  • FIG. 14 is a schematic diagram of the fourth information synchronization device provided by this application.
  • a schematic diagram of the blockchain network architecture applied in this application mainly includes: blockchain service platform, core node equipment, and light node equipment.
  • the blockchain service platform is mainly composed of multiple core nodes. Form a chain, and then provide blockchain services to core node devices and light node devices.
  • the block data of a core node in the blockchain service platform changes.
  • the block data of other core nodes must be changed. If the data of the latter core nodes remain synchronized, information synchronization is required, that is, information synchronization is required between multiple core nodes.
  • Blockchain service platform refers to a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. It is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of data blocks generated by using cryptographic methods. Each data block contains a batch of Bitcoin network transaction information. It is used to verify the validity of its information (anti-counterfeiting) and generate the next block (each core node blockchain service in Figure 1 is equivalent to a block).
  • the core node refers to the node that has all the blockchain capabilities in the blockchain service platform, including all node management capabilities, transaction capabilities, consensus capabilities, etc.
  • the core nodes in the blockchain service platform are equivalent, that is, each core node stores all node list information in the entire network, and the node list information stored by each core node has sequential consistency.
  • the core node device refers to the device that accesses the blockchain service platform within its own device through the blockchain SDK to obtain all blockchain services.
  • Light nodes refer to nodes that only have part of the blockchain capabilities in the blockchain service platform, specifically including some node management capabilities, some transaction capabilities, and communication capabilities.
  • Light node equipment refers to equipment that uses the blockchain SDK to obtain part of the blockchain service through remote device communication.
  • At least one means one or more, and “plurality” means two or more.
  • “And/or” describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “yes” generally indicates that the associated objects before and after are an “or” relationship.
  • “The following at least one item (a) or similar expressions refers to any combination of these items, including single item (a) or plural items (A) any combination.
  • at least one item (a) of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple .
  • first and second are used to distinguish multiple objects, and are not used to limit the order, timing, priority, or importance of multiple objects .
  • first priority criterion and the second priority criterion are only for distinguishing different criteria, but do not indicate the difference in content, priority, or importance of the two criteria.
  • the method for nodes in a distributed network system to synchronize information is generally: a node that has obtained updated content randomly selects N neighboring nodes as target nodes, and sends a Gossip message carrying the updated content based on the Gossip protocol; After N neighboring nodes receive the Gossip message, they will use the updated content to compare their own data. When the comparison results are inconsistent, use the updated content to update their own data. After neighboring nodes use the updated content to compare their own data, a message will be generated. The Response message is sent to the node that sent the Gossip message, and the node that sent the Gossip message receives the Response message and parses it, thus ending the message sending process.
  • the N neighboring nodes are used as the nodes that have obtained the updated content, and N neighboring nodes are randomly selected as the target node, and the Gossip message carrying the updated content is sent.
  • the receiving node compares the data saved by itself according to the received update content After generating a Response message and sending it to the first node of the sending node, it also changes to the node role of sending the updated content and repeats the above sending process. In this way, after many times of sending processes, the goal of synchronizing the content of each node in the entire network can be achieved.
  • the sending node randomly selects the target node for content synchronization. Therefore, it is very likely that the same target node may receive Gossip messages from different nodes, but different Gossip messages The updated content carried is the same, so it may cause resource waste in the content update process; or individual nodes have not been selected by any other node as the target node, resulting in these individual nodes not receiving Gossip messages and unable to update the content , Which may cause incomplete synchronization.
  • an embodiment of the present application provides a method for information synchronization. It can be applied to any distributed network architecture that requires node information synchronization.
  • the basic idea of the embodiments of the present application is to ensure that when information is synchronized in a distributed network architecture, try to ensure that the target nodes selected by the node sending the updated content that need to be synchronized are all nodes that have not synchronized the information.
  • the first node is used as the sending node and the second node is used as the receiving node.
  • the first node that initiates information synchronization for the first time is called the source node, that is, before the source node initiates information synchronization for the first time, other nodes in the distributed network are all nodes that have not performed information synchronization.
  • the source node may randomly select some nodes from other nodes in the distributed network system for information synchronization, and some nodes randomly selected by the first node will become the new first node after successfully completing the information synchronization, and continue to proceed.
  • Information synchronization until all nodes in the distributed network system complete information synchronization.
  • the node randomly selected by the first node for information synchronization can be called the second node.
  • the second node receives a new Gossip message, it first parses the received Gossip message to determine the updated content, and then Use the updated content to compare the data saved by itself, where, if the data saved by the second node itself already contains the updated content, a Response message indicating that the information synchronization failed this time is sent to the first node that sent the Gossip message, if If the data saved by the second node itself does not contain updated content, a Response message indicating that the information synchronization is successful this time is sent to the first node that sent the Gossip message, and the updated content is used for data update.
  • Two node information lists are maintained in the distributed network system, which are represented by the first node information list and the second node information list here.
  • the first node in the distributed network system can determine that the distributed network system randomly selects some nodes as destination nodes for content synchronization.
  • the nodes in the network system that are not performing content synchronization may further select a destination node from the determined nodes that are not performing content synchronization to perform content synchronization. In this way, it is avoided that some nodes are selected as the destination node multiple times, and the Gossip message is repeatedly sent to cause wastage of resources, and it can also avoid the problem of incomplete synchronization that some nodes have not been selected as the destination node.
  • a method for information synchronization provided in Embodiment 1 of the present invention includes:
  • Step 200 The first node with information synchronization capability determines, according to the first node information list and the second node information list, nodes that have not performed information synchronization in the node group where the first node is located.
  • the first node information list includes node information of all nodes in the node group
  • the second node information list includes nodes in the node group that have performed information synchronization. The node information.
  • Step 201 The first node selects at least one second node from the nodes for which information has not been synchronized.
  • Step 202 The first node synchronizes information with the at least one second node, and updates the node information corresponding to the at least one second node to the second node information list.
  • the distributed network system here provides a variety of methods when maintaining the first node information list, which will be introduced separately below:
  • All nodes in the distributed network system can share a first node information list.
  • this shared first node information list can be stored in a third-party storage device that all nodes can access, such as cloud storage devices.
  • a node in the system needs to call the first node information list, it can obtain the first node information list by remotely accessing a third-party storage device, thereby reducing local resource occupation.
  • Each node in the distributed network system maintains a first node information list.
  • the first node information list corresponding to each node can be stored in the local storage space corresponding to the node.
  • the nodes in the distributed network system require When calling the first node information list, the first node information list can be directly obtained in the local corresponding storage space, thereby increasing the calling rate.
  • all nodes in the distributed network system may also share a second node information list, and the second information list includes all the information that has been performed in the entire network.
  • the information of each node that is randomly selected by the first node as the sender for content update is stored in the shared second node information list.
  • the distributed network system currently includes 10 nodes, and the node 1 is the source node, where the following Table 1 is a common first node information list in the current distributed network system, and Table 2 (a) is the second node information list shared in the initial state when information is not synchronized in the current distributed network system.
  • the node 1 selects node 3 and node 5 for content synchronization, then after node 1 selects the node 3 and node 5, the node 1, node 3 and node 5
  • the node information is stored in the shared second node information list.
  • the node information in the shared second node information list is changed as shown in Table 2(b).
  • the node 1 When the node 1 successfully synchronizes the information of the node 3 and the node 5, the node 3 and the node 5 become the new first node, and the content update is continued, according to the table 2(b)
  • the shared second node information list and the shared first node information list shown in Table 1, it can be determined that the nodes that have not been synchronized include node 2, node 4, and node 6-10.
  • the source node can store its own node information and the selected node information for information synchronization only in the shared second node information list when the node is selected for information synchronization for the first time.
  • the source node does not need to store its own node information in the shared second node information list; or only the selected node information for information synchronization may be stored in the shared second node information list. .
  • the nodes randomly selected by the first node 1 are node 2 and node 6, the nodes randomly selected by the first node 3 are node 4 and node 10, and the first node 5 randomly
  • the selected nodes are node 8 and node 9
  • the node information of the node 2 and node 6 is stored in the shared second node information list .
  • the node information of the node 4 and the node 10 is stored in a common second node information list, and the first node 5 selects all the nodes.
  • the node information of the node 8 and the node 9 is stored in the shared second node information list.
  • the node information in the shared second node information list is updated as shown in Table 2(c), according to the shared second node information list shown in Table 2(c) and From the shared first node information list shown in Table 1, it can be determined that only node 7 is left in the distributed network system where content is not updated at this time.
  • the first node currently serving as the sender has nodes 1-6 and 8-10, and the node that has not updated the content is only node 7. Therefore, in the process of information synchronization in a distributed network system, there may be a problem that multiple first nodes select the same node that has not performed content update for information synchronization. For example, if the first node 1-6 and the nodes 8-10 all select node 7 for information synchronization, the node information of node 7 is stored in the shared second node information list.
  • node 7 will send a response to node 3 indicating that the information synchronization is successful After receiving the response message indicating that the information synchronization is successful, the node 3 still has the ability to perform information synchronization, and it can also continue to perform information synchronization for nodes in the distributed network system that have not updated the content.
  • node 1, node 2, node 4-6, and node 8-10 are synchronizing information with node 7, because the node 7 is in the node 1, node 2, node 4-6, node 8-10
  • the content update has been completed before information synchronization. Therefore, the node 7 respectively parses the received Gossip messages sent by node 1, node 2, node 4-6, and node 8-10, determines the updated content, and uses the updated content After comparing the data saved by itself, it can be determined that its data contains updated content before information synchronization. Therefore, a response message indicating that the information synchronization is unsuccessful is sent to node 1, node 2, node 4-6, and node 8-10, respectively. However, after the node 1, node 2, node 4-6, and node 8-10 receive the response message sent by node 7 indicating that the information synchronization is unsuccessful, they will lose the ability to continue information synchronization and terminate the information synchronization.
  • node 3 and node 7 in the entire distributed network system have the ability to synchronize information, and when the fourth round of information synchronization is performed, the node information in the shared second node information list is updated as shown in Table 2 ( d) as shown.
  • Table 2 ( d) the shared second node information list shown in Table 2(d) and the shared first node information list shown in Table 1, it can be known that there are no nodes that have not synchronized information in the current distributed network system. Therefore, node 3 and node 7 can terminate information synchronization.
  • an information synchronization method provided by Embodiment 2 of the present invention includes:
  • Step 300 The first node with information synchronization capability determines, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization.
  • the first node information list includes node information of all nodes in the node group
  • the second node information list includes the progress information learned by the first node itself The node information of the synchronized node.
  • the content contained in the second node information list here may be different from the content contained in the second node information list in the first embodiment.
  • Step 301 The first node selects at least one second node from the nodes for which information has not been synchronized.
  • Step 302 The first node performs information synchronization on the at least one second node, and updates the node information corresponding to the at least one second node to the second node information list.
  • Step 303 The first node sends the updated list of second node information to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node
  • the information list updates the second node information list maintained by itself.
  • the distributed network system in the second embodiment of the present application provides a variety of methods when maintaining the first node information list, which will be respectively introduced below:
  • All nodes in the distributed network system can share a first node information list.
  • this shared first node information list can be stored in a third-party storage device that all nodes can access, such as cloud storage devices.
  • a node in the system needs to call the first node information list, it can obtain the first node information list by remotely accessing a third-party storage device, thereby reducing local resource occupation.
  • Each node in the distributed network system maintains a first node information list.
  • the first node information list maintained by each node can be stored in the local storage space corresponding to the node.
  • the nodes in the distributed network system require When calling the first node information list, the first node information list can be directly obtained in the local corresponding storage space, thereby increasing the calling rate.
  • each node in the distributed network system maintains a second node information list, and the second information list only includes the first node itself
  • the learned node information of nodes that have performed information synchronization, and the second information list maintained by each node itself is updated every time information synchronization is performed.
  • the second node information list maintained by each node may be stored in a third party accessible to all nodes according to the corresponding node identifier.
  • storage devices such as cloud storage devices.
  • a node in the distributed network system needs to call the corresponding second node information list, it can remotely access a third-party storage device to obtain the corresponding second node information list according to its own node identifier, thereby reducing local resource occupation.
  • the information of each node that is randomly selected by the first node as the sender for content update is stored in the second node information list corresponding to the first node .
  • the distributed network system currently includes 10 nodes, and the node 1 is the source node, and the first node information list corresponding to the node 1 is as shown in Table 1, and the node 1 When the information is not synchronized, the second node information list corresponding to the node 1 in the initial state is shown in Table 2(a) above.
  • the node 1 selects node 3 and node 5 for information synchronization, then after node 1 selects the node 3 and node 5, the node 1, node 3 and node 5
  • the node information is stored in the second node information list corresponding to node 1, and after successful information synchronization between node 3 and node 5, the second node information list corresponding to node 1 is sent to node 3 and node 5.
  • node 3 and node 5 receive the second node information list sent by node 1, they update their corresponding second node information list to the received second node information list corresponding to node 1 sent by node 1, that is, the above table 2(b).
  • the first node information list corresponding to node 1 and the second node information list corresponding to node 1 it can be determined that the nodes corresponding to node 1 that have not undergone information synchronization are node 2, node 4, node 6-10;
  • the first node information list corresponding to node 3 and the second node information list corresponding to node 3 it can be determined that the nodes corresponding to node 3 without information synchronization are node 2, node 4, and node 6-10;
  • the first node information list corresponding to node 5 and the second node information list corresponding to node 5 can determine that the nodes corresponding to node 5 that have not undergone information synchronization are node 2, node 4, and node 6-10.
  • the source node can store its own node information and the selected node information for information synchronization only in the second node information maintained by itself when it selects a node for information synchronization for the first time.
  • subsequent other nodes that serve as synchronization nodes do not need to store their own node information in the second node information list maintained by themselves, or only store the selected node information for information synchronization in the second node information list maintained by itself. It is fine in the node information list.
  • the nodes randomly selected by the first node 1 for content update are node 2, and node 6, and the nodes randomly selected by the first node 3 for content synchronization are node 4 and node 10.
  • the nodes randomly selected by the first node 5 for content synchronization are node 8 and node 9.
  • the second node information list corresponding to node 1 is sent to node 2 and node 6.
  • node 2 and node 6 receive the second node information list sent by node 1, they update their corresponding second node information list to the received second node information list corresponding to node 1 sent by node 1, as shown in the following table 2(e).
  • the information of the node 4 and the node 10 is stored in the second node information list corresponding to the first node 3, and the node 4 and the node 10 are successfully processed.
  • the second node information list corresponding to node 3 is sent to node 4 and node 10.
  • node 4 and node 10 receive the second node information list sent by node 3, they update their corresponding second node information list to the received second node information list corresponding to node 3 sent by node 3, namely the following table 2(f).
  • the second node information list corresponding to node 5 is sent to node 8 and node 9.
  • node 8 and node 9 receive the second node information list sent by node 5, they update their corresponding second node information list to the received second node information list corresponding to node 5 sent by node 5, namely the following table 2(g).
  • the current first node as the sender has nodes 1-6, and nodes 8-10.
  • the corresponding first node information list and itself Corresponding to the second node information list, it can be determined that the nodes corresponding to node 1, node 2, and node 6 that have not undergone information synchronization are node 4, node 7-10; according to the first node 3, node 4, and node 10, their corresponding
  • the first node information list and the second node information list corresponding to itself can determine that the nodes corresponding to node 3, node 4, and node 10 without information synchronization are node 2, node 6-9; according to the first node 5, node 8 , Node 9, the first node information list corresponding to itself and the second node information list corresponding to itself, it can be determined that the nodes corresponding to node 5, node 8, and node 9 without information synchronization are node 2, node 4, node 6 7.
  • the first node 1 randomly selects node 4 and node 7 from the corresponding node 4 and node 7-10 that have not been updated for information synchronization, and stores the information of node 4 and node 7 in the first node corresponding to node 1.
  • the second node information list After the node 1 successfully synchronizes the information of the node 7, it sends its corresponding second node information list to the node 7, where the node 7 receives the second node information list sent by the node 1, and then sends the corresponding
  • the second node information list is updated to the received second node information list corresponding to node 1 sent by node 1, namely, Table 2(h) below.
  • node 1 corresponding to the node that has not been updated has node 4
  • node 4 has been in the second round of information synchronization process, and the information synchronization has been successfully completed by node 3, so node 4 now contains the update content. Therefore, when node 1 updates the information of node 4, it will receive the response message sent by node 4 indicating that the information synchronization is unsuccessful. Therefore, the first node 1 will lose the process after receiving the response message indicating that the information synchronization is unsuccessful. The ability to synchronize information, terminate information synchronization.
  • node 7 in the entire distributed network system has the ability to perform information synchronization, and when performing the fourth round of information synchronization, according to the first node information list and the second node information list corresponding to the first node 7 itself, It can be determined that the node corresponding to node 7 that has not undergone information synchronization is node 8-10.
  • the first node 7 randomly selects node 8 and node 10 from its corresponding nodes 8-10 that have not undergone content update for information synchronization, and stores the information of node 8 and node 10 in the second node information corresponding to node 7 List.
  • node 7 will also receive the response message sent by node 8 and node 10 indicating that the information synchronization is not successful when node 8 and node 10 are updated. Therefore, the first node 7 will also lose the ability to perform information synchronization and terminate the information synchronization.
  • One way is that if the first node in the distributed network system loses the ability to perform information synchronization, it is determined that the first node terminates the information synchronization. Further, if all the first nodes in the entire distributed network system lose the ability to perform information synchronization, it is determined that the entire distributed network system terminates information synchronization.
  • the first node in the distributed network system does not have a corresponding node that does not perform content update, then it is determined that the first node terminates the information synchronization, that is, the first node information list corresponding to the first node is If the node information in the two node information lists is consistent, the first node terminates information synchronization.
  • the first node that needs to suspend information synchronization can be determined, but not limited to, in the following manner:
  • the first threshold in the first embodiment of the present application refers to the maximum number of times that a node continuously synchronizes information.
  • the first threshold is 3, when the number of times that a certain first node continuously performs information synchronization reaches 3 times, the first node needs to temporarily lose the ability to perform information synchronization with other nodes. After pausing for a certain period of time, the ability to synchronize information with other nodes can be resumed again, and nodes that have not been updated are randomly selected from the corresponding nodes that have not been updated for information synchronization.
  • the first node pauses as the cumulative number of times of information synchronization increases.
  • the duration of information synchronization can also be continuously increased.
  • Embodiment 1 and/or Embodiment 2 of the present application can be determined according to the following formula 1.
  • M in the formula 1 refers to the cumulative number of times a node performs information synchronization
  • t in the formula 1 refers to the length of time that a certain first node needs to pause when the information synchronization operation is suspended
  • n is a positive number
  • Embodiment 3 On the basis of the above embodiments 1 and 2, the embodiment 3 of this application can also synchronize information by grouping the nodes in the node group, so that the first in the distributed network system
  • the first node in each group only needs to perform information synchronization for the nodes in the group that have not performed content update. Therefore, the first node does not need to determine the nodes that have not performed content updates in the entire distributed network system.
  • the first node needs to consider the number of nodes that have not performed content updates, which is more targeted, and the first in multiple groups At the same time, the node synchronizes the information of the nodes in the group where the content is not updated, which can realize the effect of concurrent information synchronization and improve the efficiency of information synchronization.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • the information synchronization process is performed by grouping nodes in the entire node group.
  • the specific steps include:
  • Step 400 Determine the number of all nodes in the entire distributed network system, and then perform step 401.
  • Step 401 Determine whether the number of all nodes in the entire distributed network system is greater than a second threshold, if yes, execute step 402, if not, execute step 403.
  • the second threshold in the third embodiment of the present application may refer to the preset maximum value of the number of nodes used to determine whether the grouping condition is met, that is, if the number of all nodes in the current node group exceeds the second threshold, it is determined If the grouping condition is met, all nodes in the current node group will be grouped; if all nodes in the current node group do not exceed the second threshold, it is determined that the grouping condition is not met, and all nodes in the current node group do not need to be grouped.
  • Step 402 Divide all nodes in the entire distributed network system into several node groups, and then perform step 404.
  • step 403 the source node in the distributed network system randomly selects a number of nodes that have not performed content update for information synchronization, and then executes step 409.
  • the node that successfully synchronizes information becomes the new first node.
  • Step 404 The source node in the distributed network system randomly selects a node that has not undergone content update from each grouped node group to perform information synchronization, and then executes step 405.
  • step 405 when the first node performs the next information synchronization, it is judged whether the number of all nodes in the node group where it is located exceeds the second threshold, if yes, step 406 is executed, and if not, step 407 is executed.
  • step 406 all nodes in the node group where the first node is located are again divided into several groups, and then step 408 is performed.
  • step 407 the first node randomly selects several nodes that have not performed content update from the nodes in the node group where it is located for information synchronization, and then performs step 409.
  • step 408 the first node randomly selects a node that has not undergone content update from each node group after regrouping to perform information synchronization, and then returns to continue to perform step 405.
  • Step 409 The first node continues to perform information synchronization until all nodes in the entire distributed network system complete information synchronization.
  • the number of all nodes in the node group where the node is located can be determined according to the first node information list corresponding to a certain node.
  • the first node information list corresponding to the nodes in each node group only includes all the node information in the node group.
  • the nodes in node group 1 are grouped again, where it is assumed that all nodes in node group 1 are divided into three groups, namely the node Group a, node group b, node group c, the first node information list corresponding to each node in each node group in the subgroup only contains all the node information in the node group, for example, node The first node information list corresponding to the nodes in the group a only includes all the node information in the node group a.
  • each node in the distributed network system shares a second node information list, and the second information list only includes information of all nodes in the node group that have performed content synchronization.
  • Grouping method 1 In Embodiment 3 of the present application, after it is determined that grouping is required, all nodes in the current node group are equally divided into the preset number of groups through the preset number of grouping groups.
  • the preset number of grouping groups is 2 groups
  • there are a total of 30 nodes in the current node group and if the average grouping conditions are met, the 30 nodes are divided into two groups, each with 15 nodes node.
  • grouping can be selected to ensure that the variance of the number of nodes in each new node group after grouping is the minimum.
  • the preset number of grouping groups is 2 groups, and there are a total of 27 nodes in the current distributed network system, then the number of nodes in the first group is x 1 and the number of nodes in the second group is x 2 , where, The average number of nodes in each group is 13.5, according to the variance formula in formula 2:
  • Grouping method 2 In the third embodiment of the application, after determining that grouping is required, grouping is performed according to the set second threshold size, and then randomly selected from all nodes in the current node group, the number of nodes with the second threshold size is divided into a group , Until the number of ungrouped nodes is less than the second threshold, finally divide the ungrouped nodes into a group or randomly add the remaining ungrouped nodes into a grouped.
  • the second threshold is set to 10
  • all nodes in the current node group have a total of 29 nodes. Then randomly select 10 nodes from the 29 nodes as the first group of nodes, and randomly select from the remaining 19 nodes. Select 10 nodes as the second group of nodes, and then use the remaining 9 nodes as the third group of nodes, which are divided into three groups;
  • the set threshold is 10
  • all nodes in the current node group have a total of 29 nodes.
  • randomly select 10 nodes from the 29 nodes as the first group of nodes
  • randomly select from the remaining 19 nodes 10 nodes are used as the second group of nodes
  • the remaining 9 nodes are randomly placed into the first group or the second group, for example, into the second group.
  • they are divided into two groups, the first group 10 nodes, 19 nodes in the second group.
  • the source node after the first round of grouping is completed, the source node will randomly select a node that has not performed content update from each node group to perform the first round of information synchronization. After completing the first round of information synchronization and the second round of information synchronization is needed, the first node needs to determine whether the number of all nodes in the current node group exceeds the first threshold.
  • the first node continues to update the current node group All the nodes in the node group are grouped, and then the first node randomly selects nodes that have not undergone content update from each of the corresponding new node groups for information synchronization; if not, the first node directly obtains information from the node group where it is located Nodes in the group that have not undergone content update are randomly selected for information synchronization.
  • the above node content synchronization process continue the above node content synchronization process until the nodes in the entire distributed network system complete information synchronization.
  • the source node is 2
  • the first threshold is set to 2
  • the second threshold is 10
  • All nodes in the distributed network system are divided into two groups, namely the first group, the nodes included are nodes 1-10, and the second group, the nodes included are 11-22.
  • the symbol R in the figure indicates that the second node parses the received Gossip message sent by the first node to determine the updated content, and after comparing the data saved by itself by using the updated content, it determines that it is before performing information synchronization.
  • the data does not contain updated content, that is, the first node has successfully synchronized the information this time, and has the ability to synchronize information;
  • the symbol E indicates that the second node parses the received Gossip message sent by the first node to determine the updated content, and uses the update
  • the content is compared with the data saved by itself, it is determined that its own data contains updated content before information synchronization is performed, that is, the first node fails to synchronize information this time, loses the ability to perform information synchronization, and terminates information synchronization.
  • the source node 2 randomly selects a node that has not performed content update from the first group and the second group to perform information synchronization.
  • the nodes randomly selected by source node 2 that have not undergone content update are node 1 and node 13.
  • node 1 and node 13 When source node 2 successfully synchronizes the information of node 1 and node 13, then node 1 and node 13 also change Become the first node and continue to randomly select nodes from the group that have not undergone content update for information synchronization.
  • the first node needs to determine whether the number of all nodes in the current group exceeds the first threshold.
  • the number of all nodes in the second group where the first node 13 is currently located is 12, which is greater than the first threshold of 10, and the first node will continue to group all nodes in the second group where it is.
  • the first node 13 divides all the nodes in the second group into two groups again, namely the third group, which contains nodes 11-20, and the fourth group, which contains nodes 21-22, And after the grouping is completed, the first node 13 randomly selects a node that has not performed content update in the third group and the fourth group to synchronize information.
  • node 15 and node 21 As shown in Fig. 7, assuming that the nodes that the first node 13 randomly selects from the third group and the fourth group that have not undergone content update are node 15 and node 21, then when the first node 13 successfully completes the node 15 and node 21 After synchronizing the information, node 15 and node 21 also become the first node, and the node information contained in the second node information list corresponding to node 13 and node 15 is [13, 15]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13 and the node 15 that have not undergone information synchronization are [11, 12, 14, 16, 17, 18, 19, 20].
  • the node included in the second node information list corresponding to node 21 is [21]. Therefore, in combination with the first node information list, it can be known that the node corresponding to the node 21 that has not undergone information synchronization is [22]. At this point, after the second round of information synchronization is completed, the node 13 has already performed two consecutive information synchronizations, and has reached the first threshold 2. Therefore, the node 13 needs to pause for a certain period of time before it can perform the next information synchronization.
  • the pause time can be 0.2 seconds.
  • the number of all the nodes in the first group where the first node 1 is currently located is 10, which is not greater than the first threshold 10, and the first node 1 directly randomly selects nodes that have not performed content update from the first group for information synchronization.
  • the nodes that the first node randomly selects from the first group without updating content are node 5 and node 6, then when the first node 1 successfully synchronizes the information of node 5 and node 6, node 5 and node 6 Node 6 also becomes the first node, and the node information contained in the second node information list corresponding to node 1, node 5, and node 6 is [1, 5, 6]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 1, node 5, and node 6 that have not undergone information synchronization are [2, 3, 4, 7, 8, 9, 10].
  • the number of nodes in each group is no more than the set second threshold of 10, therefore, there is no need to group in the subsequent information synchronization process.
  • node 5 and node 6 in the first group become the new first node, and continue to perform information synchronization.
  • the response messages returned by the node 5 and the node 6 received by the node 1 are both R, that is, the node 1 successfully completes the synchronization of the information of the node 5 and the node 6, so The node 1 can continue to synchronize information.
  • the node 1 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 1 needs to pause for a certain period of time before performing the next information synchronization, for example, after a pause of 0.2 seconds, the information synchronization can be performed.
  • the first nodes in the first group are node 1, node 5, and node 6.
  • node 5 and node 6 Continue to synchronize information.
  • the nodes that are randomly selected by the node 5 from the first group and have not undergone content update are node 3 and node 7.
  • the response messages returned by the node 3 and the node 7 to the node 5 are all R, the information synchronization is successful this time, and the first node 5 also has the ability to perform information synchronization.
  • the node 3 and the node 7 when the first node 5 successfully completes the synchronization of the information of the node 3 and the node 7, the node 3 and the node 7 also become the first node, and the second node information list corresponding to the node 5, the node 3, and the node 7 contains The nodes of are [1, 5, 6, 3, 7]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 5, node 3, and node 7 that have not undergone information synchronization are [2, 4, 8, 9, 10]. At this time, the node 5 has continuously performed information synchronization twice, and has reached the first threshold 2. Therefore, the node 5 needs to pause for a certain period of time before performing the next information synchronization.
  • the nodes that the node 6 randomly selects from the first group without content update are node 8 and node 9. According to Fig. 8, it can be seen that the response messages returned by the node 8 and the node 9 to the node 6 are all R, The information synchronization is successful this time, and the first node 6 also has the ability to perform information synchronization. Among them, when the first node 6 successfully completes the synchronization of the information of the node 8 and the node 9, the node 8 and the node 9 also become the first node, and the second node information list corresponding to the node 6, the node 8, and the node 9 contains The nodes of is [1, 5, 6, 8, 9].
  • the nodes corresponding to the node 6, node 8, and node 9 that have not undergone information synchronization are [2, 3, 4, 7, 10].
  • the node 6 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 6 needs to pause for a certain period of time before it can perform the next information synchronization.
  • the specific pause time can be 0.2 seconds, and of course it can also be other values.
  • the first node 1 After a pause of 0.2 seconds, the first node 1 will continue to perform information synchronization. It is assumed that the nodes that are randomly selected by the node 1 from the first group without updating content are the node 2 and the node 4. According to Fig. 7, the response messages returned by the node 2 to the node 1 are all E, and the response messages returned by the node 4 to the node 1 are all R. If the information synchronization is not successful this time, the first node 1 After successfully synchronizing information on node 4, terminate the information synchronization. At this time, node 4 also becomes the first node, and the nodes included in the second node information list corresponding to node 4 are [1, 2, 4, 5, 6]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 4 that have not undergone information synchronization are [3, 7, 8, 9, 10].
  • the first nodes in the third group are node 13 and node 15, wherein, because node 13 is currently in a state of suspending information synchronization, node 15 continues to perform information synchronization. It is assumed that the nodes that are randomly selected by the node 15 from the third group without performing content update are the node 16 and the node 20. It can be seen from FIG. 8 that the response messages returned by the node 16 and the node 20 to the node 15 are all R, and the information synchronization is successful this time, and the first node 15 also has the ability to perform information synchronization.
  • the node 16 and the node 20 when the first node 15 successfully completes the synchronization of the information of the node 16 and the node 20, the node 16 and the node 20 also become the first node, and the second node information list corresponding to the node 15, the node 16, and the node 20 contains The node of is [13, 15, 16, 20]. Therefore, in combination with the first node information list, it can be seen that the nodes corresponding to the node 15, the node 16, and the node 20 that have not undergone information synchronization are [11, 12, 14, 17, 18, 19]. However, at this time, the node 15 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 15 needs to pause for a certain period of time before performing the next information synchronization.
  • the information synchronization can be continued after a pause of 0.2 seconds. It is assumed that the nodes that are randomly selected by the node 13 from the third group without content update are the node 14 and the node 19. It can be seen from FIG. 8 that the response messages returned by the node 14 and the node 19 to the node 13 are all R, and the information synchronization is successful this time, and the first node 13 also has the ability to perform information synchronization.
  • the node 14 and the node 19 when the first node 13 successfully completes the synchronization of the information of the node 14 and the node 19, the node 14 and the node 19 also become the first node, and the second node information list corresponding to the node 13, the node 14, and the node 19 contains The nodes of is [13, 14, 15, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13, the node 14, and the node 19 that have not undergone information synchronization are [11, 12, 16, 17, 18, 20].
  • the first node in the fourth group is only node 21, and the corresponding node that has not undergone content update is only node 22, then node 21 selects node 22 for information synchronization.
  • the response message returned by the node 22 to the node 21 is R, and the information synchronization is successful this time, and the first node 21 also has the ability to perform information synchronization.
  • the node 22 when the first node 21 successfully completes the synchronization of the node 22 information, the node 22 also becomes the first node, and the nodes included in the second node information list corresponding to the nodes 21 and 22 are [21, 22]. Therefore, in combination with the first node information list, it can be known that the nodes 21 and 22 have no corresponding nodes that have not synchronized information. Therefore, the fourth group completes the information synchronization and terminates the information synchronization.
  • the first node in the first group that also has the ability to perform information synchronization is nodes 3-9, where node 5 and node 6 are currently in a state of suspending information synchronization. Therefore, node 3, node 4, and node 7-9 continue to synchronize information. It is assumed that the nodes selected by the node 3 randomly from the corresponding nodes [2, 4, 8, 9, 10] that have not undergone content update are node 8 and node 10. According to Figure 9, the response message returned by the node 10 to the node 3 is R, and the response message returned by the node 8 to the node 3 is E. The information synchronization is not successful this time, and the first node 3 terminates the process. Information synchronization.
  • the node 10 when the first node 3 successfully synchronizes the information of the node 10, the node 10 also becomes the first node, and the nodes contained in the second node information list corresponding to the node 10 are [1, 5, 6, 3, 7, 8, 10]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 10 that have not undergone information synchronization are [2, 4, 9].
  • the first node 4-9 in the first group although it has a corresponding node that has not performed content update, all the nodes that have not performed content update have actually completed information Synchronize. Therefore, no matter which node the first node 4-9 selects for information synchronization in the fourth round of information synchronization process, the response message sent by the corresponding node is always E, and the information synchronization will be terminated.
  • the first nodes in the third group that are also capable of information synchronization are nodes 13-16 and 19-20, among which, because node 15 is currently in a state of suspending information synchronization, node 13, node 14, node 16, node 19-20 Continue to synchronize information. It is assumed that the nodes selected by the node 13 randomly from the corresponding nodes [11, 12, 16, 17, 18, 20] that have not undergone content update are node 11 and node 18. It can be seen from FIG. 9 that the response messages returned by the node 11 and the node 18 to the node 13 are all R, and the information synchronization is successful this time, and the first node 13 can continue the information synchronization.
  • the node 11 and the node 18 when the first node 13 successfully completes the synchronization of the information of the node 11 and the node 18, the node 11 and the node 18 also become the first node, and the second node information list corresponding to the node 13, the node 11, and the node 18 contains The nodes of is [11, 13, 14, 15, 18, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13, the node 11, and the node 18 that have not undergone information synchronization are [12, 16, 17, 20].
  • the nodes selected by the node 14 randomly from the corresponding nodes [11, 12, 16, 17, 18, 20] that have not undergone content update are node 12 and node 17.
  • the response messages returned by the node 12 and the node 17 to the node 14 are all R, and the information synchronization is successful this time, and the first node 14 can continue to perform the information synchronization.
  • the node 12 and the node 17 also become the first node, and the second node information list corresponding to the node 14, the node 12, and the node 17 contains The nodes of is [12, 13, 14, 15, 17, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 14, the node 12, and the node 17 that have not undergone information synchronization are [11, 16, 18, 20].
  • the response message sent by the corresponding node will be E, and the information synchronization will be terminated.
  • the first group completes the information synchronization and terminates the information synchronization.
  • Only node 13 and node 14 in the third group also have information synchronization capabilities. It is assumed that the nodes selected by the node 13 randomly from the corresponding nodes [12, 16, 17, 20] that have not undergone content update are node 12 and node 17. It can be seen from FIG. 10 that the response message returned by the node 12 and the node 17 to the node 13 is E, the information synchronization is not successful this time, and the first node 13 terminates the information synchronization.
  • the nodes selected by the node 14 randomly from the corresponding nodes [11, 16, 18, 20] that have not undergone content update are the node 11 and the node 20. It can be seen from FIG. 9 that the response message returned by the node 11 and the node 20 to the node 14 is E, this time the information synchronization is not successful, and the first node 14 terminates the information synchronization.
  • the above-mentioned realization devices include hardware structures and/or software modules corresponding to the respective functions.
  • the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.
  • an information synchronization device of the present application includes a processor 1100, a memory 1101, and a transceiver 1102;
  • the processor 1100 is responsible for managing the bus architecture and general processing, and the memory 1101 can store data used by the processor 1100 when performing operations.
  • the transceiver 1102 is used to receive and send data under the control of the processor 1100.
  • the bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 1100 and various circuits of the memory represented by the memory 1101 are linked together.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further descriptions are provided herein.
  • the bus interface provides the interface.
  • the processor 1100 is responsible for managing the bus architecture and general processing, and the memory 1101 can store data used by the processor 1100 when performing operations.
  • the process disclosed in the embodiment of the present invention may be applied to the processor 1100 or implemented by the processor 1100.
  • each step of the signal processing flow can be completed by an integrated logic circuit of hardware in the processor 1100 or instructions in the form of software.
  • the processor 1100 may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the embodiments of the present invention The disclosed methods, steps and logic block diagrams.
  • the general-purpose processor may be a microprocessor or any conventional processor.
  • the steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 1101, and the processor 1100 reads the information in the memory 1101 and completes the steps of the signal processing flow in combination with its hardware.
  • the processor 1100 is configured to read and execute the program in the memory 1101:
  • the first node information list and the second node information list determine the nodes whose information has not been synchronized in the node group where the first node is located; wherein, the first node information list includes all nodes in the node group Node information of a node, the second node information list includes node information of nodes in the node group that have performed information synchronization; at least one second node is selected from the nodes that have not performed information synchronization, and the At least one second node performs information synchronization, and the node information corresponding to the at least one second node is updated to the second node information list.
  • the processor 1100 is specifically configured to:
  • the node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the processor 1100 is further configured to:
  • the information synchronization is terminated; or,
  • the processor 1100 is further configured to:
  • the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  • the present invention provides an information synchronization device, which includes:
  • the determining module 1200 is configured to determine, according to the first node information list and the second node information list, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node information list contains all Node information of all nodes in the node group, and the second node information list includes node information of nodes in the node group that have performed information synchronization;
  • the processing module 1201 is configured to select at least one second node from the nodes that have not performed information synchronization, perform information synchronization on the at least one second node, and update node information corresponding to the at least one second node. To the second node information list.
  • the processing module 1201 is specifically configured to:
  • the node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the processing module 1201 is further configured to:
  • the information synchronization is terminated; or,
  • the processing module 1201 is further configured to:
  • the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  • an information synchronization device includes a processor 1300, a memory 1301, and a transceiver 1302;
  • the processor 1300 is responsible for managing the bus architecture and general processing, and the memory 1301 may store data used by the processor 1300 when performing operations.
  • the transceiver 1302 is used to receive and send data under the control of the processor 1300.
  • the bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 1300 and various circuits of the memory represented by the memory 1301 are linked together.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further descriptions are provided herein.
  • the bus interface provides the interface.
  • the processor 1300 is responsible for managing the bus architecture and general processing, and the memory 1301 may store data used by the processor 1300 when performing operations.
  • the process disclosed in the embodiment of the present invention may be applied to the processor 1300 or implemented by the processor 1300.
  • each step of the signal processing flow can be completed by an integrated logic circuit of hardware in the processor 1300 or instructions in the form of software.
  • the processor 1300 may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the embodiments of the present invention The disclosed methods, steps and logic block diagrams.
  • the general-purpose processor may be a microprocessor or any conventional processor.
  • the steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 1301, and the processor 1300 reads the information in the memory 1301, and completes the steps of the signal processing flow in combination with its hardware.
  • the processor 1300 is configured to read a program in the memory 1301 and execute:
  • the first node information list and the second node information list maintained by itself determine the nodes whose information has not been synchronized in the node group where the first node is located; wherein, the first node information list includes the node group The node information of all nodes in the group, the second node information list contains the node information of the nodes that have been information synchronized learned by the first node; at least one second node is selected from the nodes that have not been information synchronized Node, performing information synchronization on the at least one second node, and updating node information corresponding to the at least one second node to the second node information list;
  • the transceiver 1302 is configured to execute: sending the updated second node information list to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node
  • the information list updates the second node information list corresponding to itself.
  • the processor 1300 is specifically configured to:
  • the node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the processor 1300 is further configured to:
  • the information synchronization is terminated; or,
  • the processor 1300 is further configured to:
  • the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  • the present invention provides an information synchronization device, which includes:
  • Determining module 1400 used to determine, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node information list Includes node information of all nodes in the node group, and the second node information list includes node information of nodes that have been information synchronized learned by the first node;
  • Processing module 1401 configured to select at least one second node from the nodes that have not performed information synchronization, perform information synchronization on the at least one second node, and update node information corresponding to the at least one second node respectively To the second node information list;
  • Sending module 1402 used to send the updated second node information list to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node information list Update the second node information list corresponding to itself.
  • the processing module 1401 is specifically configured to:
  • the node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  • the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
  • the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system
  • the quotient of the number of node groups to be divided is preset.
  • the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  • the processing module 1401 is further configured to:
  • the information synchronization is terminated; or,
  • the processing module 1401 is further configured to:
  • the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  • various aspects of the information synchronization method provided by the embodiments of the present invention can also be implemented in the form of a program product, which includes program code.
  • program code runs on a computer device
  • the program code is used to make the computer device execute the steps in the method for configuring parameters according to various exemplary embodiments of the present invention described in this specification.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the program product for configuring parameters according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program codes, and may run on a server device.
  • CD-ROM portable compact disk read-only memory
  • the program product of the present invention is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an information transmission, device, or device.
  • the readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with a periodic network action system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
  • the program code used to perform the operations of the present invention can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural styles. Programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device may be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device.
  • LAN local area network
  • WAN wide area network
  • the embodiment of the present application also provides a computing device readable storage medium for the information synchronization method, that is, the content is not lost after power failure.
  • the storage medium stores a software program, including program code, and when the program code runs on a computing device, the software program can implement any of the above embodiments of the present application when it is read and executed by one or more processors Information synchronization scheme.
  • this application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium to be used by the instruction execution system or Used in conjunction with the instruction execution system.
  • a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or transmit a program for use by an instruction execution system, device, or device, or in combination with an instruction execution system, Device or equipment use.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present application provides an information synchronization method and device. The method comprises: a first node having information synchronization ability determines, according to a first node information list and a second node information list, nodes that are not subjected to information synchronization in a node group where the first node is located; wherein the first node information list comprises node information of all nodes in the node group, the second node information list comprises node information of nodes that have been subjected to information synchronization in the node group; the first node selects at least one second node from the nodes that are not subjected to information synchronization, performs information synchronization on the at least one second node, and updates the node information respectively corresponding to the at least one second node to the second node information list. Fast information synchronization in a blockchain platform is implemented, energy consumption is reduced, and the performance of the blockchain platform is improved.

Description

一种信息同步的方法及装置Method and device for information synchronization
相关申请的交叉引用Cross references to related applications
本申请要求在2019年05月21日提交中国专利局、申请号为201910425422.6、申请名称为“一种信息同步的方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910425422.6, and the application name is "a method and equipment for information synchronization" on May 21, 2019, the entire content of which is incorporated into this application by reference in.
技术领域Technical field
本申请涉及区块链技术领域,尤其涉及一种信息同步的方法及装置。This application relates to the field of blockchain technology, and in particular to a method and device for information synchronization.
背景技术Background technique
分布式网络系统中包括多个有连接关系的节点,通常需要在多个节点之间进行内容同步。现有技术中进行节点间内容同步更新时,一般是已获取更新内容的节点需要将自身更新的内容广播给网络中的其他各个节点,例如,已获取更新内容的节点随机选取N个邻近的节点作为目标节点,发送携带更新内容的流言(Gossip)消息;N个邻近节点接收到Gossip消息后,会使用更新内容更新自身的数据,并产生一条响应(Response)消息发送给发送Gossip消息的节点。N个邻近节点再分别作为已获取更新内容的节点,随机选取N个邻近的节点作为目标节点,发送携带更新内容的Gossip消息。经过多次以上的操作,实现全网中各个节点内容同步更新的目的。A distributed network system includes multiple connected nodes, and it is usually necessary to synchronize content between multiple nodes. In the prior art, when the content is synchronously updated between nodes, generally the node that has obtained the updated content needs to broadcast the updated content to other nodes in the network. For example, the node that has obtained the updated content randomly selects N neighboring nodes As the target node, it sends a Gossip message with updated content; after N neighboring nodes receive the Gossip message, they will use the updated content to update their own data, and generate a response (Response) message to send to the node that sent the Gossip message. The N neighboring nodes are then used as the nodes that have obtained the updated content, and N neighboring nodes are randomly selected as the target node, and the Gossip message carrying the updated content is sent. After many times of the above operations, the purpose of synchronously updating the content of each node in the entire network is realized.
上述分布式网络系统进行节点内容更新的方法存在的主要问题是:已获取更新内容的节点是随机选取目标节点发送Gossip消息的,因此容易出现不同节点选取的目标节点相同,导致同一目标节点可能会接收到不同节点发来的Gossip消息,而不同Gossip消息中携带的更新内容又相同,因此可能导致内容更新过程中存在资源浪费的问题;或是个别节点没有被任何一个其他节点选择过作为目标节点,导致这些个别节点一直接收不到Gossip消息,无法进行内容更新,因此可能导致同步不完全的问题。The main problem with the method for updating node content in the above distributed network system is that the node that has obtained the updated content randomly selects the target node to send the Gossip message, so it is easy to appear that the target node selected by different nodes is the same, resulting in the same target node. Receiving Gossip messages from different nodes, and the update content carried in different Gossip messages is the same, which may lead to resource waste in the content update process; or individual nodes have not been selected as target nodes by any other node , Causing these individual nodes to always fail to receive Gossip messages and unable to update content, which may lead to incomplete synchronization problems.
发明内容Summary of the invention
本申请提供一种信息同步的方法及装置,用以避免现有技术分布式网络系统进行节点内容更新时存在的同步不完全且同步过程资源浪费的问题。The present application provides a method and device for information synchronization, which are used to avoid the problems of incomplete synchronization and waste of synchronization process resources that exist when the distributed network system of the prior art performs node content update.
第一方面,本申请实施例提供一种信息同步的方法,包括:In the first aspect, an embodiment of the present application provides a method for information synchronization, including:
具有信息同步能力的第一节点根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息;所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。The first node with information synchronization capability determines, according to the first node information list and the second node information list, nodes in the node group where the first node is not performing information synchronization; wherein, in the first node information list The node information of all nodes in the node group is included, and the second node information list includes the node information of the nodes in the node group that have performed information synchronization; the first node has not synchronized information from the Select at least one second node from the nodes in, perform information synchronization on the at least one second node, and update the respective node information corresponding to the at least one second node to the second node information list.
基于该方案,所述第一节点是从未进行信息同步的节点中选取进行信息同步的节点,因此,加快了信息同步的速度,减少了耗能,提升了区块链平台的性能。Based on this solution, the first node is a node that is selected for information synchronization from nodes that have not performed information synchronization. Therefore, the speed of information synchronization is accelerated, energy consumption is reduced, and the performance of the blockchain platform is improved.
在一种可能的实现方式中,所述第一节点将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。In a possible implementation manner, the first node will determine the node corresponding to the node information included in the first node information list and not included in the second node information list as no information Synchronized node.
基于该方案,提供了一种如何确定未进行信息同步的方法。Based on this solution, a method of how to determine that information synchronization is not performed is provided.
在一种可能的实现方式中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation manner, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
基于该方案,提供了将整个网络系统中的节点进行分组的方式进行信息同步,从而使所述网络系统中的第一节点在随机选取未进行信息同步的节点进行信息同步时,每组中的第一节点仅需对所在分组中未进行内容更新的节点进行信息同步,因此,第一节点不需要确定整个分布式网络系统中未进行内容更新的节点,这样第一节点需要考虑的未进行内容更新的节点数量较少,针对性更强,且多组中的第一节点同时对所在组中未进行信息同步的节点进行信息同步,可以实现并发信息同步效果,提升信息同步效率。Based on this solution, a way to group nodes in the entire network system for information synchronization is provided, so that when the first node in the network system randomly selects nodes that have not been synchronized for information synchronization, the nodes in each group The first node only needs to synchronize the information of the nodes in the group where the content is not updated. Therefore, the first node does not need to determine the nodes that have not been updated in the entire distributed network system, so the first node needs to consider the unupdated content The number of updated nodes is smaller and more targeted, and the first node in multiple groups simultaneously synchronizes the information of the nodes in the group where the information is not synchronized, which can achieve the effect of concurrent information synchronization and improve the efficiency of information synchronization.
在一种可能的实现方式中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation manner, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
基于该方案,提供了一种进行信息同步时,将网络系统中所有的节点进行分组的方法。Based on this solution, a method is provided for grouping all nodes in the network system during information synchronization.
在一种可能的实现方式中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation manner, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
基于该方案,提供了另一种进行信息同步时,将网络系统中所有的节点进行分组的方法。Based on this solution, another method is provided for grouping all nodes in the network system during information synchronization.
在一种可能的实现方式中,所述方法还包括:若所述第一节点在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或若所述第一节点在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。In a possible implementation manner, the method further includes: if the first node determines that the second node information list includes all node information included in the first node information list, terminating information synchronization Or if the first node receives any response from the second node that the information synchronization fails, then terminates the information synchronization.
基于该方案,提供了如何确定终止信息同步的方法。Based on this solution, a method for determining the termination of information synchronization is provided.
在一种可能的实现方式中,所述方法还包括:若所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则所述第一节点连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;所述第一节点在暂停预设时长后恢复信息同步操作;其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。In a possible implementation manner, the method further includes: if the first node selects at least one second node from the nodes for which information is not synchronized as a round of selection operation, the first node continuously When the number of rounds for the selection operation reaches the first threshold, the information synchronization operation is suspended; the first node resumes the information synchronization operation after pausing for a preset period of time; wherein, the preset period of time is based on the accumulation of the first node The number of rounds for the selection operation is determined.
基于该方案,提供了一种对整个分布式网络系统中的部分第一节点执行暂停信息同步的方案,从而降低整个系统的整体功耗,避免出现系统中某个节点功耗过高的情况。Based on this solution, a solution for suspending information synchronization for part of the first nodes in the entire distributed network system is provided, thereby reducing the overall power consumption of the entire system and avoiding excessive power consumption of a node in the system.
第二方面,本申请实施例还提供一种信息同步的方法,包括:In the second aspect, an embodiment of the present application also provides a method for information synchronization, including:
具有信息同步能力的第一节点根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述第一节点学习到的已进行信息同步的节点的节点信息;所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中;所述第一节点将更新后的第二节点信息列表发送给成功完成信息同步的第二节点,以使所述成功完成信息同步 的第二节点,根据接收到的所述第二节点信息列表更新自身对应的第二节点信息列表。The first node with information synchronization capability determines, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node The information list contains the node information of all nodes in the node group, and the second node information list contains the node information of the node that has been synchronized with the information learned by the first node; At least one second node is selected from the nodes that have not performed information synchronization, information synchronization is performed on the at least one second node, and the node information corresponding to the at least one second node is updated to the second node information list In; the first node sends the updated list of second node information to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node information The list updates the second node information list corresponding to itself.
基于该方案,所述第一节点是从未进行信息同步的节点中选取进行信息同步的节点,因此,加快了信息同步的速度,减少了耗能,提升了区块链平台的性能。Based on this solution, the first node is a node that is selected for information synchronization from nodes that have not performed information synchronization. Therefore, the speed of information synchronization is accelerated, energy consumption is reduced, and the performance of the blockchain platform is improved.
在一种可能的实现方式中,所述第一节点将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。In a possible implementation manner, the first node will determine the node corresponding to the node information included in the first node information list and not included in the second node information list as no information Synchronized node.
基于该方案,提供了一种如何确定未进行信息同步的方法。Based on this solution, a method of how to determine that information synchronization is not performed is provided.
在一种可能的实现方式中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation manner, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
基于该方案,提供了将整个网络系统中的节点进行分组的方式进行信息同步,从而使所述网络系统中的第一节点在随机选取未进行信息同步的节点进行信息同步时,每组中的第一节点仅需对所在分组中未进行内容更新的节点进行信息同步,因此,第一节点不需要确定整个分布式网络系统中未进行内容更新的节点,这样第一节点需要考虑的未进行内容更新的节点数量较少,针对性更强,且多组中的第一节点同时对所在组中未进行信息同步的节点进行信息同步,可以实现并发信息同步效果,提升信息同步效率。Based on this solution, a way to group nodes in the entire network system for information synchronization is provided, so that when the first node in the network system randomly selects nodes that have not been synchronized for information synchronization, the nodes in each group The first node only needs to synchronize the information of the nodes in the group where the content is not updated. Therefore, the first node does not need to determine the nodes that have not been updated in the entire distributed network system, so the first node needs to consider the unupdated content The number of updated nodes is smaller and more targeted, and the first node in multiple groups simultaneously synchronizes the information of the nodes in the group where the information is not synchronized, which can achieve the effect of concurrent information synchronization and improve the efficiency of information synchronization.
在一种可能的实现方式中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation manner, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
基于该方案,提供了一种进行信息同步时,将网络系统中所有的节点进行分组的方法。Based on this solution, a method is provided for grouping all nodes in the network system during information synchronization.
在一种可能的实现方式中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation manner, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
基于该方案,提供了另一种进行信息同步时,将网络系统中所有的节点进行分组的方法。Based on this solution, another method is provided for grouping all nodes in the network system during information synchronization.
在一种可能的实现方式中,所述方法还包括:若所述第一节点在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或若所述第一节点在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。In a possible implementation manner, the method further includes: if the first node determines that the second node information list includes all node information included in the first node information list, terminating information synchronization Or if the first node receives any response from the second node that the information synchronization fails, then terminates the information synchronization.
基于该方案,提供了如何确定终止信息同步的方法。Based on this solution, a method for determining the termination of information synchronization is provided.
在一种可能的实现方式中,所述方法还包括:若所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则所述第一节点连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;所述第一节点在暂停预设时长后恢复信息同步操作;其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。In a possible implementation manner, the method further includes: if the first node selects at least one second node from the nodes for which information is not synchronized as a round of selection operation, the first node continuously When the number of rounds for the selection operation reaches the first threshold, the information synchronization operation is suspended; the first node resumes the information synchronization operation after pausing for a preset period of time; wherein, the preset period of time is based on the accumulation of the first node The number of rounds for the selection operation is determined.
基于该方案,提供了一种对整个分布式网络系统中的部分第一节点执行暂停信息同步的方案,从而降低整个系统的整体功耗,避免出现系统中某个节点功耗过高的情况。Based on this solution, a solution for suspending information synchronization for part of the first nodes in the entire distributed network system is provided, thereby reducing the overall power consumption of the entire system and avoiding excessive power consumption of a node in the system.
第三方面,本申请实施例提供了一种信息同步的装置,该装置可以用来执行上述第一方面及第一方面的任意可能的实现方式中的操作。例如,装置可以包括用于执行上述第一方面或第一方面的任意可能的实现方式中的各个操作的模块单元;和/或,该装置可以用来执行上述第二方面及第二方面的任意可能的实现方式中的操作,例如,装置可以包括用于执行上述第二方面或第二方面的任意可能的实现方式中的各个操作的模块单元。In the third aspect, an embodiment of the present application provides an information synchronization device, which can be used to perform the operations in the foregoing first aspect and any possible implementation manner of the first aspect. For example, the device may include a module unit for performing each operation in the foregoing first aspect or any possible implementation of the first aspect; and/or, the device may be used to perform the foregoing second aspect and any of the second aspects. Operations in a possible implementation manner, for example, the apparatus may include a module unit for performing the above-mentioned second aspect or each operation in any possible implementation manner of the second aspect.
第四方面,本申请实施例提供了一种信息同步的装置,该装置包括:处理器、收发器,可选的还包括存储器。其中,处理器、收发器和存储器之间通过内部连接通路互相通信。存储器用于存储指令,处理器用于执行所述存储器存储的指令。当处理器执行存储器存储的指令时,上述执行使得装置执行上述第一方面或第一方面的任意可能的实现方式中的任一方法;和/或,使得装置执行上述第二方面或第二方面的任意可能的实现方式中的任一方法。In a fourth aspect, an embodiment of the present application provides an information synchronization device. The device includes a processor, a transceiver, and optionally a memory. Among them, the processor, transceiver, and memory communicate with each other through internal connection paths. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. When the processor executes the instructions stored in the memory, the foregoing execution causes the apparatus to execute any method in the foregoing first aspect or any possible implementation of the first aspect; and/or causes the apparatus to execute the foregoing second aspect or second aspect Any of the possible implementations of.
第五方面,本申请实施例提供了一种芯片系统,包括处理器,可选的还包括存储器;其中,存储器用于存储计算机程序,处理器用于从存储器中调用并运行计算机程序,使得安装有芯片系统的通信设备执行上述第一方面或第一方面的任意可能的实现方式中的任一方法;和/或,使得安装有芯片系统的通信设备执行上述第二方面或第二方面的任意可能的实现方式中的任一方法。In a fifth aspect, the embodiments of the present application provide a chip system, including a processor, and optionally a memory; where the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that The communication device of the chip system executes any method of the first aspect or any possible implementation of the first aspect; and/or, the communication device installed with the chip system executes the second aspect or any of the second aspects Any one of the implementation methods.
第六方面,本申请实施例提供了一种计算机程序产品,计算机程序产品包括:计算机程序代码,当计算机程序代码被通信设备的通信单元、处理单元或收发器、处理器运行时,使得通信设备执行上述第一方面或第一方面的任意可能的实现方式中的任一方法;和/或,使得通信设备执行上述第二方面或第二方面的任意可能的实现方式中的任一方法。In a sixth aspect, the embodiments of the present application provide a computer program product, the computer program product includes: computer program code, when the computer program code is run by the communication unit, processing unit or transceiver, or processor of the communication device, the communication device Perform any method in the foregoing first aspect or any possible implementation manner of the first aspect; and/or cause the communication device to perform any method in the foregoing second aspect or any possible implementation manner of the second aspect.
第七方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有程序,程序使得通信设备(例如,终端设备或网络设备)执行上述第一方面或第一方面的任意可能的实现方式中的任一方法;和/或,使得通信设备执行上述第二方面或第二方面的任意可能的实现方式中的任一方法。In a seventh aspect, the embodiments of the present application provide a computer-readable storage medium, the computer-readable storage medium stores a program, and the program causes a communication device (for example, a terminal device or a network device) to execute the first aspect or the first aspect described above. Any method in any possible implementation manner; and/or, causing the communication device to execute the above-mentioned second aspect or any method in any possible implementation manner of the second aspect.
第八方面,本申请实施例提供了一种计算机程序,计算机程序在某一计算机上执行时,将会使得计算机实现上述第一方面或第一方面的任意可能的实现方式中的任一方法;和/或,使得计算机实现上述第二方面或第二方面的任意可能的实现方式中的任一方法。In an eighth aspect, the embodiments of the present application provide a computer program. When the computer program is executed on a computer, it will enable the computer to implement the first aspect or any one of the possible implementations of the first aspect; And/or, cause the computer to implement the second aspect or any method in any possible implementation manner of the second aspect.
附图说明Description of the drawings
图1为本申请提供的一种信息同步系统架构示意图;Figure 1 is a schematic diagram of an information synchronization system architecture provided by this application;
图2为本申请提供的第一种信息同步的方法示意图;Figure 2 is a schematic diagram of the first information synchronization method provided by this application;
图3为本申请提供的第二种信息同步的方法示意图;Figure 3 is a schematic diagram of the second information synchronization method provided by this application;
图4为本申请提供的一种通过分组的方式进行信息同步流程示意图;FIG. 4 is a schematic diagram of a flow of information synchronization through grouping provided by this application;
图5为本申请提供的一种源节点从每组中随机选取部分节点进行信息同步示意图;Figure 5 is a schematic diagram of a source node randomly selecting some nodes from each group for information synchronization provided by this application;
图6为本申请提供的进行信息同步时第一轮同步示意图;Figure 6 is a schematic diagram of the first round of synchronization provided by this application for information synchronization;
图7为本申请提供的进行信息同步时第二轮同步示意图;FIG. 7 is a schematic diagram of the second round of synchronization when performing information synchronization provided by this application;
图8为本申请提供的进行信息同步时第三轮同步示意图;FIG. 8 is a schematic diagram of the third round of synchronization when performing information synchronization provided by this application;
图9为本申请提供的进行信息同步时第四轮同步示意图;FIG. 9 is a schematic diagram of the fourth round of synchronization when performing information synchronization provided by this application;
图10为本申请提供的进行信息同步时第五轮同步示意图;FIG. 10 is a schematic diagram of the fifth round of synchronization when performing information synchronization provided by this application;
图11为本申请提供的第一种信息同步的装置示意图;FIG. 11 is a schematic diagram of the first information synchronization device provided by this application;
图12为本申请提供的第二种信息同步的装置示意图;FIG. 12 is a schematic diagram of the second information synchronization device provided by this application;
图13为本申请提供的第三种信息同步的装置示意图;FIG. 13 is a schematic diagram of a third information synchronization device provided by this application;
图14为本申请提供的第四种信息同步的装置示意图。FIG. 14 is a schematic diagram of the fourth information synchronization device provided by this application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述。方法实施例中的具体操作方法也可以应用于设备实施例或系统实施例中。其中,在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment. Wherein, in the description of the present application, unless otherwise specified, "multiple" means two or more.
本发明实施例可以应用于各种有节点信息同步需求的网络系统中,例如包括多个节点的分布式网络系统,该分布式网络系统可以为使用区块链技术的区块链网络架构。如图1所示,为本申请应用的一个区块链网络架构示意图,主要包括:区块链服务平台、核心节点设备和轻节点设备,其中,区块链服务平台主要由多个核心节点共同组成链,进而对核心节点设备和轻节点设备提供区块链服务。例如,区块链服务平台中的某个核心节点的区块数据发生改变,为了能够使区块链服务平台可以正常的对外提供基本的服务,因此,其他核心节点的区块数据必须与发生改变后的所述核心节点的数据保持同步一致,则需要进行信息同步,即多个核心节点之间需要进行信息同步。The embodiments of the present invention can be applied to various network systems that require synchronization of node information, such as a distributed network system including multiple nodes, and the distributed network system may be a blockchain network architecture using blockchain technology. As shown in Figure 1, a schematic diagram of the blockchain network architecture applied in this application mainly includes: blockchain service platform, core node equipment, and light node equipment. Among them, the blockchain service platform is mainly composed of multiple core nodes. Form a chain, and then provide blockchain services to core node devices and light node devices. For example, the block data of a core node in the blockchain service platform changes. In order to enable the blockchain service platform to provide basic services to the outside world, the block data of other core nodes must be changed. If the data of the latter core nodes remain synchronized, information synchronization is required, that is, information synchronization is required between multiple core nodes.
以下,对图1中的区块链网络架构中的各部分组成进行解释说明,以便于理解。Below, the composition of each part of the blockchain network architecture in FIG. 1 will be explained to facilitate understanding.
1)区块链服务平台,是指分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。它本质上是一个去中心化的数据库,同时作为比特币的底层技术,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次比特币网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块(图1中每个核心节点区块链服务相当于一个区块)。1) Blockchain service platform refers to a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. It is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of data blocks generated by using cryptographic methods. Each data block contains a batch of Bitcoin network transaction information. It is used to verify the validity of its information (anti-counterfeiting) and generate the next block (each core node blockchain service in Figure 1 is equivalent to a block).
2)核心节点,是指在区块链服务平台中具备全部区块链能力的节点,具体包括全部的节点管理能力、交易能力、共识能力等。其中,区块链服务平台中的核心节点具有等价性,即每个核心节点都保存有全网中所有的节点列表信息,并且每个核心节点所保存的节点列表信息具有顺序一致性。2) The core node refers to the node that has all the blockchain capabilities in the blockchain service platform, including all node management capabilities, transaction capabilities, consensus capabilities, etc. Among them, the core nodes in the blockchain service platform are equivalent, that is, each core node stores all node list information in the entire network, and the node list information stored by each core node has sequential consistency.
3)核心节点设备,是指通过区块链SDK在自身设备内部访问区块链服务平台,从而获取所有的区块链服务的设备。3) The core node device refers to the device that accesses the blockchain service platform within its own device through the blockchain SDK to obtain all blockchain services.
4)轻节点,是指在区块链服务平台中只具备部分区块链能力的节点,具体包括部分节点管理能力、部分交易能力和通信能力。4) Light nodes refer to nodes that only have part of the blockchain capabilities in the blockchain service platform, specifically including some node management capabilities, some transaction capabilities, and communication capabilities.
5)轻节点设备,是指利用区块链SDK通过远程设备通信的方式,获取部分的区块链服务的设备。5) Light node equipment refers to equipment that uses the blockchain SDK to obtain part of the blockchain service through remote device communication.
6)本申请实施例中的术语“系统”和“网络”可被互换使用。“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“以是一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)下或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。6) The terms "system" and "network" in the embodiments of this application can be used interchangeably. "At least one" means one or more, and "plurality" means two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "yes" generally indicates that the associated objects before and after are an "or" relationship. "The following at least one item (a) or similar expressions refers to any combination of these items, including single item (a) or plural items (A) any combination. For example, at least one item (a) of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple .
除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一优先级准则和第二优先级准则,只是为了区分不同的准则,而并不是表示这两种准则的内容、优先级或者重要程度等的不同。Unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects, and are not used to limit the order, timing, priority, or importance of multiple objects . For example, the first priority criterion and the second priority criterion are only for distinguishing different criteria, but do not indicate the difference in content, priority, or importance of the two criteria.
此外,本申请实施例和权利要求书及附图中的术语“包括”和“具有”不是排他的。例如, 包括了一系列步骤或模块的过程、方法、系统、产品或设备,不限定于已列出的步骤或模块,还可以包括没有列出的步骤或模块。In addition, the terms "including" and "having" in the embodiments of the present application, claims and drawings are not exclusive. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, and may also include unlisted steps or modules.
目前,现有技术中,分布式网络系统中的节点进行信息同步的方法一般是:已获取更新内容的节点随机选取N个邻近的节点作为目标节点,基于Gossip协议发送携带更新内容的Gossip消息;N个邻近节点接收到Gossip消息后,会使用更新内容对比自身的数据,在对比结果不一致时使用更新内容更新自身保存的数据,邻近节点在使用更新内容对比自身保存的数据后,还会产生一条Response消息发送给发送Gossip消息的节点,发送Gossip消息的节点收到Response消息后进行解析,从而结束本次消息发送的流程。然后,所述N个邻近节点再分别作为已获取更新内容的节点,随机选取N个邻近的节点作为目标节点,发送携带更新内容的Gossip消息,接收节点根据接收到的更新内容对比自身保存的数据后生成Response消息并发送给发送节点第一节点之后也相应转变成发送更新内容的节点角色并重复上述发送过程。这样经过多次以上的发送过程,就可以实现全网中各个节点内容同步一致的目的。Currently, in the prior art, the method for nodes in a distributed network system to synchronize information is generally: a node that has obtained updated content randomly selects N neighboring nodes as target nodes, and sends a Gossip message carrying the updated content based on the Gossip protocol; After N neighboring nodes receive the Gossip message, they will use the updated content to compare their own data. When the comparison results are inconsistent, use the updated content to update their own data. After neighboring nodes use the updated content to compare their own data, a message will be generated. The Response message is sent to the node that sent the Gossip message, and the node that sent the Gossip message receives the Response message and parses it, thus ending the message sending process. Then, the N neighboring nodes are used as the nodes that have obtained the updated content, and N neighboring nodes are randomly selected as the target node, and the Gossip message carrying the updated content is sent. The receiving node compares the data saved by itself according to the received update content After generating a Response message and sending it to the first node of the sending node, it also changes to the node role of sending the updated content and repeats the above sending process. In this way, after many times of sending processes, the goal of synchronizing the content of each node in the entire network can be achieved.
但是,上述分布式网络系统进行信息同步的主要问题是:发送节点随机选取目标节点进行内容同步,因此,很可能出现同一目标节点可能会接收到不同节点发来的Gossip消息,而不同Gossip消息中携带的更新内容相同,因此可能导致内容更新过程中存在资源浪费的问题;或是个别节点没有被任何一个其他节点选择过作为目标节点,导致这些个别节点一直接收不到Gossip消息,无法进行内容更新,因此可能导致同步不完全的问题。However, the main problem of the above-mentioned distributed network system for information synchronization is that the sending node randomly selects the target node for content synchronization. Therefore, it is very likely that the same target node may receive Gossip messages from different nodes, but different Gossip messages The updated content carried is the same, so it may cause resource waste in the content update process; or individual nodes have not been selected by any other node as the target node, resulting in these individual nodes not receiving Gossip messages and unable to update the content , Which may cause incomplete synchronization.
为解决该问题,本申请实施例提供一种信息同步的方法。可应用于任何需要节点信息同步的分布式网络架构中。本申请实施例的基础思想就是在分布式网络架构中进行信息同步时,尽量保证发送更新内容的节点所选取的需要进行信息同步的目标节点都是未进行过信息同步的节点。To solve this problem, an embodiment of the present application provides a method for information synchronization. It can be applied to any distributed network architecture that requires node information synchronization. The basic idea of the embodiments of the present application is to ensure that when information is synchronized in a distributed network architecture, try to ensure that the target nodes selected by the node sending the updated content that need to be synchronized are all nodes that have not synchronized the information.
为方便对本申请实施例进行介绍,下述实施例中,以第一节点为发送节点、以第二节点为接收节点进行介绍。To facilitate the introduction of the embodiments of the present application, in the following embodiments, the first node is used as the sending node and the second node is used as the receiving node.
其中,本申请中将初次发起信息同步的第一节点叫做源节点,也就是说,所述源节点在初次发起信息同步之前,分布式网络中的其他节点都是未进行信息同步的节点,此时,所述源节点可以从所述分布式网络系统中的其他节点中随机选取部分节点进行信息同步,而第一节点随机选取的部分节点成功完成信息同步后成为新的第一节点,继续进行信息同步,直到整个分布式网络系统中的节点都完成信息同步。In this application, the first node that initiates information synchronization for the first time is called the source node, that is, before the source node initiates information synchronization for the first time, other nodes in the distributed network are all nodes that have not performed information synchronization. At this time, the source node may randomly select some nodes from other nodes in the distributed network system for information synchronization, and some nodes randomly selected by the first node will become the new first node after successfully completing the information synchronization, and continue to proceed. Information synchronization, until all nodes in the distributed network system complete information synchronization.
而被所述第一节点随机选取的进行信息同步的节点则可称为第二节点,当所述第二节点接收到一条新的Gossip消息时,首先解析收到的Gossip消息确定更新内容,然后使用更新内容对比自身保存的数据,其中,若所述第二节点自身保存的数据已包含更新内容,则向发送Gossip消息的所述第一节点发送一条说明此次信息同步失败的Response消息,若所述第二节点自身保存的数据未包含更新内容,则向发送Gossip消息的所述第一节点发送一条说明此次信息同步成功的Response消息,并使用更新内容进行数据更新。The node randomly selected by the first node for information synchronization can be called the second node. When the second node receives a new Gossip message, it first parses the received Gossip message to determine the updated content, and then Use the updated content to compare the data saved by itself, where, if the data saved by the second node itself already contains the updated content, a Response message indicating that the information synchronization failed this time is sent to the first node that sent the Gossip message, if If the data saved by the second node itself does not contain updated content, a Response message indicating that the information synchronization is successful this time is sent to the first node that sent the Gossip message, and the updated content is used for data update.
在分布式网络系统中维护两个节点信息列表,这里以第一节点信息列表和第二节点信息列表进行表示。其中,通过所述第一节点信息列表和所述第二节点信息列表可以使所述分布式网络系统中的第一节点在随机选取部分节点作为目的节点进行内容同步时,确定出所述分布式网络系统中未进行内容同步的节点,进而可以在确定出的所述未进行内容同步的节点中选取目的节点进行内容同步。以此避免有些节点被多次选择作为目的节点,被重 复发送Gossip消息导致浪费资源,也可以避免有些节点一直未被选取到作为目的节点,导致同步不完全的问题。Two node information lists are maintained in the distributed network system, which are represented by the first node information list and the second node information list here. Wherein, through the first node information list and the second node information list, the first node in the distributed network system can determine that the distributed network system randomly selects some nodes as destination nodes for content synchronization. The nodes in the network system that are not performing content synchronization may further select a destination node from the determined nodes that are not performing content synchronization to perform content synchronization. In this way, it is avoided that some nodes are selected as the destination node multiple times, and the Gossip message is repeatedly sent to cause wastage of resources, and it can also avoid the problem of incomplete synchronization that some nodes have not been selected as the destination node.
本申请中针对分布式网络系统中的节点进行信息同步提出了多种改进方式,下面以具体实施例的方式分别进行介绍。In this application, a variety of improved methods for information synchronization of nodes in a distributed network system are proposed, which are respectively introduced in the following specific embodiments.
如图2所示,本发明实施例一提供的一种信息同步的方法,该方法包括:As shown in FIG. 2, a method for information synchronization provided in Embodiment 1 of the present invention includes:
步骤200,具有信息同步能力的第一节点根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点。Step 200: The first node with information synchronization capability determines, according to the first node information list and the second node information list, nodes that have not performed information synchronization in the node group where the first node is located.
一种可能的实现方式中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息。In a possible implementation manner, the first node information list includes node information of all nodes in the node group, and the second node information list includes nodes in the node group that have performed information synchronization. The node information.
步骤201,所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点。Step 201: The first node selects at least one second node from the nodes for which information has not been synchronized.
步骤202,所述第一节点对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。Step 202: The first node synchronizes information with the at least one second node, and updates the node information corresponding to the at least one second node to the second node information list.
其中,因为当前分布式网络系统中节点对应的第一节点信息列表需要满足等价性的原则,即每个节点对应的第一节点信息列表要具有内容一致性、顺序一致性的特点,因此,本申请实施例这里分布式网络系统在维护第一节点信息列表时,提供了多种方式,下面分别进行介绍:Among them, because the first node information list corresponding to nodes in the current distributed network system needs to meet the principle of equivalence, that is, the first node information list corresponding to each node must have the characteristics of content consistency and sequence consistency, therefore, In the embodiment of the application, the distributed network system here provides a variety of methods when maintaining the first node information list, which will be introduced separately below:
维护方式1:分布式网络系统中的所有节点可以共用一个第一节点信息列表。Maintenance method 1: All nodes in the distributed network system can share a first node information list.
若分布式网络中的所有节点共用一个第一节点信息列表,则这个共用的第一节点信息列表可以保存在所有节点均可以访问的第三方存储设备中,例如云存储设备等,当分布式网络系统中的节点需要调用第一节点信息列表时,可以通过远程访问第三方存储设备获取第一节点信息列表,由此可以减少本地资源占用。If all nodes in the distributed network share a first node information list, this shared first node information list can be stored in a third-party storage device that all nodes can access, such as cloud storage devices. When the distributed network When a node in the system needs to call the first node information list, it can obtain the first node information list by remotely accessing a third-party storage device, thereby reducing local resource occupation.
维护方式2:分布式网络系统中的每个节点维护一个第一节点信息列表。Maintenance mode 2: Each node in the distributed network system maintains a first node information list.
若分布式网络中的每个节点维护一个第一节点信息列表,则可以将每个节点对应的第一节点信息列表保存在所述节点对应的本地存储空间,当分布式网络系统中的节点需要调用第一节点信息列表时,可以直接在本地对应的存储空间中获取第一节点信息列表,由此可以提高调用速率。If each node in the distributed network maintains a first node information list, the first node information list corresponding to each node can be stored in the local storage space corresponding to the node. When the nodes in the distributed network system require When calling the first node information list, the first node information list can be directly obtained in the local corresponding storage space, thereby increasing the calling rate.
进一步的,本申请实施例一中提供的进行信息同步的方法中,分布式网络系统中的所有节点也可以共用一个第二节点信息列表,所述第二信息列表中包含全网中所有已进行内容同步的节点的信息。因此,本申请实施例一中的分布式网络系统中在维护第二节点信息列表时,可以将这个共用的第二节点信息列表保存在所有节点均可以访问的第三方存储设备中,例如云存储设备等,当分布式网络系统中的节点需要调用第二节点信息列表时,可以通过远程访问第三方存储设备获取第二节点信息列表,由此可以减少本地资源占用。Further, in the method for information synchronization provided in the first embodiment of the present application, all nodes in the distributed network system may also share a second node information list, and the second information list includes all the information that has been performed in the entire network. The information of the node where the content is synchronized. Therefore, when maintaining the second node information list in the distributed network system in the first embodiment of the present application, the shared second node information list can be stored in a third-party storage device that all nodes can access, such as cloud storage. For devices, etc., when nodes in the distributed network system need to call the second node information list, they can obtain the second node information list by remotely accessing a third-party storage device, thereby reducing local resource occupation.
也就是说,本申请实施例一在进行信息同步时,每一个作为发送方的第一节点随机选取过的进行内容更新的节点的信息都被存储在共用的第二节点信息列表中。That is to say, when performing information synchronization in Embodiment 1 of the present application, the information of each node that is randomly selected by the first node as the sender for content update is stored in the shared second node information list.
示例性的,假设所述分布式网络系统中当前包括10个节点,所述节点1为源节点,其中,下述表1为当前分布式网络系统中的共用的第一节点信息列表,表2(a)为当前分布式网络系统中未进行信息同步时,初始状态下共用的第二节点信息列表。Exemplarily, suppose that the distributed network system currently includes 10 nodes, and the node 1 is the source node, where the following Table 1 is a common first node information list in the current distributed network system, and Table 2 (a) is the second node information list shared in the initial state when information is not synchronized in the current distributed network system.
假设,第一轮信息同步时,所述节点1选择节点3和节点5进行内容同步,则所述节点1在选取了所述节点3和节点5之后,将节点1、节点3和节点5的节点信息存储到共用的第二节点信息列表中。此时,第一轮内容同步后,共用的第二节点信息列表中的节点 信息变更为如表2(b)所示。当所述节点1成功对所述节点3和节点5进行信息同步后,则所述节点3和节点5变成新的第一节点,继续进行内容更新,则根据表2(b)所示的共用的第二节点信息列表和表1所示的共用的第一节点信息列表,可以确定未进行内容同步的节点包括为节点2、节点4、节点6-10。Assuming that during the first round of information synchronization, the node 1 selects node 3 and node 5 for content synchronization, then after node 1 selects the node 3 and node 5, the node 1, node 3 and node 5 The node information is stored in the shared second node information list. At this time, after the first round of content synchronization, the node information in the shared second node information list is changed as shown in Table 2(b). When the node 1 successfully synchronizes the information of the node 3 and the node 5, the node 3 and the node 5 become the new first node, and the content update is continued, according to the table 2(b) The shared second node information list and the shared first node information list shown in Table 1, it can be determined that the nodes that have not been synchronized include node 2, node 4, and node 6-10.
需要说明的是,本申请实施例一中,源节点只有在第一次选取节点进行信息同步时,可以将自身节点信息和所选取的进行信息同步的节点信息存储到共用的第二节点信息列表中,后续所述源节点不需要再将自身的节点信息存储到共用的第二节点信息列表中;或仅将所选取的进行信息同步的节点信息存储到共用的第二节点信息列表中就可以。It should be noted that, in the first embodiment of the present application, the source node can store its own node information and the selected node information for information synchronization only in the shared second node information list when the node is selected for information synchronization for the first time. In the following, the source node does not need to store its own node information in the shared second node information list; or only the selected node information for information synchronization may be stored in the shared second node information list. .
假设,第二轮信息同步时,所述第一节点1随机选取的节点为节点2和节点6,所述第一节点3随机选取的节点为节点4和节点10,所述第一节点5随机选取的节点为节点8和节点9,则所述第一节点1在选取了所述节点2和节点6之后,将所述节点2和节点6的节点信息存储到共用的第二节点信息列表中。所述第一节点3在选取了所述节点4和节点10之后,将所述节点4和节点10的节点信息存储到共用的第二节点信息列表中,所述第一节点5在选取了所述节点8和节点9之后,将所述节点8和节点9的节点信息存储到共用的第二节点信息列表中。此时,第二轮信息同步后,共用的第二节点信息列表中的节点信息更新为如表2(c)所示,则根据表2(c)所示的共用的第二节点信息列表和表1所示的共用的第一节点信息列表,可以确定此时分布式网络系统中未进行内容更新的节点仅剩下节点7。Suppose that during the second round of information synchronization, the nodes randomly selected by the first node 1 are node 2 and node 6, the nodes randomly selected by the first node 3 are node 4 and node 10, and the first node 5 randomly The selected nodes are node 8 and node 9, then after the first node 1 selects the node 2 and node 6, the node information of the node 2 and node 6 is stored in the shared second node information list . After the first node 3 selects the node 4 and the node 10, the node information of the node 4 and the node 10 is stored in a common second node information list, and the first node 5 selects all the nodes. After the node 8 and the node 9 are described, the node information of the node 8 and the node 9 is stored in the shared second node information list. At this time, after the second round of information synchronization, the node information in the shared second node information list is updated as shown in Table 2(c), according to the shared second node information list shown in Table 2(c) and From the shared first node information list shown in Table 1, it can be determined that only node 7 is left in the distributed network system where content is not updated at this time.
假设,第三轮信息同步时,当前作为发送方的第一节点有节点1-6,节点8-10,而未进行内容更新的节点仅剩下节点7。因此,分布式网络系统中在进行信息同步过程中,可能会出现多个第一节点选取同一个未进行内容更新的节点进行信息同步的问题。例如,第一节点1-6,节点8-10都选取节点7进行信息同步,则将节点7的节点信息存储到共用的第二节点信息列表中。Assume that during the third round of information synchronization, the first node currently serving as the sender has nodes 1-6 and 8-10, and the node that has not updated the content is only node 7. Therefore, in the process of information synchronization in a distributed network system, there may be a problem that multiple first nodes select the same node that has not performed content update for information synchronization. For example, if the first node 1-6 and the nodes 8-10 all select node 7 for information synchronization, the node information of node 7 is stored in the shared second node information list.
需要说明的是,将要存储到共用的第二节点信息列表中的节点信息在共用的第二节点信息列表中已存在时,则不进行重复存储。It should be noted that when the node information to be stored in the shared second node information list already exists in the shared second node information list, no repeated storage is performed.
其中,若第一节点1-6,节点8-10都选取节点7进行信息同步,假设节点3最先成功对节点7进行了信息同步,则节点7会向节点3发送表示信息同步成功的response消息,且节点3在接收到表示信息同步成功的response消息后还继续具有进行信息同步的能力,还可以继续对分布式网络系统中未进行内容更新的节点进行信息同步。Among them, if the first node 1-6, node 8-10 all select node 7 for information synchronization, assuming that node 3 successfully synchronizes information with node 7 first, node 7 will send a response to node 3 indicating that the information synchronization is successful After receiving the response message indicating that the information synchronization is successful, the node 3 still has the ability to perform information synchronization, and it can also continue to perform information synchronization for nodes in the distributed network system that have not updated the content.
而此时节点1、节点2、节点4-6、节点8-10在对节点7进行信息同步时,因为所述节点7在所述节点1、节点2、节点4-6、节点8-10进行信息同步之前已完成了内容更新,因此,所述节点7在分别解析接收到的节点1、节点2、节点4-6、节点8-10发送的Gossip消息,确定更新内容,通过使用更新内容对比自身保存的数据后,可以确定在进行信息同步前自身数据已包含更新内容。因此,分别向节点1、节点2、节点4-6、节点8-10发送表示信息同步未成功的response消息。而所述节点1、节点2、节点4-6、节点8-10在接收到节点7发送的表示信息同步未成功的response消息后,则会失去继续进行信息同步的能力,终止进行信息同步。At this time, when node 1, node 2, node 4-6, and node 8-10 are synchronizing information with node 7, because the node 7 is in the node 1, node 2, node 4-6, node 8-10 The content update has been completed before information synchronization. Therefore, the node 7 respectively parses the received Gossip messages sent by node 1, node 2, node 4-6, and node 8-10, determines the updated content, and uses the updated content After comparing the data saved by itself, it can be determined that its data contains updated content before information synchronization. Therefore, a response message indicating that the information synchronization is unsuccessful is sent to node 1, node 2, node 4-6, and node 8-10, respectively. However, after the node 1, node 2, node 4-6, and node 8-10 receive the response message sent by node 7 indicating that the information synchronization is unsuccessful, they will lose the ability to continue information synchronization and terminate the information synchronization.
此时,整个分布式网络系统中仅有节点3和节点7具有进行信息同步的能力,而在进行第四轮信息同步时,共用的第二节点信息列表中的节点信息更新为如表2(d)所示。则根据表2(d)所示的共用的第二节点信息列表和表1所示的共用的第一节点信息列表可知, 当前分布式网络系统中不存在未进行信息同步的节点。因此,节点3和节点7可以终止信息同步。At this time, only node 3 and node 7 in the entire distributed network system have the ability to synchronize information, and when the fourth round of information synchronization is performed, the node information in the shared second node information list is updated as shown in Table 2 ( d) as shown. According to the shared second node information list shown in Table 2(d) and the shared first node information list shown in Table 1, it can be known that there are no nodes that have not synchronized information in the current distributed network system. Therefore, node 3 and node 7 can terminate information synchronization.
表1 第一节点信息列表Table 1 List of first node information
第一节点信息列表First node information list
节点1信息Node 1 information
节点2信息Node 2 information
节点3信息Node 3 information
节点4信息Node 4 information
节点5信息Node 5 information
节点6信息Node 6 information
节点7信息Node 7 information
节点8信息Node 8 information
节点9信息Node 9 information
节点10信息Node 10 information
表2(a) 第二节点信息列表Table 2(a) List of second node information
第二节点信息列表Second node information list
air
表2(b) 第二节点信息列表Table 2(b) List of second node information
第二节点信息列表Second node information list
节点1信息Node 1 information
节点3信息Node 3 information
节点5信息Node 5 information
表2(c) 第二节点信息列表Table 2(c) List of second node information
第二节点信息列表Second node information list
节点1信息Node 1 information
节点2信息Node 2 information
节点3信息Node 3 information
节点4信息Node 4 information
节点5信息Node 5 information
节点6信息Node 6 information
节点8信息Node 8 information
节点9信息Node 9 information
节点10信息Node 10 information
表2(d) 第二节点信息列表Table 2(d) List of second node information
第二节点信息列表Second node information list
节点1信息Node 1 information
节点2信息Node 2 information
节点3信息Node 3 information
节点4信息Node 4 information
节点5信息Node 5 information
节点6信息Node 6 information
节点7信息Node 7 information
节点8信息Node 8 information
节点9信息Node 9 information
节点10信息Node 10 information
如图3所示,本发明实施例二提供的一种信息同步的方法,该方法包括:As shown in FIG. 3, an information synchronization method provided by Embodiment 2 of the present invention includes:
步骤300,具有信息同步能力的第一节点根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点。Step 300: The first node with information synchronization capability determines, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization.
在一种示例性中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中则包含所述第一节点自己学习到的已进行信息同步的节点的节点信息。In an example, the first node information list includes node information of all nodes in the node group, and the second node information list includes the progress information learned by the first node itself The node information of the synchronized node.
需要说明注意的是,这里第二节点信息列表中包含的内容可能不同于实施例一中第二节点信息列表中包含的内容。It should be noted that the content contained in the second node information list here may be different from the content contained in the second node information list in the first embodiment.
步骤301,所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点。Step 301: The first node selects at least one second node from the nodes for which information has not been synchronized.
步骤302,所述第一节点对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。Step 302: The first node performs information synchronization on the at least one second node, and updates the node information corresponding to the at least one second node to the second node information list.
步骤303,所述第一节点将更新后的第二节点信息列表发送给成功完成信息同步的第 二节点,以使所述成功完成信息同步的第二节点,根据接收到的所述第二节点信息列表更新自身维护的第二节点信息列表。Step 303: The first node sends the updated list of second node information to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node The information list updates the second node information list maintained by itself.
其中,因为当前分布式网络系统中节点对应的第一节点信息列表需要满足等价性的原则,即每个节点对应的第一节点信息列表要具有内容一致性、顺序一致性的特点。因此,本申请实施例二中分布式网络系统在维护第一节点信息列表时,提供了多种方式,下面分别进行介绍:Among them, because the first node information list corresponding to the nodes in the current distributed network system needs to meet the principle of equivalence, that is, the first node information list corresponding to each node must have the characteristics of content consistency and sequence consistency. Therefore, the distributed network system in the second embodiment of the present application provides a variety of methods when maintaining the first node information list, which will be respectively introduced below:
维护方式1:分布式网络系统中的所有节点可以共用一个第一节点信息列表。Maintenance method 1: All nodes in the distributed network system can share a first node information list.
若分布式网络中的所有节点共用一个第一节点信息列表,则这个共用的第一节点信息列表可以保存在所有节点均可以访问的第三方存储设备中,例如云存储设备等,当分布式网络系统中的节点需要调用第一节点信息列表时,可以通过远程访问第三方存储设备获取第一节点信息列表,由此可以减少本地资源占用。If all nodes in the distributed network share a first node information list, this shared first node information list can be stored in a third-party storage device that all nodes can access, such as cloud storage devices. When the distributed network When a node in the system needs to call the first node information list, it can obtain the first node information list by remotely accessing a third-party storage device, thereby reducing local resource occupation.
维护方式2:分布式网络系统中的每个节点维护一个第一节点信息列表。Maintenance mode 2: Each node in the distributed network system maintains a first node information list.
若分布式网络中的每个节点维护一个第一节点信息列表,则可以将每个节点维护的第一节点信息列表保存在所述节点对应的本地存储空间,当分布式网络系统中的节点需要调用第一节点信息列表时,可以直接在本地对应的存储空间中获取第一节点信息列表,由此可以提高调用速率。If each node in the distributed network maintains a first node information list, the first node information list maintained by each node can be stored in the local storage space corresponding to the node. When the nodes in the distributed network system require When calling the first node information list, the first node information list can be directly obtained in the local corresponding storage space, thereby increasing the calling rate.
进一步的,本申请实施例二中提供的进行信息同步的方法中,分布式网络系统中的每个节点维护一个第二节点信息列表,所述第二信息列表中仅包含所述第一节点自己学习到的已进行信息同步的节点的节点信息,且每个节点自己维护的第二信息列表每次进行信息同步时都随之进行更新。Further, in the method for information synchronization provided in the second embodiment of the present application, each node in the distributed network system maintains a second node information list, and the second information list only includes the first node itself The learned node information of nodes that have performed information synchronization, and the second information list maintained by each node itself is updated every time information synchronization is performed.
示例性的,本申请实施例二中分布式网络系统中在维护第二节点信息列表时,可以将每个节点维护的第二节点信息列表按照对应节点标识保存在所有节点均可以访问的第三方存储设备中,例如云存储设备等。当分布式网络系统中的节点需要调用对应的第二节点信息列表时,可以通过远程访问第三方存储设备,根据自身节点标识获取对应的第二节点信息列表,由此可以减少本地资源占用。Exemplarily, when maintaining the second node information list in the distributed network system in the second embodiment of the present application, the second node information list maintained by each node may be stored in a third party accessible to all nodes according to the corresponding node identifier. In storage devices, such as cloud storage devices. When a node in the distributed network system needs to call the corresponding second node information list, it can remotely access a third-party storage device to obtain the corresponding second node information list according to its own node identifier, thereby reducing local resource occupation.
也就是说,本申请实施例二在进行信息同步时,每一个作为发送方的第一节点随机选取的进行内容更新的节点的信息,都被存储在第一节点对应的第二节点信息列表中。That is to say, in the second embodiment of the present application, when information is synchronized, the information of each node that is randomly selected by the first node as the sender for content update is stored in the second node information list corresponding to the first node .
示例性的,假设所述分布式网络系统中当前包括10个节点,所述节点1为源节点,其中,所述节点1对应的第一节点信息列表如上述表1所示,所述节点1未进行信息同步时,初始状态下所述节点1对应的第二节点信息列表如上表2(a)所示。Exemplarily, suppose that the distributed network system currently includes 10 nodes, and the node 1 is the source node, and the first node information list corresponding to the node 1 is as shown in Table 1, and the node 1 When the information is not synchronized, the second node information list corresponding to the node 1 in the initial state is shown in Table 2(a) above.
假设,第一轮信息同步时,所述节点1选择节点3和节点5进行信息同步,则所述节点1在选取了所述节点3和节点5之后,将节点1、节点3和节点5的节点信息存储到节点1对应的第二节点信息列表中,并在成功对节点3和节点5进行信息同步后,将节点1对应的第二节点信息列表发送给节点3和节点5。节点3和节点5在接收到节点1发送的第二节点信息列表后,将自身对应的第二节点信息列表更新为接收到的节点1发送的节点1对应的第二节点信息列表,即上表2(b)。Assuming that during the first round of information synchronization, the node 1 selects node 3 and node 5 for information synchronization, then after node 1 selects the node 3 and node 5, the node 1, node 3 and node 5 The node information is stored in the second node information list corresponding to node 1, and after successful information synchronization between node 3 and node 5, the second node information list corresponding to node 1 is sent to node 3 and node 5. After node 3 and node 5 receive the second node information list sent by node 1, they update their corresponding second node information list to the received second node information list corresponding to node 1 sent by node 1, that is, the above table 2(b).
此时,第一轮信息同步后,根据节点1对应的第一节点信息列表和节点1对应的第二节点信息列表可以确定节点1对应的未进行信息同步的节点为节点2、节点4、节点6-10;根据节点3对应的第一节点信息列表和节点3对应的第二节点信息列表可以确定节点3对应的未进行信息同步的节点为节点2、节点4、节点6-10;根据节点5对应的第一节点信 息列表和节点5对应的第二节点信息列表可以确定节点5对应的未进行信息同步的节点为节点2、节点4、节点6-10。At this point, after the first round of information synchronization, according to the first node information list corresponding to node 1 and the second node information list corresponding to node 1, it can be determined that the nodes corresponding to node 1 that have not undergone information synchronization are node 2, node 4, node 6-10; According to the first node information list corresponding to node 3 and the second node information list corresponding to node 3, it can be determined that the nodes corresponding to node 3 without information synchronization are node 2, node 4, and node 6-10; The first node information list corresponding to node 5 and the second node information list corresponding to node 5 can determine that the nodes corresponding to node 5 that have not undergone information synchronization are node 2, node 4, and node 6-10.
需要说明的是,本申请实施例二中,源节点只有在第一次选取节点进行信息同步时,可以将自身节点信息和所选取的进行信息同步的节点信息存储到自身维护的第二节点信息列表中;后续其他作为同步节点的节点则不需要再将自身的节点信息存储到自身维护的第二节点信息列表中,或仅将所选取的进行信息同步的节点信息存储到自身维护的第二节点信息列表中就可以。It should be noted that, in the second embodiment of the present application, the source node can store its own node information and the selected node information for information synchronization only in the second node information maintained by itself when it selects a node for information synchronization for the first time. In the list; subsequent other nodes that serve as synchronization nodes do not need to store their own node information in the second node information list maintained by themselves, or only store the selected node information for information synchronization in the second node information list maintained by itself. It is fine in the node information list.
假设,第二轮信息同步时,所述第一节点1随机选取的进行内容更新的节点为节点2、节点6,所述第一节点3随机选取的进行内容同步的节点为节点4、节点10,所述第一节点5随机选取的进行内容同步的节点为节点8、节点9。其中,第一节点1在选取了节点2和节点6之后,将节点2和节点6的信息存储到第一节点1对应的第二节点信息列表中,并在成功对节点2和节点6进行信息同步后,将节点1对应的第二节点信息列表发送给节点2和节点6。节点2和节点6在接收到节点1发送的第二节点信息列表后,将自身对应的第二节点信息列表更新为接收到的节点1发送的节点1对应的第二节点信息列表,即下表2(e)。Suppose that during the second round of information synchronization, the nodes randomly selected by the first node 1 for content update are node 2, and node 6, and the nodes randomly selected by the first node 3 for content synchronization are node 4 and node 10. The nodes randomly selected by the first node 5 for content synchronization are node 8 and node 9. Among them, after the first node 1 selects node 2 and node 6, the information of node 2 and node 6 is stored in the second node information list corresponding to first node 1, and the information of node 2 and node 6 is successfully performed After synchronization, the second node information list corresponding to node 1 is sent to node 2 and node 6. After node 2 and node 6 receive the second node information list sent by node 1, they update their corresponding second node information list to the received second node information list corresponding to node 1 sent by node 1, as shown in the following table 2(e).
同理,第一节点3在选取了节点4和节点10之后,将节点4和节点10的信息存储到第一节点3对应的第二节点信息列表中,并在成功对节点4和节点10进行信息同步后,将节点3对应的第二节点信息列表发送给节点4和节点10。节点4和节点10在接收到节点3发送的第二节点信息列表后,将自身对应的第二节点信息列表更新为接收到的节点3发送的节点3对应的第二节点信息列表,即下表2(f)。In the same way, after the first node 3 selects the node 4 and the node 10, the information of the node 4 and the node 10 is stored in the second node information list corresponding to the first node 3, and the node 4 and the node 10 are successfully processed. After the information is synchronized, the second node information list corresponding to node 3 is sent to node 4 and node 10. After node 4 and node 10 receive the second node information list sent by node 3, they update their corresponding second node information list to the received second node information list corresponding to node 3 sent by node 3, namely the following table 2(f).
同理,第一节点5在选取了节点8和节点9之后,将节点8和节点9的信息存储到第一节点5对应的第二节点信息列表中,并在成功对节点8和节点9进行信息同步后,将节点5对应的第二节点信息列表发送给节点8和节点9。节点8和节点9在接收到节点5发送的第二节点信息列表后,将自身对应的第二节点信息列表更新为接收到的节点5发送的节点5对应的第二节点信息列表,即下表2(g)。In the same way, after the first node 5 has selected nodes 8 and 9, the information of nodes 8 and 9 is stored in the second node information list corresponding to the first node 5, and the node 8 and node 9 are successfully processed After the information is synchronized, the second node information list corresponding to node 5 is sent to node 8 and node 9. After node 8 and node 9 receive the second node information list sent by node 5, they update their corresponding second node information list to the received second node information list corresponding to node 5 sent by node 5, namely the following table 2(g).
假设,第三轮信息同步时,当前作为发送方的第一节点有节点1-6,节点8-10,根据第一节点1、节点2、节点6,自身对应的第一节点信息列表和自身对应的第二节点信息列表,可以确定节点1、节点2、节点6对应的未进行信息同步的节点为节点4、节点7-10;根据第一节点3、节点4、节点10,自身对应的第一节点信息列表和自身对应的第二节点信息列表,可以确定节点3、节点4、节点10对应的未进行信息同步的节点为节点2、节点6-9;根据第一节点5、节点8、节点9,自身对应的第一节点信息列表和自身对应的第二节点信息列表,可以确定节点5、节点8、节点9对应的未进行信息同步的节点为节点2、节点4、节点6-7、节点10。Suppose that during the third round of information synchronization, the current first node as the sender has nodes 1-6, and nodes 8-10. According to the first node 1, node 2, and node 6, the corresponding first node information list and itself Corresponding to the second node information list, it can be determined that the nodes corresponding to node 1, node 2, and node 6 that have not undergone information synchronization are node 4, node 7-10; according to the first node 3, node 4, and node 10, their corresponding The first node information list and the second node information list corresponding to itself can determine that the nodes corresponding to node 3, node 4, and node 10 without information synchronization are node 2, node 6-9; according to the first node 5, node 8 , Node 9, the first node information list corresponding to itself and the second node information list corresponding to itself, it can be determined that the nodes corresponding to node 5, node 8, and node 9 without information synchronization are node 2, node 4, node 6 7. Node 10.
假设,第一节点1从自身对应的未进行内容更新的节点4、节点7-10中随机选取节点4、节点7进行信息同步,并将节点4和节点7的信息存储到节点1对应的第二节点信息列表中。所述节点1在成功对节点7进行信息同步后,将自身对应的第二节点信息列表发送给节点7,其中,节点7在接收到节点1发送的第二节点信息列表后,将自身对应的第二节点信息列表更新为接收到的节点1发送的节点1对应的第二节点信息列表,即下表2(h)。Suppose that the first node 1 randomly selects node 4 and node 7 from the corresponding node 4 and node 7-10 that have not been updated for information synchronization, and stores the information of node 4 and node 7 in the first node corresponding to node 1. The second node information list. After the node 1 successfully synchronizes the information of the node 7, it sends its corresponding second node information list to the node 7, where the node 7 receives the second node information list sent by the node 1, and then sends the corresponding The second node information list is updated to the received second node information list corresponding to node 1 sent by node 1, namely, Table 2(h) below.
其中,所述节点1对应的未进行内容更新的节点中虽然有节点4,但是节点4已在第 二轮信息同步过程中,由节点3成功完成了信息同步,故此时节点4中已包含更新内容。因此,节点1在对节点4进行信息更新时,会接收到节点4发送的表示信息同步未成功的response消息,故第一节点1在接收到表示信息同步未成功的response消息后,便失去进行信息同步的能力,终止进行信息同步。Wherein, although the node 1 corresponding to the node that has not been updated has node 4, node 4 has been in the second round of information synchronization process, and the information synchronization has been successfully completed by node 3, so node 4 now contains the update content. Therefore, when node 1 updates the information of node 4, it will receive the response message sent by node 4 indicating that the information synchronization is unsuccessful. Therefore, the first node 1 will lose the process after receiving the response message indicating that the information synchronization is unsuccessful. The ability to synchronize information, terminate information synchronization.
同理,假设节点7已被节点1成功进行信息同步,因此,第一节点2-6、第一节点8-10从自身对应的未进行内容更新的节点中无论选取哪几个节点进行信息同步,第一节点2-6、第一节点8-10都会接收到对应被同步节点发送的表示信息同步未成功的response消息。故第一节点2-6、第一节点8-10都会失去进行信息同步的能力,终止进行信息同步。In the same way, assume that node 7 has been successfully synchronized by node 1. Therefore, the first node 2-6 and the first node 8-10 from their corresponding nodes that have not performed content update, no matter which nodes are selected for information synchronization , Both the first node 2-6 and the first node 8-10 will receive the response message sent by the synchronized node indicating that the information synchronization is not successful. Therefore, both the first node 2-6 and the first node 8-10 will lose the ability to perform information synchronization and terminate the information synchronization.
此时,整个分布式网络系统中仅有节点7具有进行信息同步的能力,而在进行第四轮信息同步时,根据第一节点信息列表和第一节点7自身对应的第二节点信息列表,可以确定节点7对应的未进行信息同步的节点为节点8-10。假设,第一节点7从自身对应的未进行内容更新的节点8-10中随机选取节点8、节点10进行信息同步,并将节点8和节点10的信息存储到节点7对应的第二节点信息列表中。其中,因节点8、节点10中已包含更新内容,因此,节点7在对节点8和节点10进行信息更新时,也会接收到节点8和节点10发送的表示信息同步未成功的response消息,故第一节点7也会失去进行信息同步的能力,终止进行信息同步。At this time, only node 7 in the entire distributed network system has the ability to perform information synchronization, and when performing the fourth round of information synchronization, according to the first node information list and the second node information list corresponding to the first node 7 itself, It can be determined that the node corresponding to node 7 that has not undergone information synchronization is node 8-10. Suppose that the first node 7 randomly selects node 8 and node 10 from its corresponding nodes 8-10 that have not undergone content update for information synchronization, and stores the information of node 8 and node 10 in the second node information corresponding to node 7 List. Among them, because node 8 and node 10 already contain updated content, node 7 will also receive the response message sent by node 8 and node 10 indicating that the information synchronization is not successful when node 8 and node 10 are updated. Therefore, the first node 7 will also lose the ability to perform information synchronization and terminate the information synchronization.
此时,整个分布式网络系统中就不存在具有进行信息同步能力的节点,则整个分布式网络系统终止进行信息同步。At this time, there is no node capable of information synchronization in the entire distributed network system, and the entire distributed network system terminates information synchronization.
表2(e) 节点1-2、节点6对应的第二节点信息列表Table 2(e) The second node information list corresponding to node 1-2 and node 6
第二节点信息列表Second node information list
节点1信息Node 1 information
节点2信息Node 2 information
节点3信息Node 3 information
节点5信息Node 5 information
节点6信息Node 6 information
表2(f) 节点3-4、节点10对应的第二节点信息列表Table 2(f) The second node information list corresponding to node 3-4 and node 10
第二节点信息列表Second node information list
节点1信息Node 1 information
节点3信息Node 3 information
节点4信息Node 4 information
节点5信息Node 5 information
节点10信息Node 10 information
表2(g) 节点5、节点8-9对应的第二节点信息列表Table 2(g) The second node information list corresponding to node 5 and node 8-9
第二节点信息列表Second node information list
节点1信息Node 1 information
节点3信息Node 3 information
节点5信息Node 5 information
节点8信息Node 8 information
节点9信息Node 9 information
表2(h) 节点1、节点7对应的第二节点信息列表Table 2(h) The second node information list corresponding to node 1 and node 7
第二节点信息列表Second node information list
节点1信息Node 1 information
节点2信息Node 2 information
节点3信息Node 3 information
节点4信息Node 4 information
节点5信息Node 5 information
节点6信息Node 6 information
节点7信息Node 7 information
其中,通过本申请上述实施例一和实施例二的内容可知,在分布式网络系统中进行信息同步时,主要通过两种方式确定分布式网络系统中的第一节点何时终止信息同步,以及整个分布式网络系统何时终止信息同步。Among them, it can be known from the content of the first and second embodiments of the present application that when information is synchronized in a distributed network system, two methods are mainly used to determine when the first node in the distributed network system terminates information synchronization, and When will the entire distributed network system terminate information synchronization?
一种方式为分布式网络系统中的第一节点失去进行信息同步的能力,则确定所述第一节点终止信息同步。进一步的,整个分布式网络系统中的所有第一节点都失去进行信息同步的能力,则确定整个分布式网络系统终止信息同步。One way is that if the first node in the distributed network system loses the ability to perform information synchronization, it is determined that the first node terminates the information synchronization. Further, if all the first nodes in the entire distributed network system lose the ability to perform information synchronization, it is determined that the entire distributed network system terminates information synchronization.
另一种方式为分布式网络系统中的第一节点没有对应的未进行内容更新的节点,则确定所述第一节点终止信息同步,即所述第一节点对应的第一节点信息列表与第二节点信息列表中节点信息一致,则所述第一节点终止进行信息同步。Another way is that the first node in the distributed network system does not have a corresponding node that does not perform content update, then it is determined that the first node terminates the information synchronization, that is, the first node information list corresponding to the first node is If the node information in the two node information lists is consistent, the first node terminates information synchronization.
进一步的,整个分布式网络系统中所有第一节点没有对应的未进行内容更新的节点,则确定整个分布式网络系统终止信息同步。Further, if all the first nodes in the entire distributed network system have no corresponding nodes that have not performed content update, it is determined that the entire distributed network system terminates information synchronization.
进一步的,为减少每个节点的同步信息次数的平均值和方差值,从而降低整个系统的整体功耗,避免出现系统中某个节点功耗过高的情况。Further, in order to reduce the average value and variance value of the number of synchronization information of each node, thereby reducing the overall power consumption of the entire system, and avoiding the situation that a certain node in the system consumes too much power.
本申请实施例一和/或实施例二中还可以对整个分布式网络系统中的部分第一节点执行暂停信息同步操作。In the first embodiment and/or the second embodiment of the present application, it is also possible to perform a pause information synchronization operation on part of the first nodes in the entire distributed network system.
其中,本申请实施例一和/或实施例二中可以但不限于通过下述方式来确定需要暂停信息同步的第一节点:Among them, in Embodiment 1 and/or Embodiment 2 of the present application, the first node that needs to suspend information synchronization can be determined, but not limited to, in the following manner:
当某个第一节点连续进行信息同步的次数不小于第一阈值时,则所述第一节点暂时失 去信息同步的能力。其中,本申请实施例一中所述第一阈值指节点连续进行信息同步的最大次数。When the number of times that a certain first node continuously performs information synchronization is not less than the first threshold, the first node temporarily loses the ability to synchronize information. Among them, the first threshold in the first embodiment of the present application refers to the maximum number of times that a node continuously synchronizes information.
示例性的,假设第一阈值为3,则当某个第一节点连续进行信息同步的次数达到3次时,则所述第一节点需要暂时失去对其他节点进行信息同步的能力。暂停一定时间后还可以再次恢复对其他节点进行信息同步能力,继续从对应的未进行内容更新的节点中随机选取未进行内容更新的节点进行信息同步。Exemplarily, assuming that the first threshold is 3, when the number of times that a certain first node continuously performs information synchronization reaches 3 times, the first node needs to temporarily lose the ability to perform information synchronization with other nodes. After pausing for a certain period of time, the ability to synchronize information with other nodes can be resumed again, and nodes that have not been updated are randomly selected from the corresponding nodes that have not been updated for information synchronization.
需要说明的是,本申请实施例一和/或实施例二中在对第一节点执行暂停信息同步操作时,所述第一节点随着累计进行信息同步次数的增加,所述第一节点暂停进行信息同步的时长也可以不断的增加。It should be noted that, when the information synchronization operation is performed on the first node in the first embodiment and/or the second embodiment of the present application, the first node pauses as the cumulative number of times of information synchronization increases. The duration of information synchronization can also be continuously increased.
进一步的,本申请实施例一和/或实施例二中第一节点暂停进行信息同步的时长可根据如下公式1进行确定。Further, the length of time during which the first node suspends information synchronization in Embodiment 1 and/or Embodiment 2 of the present application can be determined according to the following formula 1.
其中,所述公式1中的M指某个节点累计进行信息同步的次数、所述公式1中的t指某个第一节点执行暂停信息同步操作时需要暂停的时长,n为正数,n可以为0.2等值。Wherein, M in the formula 1 refers to the cumulative number of times a node performs information synchronization, t in the formula 1 refers to the length of time that a certain first node needs to pause when the information synchronization operation is suspended, n is a positive number, and n It can be 0.2 equivalent.
t=n(M-1)     (公式1)t=n(M-1) (Formula 1)
实施例三,本申请实施例三在上述实施例一、二的基础上,还可通过将节点群组中的节点进行分组的方式进行信息同步,从而使所述分布式网络系统中的第一节点在随机选取未进行内容更新的节点进行信息同步时,每组中的第一节点仅需对所在分组中未进行内容更新的节点进行信息同步。因此,第一节点不需要确定整个分布式网络系统中未进行内容更新的节点,这样第一节点需要考虑的未进行内容更新的节点数量较少,针对性更强,且多组中的第一节点同时对所在组中未进行内容更新的节点进行信息同步,可以实现并发信息同步效果,提升信息同步效率。 Embodiment 3. On the basis of the above embodiments 1 and 2, the embodiment 3 of this application can also synchronize information by grouping the nodes in the node group, so that the first in the distributed network system When a node randomly selects nodes that have not performed content update for information synchronization, the first node in each group only needs to perform information synchronization for the nodes in the group that have not performed content update. Therefore, the first node does not need to determine the nodes that have not performed content updates in the entire distributed network system. In this way, the first node needs to consider the number of nodes that have not performed content updates, which is more targeted, and the first in multiple groups At the same time, the node synchronizes the information of the nodes in the group where the content is not updated, which can realize the effect of concurrent information synchronization and improve the efficiency of information synchronization.
其中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。Wherein, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
如图4所示,本发明实施例三通过将整个节点群组中的节点进行分组的方式进行信息同步的流程,具体步骤包括:As shown in Fig. 4, in the third embodiment of the present invention, the information synchronization process is performed by grouping nodes in the entire node group. The specific steps include:
步骤400,确定整个分布式网络系统中所有节点的数量,然后执行步骤401。Step 400: Determine the number of all nodes in the entire distributed network system, and then perform step 401.
步骤401,判断整个分布式网络系统中的所有节点的数量是否大于第二阈值,若是,执行步骤402,若否,执行步骤403。Step 401: Determine whether the number of all nodes in the entire distributed network system is greater than a second threshold, if yes, execute step 402, if not, execute step 403.
其中,本申请实施例三中的第二阈值可以是指预先设置的用于判断是否满足分组条件的节点数量最大值,即若当前节点群组中的所有节点的数量超过第二阈值,则确定满足分组条件,将对当前节点群组中的所有节点进行分组;若当前节点群组中所有节点没有超过第二阈值,则确定不满足分组条件,当前节点群组中所有节点不需要进行分组。Among them, the second threshold in the third embodiment of the present application may refer to the preset maximum value of the number of nodes used to determine whether the grouping condition is met, that is, if the number of all nodes in the current node group exceeds the second threshold, it is determined If the grouping condition is met, all nodes in the current node group will be grouped; if all nodes in the current node group do not exceed the second threshold, it is determined that the grouping condition is not met, and all nodes in the current node group do not need to be grouped.
步骤402,将整个分布式网络系统中的所有节点分为若干个节点群组,然后执行步骤404。Step 402: Divide all nodes in the entire distributed network system into several node groups, and then perform step 404.
步骤403,所述分布式网络系统中的源节点随机选取若干未进行内容更新的节点进行信息同步,然后执行步骤409。In step 403, the source node in the distributed network system randomly selects a number of nodes that have not performed content update for information synchronization, and then executes step 409.
其中,所述源节点在成功对随机选取的未进行内容更新的节点进行信息同步后,则成功进行信息同步的节点成为新的第一节点。Wherein, after the source node successfully synchronizes information with a randomly selected node that has not undergone content update, the node that successfully synchronizes information becomes the new first node.
步骤404,所述分布式网络系统中的源节点从每个分组后的节点群组中随机选取一个 未进行内容更新的节点进行信息同步,然后执行步骤405。Step 404: The source node in the distributed network system randomly selects a node that has not undergone content update from each grouped node group to perform information synchronization, and then executes step 405.
步骤405,第一节点在进行下一次信息同步时,判断所在节点群组中的所有节点数量是否超过第二阈值,若是,执行步骤406,若否,执行步骤407。In step 405, when the first node performs the next information synchronization, it is judged whether the number of all nodes in the node group where it is located exceeds the second threshold, if yes, step 406 is executed, and if not, step 407 is executed.
步骤406,将第一节点所在节点群组中的所有节点再次分为若干个组,然后执行步骤408。In step 406, all nodes in the node group where the first node is located are again divided into several groups, and then step 408 is performed.
步骤407,第一节点从所在节点群组中的节点中随机选取若干未进行内容更新的节点进行信息同步,然后执行步骤409。In step 407, the first node randomly selects several nodes that have not performed content update from the nodes in the node group where it is located for information synchronization, and then performs step 409.
步骤408,第一节点分别从再次分组后的每个节点群组中随机选取一个未进行内容更新的节点进行信息同步,然后返回继续执行步骤405。In step 408, the first node randomly selects a node that has not undergone content update from each node group after regrouping to perform information synchronization, and then returns to continue to perform step 405.
步骤409,第一节点继续进行信息同步,直到整个分布式网络系统中的所有节点都完成信息同步。Step 409: The first node continues to perform information synchronization until all nodes in the entire distributed network system complete information synchronization.
需要说明的是,可根据某个节点对应的第一节点信息列表确定所述节点所在节点群组中的所有节点数量。It should be noted that the number of all nodes in the node group where the node is located can be determined according to the first node information list corresponding to a certain node.
本申请实施例三中在将整个分布式网络系统中的所有节点进行分组后,则每个节点群组中的节点对应的第一节点信息列表中仅包含该节点群组中的所有节点信息。同理,若将某个节点群组中的所有节点再次进行分组,例如将节点群组1中的节点再次进行分组,其中,假设将节点群组1中的所有节点分成三组,分别为节点群组a,节点群组b,节点群组c,则再次分组中的每个节点群组中的节点对应的第一节点信息列表中仅包含该节点群组中的所有节点信息,例如,节点群组a中的节点对应的第一节点信息列表中仅包含节点群组a中的所有节点信息。In the third embodiment of the present application, after all the nodes in the entire distributed network system are grouped, the first node information list corresponding to the nodes in each node group only includes all the node information in the node group. In the same way, if all the nodes in a certain node group are grouped again, for example, the nodes in node group 1 are grouped again, where it is assumed that all nodes in node group 1 are divided into three groups, namely the node Group a, node group b, node group c, the first node information list corresponding to each node in each node group in the subgroup only contains all the node information in the node group, for example, node The first node information list corresponding to the nodes in the group a only includes all the node information in the node group a.
其中,若分布式网络系统中的所有节点共用一个第二节点信息列表,则本申请实施例二中在将整个分布式网络系统中的所有节点进行分组后,分布式网络系统中的每个节点群组中的所有节点共用一个第二节点信息列表,所述第二信息列表中仅包含该节点群组中所有已进行内容同步的节点的信息。Wherein, if all nodes in the distributed network system share a second node information list, in the second embodiment of the present application, after all nodes in the entire distributed network system are grouped, each node in the distributed network system All nodes in the group share a second node information list, and the second information list only includes information of all nodes in the node group that have performed content synchronization.
本申请实施例三中通过分组方式进行信息同步时,可以有多种分组方式,下面分别进行介绍。In the third embodiment of the present application, when information is synchronized by grouping, there may be multiple grouping methods, which will be introduced separately below.
分组方式1:本申请实施例三中在确定需要进行分组后,通过预先设置的分组组数,将当前节点群组中的所有节点平均分成预先设置的组数。Grouping method 1: In Embodiment 3 of the present application, after it is determined that grouping is required, all nodes in the current node group are equally divided into the preset number of groups through the preset number of grouping groups.
例如,假设预先设置的分组组数为2组,当前节点群组中一共有30个节点,在满足平均分组条件的情况下,则将所述30个节点平均分为两组,每组15个节点。For example, assuming that the preset number of grouping groups is 2 groups, there are a total of 30 nodes in the current node group, and if the average grouping conditions are met, the 30 nodes are divided into two groups, each with 15 nodes node.
其中,若不能将当前节点群组中的所有节点平均分成所述预先设置的组数,则可以选择分组后,保证分组后的每个新节点群组中节点数量的方差为最小值。Wherein, if all the nodes in the current node group cannot be equally divided into the preset number of groups, grouping can be selected to ensure that the variance of the number of nodes in each new node group after grouping is the minimum.
例如,预先设置的分组组数为2组,当前分布式网络系统中一共有27个节点,则设第一组中的节点数量为x 1,第二组中的节点数量为x 2,其中,每组中的平均节点数量为13.5,则根据公式2中的方差公式: For example, the preset number of grouping groups is 2 groups, and there are a total of 27 nodes in the current distributed network system, then the number of nodes in the first group is x 1 and the number of nodes in the second group is x 2 , where, The average number of nodes in each group is 13.5, according to the variance formula in formula 2:
Figure PCTCN2020076858-appb-000001
Figure PCTCN2020076858-appb-000001
可以得到公式3:You can get formula 3:
Figure PCTCN2020076858-appb-000002
Figure PCTCN2020076858-appb-000002
因为最终的方差s 2的大小与(x 1-13.5) 2、(x 2-13.5) 2的值有关,(x 1-13.5) 2、(x 2-13.5) 2的值越小,得到的方差则越小,且节点数量需要为整数值。故只有当x 1=14,x 2= 13或x 1=13,x 2=14时,才能够使得到的方差最小,此时方差值为0.25。故,最终可将所述节点群组中的27个节点分为两组,一组14个节点,另一组13个节点。 Because the final size of the variance s 2 and (x 1 -13.5) 2, ( 2 -13.5 x) value of about 2, (x 1 -13.5) 2, (x 2 -13.5) smaller values of 2, obtained The variance is smaller, and the number of nodes needs to be an integer value. Therefore, only when x 1 =14, x 2 =13 or x 1 =13, x 2 =14 can the obtained variance be minimized, and the variance value is 0.25 at this time. Therefore, the 27 nodes in the node group can be divided into two groups, one group of 14 nodes, and the other group of 13 nodes.
分组方式2:本申请实施例三中在确定需要进行分组后,根据设置的第二阈值大小进行分组,然后从当前节点群组中的所有节点中随机选择第二阈值大小数量的节点分成一组,直至未分组的节点数量小于第二阈值,最后将未分组的节点分成一组或将剩余未分组的节点随机加入到一个已分组中。Grouping method 2: In the third embodiment of the application, after determining that grouping is required, grouping is performed according to the set second threshold size, and then randomly selected from all nodes in the current node group, the number of nodes with the second threshold size is divided into a group , Until the number of ungrouped nodes is less than the second threshold, finally divide the ungrouped nodes into a group or randomly add the remaining ungrouped nodes into a grouped.
例如,假设设定的第二阈值为10,当前节点群组中的所有节点一共有29个节点,则从29个节点中随机选取10个节点作为第一组节点,从剩余19个节点中随机选取10个节点作为第二组节点,然后将剩余的9个节点作为第三组节点,一共分为三组;For example, suppose that the second threshold is set to 10, and all nodes in the current node group have a total of 29 nodes. Then randomly select 10 nodes from the 29 nodes as the first group of nodes, and randomly select from the remaining 19 nodes. Select 10 nodes as the second group of nodes, and then use the remaining 9 nodes as the third group of nodes, which are divided into three groups;
再例如,假设设定的阈值为10,当前节点群组中的所有节点一共有29个节点,则从29个节点中随机选取10个节点作为第一组节点,从剩余19个节点中随机选取10个节点作为第二组节点,然后将剩余的9个节点随机放入第一组或者第二组中,例如放入第二组,则此时,一共分成了两个组,第一组中10个节点,第二组中19个节点。For another example, suppose that the set threshold is 10, and all nodes in the current node group have a total of 29 nodes. Then randomly select 10 nodes from the 29 nodes as the first group of nodes, and randomly select from the remaining 19 nodes 10 nodes are used as the second group of nodes, and then the remaining 9 nodes are randomly placed into the first group or the second group, for example, into the second group. At this time, they are divided into two groups, the first group 10 nodes, 19 nodes in the second group.
进一步的,本申请实施例三中在完成第一轮分组之后,所述源节点会分别从每个节点群组中随机选取一个未进行内容更新的节点进行第一轮信息同步。在完成第一轮信息同步,需要进行第二轮信息同步时,第一节点需要判断当前所在节点群组中的所有节点数量是否超过第一阈值,若是,第一节点继续将当前所在节点群组中的所有节点进行分组,然后,所述第一节点从对应的新分的每个节点群组中随机选取未进行内容更新的节点进行信息同步;若不是,则第一节点直接从所在节点群组中随机选取未进行内容更新的节点进行信息同步。以此类推,继续进行上述的节点内容同步过程,直到整个分布式网络系统中的节点都完成信息同步。Further, in the third embodiment of the present application, after the first round of grouping is completed, the source node will randomly select a node that has not performed content update from each node group to perform the first round of information synchronization. After completing the first round of information synchronization and the second round of information synchronization is needed, the first node needs to determine whether the number of all nodes in the current node group exceeds the first threshold. If so, the first node continues to update the current node group All the nodes in the node group are grouped, and then the first node randomly selects nodes that have not undergone content update from each of the corresponding new node groups for information synchronization; if not, the first node directly obtains information from the node group where it is located Nodes in the group that have not undergone content update are randomly selected for information synchronization. By analogy, continue the above node content synchronization process until the nodes in the entire distributed network system complete information synchronization.
下面在实施例二的基础上,结合附图5-10整体对本发明实施例三进行具体介绍。In the following, on the basis of the second embodiment, the third embodiment of the present invention will be described in detail with reference to FIGS. 5-10.
如图5所示,假设当前分布式网络系统中一共有22个节点,源节点为2,设定的第一阈值为2,第二阈值为10,且按照上述分组方式2中的分组方式将所述分布式网络系统中的所有节点分为两组,分别为第一组,所包含的节点为节点1-10,第二组,所包含的节点为11-22。As shown in Figure 5, assuming that there are 22 nodes in the current distributed network system, the source node is 2, the first threshold is set to 2, and the second threshold is 10, and according to the above grouping method 2 All nodes in the distributed network system are divided into two groups, namely the first group, the nodes included are nodes 1-10, and the second group, the nodes included are 11-22.
需要说明的是,所述附图中的符号R表示第二节点解析接收到的第一节点发送的Gossip消息确定更新内容,通过使用更新内容对比自身保存的数据后,确定在进行信息同步前自身数据未包含更新内容,即所述第一节点此次信息同步成功,还具有进行信息同步的能力;符号E表示第二节点解析接收到的第一节点发送的Gossip消息确定更新内容,通过使用更新内容对比自身保存的数据后,确定在进行信息同步前自身数据已包含更新内容,即所述第一节点此次信息同步失败,失去进行信息同步的能力,终止进行信息同步。It should be noted that the symbol R in the figure indicates that the second node parses the received Gossip message sent by the first node to determine the updated content, and after comparing the data saved by itself by using the updated content, it determines that it is before performing information synchronization. The data does not contain updated content, that is, the first node has successfully synchronized the information this time, and has the ability to synchronize information; the symbol E indicates that the second node parses the received Gossip message sent by the first node to determine the updated content, and uses the update After the content is compared with the data saved by itself, it is determined that its own data contains updated content before information synchronization is performed, that is, the first node fails to synchronize information this time, loses the ability to perform information synchronization, and terminates information synchronization.
假设如图6所示,第一轮信息同步时,所述源节点2分别在第一组和第二组中随机选取一个未进行内容更新的节点进行信息同步。例如,源节点2随机选取的未进行内容更新的节点为节点1和节点13,当源节点2成功完成对节点1和节点13的信息同步后,则所述节点1和所述节点13也变成第一节点,继续从所在组中随机选取未进行内容更新的节点进行信息同步。Assume that as shown in FIG. 6, during the first round of information synchronization, the source node 2 randomly selects a node that has not performed content update from the first group and the second group to perform information synchronization. For example, the nodes randomly selected by source node 2 that have not undergone content update are node 1 and node 13. When source node 2 successfully synchronizes the information of node 1 and node 13, then node 1 and node 13 also change Become the first node and continue to randomly select nodes from the group that have not undergone content update for information synchronization.
在进行第二轮信息同步时,第一节点需要判断当前所在组中的所有节点数量是否超过第一阈值。其中,第一节点13当前所在第二组中的所有节点的数量为12,大于第一阈值10,则第一节点将所在第二组中的所有节点继续进行分组。例如,第一节点13将所在的 第二组中的所有节点再次分为两组,分别为第三组,所包含的节点为11-20,第四组,所包含的节点为21-22,并在完成分组后,第一节点13分别在第三组和第四组中随机选取一个未进行内容更新的节点进行信息同步。During the second round of information synchronization, the first node needs to determine whether the number of all nodes in the current group exceeds the first threshold. Wherein, the number of all nodes in the second group where the first node 13 is currently located is 12, which is greater than the first threshold of 10, and the first node will continue to group all nodes in the second group where it is. For example, the first node 13 divides all the nodes in the second group into two groups again, namely the third group, which contains nodes 11-20, and the fourth group, which contains nodes 21-22, And after the grouping is completed, the first node 13 randomly selects a node that has not performed content update in the third group and the fourth group to synchronize information.
如图7所示,假设第一节点13从第3组和第四组中随机选取的未进行内容更新的节点为节点15和节点21,则当第一节点13成功完成对节点15和节点21的信息同步后,节点15和节点21也变成第一节点,且节点13、节点15对应的第二节点信息列表中包含的节点信息为[13、15]。从而结合第一节点信息列表,可知,所述节点13、节点15对应的未进行信息同步的节点为[11、12、14、16、17、18、19、20]。As shown in Fig. 7, assuming that the nodes that the first node 13 randomly selects from the third group and the fourth group that have not undergone content update are node 15 and node 21, then when the first node 13 successfully completes the node 15 and node 21 After synchronizing the information, node 15 and node 21 also become the first node, and the node information contained in the second node information list corresponding to node 13 and node 15 is [13, 15]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13 and the node 15 that have not undergone information synchronization are [11, 12, 14, 16, 17, 18, 19, 20].
节点21对应的第二节点信息列表中包含的节点为[21]。从而结合第一节点信息列表,可知,所述节点21对应的未进行信息同步的节点为[22]。此时,完成第二轮信息同步后,所述节点13已经连续进行了两次信息同步,已经达到第一阈值2,因此,所述节点13需要暂停一定时长后才能进行下一次信息同步,具体暂停时间可以为0.2秒。The node included in the second node information list corresponding to node 21 is [21]. Therefore, in combination with the first node information list, it can be known that the node corresponding to the node 21 that has not undergone information synchronization is [22]. At this point, after the second round of information synchronization is completed, the node 13 has already performed two consecutive information synchronizations, and has reached the first threshold 2. Therefore, the node 13 needs to pause for a certain period of time before it can perform the next information synchronization. The pause time can be 0.2 seconds.
而第一节点1当前所在第一组中的所有节点的数量为10,不大于第一阈值10,则第一节点1直接从第一组中随机选取未进行内容更新的节点进行信息同步。假设,所述第一节点从第一组中随机选取的未进行内容更新的节点为节点5和节点6,则当第一节点1成功完成对节点5和节点6的信息同步后,节点5和节点6也变成第一节点,且节点1、节点5、节点6对应的第二节点信息列表中包含的节点信息为[1、5、6]。从而结合第一节点信息列表,可知,所述节点1、节点5、节点6对应的未进行信息同步的节点为[2、3、4、7、8、9、10]。And the number of all the nodes in the first group where the first node 1 is currently located is 10, which is not greater than the first threshold 10, and the first node 1 directly randomly selects nodes that have not performed content update from the first group for information synchronization. Assuming that the nodes that the first node randomly selects from the first group without updating content are node 5 and node 6, then when the first node 1 successfully synchronizes the information of node 5 and node 6, node 5 and node 6 Node 6 also becomes the first node, and the node information contained in the second node information list corresponding to node 1, node 5, and node 6 is [1, 5, 6]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 1, node 5, and node 6 that have not undergone information synchronization are [2, 3, 4, 7, 8, 9, 10].
此时,完成第二轮信息同步后,每组中的节点数量已经不大于设定的第二阈值10,因此,后续进行信息同步过程中不需要再进行分组。其中,所述第一组中的节点5和节点6成为新的第一节点,并继续进行信息同步。而此时所述节点1收到的所述节点5和所述节点6返回的response消息都是R,即所述节点1成功完成对所述节点5和所述节点6的信息同步,所以所述节点1可继续进行信息同步。但是,此时所述节点1已经连续执行了两次信息同步,已经达到第一阈值2。因此,所述节点1需要暂停一定时长后才能进行下一次信息同步,比如暂停0.2秒后再进行信息同步。At this time, after the second round of information synchronization is completed, the number of nodes in each group is no more than the set second threshold of 10, therefore, there is no need to group in the subsequent information synchronization process. Wherein, node 5 and node 6 in the first group become the new first node, and continue to perform information synchronization. At this time, the response messages returned by the node 5 and the node 6 received by the node 1 are both R, that is, the node 1 successfully completes the synchronization of the information of the node 5 and the node 6, so The node 1 can continue to synchronize information. However, at this time, the node 1 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 1 needs to pause for a certain period of time before performing the next information synchronization, for example, after a pause of 0.2 seconds, the information synchronization can be performed.
如图8所示,进行第三轮进行信息同步时,第一组中的第一节点为节点1、节点5和节点6,其中,因为节点1目前处于暂停进行信息同步状态,节点5和节点6继续进行信息同步。假设,所述节点5从第一组中随机选取的未进行内容更新的节点为节点3和节点7,根据图7可知,所述节点3和节点7返回给所述节点5的response消息都为R,此次信息同步成功,第一节点5还具有进行信息同步的能力。其中,当第一节点5成功完成对节点3和节点7的信息同步后,节点3和节点7也变成第一节点,且节点5、节点3、节点7对应的第二节点信息列表中包含的节点为[1、5、6、3、7]。从而结合第一节点信息列表,可知,所述节点5、节点3、节点7对应的未进行信息同步的节点为[2、4、8、9、10]。此时所述节点5已经连续执行了两次信息同步,已经达到第一阈值2。因此,所述节点5需要暂停一定时长后才能进行下一次信息同步。As shown in Figure 8, when the third round of information synchronization is performed, the first nodes in the first group are node 1, node 5, and node 6. Among them, because node 1 is currently in a state of suspending information synchronization, node 5 and node 6 Continue to synchronize information. Assume that the nodes that are randomly selected by the node 5 from the first group and have not undergone content update are node 3 and node 7. According to Figure 7, the response messages returned by the node 3 and the node 7 to the node 5 are all R, the information synchronization is successful this time, and the first node 5 also has the ability to perform information synchronization. Among them, when the first node 5 successfully completes the synchronization of the information of the node 3 and the node 7, the node 3 and the node 7 also become the first node, and the second node information list corresponding to the node 5, the node 3, and the node 7 contains The nodes of are [1, 5, 6, 3, 7]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 5, node 3, and node 7 that have not undergone information synchronization are [2, 4, 8, 9, 10]. At this time, the node 5 has continuously performed information synchronization twice, and has reached the first threshold 2. Therefore, the node 5 needs to pause for a certain period of time before performing the next information synchronization.
所述节点6从第一组中随机选取的未进行内容更新的节点为节点8和节点9,根据图8可知,所述节点8和节点9返回给所述节点6的response消息都为R,此次信息同步成功,第一节点6还具有进行信息同步的能力。其中,当第一节点6成功完成对节点8和节点9的信息同步后,节点8和节点9也变成第一节点,且节点6、节点8、节点9对应的 第二节点信息列表中包含的节点为[1、5、6、8、9]。从而结合第一节点信息列表,可知,所述节点6、节点8、节点9对应的未进行信息同步的节点为[2、3、4、7、10]。此时所述节点6已经连续执行了两次信息同步,已经达到第一阈值2。因此,所述节点6需要暂停一定时长后才能进行下一次信息同步,具体暂停时间可以为0.2秒,当然还可以为其他值。The nodes that the node 6 randomly selects from the first group without content update are node 8 and node 9. According to Fig. 8, it can be seen that the response messages returned by the node 8 and the node 9 to the node 6 are all R, The information synchronization is successful this time, and the first node 6 also has the ability to perform information synchronization. Among them, when the first node 6 successfully completes the synchronization of the information of the node 8 and the node 9, the node 8 and the node 9 also become the first node, and the second node information list corresponding to the node 6, the node 8, and the node 9 contains The nodes of is [1, 5, 6, 8, 9]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 6, node 8, and node 9 that have not undergone information synchronization are [2, 3, 4, 7, 10]. At this time, the node 6 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 6 needs to pause for a certain period of time before it can perform the next information synchronization. The specific pause time can be 0.2 seconds, and of course it can also be other values.
对于第一节点1来说,暂停0.2秒后,第一节点1将继续执行信息同步,假设,所述节点1从第一组中随机选取的未进行内容更新的节点为节点2和节点4。根据图7可知,所述节点2返回给所述节点1的response消息都为E,所述节点4返回给所述节点1的response消息都为R,此次信息同步未成功,则第一节点1在成功对节点4进行信息同步后,终止进行信息同步。此时,节点4也变成第一节点,且节点4对应的第二节点信息列表中包含的节点为[1、2、4、5、6]。从而结合第一节点信息列表,可知,所述节点4对应的未进行信息同步的节点为[3、7、8、9、10]。For the first node 1, after a pause of 0.2 seconds, the first node 1 will continue to perform information synchronization. It is assumed that the nodes that are randomly selected by the node 1 from the first group without updating content are the node 2 and the node 4. According to Fig. 7, the response messages returned by the node 2 to the node 1 are all E, and the response messages returned by the node 4 to the node 1 are all R. If the information synchronization is not successful this time, the first node 1 After successfully synchronizing information on node 4, terminate the information synchronization. At this time, node 4 also becomes the first node, and the nodes included in the second node information list corresponding to node 4 are [1, 2, 4, 5, 6]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 4 that have not undergone information synchronization are [3, 7, 8, 9, 10].
需要说明的是,因第二组中的所有节点已被重新分到第三组和第四组中,因此,后续进行信息同步时,不需要再考虑第二组。It should be noted that since all the nodes in the second group have been re-divided into the third and fourth groups, there is no need to consider the second group when subsequent information synchronization is performed.
其中,目前第三组中的第一节点为节点13和节点15,其中,因为节点13目前处于暂停进行信息同步状态,因此,节点15继续进行信息同步。假设,所述节点15从第三组中随机选取的未进行内容更新的节点为节点16和节点20。根据图8可知,所述节点16和节点20返回给所述节点15的response消息都为R,此次信息同步成功,第一节点15还具有进行信息同步的能力。其中,当第一节点15成功完成对节点16和节点20的信息同步后,节点16和节点20也变成第一节点,且节点15、节点16、节点20对应的第二节点信息列表中包含的节点为[13、15、16、20]。从而结合第一节点信息列表,可知,所述节点15、节点16、节点20对应的未进行信息同步的节点为[11、12、14、17、18、19]。但此时所述节点15已经连续执行了两次信息同步,已经达到第一阈值2。因此,所述节点15需要暂停一定时长后才能进行下一次信息同步。Among them, currently the first nodes in the third group are node 13 and node 15, wherein, because node 13 is currently in a state of suspending information synchronization, node 15 continues to perform information synchronization. It is assumed that the nodes that are randomly selected by the node 15 from the third group without performing content update are the node 16 and the node 20. It can be seen from FIG. 8 that the response messages returned by the node 16 and the node 20 to the node 15 are all R, and the information synchronization is successful this time, and the first node 15 also has the ability to perform information synchronization. Among them, when the first node 15 successfully completes the synchronization of the information of the node 16 and the node 20, the node 16 and the node 20 also become the first node, and the second node information list corresponding to the node 15, the node 16, and the node 20 contains The node of is [13, 15, 16, 20]. Therefore, in combination with the first node information list, it can be seen that the nodes corresponding to the node 15, the node 16, and the node 20 that have not undergone information synchronization are [11, 12, 14, 17, 18, 19]. However, at this time, the node 15 has continuously performed information synchronization twice, and the first threshold 2 has been reached. Therefore, the node 15 needs to pause for a certain period of time before performing the next information synchronization.
其中,对于第一节点13来说,可以暂停0.2秒后继续执行信息同步,假设所述节点13从第三组中随机选取的未进行内容更新的节点为节点14和节点19。根据图8可知,所述节点14和节点19返回给所述节点13的response消息都为R,此次信息同步成功,第一节点13还具有进行信息同步的能力。其中,当第一节点13成功完成对节点14和节点19的信息同步后,节点14和节点19也变成第一节点,且节点13、节点14、节点19对应的第二节点信息列表中包含的节点为[13、14、15、19]。从而结合第一节点信息列表,可知,所述节点13、节点14、节点19对应的未进行信息同步的节点为[11、12、16、17、18、20]。Among them, for the first node 13, the information synchronization can be continued after a pause of 0.2 seconds. It is assumed that the nodes that are randomly selected by the node 13 from the third group without content update are the node 14 and the node 19. It can be seen from FIG. 8 that the response messages returned by the node 14 and the node 19 to the node 13 are all R, and the information synchronization is successful this time, and the first node 13 also has the ability to perform information synchronization. Among them, when the first node 13 successfully completes the synchronization of the information of the node 14 and the node 19, the node 14 and the node 19 also become the first node, and the second node information list corresponding to the node 13, the node 14, and the node 19 contains The nodes of is [13, 14, 15, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13, the node 14, and the node 19 that have not undergone information synchronization are [11, 12, 16, 17, 18, 20].
而目前第四组中的第一节点仅节点21,且对应的未进行内容更新的节点仅剩节点22,则节点21选取节点22进行信息同步。根据图7可知,所述节点22返回给所述节点21的response消息为R,此次信息同步成功,第一节点21还具有进行信息同步的能力。其中,当第一节点21成功完成对节点22信息同步后,节点22也变成第一节点,且节点21、节点22对应的第二节点信息列表中包含的节点为[21、22]。从而结合第一节点信息列表,可知,所述节点21、节点22没有对应的未进行信息同步的节点。因此,第四组完成了信息同步,终止进行信息同步。At present, the first node in the fourth group is only node 21, and the corresponding node that has not undergone content update is only node 22, then node 21 selects node 22 for information synchronization. It can be seen from FIG. 7 that the response message returned by the node 22 to the node 21 is R, and the information synchronization is successful this time, and the first node 21 also has the ability to perform information synchronization. Wherein, when the first node 21 successfully completes the synchronization of the node 22 information, the node 22 also becomes the first node, and the nodes included in the second node information list corresponding to the nodes 21 and 22 are [21, 22]. Therefore, in combination with the first node information list, it can be known that the nodes 21 and 22 have no corresponding nodes that have not synchronized information. Therefore, the fourth group completes the information synchronization and terminates the information synchronization.
进行第四轮信息同步时,第一组中还具有进行信息同步能力的第一节点为节点3-9,其中,因为节点5和节点6目前处于暂停进行信息同步的状态。因此,节点3、节点4、节点7-9继续进行信息同步。假设,所述节点3从对应的未进行内容更新的节点[2、4、8、 9、10]中随机选取的节点为节点8和节点10。根据图9可知,所述节点10返回给所述节点3的response消息为R,所述节点8返回给所述节点3的response消息为E,此次信息同步未成功,第一节点3终止进行信息同步。其中,当第一节点3成功完成对节点10的信息同步后,节点10也变成第一节点,且节点10对应的第二节点信息列表中包含的节点为[1、5、6、3、7、8、10]。从而结合第一节点信息列表,可知,所述节点10对应的未进行信息同步的节点为[2、4、9]。When the fourth round of information synchronization is performed, the first node in the first group that also has the ability to perform information synchronization is nodes 3-9, where node 5 and node 6 are currently in a state of suspending information synchronization. Therefore, node 3, node 4, and node 7-9 continue to synchronize information. It is assumed that the nodes selected by the node 3 randomly from the corresponding nodes [2, 4, 8, 9, 10] that have not undergone content update are node 8 and node 10. According to Figure 9, the response message returned by the node 10 to the node 3 is R, and the response message returned by the node 8 to the node 3 is E. The information synchronization is not successful this time, and the first node 3 terminates the process. Information synchronization. Among them, when the first node 3 successfully synchronizes the information of the node 10, the node 10 also becomes the first node, and the nodes contained in the second node information list corresponding to the node 10 are [1, 5, 6, 3, 7, 8, 10]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 10 that have not undergone information synchronization are [2, 4, 9].
同理,如图9所示,第一组中的第一节点4-9,虽然自身还有对应的未进行内容更新的节点,但是,所述未进行内容更新的节点实际上都已完成信息同步。因此,无论第一节点4-9在第四轮信息同步过程中选取哪个节点进行信息同步,接收到对应节点发送的response消息都为E,都会终止进行信息同步。Similarly, as shown in Figure 9, the first node 4-9 in the first group, although it has a corresponding node that has not performed content update, all the nodes that have not performed content update have actually completed information Synchronize. Therefore, no matter which node the first node 4-9 selects for information synchronization in the fourth round of information synchronization process, the response message sent by the corresponding node is always E, and the information synchronization will be terminated.
第三组中还具有进行信息同步能力的第一节点为节点13-16、节点19-20,其中,因为节点15目前处于暂停进行信息同步状态,因此,节点13、节点14、节点16、节点19-20继续进行信息同步。假设,所述节点13从对应的未进行内容更新的节点[11、12、16、17、18、20]中随机选取的节点为节点11和节点18。根据图9可知,所述节点11和节点18返回给所述节点13的response消息都为R,此次信息同步成功,第一节点13可继续进行信息同步。其中,当第一节点13成功完成对节点11和节点18的信息同步后,节点11和节点18也变成第一节点,且节点13、节点11、节点18对应的第二节点信息列表中包含的节点为[11、13、14、15、18、19]。从而结合第一节点信息列表,可知,所述节点13、节点11、节点18对应的未进行信息同步的节点为[12、16、17、20]。The first nodes in the third group that are also capable of information synchronization are nodes 13-16 and 19-20, among which, because node 15 is currently in a state of suspending information synchronization, node 13, node 14, node 16, node 19-20 Continue to synchronize information. It is assumed that the nodes selected by the node 13 randomly from the corresponding nodes [11, 12, 16, 17, 18, 20] that have not undergone content update are node 11 and node 18. It can be seen from FIG. 9 that the response messages returned by the node 11 and the node 18 to the node 13 are all R, and the information synchronization is successful this time, and the first node 13 can continue the information synchronization. Among them, when the first node 13 successfully completes the synchronization of the information of the node 11 and the node 18, the node 11 and the node 18 also become the first node, and the second node information list corresponding to the node 13, the node 11, and the node 18 contains The nodes of is [11, 13, 14, 15, 18, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 13, the node 11, and the node 18 that have not undergone information synchronization are [12, 16, 17, 20].
所述节点14从对应的未进行内容更新的节点[11、12、16、17、18、20]中随机选取的节点为节点12和节点17。根据图9可知,所述节点12和节点17返回给所述节点14的response消息都为R,此次信息同步成功,第一节点14可继续进行信息同步。其中,当第一节点14成功完成对节点12和节点17的信息同步后,节点12和节点17也变成第一节点,且节点14、节点12、节点17对应的第二节点信息列表中包含的节点为[12、13、14、15、17、19]。从而结合第一节点信息列表,可知,所述节点14、节点12、节点17对应的未进行信息同步的节点为[11、16、18、20]。The nodes selected by the node 14 randomly from the corresponding nodes [11, 12, 16, 17, 18, 20] that have not undergone content update are node 12 and node 17. It can be seen from FIG. 9 that the response messages returned by the node 12 and the node 17 to the node 14 are all R, and the information synchronization is successful this time, and the first node 14 can continue to perform the information synchronization. Among them, when the first node 14 successfully completes the synchronization of the information of the node 12 and the node 17, the node 12 and the node 17 also become the first node, and the second node information list corresponding to the node 14, the node 12, and the node 17 contains The nodes of is [12, 13, 14, 15, 17, 19]. Therefore, in combination with the first node information list, it can be known that the nodes corresponding to the node 14, the node 12, and the node 17 that have not undergone information synchronization are [11, 16, 18, 20].
同理,第三组中的第一节点16、节点19-20,虽然自身还有对应的未进行内容更新的节点,但是,所述未进行内容更新的节点实际上都已完成信息同步。因此,无论第一节点16、节点19-20在第四轮信息同步过程中选取哪个节点进行信息同步,接收到对应节点发送的response消息都为E,都会终止进行信息同步。In the same way, although the first node 16 and the nodes 19-20 in the third group have corresponding nodes that have not performed content update themselves, all the nodes that have not performed content update have actually completed information synchronization. Therefore, no matter which node the first node 16 and the nodes 19-20 select for information synchronization in the fourth round of information synchronization process, the response message sent by the corresponding node will be E, and the information synchronization will be terminated.
进行第五轮信息同步时,第一组中不存在具有进行信息同步能力的第一节点,因此,第一组完成了信息同步,终止进行信息同步。第三组中仅有节点13和节点14还具有信息同步能力。假设,所述节点13从对应的未进行内容更新的节点[12、16、17、20]中随机选取的节点为节点12和节点17。根据图10可知,所述节点12和所述节点17返回给所述节点13的response消息为E,此次信息同步未成功,第一节点13终止进行信息同步。所述节点14从对应的未进行内容更新的节点[11、16、18、20]中随机选取的节点为节点11和节点20。根据图9可知,所述节点11和所述节点20返回给所述节点14的response消息为E,此次信息同步未成功,第一节点14终止进行信息同步。During the fifth round of information synchronization, there is no first node capable of information synchronization in the first group. Therefore, the first group completes the information synchronization and terminates the information synchronization. Only node 13 and node 14 in the third group also have information synchronization capabilities. It is assumed that the nodes selected by the node 13 randomly from the corresponding nodes [12, 16, 17, 20] that have not undergone content update are node 12 and node 17. It can be seen from FIG. 10 that the response message returned by the node 12 and the node 17 to the node 13 is E, the information synchronization is not successful this time, and the first node 13 terminates the information synchronization. The nodes selected by the node 14 randomly from the corresponding nodes [11, 16, 18, 20] that have not undergone content update are the node 11 and the node 20. It can be seen from FIG. 9 that the response message returned by the node 11 and the node 20 to the node 14 is E, this time the information synchronization is not successful, and the first node 14 terminates the information synchronization.
此时,整个分布式网络系统中第一组和第三组中已没有具有进行信息同步能力的第一节点,第四组中已没有未进行内容更新的节点,因此,整个分布式网络系统终止进行信息 同步。At this time, in the entire distributed network system, there is no first node capable of information synchronization in the first group and the third group, and there is no node in the fourth group that has not updated the content. Therefore, the entire distributed network system is terminated. Synchronize information.
通过上述对本申请方案的介绍,可以理解的是,上述实现各设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。From the above introduction to the solution of the present application, it can be understood that, in order to realize the above functions, the above-mentioned realization devices include hardware structures and/or software modules corresponding to the respective functions. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.
如图11所示,本申请一种信息同步的装置,该装置包括处理器1100、存储器1101和收发机1102;As shown in FIG. 11, an information synchronization device of the present application includes a processor 1100, a memory 1101, and a transceiver 1102;
处理器1100负责管理总线架构和通常的处理,存储器1101可以存储处理器1100在执行操作时所使用的数据。收发机1102用于在处理器1100的控制下接收和发送数据。The processor 1100 is responsible for managing the bus architecture and general processing, and the memory 1101 can store data used by the processor 1100 when performing operations. The transceiver 1102 is used to receive and send data under the control of the processor 1100.
总线架构可以包括任意数量的互联的总线和桥,具体由处理器1100代表的一个或多个处理器和存储器1101代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。处理器1100负责管理总线架构和通常的处理,存储器1101可以存储处理器1100在执行操作时所使用的数据。The bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 1100 and various circuits of the memory represented by the memory 1101 are linked together. The bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further descriptions are provided herein. The bus interface provides the interface. The processor 1100 is responsible for managing the bus architecture and general processing, and the memory 1101 can store data used by the processor 1100 when performing operations.
本发明实施例揭示的流程,可以应用于处理器1100中,或者由处理器1100实现。在实现过程中,信号处理流程的各步骤可以通过处理器1100中的硬件的集成逻辑电路或者软件形式的指令完成。处理器1100可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1101,处理器1100读取存储器1101中的信息,结合其硬件完成信号处理流程的步骤。The process disclosed in the embodiment of the present invention may be applied to the processor 1100 or implemented by the processor 1100. In the implementation process, each step of the signal processing flow can be completed by an integrated logic circuit of hardware in the processor 1100 or instructions in the form of software. The processor 1100 may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the embodiments of the present invention The disclosed methods, steps and logic block diagrams. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 1101, and the processor 1100 reads the information in the memory 1101 and completes the steps of the signal processing flow in combination with its hardware.
具体地,处理器1100,用于读取存储器1101中的程序并执行:Specifically, the processor 1100 is configured to read and execute the program in the memory 1101:
根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息;从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。According to the first node information list and the second node information list, determine the nodes whose information has not been synchronized in the node group where the first node is located; wherein, the first node information list includes all nodes in the node group Node information of a node, the second node information list includes node information of nodes in the node group that have performed information synchronization; at least one second node is selected from the nodes that have not performed information synchronization, and the At least one second node performs information synchronization, and the node information corresponding to the at least one second node is updated to the second node information list.
在一种可能的实现方法中,所述处理器1100具体用于:In a possible implementation method, the processor 1100 is specifically configured to:
将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
在一种可能的实现方法中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation method, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
在一种可能的实现方法中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation method, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
在一种可能的实现方法中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation method, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
在一种可能的实现方法中,所述处理器1100还用于:In a possible implementation method, the processor 1100 is further configured to:
若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或,If it is determined that the second node information list includes all the node information included in the first node information list, the information synchronization is terminated; or,
若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
在一种可能的实现方法中,所述处理器1100还用于:In a possible implementation method, the processor 1100 is further configured to:
若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
如图12所示,本发明提供一种信息同步的装置,该装置包括:As shown in Figure 12, the present invention provides an information synchronization device, which includes:
确定模块1200:用于根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息;The determining module 1200 is configured to determine, according to the first node information list and the second node information list, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node information list contains all Node information of all nodes in the node group, and the second node information list includes node information of nodes in the node group that have performed information synchronization;
处理模块1201:用于从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。The processing module 1201 is configured to select at least one second node from the nodes that have not performed information synchronization, perform information synchronization on the at least one second node, and update node information corresponding to the at least one second node. To the second node information list.
在一种可能的实现方法中,所述处理模块1201具体用于:In a possible implementation method, the processing module 1201 is specifically configured to:
将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
在一种可能的实现方法中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation method, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
在一种可能的实现方法中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation method, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
在一种可能的实现方法中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation method, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
在一种可能的实现方法中,所述处理模块1201还用于:In a possible implementation method, the processing module 1201 is further configured to:
若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或,If it is determined that the second node information list includes all the node information included in the first node information list, the information synchronization is terminated; or,
若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
在一种可能的实现方法中,所述处理模块1201还用于:In a possible implementation method, the processing module 1201 is further configured to:
若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
如图13所示,本发明实施例一种信息同步的装置,该装置包括处理器1300、存储器1301和收发机1302;As shown in FIG. 13, an information synchronization device according to an embodiment of the present invention includes a processor 1300, a memory 1301, and a transceiver 1302;
处理器1300负责管理总线架构和通常的处理,存储器1301可以存储处理器1300在执行操作时所使用的数据。收发机1302用于在处理器1300的控制下接收和发送数据。The processor 1300 is responsible for managing the bus architecture and general processing, and the memory 1301 may store data used by the processor 1300 when performing operations. The transceiver 1302 is used to receive and send data under the control of the processor 1300.
总线架构可以包括任意数量的互联的总线和桥,具体由处理器1300代表的一个或多个处理器和存储器1301代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。处理器1300负责管理总线架构和通常的处理,存储器1301可以存储处理器1300在执行操作时所使用的数据。The bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 1300 and various circuits of the memory represented by the memory 1301 are linked together. The bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further descriptions are provided herein. The bus interface provides the interface. The processor 1300 is responsible for managing the bus architecture and general processing, and the memory 1301 may store data used by the processor 1300 when performing operations.
本发明实施例揭示的流程,可以应用于处理器1300中,或者由处理器1300实现。在实现过程中,信号处理流程的各步骤可以通过处理器1300中的硬件的集成逻辑电路或者软件形式的指令完成。处理器1300可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1301,处理器1300读取存储器1301中的信息,结合其硬件完成信号处理流程的步骤。The process disclosed in the embodiment of the present invention may be applied to the processor 1300 or implemented by the processor 1300. In the implementation process, each step of the signal processing flow can be completed by an integrated logic circuit of hardware in the processor 1300 or instructions in the form of software. The processor 1300 may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the embodiments of the present invention The disclosed methods, steps and logic block diagrams. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 1301, and the processor 1300 reads the information in the memory 1301, and completes the steps of the signal processing flow in combination with its hardware.
具体地,处理器1300,用于读取存储器1301中的程序并执行:Specifically, the processor 1300 is configured to read a program in the memory 1301 and execute:
根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述第一节点学习到的已进行信息同步的节点的节点信息;从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中;According to the first node information list and the second node information list maintained by itself, determine the nodes whose information has not been synchronized in the node group where the first node is located; wherein, the first node information list includes the node group The node information of all nodes in the group, the second node information list contains the node information of the nodes that have been information synchronized learned by the first node; at least one second node is selected from the nodes that have not been information synchronized Node, performing information synchronization on the at least one second node, and updating node information corresponding to the at least one second node to the second node information list;
收发机1302,用于执行:将更新后的第二节点信息列表发送给成功完成信息同步的第二节点,以使所述成功完成信息同步的第二节点,根据接收到的所述第二节点信息列表更新自身对应的第二节点信息列表。The transceiver 1302 is configured to execute: sending the updated second node information list to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node The information list updates the second node information list corresponding to itself.
在一种可能的实现方法中,所述处理器1300具体用于:In a possible implementation method, the processor 1300 is specifically configured to:
将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
在一种可能的实现方法中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation method, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
在一种可能的实现方法中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation method, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
在一种可能的实现方法中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation method, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
在一种可能的实现方法中,所述处理器1300还用于:In a possible implementation method, the processor 1300 is further configured to:
若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或,If it is determined that the second node information list includes all the node information included in the first node information list, the information synchronization is terminated; or,
若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
在一种可能的实现方法中,所述处理器1300还用于:In a possible implementation method, the processor 1300 is further configured to:
若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
如图14所示,本发明提供一种信息同步的装置,该装置包括:As shown in Fig. 14, the present invention provides an information synchronization device, which includes:
确定模块1400:用于根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述第一节点学习到的已进行信息同步的节点的节点信息;Determining module 1400: used to determine, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node information list Includes node information of all nodes in the node group, and the second node information list includes node information of nodes that have been information synchronized learned by the first node;
处理模块1401:用于从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中;Processing module 1401: configured to select at least one second node from the nodes that have not performed information synchronization, perform information synchronization on the at least one second node, and update node information corresponding to the at least one second node respectively To the second node information list;
发送模块1402:用于将更新后的第二节点信息列表发送给成功完成信息同步的第二节点,以使所述成功完成信息同步的第二节点,根据接收到的所述第二节点信息列表更新自身对应的第二节点信息列表。Sending module 1402: used to send the updated second node information list to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization, according to the received second node information list Update the second node information list corresponding to itself.
在一种可能的实现方法中,所述处理模块1401具体用于:In a possible implementation method, the processing module 1401 is specifically configured to:
将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
在一种可能的实现方法中,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。In a possible implementation method, the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system.
在一种可能的实现方法中,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。In a possible implementation method, the variance between the number of nodes included in each node group and the average value of the number of nodes is a minimum value, where the average number of nodes is the sum of the number of all nodes in the network system The quotient of the number of node groups to be divided is preset.
在一种可能的实现方法中,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。In a possible implementation method, if all nodes in the network system are grouped to obtain N node groups, the number of nodes in 1 to N-1 node groups is equal, and the Nth node group The number of nodes in is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
在一种可能的实现方法中,所述处理模块1401还用于:In a possible implementation method, the processing module 1401 is further configured to:
若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或,If it is determined that the second node information list includes all the node information included in the first node information list, the information synchronization is terminated; or,
若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
在一种可能的实现方法中,所述处理模块1401还用于:In a possible implementation method, the processing module 1401 is further configured to:
若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
在一些可能的实施方式中,本发明实施例提供的信息同步的方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序代码在计算机设备上运行时,所述程序代码用于使所述计算机设备执行本说明书中描述的根据本发明各种示例性实施方式的配置参数的方法中的步骤。In some possible implementation manners, various aspects of the information synchronization method provided by the embodiments of the present invention can also be implemented in the form of a program product, which includes program code. When the program code runs on a computer device, The program code is used to make the computer device execute the steps in the method for configuring parameters according to various exemplary embodiments of the present invention described in this specification.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product can use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
根据本发明的实施方式的用于配置参数的程序产品,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在服务器设备上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被信息传输、装置或者器件使用或者与其结合使用。The program product for configuring parameters according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program codes, and may run on a server device. However, the program product of the present invention is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an information transmission, device, or device.
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由周期网络动作系统、装置或者器件使用或者与其结合使用的程序。The readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with a periodic network action system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、RF等,或者上述的任意合适的组合。The program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算设备,或者,可以连接到外部计算设备。The program code used to perform the operations of the present invention can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural styles. Programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on. In the case of a remote computing device, the remote computing device may be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device.
本申请实施例针对信息同步的方法还提供一种计算设备可读存储介质,即断电后内容不丢失。该存储介质中存储软件程序,包括程序代码,当所述程序代码在计算设备上运行时,该软件程序在被一个或多个处理器读取并执行时可实现本申请实施例上面任何一种信息同步的方案。The embodiment of the present application also provides a computing device readable storage medium for the information synchronization method, that is, the content is not lost after power failure. The storage medium stores a software program, including program code, and when the program code runs on a computing device, the software program can implement any of the above embodiments of the present application when it is read and executed by one or more processors Information synchronization scheme.
以上参照示出根据本申请实施例的方法、装置(系统)和/或计算机程序产品的框图和/或流程图描述本申请。应理解,可以通过计算机程序指令来实现框图和/或流程图示图的一个块以及框图和/或流程图示图的块的组合。可以将这些计算机程序指令提供给通用计算机、专用计算机的处理器和/或其它可编程数据处理装置,以产生机器,使得经由计算机处理器和/或其它可编程数据处理装置执行的指令创建用于实现框图和/或流程图块中所指定的功能/动作的方法。The foregoing describes the present application with reference to block diagrams and/or flowcharts showing methods, devices (systems) and/or computer program products according to embodiments of the present application. It should be understood that one block of the block diagram and/or flowchart diagram and a combination of the blocks in the block diagram and/or flowchart diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, and/or other programmable data processing devices to produce a machine, so that the instructions executed via the computer processor and/or other programmable data processing devices are created for A method of implementing the functions/actions specified in the block diagram and/or flowchart block.
相应地,还可以用硬件和/或软件(包括固件、驻留软件、微码等)来实施本申请。更 进一步地,本申请可以采取计算机可使用或计算机可读存储介质上的计算机程序产品的形式,其具有在介质中实现的计算机可使用或计算机可读程序代码,以由指令执行系统来使用或结合指令执行系统而使用。在本申请上下文中,计算机可使用或计算机可读介质可以是任意介质,其可以包含、存储、通信、传输、或传送程序,以由指令执行系统、装置或设备使用,或结合指令执行系统、装置或设备使用。Correspondingly, hardware and/or software (including firmware, resident software, microcode, etc.) can also be used to implement this application. Furthermore, this application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium to be used by the instruction execution system or Used in conjunction with the instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or transmit a program for use by an instruction execution system, device, or device, or in combination with an instruction execution system, Device or equipment use.
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包括这些改动和变型在内。Although the application has been described in combination with specific features and embodiments, it is obvious that various modifications and combinations can be made without departing from the spirit and scope of the application. Accordingly, this specification and drawings are merely exemplary descriptions of the application defined by the appended claims, and are deemed to have covered any and all modifications, changes, combinations or equivalents within the scope of the application. Obviously, those skilled in the art can make various changes and modifications to the application without departing from the scope of the application. In this way, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims (30)

  1. 一种信息同步的方法,其特征在于,包括:A method for information synchronization, characterized in that it includes:
    具有信息同步能力的第一节点根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息;The first node with information synchronization capability determines, according to the first node information list and the second node information list, nodes in the node group where the first node is not performing information synchronization; wherein, in the first node information list Includes node information of all nodes in the node group, and the second node information list includes node information of nodes in the node group that have performed information synchronization;
    所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。The first node selects at least one second node from the nodes that have not performed information synchronization, performs information synchronization on the at least one second node, and updates the node information corresponding to the at least one second node to In the second node information list.
  2. 如权利要求1所述的方法,其特征在于,所述第一节点根据所述第一节点信息列表和第二节点信息列表,确定未进行信息同步的节点,包括:The method according to claim 1, wherein the first node determines the nodes that have not performed information synchronization according to the first node information list and the second node information list, comprising:
    所述第一节点将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The first node determines the node corresponding to the node information included in the first node information list and not included in the second node information list as a node that has not undergone information synchronization.
  3. 如权利要求1所述的方法,其特征在于,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。The method of claim 1, wherein the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system group.
  4. 如权利要求3所述的方法,其特征在于,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。The method according to claim 3, wherein the variance between the number of nodes included in each of the node groups and the average value of the number of nodes is a minimum value, wherein the average value of the number of nodes is the value in the network system The quotient of the number of all nodes and the preset number of node groups to be divided.
  5. 如权利要求3所述的方法,其特征在于,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。The method of claim 3, wherein if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node groups The number of nodes in each node group is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  6. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:
    若所述第一节点在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或If the first node determines that the second node information list includes all the node information included in the first node information list, it terminates information synchronization; or
    若所述第一节点在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If the first node receives a response that any one of the second nodes feedbacks information synchronization failure, the information synchronization is terminated.
  7. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:
    若所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则所述第一节点连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If the first node selects at least one second node from the nodes that have not performed information synchronization as a round of selection operation, the number of consecutive rounds of the selection operation performed by the first node reaches the first threshold, and the operation is suspended Information synchronization operation;
    所述第一节点在暂停预设时长后恢复信息同步操作;The first node resumes the information synchronization operation after pausing for a preset period of time;
    其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  8. 一种信息同步的方法,其特征在于,包括:A method for information synchronization, characterized in that it includes:
    具有信息同步能力的第一节点根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述第一节点学习到的已进行信息同步的节点的节点信息;The first node with information synchronization capability determines, according to the first node information list and the second node information list maintained by itself, the nodes in the node group where the first node is not performing information synchronization; wherein, the first node The information list includes node information of all nodes in the node group, and the second node information list includes node information of nodes that have been information synchronized learned by the first node;
    所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点,对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第 二节点信息列表中;The first node selects at least one second node from the nodes that have not performed information synchronization, performs information synchronization on the at least one second node, and updates the node information corresponding to the at least one second node to In the second node information list;
    所述第一节点将更新后的第二节点信息列表发送给成功完成信息同步的第二节点,以使所述成功完成信息同步的第二节点,根据接收到的所述第二节点信息列表更新自身维护的第二节点信息列表。The first node sends the updated second node information list to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization updates according to the received second node information list The second node information list maintained by itself.
  9. 如权利要求8所述的方法,其特征在于,所述第一节点根据第一节点信息列表和自身维护的第二节点信息列表,确定未进行信息同步的节点,包括:The method according to claim 8, wherein the first node determines the nodes that have not synchronized information according to the first node information list and the second node information list maintained by the first node, comprising:
    所述第一节点将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The first node determines the node corresponding to the node information included in the first node information list and not included in the second node information list as a node that has not undergone information synchronization.
  10. 如权利要求8所述的方法,其特征在于,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。The method of claim 8, wherein the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system group.
  11. 如权利要求10所述的方法,其特征在于,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。The method according to claim 10, wherein the variance between the number of nodes contained in each of the node groups and the average value of the number of nodes is a minimum value, wherein the average value of the number of nodes is the value in the network system The quotient of the number of all nodes and the preset number of node groups to be divided.
  12. 如权利要求10所述的方法,其特征在于,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。The method of claim 10, wherein if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node groups The number of nodes in each node group is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  13. 如权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, wherein the method further comprises:
    若所述第一节点在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或If the first node determines that the second node information list includes all the node information included in the first node information list, it terminates information synchronization; or
    若所述第一节点在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If the first node receives a response that any one of the second nodes feedbacks that the information synchronization fails, the information synchronization is terminated.
  14. 如权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, wherein the method further comprises:
    若所述第一节点从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则所述第一节点连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If the first node selects at least one second node from the nodes that have not performed information synchronization as a round of selection operation, the number of consecutive rounds of the selection operation performed by the first node reaches the first threshold, and the operation is suspended Information synchronization operation;
    所述第一节点在暂停预设时长后恢复信息同步操作;The first node resumes the information synchronization operation after pausing for a preset period of time;
    其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  15. 一种信息同步的装置,其特征在于,包括:处理单元和通信单元;An information synchronization device, which is characterized by comprising: a processing unit and a communication unit;
    所述处理单元,用于根据第一节点信息列表和第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述节点群组中已进行信息同步的节点的节点信息;以及The processing unit is configured to determine, according to a first node information list and a second node information list, nodes in the node group where the first node is located that have not undergone information synchronization; wherein, the first node information list includes Node information of all nodes in the node group, and the second node information list includes node information of nodes in the node group that have performed information synchronization; and
    从所述未进行信息同步的节点中选取至少一个第二节点,通过所述通信单元对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中。Select at least one second node from the nodes for which information has not been synchronized, perform information synchronization on the at least one second node through the communication unit, and update the node information corresponding to the at least one second node to In the second node information list.
  16. 如权利要求15所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 15, wherein the processing unit is specifically configured to:
    将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  17. 如权利要求15所述的装置,其特征在于,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。The apparatus of claim 15, wherein the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system group.
  18. 如权利要求17所述的装置,其特征在于,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。The device according to claim 17, wherein the variance between the number of nodes contained in each of the node groups and the average value of the number of nodes is a minimum value, wherein the average value of the number of nodes is the value in the network system The quotient of the number of all nodes and the preset number of node groups to be divided.
  19. 如权利要求17所述的装置,其特征在于,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。The apparatus of claim 17, wherein if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node groups The number of nodes in each node group is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  20. 如权利要求15所述的装置,其特征在于,所述处理单元还用于:The device according to claim 15, wherein the processing unit is further configured to:
    若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或If it is determined that the second node information list includes all the node information included in the first node information list, terminate the information synchronization; or
    若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
  21. 如权利要求15所述的装置,其特征在于,所述处理单元还用于:The device according to claim 15, wherein the processing unit is further configured to:
    若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
    在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
    其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  22. 一种信息同步的装置,其特征在于,包括:处理单元和通信单元;An information synchronization device, which is characterized by comprising: a processing unit and a communication unit;
    所述处理单元,用于根据第一节点信息列表和自身维护的第二节点信息列表,确定所述第一节点所在的节点群组中未进行信息同步的节点;其中,所述第一节点信息列表中包含所述节点群组中所有节点的节点信息,所述第二节点信息列表中包含所述第一节点学习到的已进行信息同步的节点的节点信息;The processing unit is configured to determine, according to a first node information list and a second node information list maintained by itself, a node in the node group where the first node is not performing information synchronization; wherein, the first node information The list includes node information of all nodes in the node group, and the second node information list includes node information of nodes that have been information synchronized learned by the first node;
    从所述未进行信息同步的节点中选取至少一个第二节点,通过所述通信单元对所述至少一个第二节点进行信息同步,并将所述至少一个第二节点分别对应的节点信息更新到所述第二节点信息列表中;以及Select at least one second node from the nodes for which information has not been synchronized, perform information synchronization on the at least one second node through the communication unit, and update the node information corresponding to the at least one second node to In the second node information list; and
    通过所述通信单元将更新后的第二节点信息列表发送给成功完成信息同步的第二节点,以使所述成功完成信息同步的第二节点,根据接收到的所述第二节点信息列表更新自身维护的第二节点信息列表。The updated second node information list is sent through the communication unit to the second node that successfully completes the information synchronization, so that the second node that successfully completes the information synchronization is updated according to the received second node information list The second node information list maintained by itself.
  23. 如权利要求22所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 22, wherein the processing unit is specifically configured to:
    将包含在所述第一节点信息列表中、且不包含在所述第二节点信息列表中的节点信息对应的节点,确定为未进行信息同步的节点。The node corresponding to the node information included in the first node information list but not included in the second node information list is determined as a node that has not undergone information synchronization.
  24. 如权利要求22所述的装置,其特征在于,所述节点群组包含网络系统中所有的节点;或所述节点群组为对所述网络系统中所有的节点进行分组后得到的一个节点群组。The apparatus of claim 22, wherein the node group includes all nodes in the network system; or the node group is a node group obtained by grouping all the nodes in the network system group.
  25. 如权利要求24所述的装置,其特征在于,每个所述节点群组中包含的节点数量与节点数量平均值的方差为最小值,其中,所述节点数量平均值为所述网络系统中所有节点数量与预设需要划分的节点群组数的商值。The device of claim 24, wherein the variance between the number of nodes included in each of the node groups and the average value of the number of nodes is a minimum value, wherein the average value of the number of nodes is the value in the network system The quotient of the number of all nodes and the preset number of node groups to be divided.
  26. 如权利要求24所述的装置,其特征在于,若所述网络系统中的所有节点进行分组后得到N个节点群组,则1至N-1个节点群组中的节点数量相等,第N个节点群组中的节点数量小于等于第1至N-1个节点群组中任意一个节点群组包含的节点数量。The apparatus according to claim 24, wherein if all nodes in the network system are grouped to obtain N node groups, the number of nodes in the 1 to N-1 node groups is equal, and the Nth node groups The number of nodes in each node group is less than or equal to the number of nodes included in any one of the first to N-1 node groups.
  27. 如权利要求22所述的装置,其特征在于,所述处理单元还用于:The device according to claim 22, wherein the processing unit is further configured to:
    若在确定所述第二节点信息列表包含所述第一节点信息列表包含的所有节点信息时,则终止进行信息同步;或If it is determined that the second node information list includes all the node information included in the first node information list, terminate the information synchronization; or
    若在接收到任意一个所述第二节点反馈信息同步失败的响应时,则终止进行信息同步。If any one of the second nodes feedback information synchronization failure response, the information synchronization is terminated.
  28. 如权利要求22所述的装置,其特征在于,所述处理单元还用于:The device according to claim 22, wherein the processing unit is further configured to:
    若从所述未进行信息同步的节点中选取至少一个第二节点作为一轮选取操作,则连续进行所述选取操作的轮数达到第一阈值,暂停进行信息同步操作;If at least one second node is selected from the nodes for which information has not been synchronized as a round of selection operation, the number of consecutive rounds of the selection operation reaches the first threshold, and the information synchronization operation is suspended;
    在暂停预设时长后恢复信息同步操作;Resume information synchronization operation after pausing for a preset period of time;
    其中,所述预设时长是根据所述第一节点累计进行所述选取操作的轮数确定的。Wherein, the preset duration is determined according to the cumulative number of rounds of the selection operation performed by the first node.
  29. 一种装置,其特征在于,包括:处理器、通信接口和存储器;A device, characterized by comprising: a processor, a communication interface and a memory;
    所述存储器,用于存储程序指令;The memory is used to store program instructions;
    所述处理器,用于通过调用所述存储器存储的程序指令,通过所述通信接口执行如权利要求1至7中任一项所述的方法;或执行如权利要求8~14中任一项所述的方法。The processor is configured to execute the method according to any one of claims 1 to 7 through the communication interface by calling the program instructions stored in the memory; or execute any one of claims 8 to 14 The method described.
  30. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如权利要求1至7中任一项所述的方法;或执行如权利要求8~14中任一项所述的方法。A computer-readable storage medium, characterized in that, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer execute any one of claims 1 to 7 Method; or implement the method according to any one of claims 8-14.
PCT/CN2020/076858 2019-05-21 2020-02-26 Information synchronization method and device WO2020233185A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/136,270 US11165864B2 (en) 2019-05-21 2020-12-29 Information synchronization method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910425422.6A CN111988345B (en) 2019-05-21 2019-05-21 Information synchronization method and device
CN201910425422.6 2019-05-21

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/136,270 Continuation US11165864B2 (en) 2019-05-21 2020-12-29 Information synchronization method and apparatus

Publications (1)

Publication Number Publication Date
WO2020233185A1 true WO2020233185A1 (en) 2020-11-26

Family

ID=73436964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/076858 WO2020233185A1 (en) 2019-05-21 2020-02-26 Information synchronization method and device

Country Status (3)

Country Link
US (1) US11165864B2 (en)
CN (1) CN111988345B (en)
WO (1) WO2020233185A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800071A (en) * 2020-08-24 2021-05-14 支付宝(杭州)信息技术有限公司 Service processing method, device, equipment and storage medium based on block chain
CN113259118B (en) * 2021-06-02 2021-09-24 支付宝(杭州)信息技术有限公司 Method for synchronizing node information lists
CN115794947A (en) * 2022-11-29 2023-03-14 蚂蚁财富(上海)金融信息服务有限公司 Data synchronization method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404387A (en) * 2011-10-25 2012-04-04 上海聚力传媒技术有限公司 Method, device and equipment for information synchronization with other nodes
US20120209808A1 (en) * 2011-02-11 2012-08-16 Chienwen Tien Method and apparatus for peer-to-peer database synchronization in dynamic networks
CN105740248A (en) * 2014-12-09 2016-07-06 华为软件技术有限公司 Data synchronization method, apparatus and system
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457257B2 (en) 2005-11-17 2008-11-25 International Business Machines Corporation Apparatus, system, and method for reliable, fast, and scalable multicast message delivery in service overlay networks
US8965954B2 (en) * 2008-10-21 2015-02-24 Google Inc. Always ready client/server data synchronization
CN102955816B (en) * 2011-08-30 2016-04-20 国际商业机器公司 String matching is utilized to carry out the method and system of data syn-chronization
CN103577382B (en) * 2013-10-24 2017-01-04 华为技术有限公司 Method and device for configuring node controller
CN103648083A (en) 2013-12-27 2014-03-19 哈尔滨工业大学 Distributed average-consensus broadcast Gossip wireless communication method
EP3599558B1 (en) * 2015-11-24 2022-12-21 T2 Data AB Data synchronization in a distributed data storage system
US10719188B2 (en) * 2016-07-21 2020-07-21 Palantir Technologies Inc. Cached database and synchronization system for providing dynamic linked panels in user interface
CN109274754B (en) * 2018-10-11 2021-05-04 上海保险交易所股份有限公司 Method, apparatus, and storage medium for synchronizing data in a blockchain network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120209808A1 (en) * 2011-02-11 2012-08-16 Chienwen Tien Method and apparatus for peer-to-peer database synchronization in dynamic networks
CN102404387A (en) * 2011-10-25 2012-04-04 上海聚力传媒技术有限公司 Method, device and equipment for information synchronization with other nodes
CN105740248A (en) * 2014-12-09 2016-07-06 华为软件技术有限公司 Data synchronization method, apparatus and system
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization

Also Published As

Publication number Publication date
CN111988345A (en) 2020-11-24
CN111988345B (en) 2021-12-03
US20210120085A1 (en) 2021-04-22
US11165864B2 (en) 2021-11-02

Similar Documents

Publication Publication Date Title
WO2020233185A1 (en) Information synchronization method and device
JP7333449B2 (en) Flow Control for Probabilistic Relays in Blockchain Networks
WO2020119523A1 (en) Network channel switching method and apparatus, device, and storage medium
CN113364638B (en) Method, electronic device and storage medium for EPA networking
CN110913501A (en) Consensus method suitable for wireless block chain network
JP6265058B2 (en) Network transmission system, its master node, slave node
CN109792406B (en) Message transmission method, device and storage medium in server cluster
Liu et al. Minimizing age-of-information with throughput requirements in multi-path network communication
WO2020238989A1 (en) Method and apparatus for scheduling task processing entity
CN110324166B (en) Method, device and system for synchronizing target information in multiple nodes
CN109361625B (en) Method, device and controller for checking forwarding table item
WO2021143026A1 (en) Flow table updating method, apparatus and system, computer device, and storage medium
CN110149221B (en) Self-adaptive network construction method and device based on alliance chain
KR102403476B1 (en) Distributed Deep Learning System and Its Operation Method
CN109496407B (en) Message transmission method, device and storage medium in block chain system
CN111008249A (en) Parallel chain block synchronization method, device and storage medium
WO2024103712A1 (en) Signal scanning method and apparatus, electronic device, and storage medium
US11700189B2 (en) Method for performing task processing on common service entity, common service entity, apparatus and medium for task processing
CN110620811B (en) ONU management method and system under vOLT cluster architecture
CN116566712A (en) Internet of things block chain consensus method based on trust score
Chlebus et al. Energy efficient adversarial routing in shared channels
CN110888892A (en) Block synchronization method, device and storage medium
CN114827159B (en) Network request path optimization method, device, equipment and storage medium
JP2007272540A (en) Data distributing method and data distributing system
CN111190733B (en) Computing resource scheduling method and device for RSA computation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20810282

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20810282

Country of ref document: EP

Kind code of ref document: A1