WO2021008285A1 - 分布式系统的数据同步方法、装置、介质、电子设备 - Google Patents

分布式系统的数据同步方法、装置、介质、电子设备 Download PDF

Info

Publication number
WO2021008285A1
WO2021008285A1 PCT/CN2020/096119 CN2020096119W WO2021008285A1 WO 2021008285 A1 WO2021008285 A1 WO 2021008285A1 CN 2020096119 W CN2020096119 W CN 2020096119W WO 2021008285 A1 WO2021008285 A1 WO 2021008285A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
target
data
adjacent
weight value
Prior art date
Application number
PCT/CN2020/096119
Other languages
English (en)
French (fr)
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 腾讯科技(深圳)有限公司
Priority to KR1020217008399A priority Critical patent/KR102476531B1/ko
Priority to JP2021514604A priority patent/JP7214295B2/ja
Priority to SG11202101244WA priority patent/SG11202101244WA/en
Priority to US17/154,745 priority patent/US11645303B2/en
Publication of WO2021008285A1 publication Critical patent/WO2021008285A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0866Checking the configuration
    • H04L41/0869Validating the configuration within one network element
    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • 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/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • 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]

Definitions

  • This application relates to the field of computer technology, in particular, to a data synchronization method, device, medium and electronic equipment of a distributed system.
  • a distributed system is a system composed of a group of computer nodes that communicate through a network and coordinate work in order to complete common tasks.
  • each node is used to calculate or store data, and in a distributed system, it may be necessary to synchronize data between nodes. For example, in a blockchain system, when there is a new block When a chain node joins, it needs to synchronize data from other blockchain nodes.
  • the purpose of this application is to provide a data synchronization method and device, computer readable storage medium, and electronic equipment for a distributed system, so as to at least shorten the time for data synchronization in the distributed system and improve synchronization efficiency.
  • a data synchronization method of a distributed system includes:
  • a target neighboring node for synchronizing data to the target node is selected, so as to synchronize the target data in the target neighboring node to the target node.
  • a data synchronization device for a distributed system, including: an acquisition module configured to acquire historical data synchronization information of adjacent nodes connected to a target node; and a determining module configured to The historical data synchronization information determines the selection weight value of the adjacent node, and the selection weight value is used to measure the efficiency of the adjacent node to synchronize data to the target node; the selection module is set to be based on the adjacent node The weight value is selected to select a target adjacent node for synchronizing data to the target node; a synchronization module is configured to synchronize the target data in the target adjacent node to the target node.
  • a computer-readable storage medium on which a computer program is stored.
  • the computer program includes executable instructions.
  • the executable instructions are executed by a processor, the implementation is as described in the above-mentioned embodiments.
  • the data synchronization method of the distributed system described in.
  • an electronic device including: one or more processors; a memory, configured to store executable instructions of the processor, when the executable instructions are executed by the one or more When multiple processors execute, the one or more processors implement the data synchronization method of the distributed system as described in the foregoing embodiment.
  • Fig. 1 is a schematic diagram of an application scenario of a data synchronization method for a distributed system according to an embodiment of the present application
  • Fig. 2 is a flow chart showing data synchronization of a distributed system according to an embodiment of the present application
  • FIG. 3 is a detailed flowchart of step 210 shown in FIG. 2 according to an embodiment of the present application;
  • FIG. 4 is a detailed flowchart of step 220 shown in FIG. 2 according to an embodiment of the present application;
  • Fig. 5 is a detailed flowchart of step 230 shown in Fig. 2 according to an embodiment of the present application;
  • Fig. 6 is a detailed flowchart of block header data synchronization according to an embodiment of the present application.
  • FIG. 7 is a detailed flowchart of complete block data synchronization according to an embodiment of the present application.
  • Fig. 8 is a block diagram of a data synchronization device of a distributed system according to an embodiment of the present application.
  • Fig. 9 is a computer-readable storage medium for implementing the foregoing method according to an embodiment of the present application.
  • Fig. 10 is a block diagram showing an example of an electronic device implementing the foregoing method according to an embodiment of the present application.
  • the present application provides a data synchronization method, device, medium, and electronic equipment of a distributed system, which can solve the above-mentioned technical problems of slow data synchronization and low data synchronization efficiency of nodes in the distributed system.
  • Figure 1 shows a schematic diagram of an application scenario of a data synchronization method in a distributed system.
  • the scene 100 is a part of the distributed system, where the electronic devices 101, 102, 103, 104 and 105 are respectively a node in the distributed system, and the electronic devices can be smart phones or tablet computers.
  • Portable mobile devices such as laptops, laptops, etc. can also be fixed devices such as computer equipment, field terminals, desktop computers, servers, and workstations.
  • the implementation environment of this application can be any node in the entire distributed system.
  • the smart phone 101 can be used as the target node for data synchronization, and the desktop computer 102, the notebook computer 103, the tablet computer 104, and the workstation 105 will be the adjacent nodes of the smart phone 101.
  • the smart phone 101 in the process of data synchronization, the smart phone 101 will first simultaneously obtain the historical data synchronization information with the desktop computer 102, the notebook computer 103, the tablet computer 104, and the workstation 105 at the same time.
  • the historical data synchronization information determines the selection weight value used to measure the efficiency of the neighboring node to synchronize data with the smart phone 101, and finally selects the target neighboring node for synchronizing data to the smart phone 101 according to the selection weight value , And complete the data synchronization process.
  • data transmission between nodes in the distributed system can be realized through a communication connection (for example, a wired communication network connection or a wireless communication network connection).
  • a communication connection for example, a wired communication network connection or a wireless communication network connection.
  • a data synchronization method of a distributed system is provided.
  • the execution subject of the data synchronization method may be a node included in the distributed system that needs to perform data synchronization, such as an electronic device that acts as any node.
  • the data synchronization method may include the following steps:
  • Step 210 Obtain historical data synchronization information of adjacent nodes connected to the target node.
  • Step 220 Determine a selection weight value of the adjacent node according to the historical data synchronization information, where the selection weight value is used to measure the efficiency of the adjacent node to synchronize data with the target node.
  • Step 230 Select a target neighbor node for synchronizing data with the target node according to the selection weight value of the neighbor node, so as to synchronize the target data in the target neighbor node to the target node.
  • step 210 Acquire historical data synchronization information of adjacent nodes connected to the target node.
  • the target node refers to a node that needs to perform data synchronization in a distributed system, for example, any node in a blockchain system.
  • the adjacent nodes refer to other nodes connected to the target node in the distributed system.
  • the process of obtaining historical data synchronization information of adjacent nodes connected to the target node in step 210 can be completed in the manner shown in FIG. 3, and specifically includes the following steps:
  • Step 2101 Detect whether each adjacent node connected to the target node has target data that needs to be synchronized with the target node, and obtain candidate adjacent nodes that need to synchronize the target data with the target node.
  • the distributed system may include a blockchain system
  • the target data may include block data.
  • the blockchain system is a type of distributed system, and its main function is to store data. Any data that needs to be saved can be written to or read from the blockchain.
  • the data in the blockchain mainly exists in the form of blocks, that is, a block is the basic unit of the entire blockchain data.
  • a block includes a block header and a block body.
  • the block header records the current The characteristic value data of the block, such as the current time, the height of the block header, the hash of the previous block, and the hash of the block body, etc.
  • the block body records the actual data that needs to be saved.
  • the blocks in the blockchain are connected in a strict order in one direction to form a data chain. In the blockchain system, a block will be generated at regular intervals. The new block generated is connected to the previous block.
  • the blockchain data will be continuously updated.
  • the newly added node needs to synchronize the block data in the blockchain system, and as the blockchain data is continuously updated, Each node in the blockchain system also needs to continuously update block data.
  • each block data is unique. Therefore, the identity of each block data can be identified by the height of the block header or the hash value in the block header.
  • the height of the block header gradually increases with the continuous update of the block, that is, each time a block is generated, the block header height of the new block generated will increase by one. Based on this, this application uses the block header height to detect whether each adjacent node connected to the target node in the blockchain system has data that needs to be synchronized with the target node.
  • the first block header height of the blockchain ledger in the target node and the second block header height of the blockchain ledger in the adjacent node connected to the target node are obtained respectively, and the first block header height is compared with the second block header height.
  • the height of the block header If the height of the second block header is greater than the height of the first block header, it indicates that there is block data that needs to be synchronized with the target node in the adjacent nodes connected to the target node.
  • the data that needs to be synchronized with the target node can be obtained.
  • Candidate neighbor nodes for the target node to synchronize data The advantage of this is that only the selection weight value of the candidate adjacent nodes is determined, and the target adjacent node is selected from the candidate adjacent nodes, which can filter out some adjacent nodes without data synchronization prospects, thereby reducing the acquisition of some unnecessary historical data Synchronizing information reduces the storage and calculation pressure of the system, and also improves the utilization rate of the historical data synchronization information.
  • Step 2102 Obtain historical data synchronization information of the candidate neighboring node.
  • the advantage of obtaining candidate adjacent nodes that need to synchronize data with the target node is that Before acquiring the historical data synchronization information of the adjacent node, it is possible to further determine that all adjacent nodes have data by detecting whether each adjacent node connected to the target node has data that needs to be synchronized with the target node. Candidate neighboring nodes of the synchronization foreground.
  • the advantage of doing so is that it can filter out some neighboring nodes that do not have a data synchronization foreground, thereby reducing the acquisition of some unnecessary historical data synchronization information, reducing the storage and calculation pressure of the system, and improving the overall performance.
  • the utilization of historical data synchronization information is that it can filter out some neighboring nodes that do not have a data synchronization foreground, thereby reducing the acquisition of some unnecessary historical data synchronization information, reducing the storage and calculation pressure of the system, and improving the overall performance.
  • step 220 Determine the selection weight value of the adjacent node according to the historical data synchronization information, where the selection weight value is used to measure the efficiency of the adjacent node to synchronize data with the target node.
  • the historical data synchronization information may include the number of errors in the historical data synchronization process between the target node and the adjacent node.
  • the historical data synchronization information determines the number of errors of the adjacent node.
  • Step 2201 Detect adjacent nodes whose number of errors does not exceed the threshold of the number of errors.
  • the number of errors refers to the number of errors in the historical data synchronization process between the target node and the adjacent node.
  • node synchronization failure when data is synchronized between nodes in a distributed system, due to the failure of the node itself or the failure of the data transmission network, it is inevitable that node synchronization failure will occur, such as data synchronization request timeout, data Abnormalities occurred during the synchronization download process, and node access failures, etc.
  • the adjacent nodes connected to the target node can be filtered, that is, the adjacent nodes with the number of errors exceeding a certain number are filtered, and the number of errors does not exceed a certain number.
  • a certain number of adjacent nodes are retained, and the retained adjacent node is finally used as a candidate for subsequent target adjacent node determination.
  • the number of errors can be set according to actual conditions, for example, set to 3 times. If adjacent node 1, adjacent node 2, adjacent node 3, and adjacent node 4 have 4, 3, 1 and 0 errors in the process of synchronizing data in history, respectively, the adjacent node that is finally retained can be These are the adjacent node 2, the adjacent node 3, and the adjacent node 4.
  • Step 2202 Determine, according to the historical data synchronization information, a selection weight value of an adjacent node whose number of errors does not exceed the threshold of the number of errors.
  • the success rate of data synchronization in the subsequent synchronization process can be improved.
  • the burden of calculating the selected weight value by the system can be reduced, thereby reducing the calculation pressure of the system and improving the efficiency of data synchronization.
  • the historical data synchronization information may include historical data transmission speed, and the determination of the selection weight value of the adjacent node according to the historical data synchronization information may calculate the adjacent node's Select weight value:
  • W i represents the selection weight value of the i-th adjacent node
  • j represents the data synchronization between the target node and the i-th adjacent node for the jth time in history
  • m represents the m-th in the history of the target node and the i-th adjacent node Data synchronization
  • n represents the number of data synchronization between the target node and the i-th adjacent node in the last n times in history
  • S j represents the data synchronization process between the target node and the i-th adjacent node in the jth time in history Historical data transmission speed.
  • the historical data transmission speed may refer to the ratio of the size of the target data transmitted in the historical data synchronization process to the data transmission time
  • the data transmission time may refer to the target node after the target node has completely received the The difference between the time when the target data is time and the time when the target neighboring node is requested to download the target data. For example, during a certain data synchronization process, the time when the target node requests the target neighboring node to download the target data is at 12:00 on July 1, 2019, and the time when the target node completely receives the target data is At 12: 00: 03 on July 1, 2019, the data transmission time is 3.00 seconds. If the size of the target data is 30 Mb, the historical data transmission speed this time is 10 Mb/s.
  • the selection weight value of the adjacent node may be required to use the average value of the data transmission speed of the target node and an adjacent node in the last 5 data synchronization processes in history as the selection weight value of the adjacent node, as shown in Table 1.
  • the data of the adjacent node can be well measured Synchronization efficiency, thereby more targeted selection of target adjacent nodes, thereby improving the efficiency of data synchronization.
  • the historical data synchronization information may include historical data transmission speed and historical data request time, and the determination of the selection weight value of the adjacent node according to the historical data synchronization information may be calculated by the following formula The selection weight value of the adjacent node:
  • W i represents the selection weight value of the i-th adjacent node
  • j represents the data synchronization between the target node and the i-th adjacent node for the jth time in history
  • m represents the m-th in the history of the target node and the i-th adjacent node Data synchronization
  • n represents the number of data synchronization between the target node and the i-th adjacent node in the last n times in history
  • S j represents the data synchronization process between the target node and the i-th adjacent node in the jth time in history Historical data transmission speed
  • t j represents the historical data request time when the target node and the i-th adjacent node perform data synchronization for the jth time in history
  • t represents the time when the selection weight value of the i-th adjacent node is calculated.
  • the historical data transmission speed may also refer to the ratio of the size of the target data transmitted during the data synchronization process to the data transmission time.
  • the historical data request time may refer to the time when the target node requests the i-th adjacent node to download the target data in the historical data synchronization process. In this embodiment, it is mainly used to measure the calculation of the i-th adjacent node.
  • the time when the weight value is selected is the length of time between the historical data request time when the target node and the i-th adjacent node perform data synchronization for the jth time in history.
  • the time length can measure the target node and the i-th
  • the frequency of data synchronization between adjacent nodes that is, the shorter the time length, the more frequent the data synchronization between the target node and the i-th adjacent node.
  • the average value of the data transmission speed of the target node and the i-th adjacent node during the last 5 data synchronization processes in the history and when calculating the selection weight value of the i-th adjacent node The sum of the average value of the time length between the time of the target node and the i-th adjacent node in the history of the last 5 time data synchronization requests for historical data is used as the selection weight value of the adjacent node.
  • the data transmission speeds of the target node and the i-th adjacent node during the last 5 data synchronization in history are: 10Mb/s, 30Mb/s, 20Mb/s, 15Mb/s, 25Mb/s .
  • the time when the target node requested the i-th neighboring node to download the target data for the last 5 times in history were: July 1, 2019 12:00: 00: 00, July 1, 2019, 12:00: 00: 10, At 12:00:20 on July 1, 2019, at 12:00:30 on July 1, 2019, and at 12:00:40 on July 1, 2019.
  • the performance of the adjacent node can be well measured. Data synchronization efficiency. However, if the data transmission speed of a certain adjacent node is too high, it will cause other nodes to always choose this adjacent node as the target adjacent node, which will cause the node to be overloaded and reduce the efficiency of data synchronization. For adjacent nodes with higher data transmission speed, the number of times that they are selected as the target adjacent node will be more frequent.
  • the time when the selection weight value of this adjacent node is calculated is the distance between the target node and this adjacent node in history The length of time between historical data request moments during the jth data synchronization will be shorter. Based on this, the historical data request time when the target node requests synchronization data from the adjacent node is used as another factor for determining the selection weight value, which can balance the adjacent node resources connected to the target node in the distributed system, In order to prevent an adjacent node from being over-utilized and causing the adjacent node to be overloaded, based on the above embodiment, a better adjacent node can be selected.
  • the manner of determining the selection weight value of the adjacent node according to the historical data synchronization information may be arbitrary, and is not limited to the examples shown above.
  • step 230 according to the selection weight value of the adjacent node, a target adjacent node for synchronizing data with the target node is selected, so as to synchronize the target data in the target adjacent node to the target node.
  • selecting a target neighboring node for synchronizing data with the target node according to the selection weight value of the neighboring node may include the steps shown in FIG. 5,
  • FIG. 5 is a detailed flowchart of step 230 according to an embodiment of the present application, which specifically includes the following steps:
  • Step 2301 Detect whether each adjacent node connected to the target node has data that needs to be synchronized with the target node, and obtain candidate adjacent nodes that need to synchronize data with the target node.
  • the distributed system may include a blockchain system
  • the target data may include block data
  • the detection of whether each adjacent node connected to the target node needs to provide information to the The data synchronized by the target node can be realized in the following ways:
  • the first block header height of the blockchain ledger in the target node and the second block header height of the blockchain ledger in the adjacent node connected to the target node are obtained respectively. Then compare the height of the first block header with the height of the second block header to detect whether each adjacent node connected to the target node has data that needs to be synchronized with the target node. If the second block header If the height is greater than the height of the first block header, it indicates that there is block data that needs to be synchronized with the target node in the adjacent nodes connected to the target node, and there will be adjacent nodes that synchronize the block data with the target node As a candidate neighbor node.
  • Step 2302 According to the selection weight value of the candidate neighboring node, select the target neighboring node for synchronizing data with the target node.
  • selecting the target neighboring node for synchronizing data with the target node can be achieved in the following manner:
  • the candidate neighboring nodes are sorted in descending order, and the neighboring node with the largest selection weight value is used as the target neighboring node.
  • each adjacent node connected to the target node has data that needs to be synchronized with the target node to obtain candidate adjacent nodes that need to synchronize data with the target node, it is possible to avoid certain Some selected target neighboring nodes have failed to synchronize data due to incomplete data, thereby reducing the waste of computer network resources.
  • the distributed system may include a blockchain system
  • the target data may include complete block data
  • the target data Synchronizing the target neighboring node of the node data to synchronize the target data in the target neighboring node to the target node can be achieved in the following manner:
  • a second target adjacent node for synchronizing the complete block data with the target node is selected to synchronize the complete block data from the second target adjacent node.
  • the distributed system may include a blockchain system
  • the target data may include block header data and complete block data
  • the target data may be selected for Synchronizing the target neighboring node of data to the target node to synchronize the target data in the target neighboring node to the target node can be achieved in the following manner:
  • a second target neighboring node for synchronizing the complete block data to the target node is selected according to the selection weight value of the neighboring node, so that the second target neighboring node Synchronize the complete block data in.
  • the following steps may also be implemented:
  • the block with complete block data contains a block The block header and block body, and the block without complete block data only contains the block header. Therefore, in this specific embodiment, the third block header height refers to the height of the block header of a block with complete block data, and the fourth block header height refers to a block without complete block data.
  • the height of the block header of the block with complete block data is less than the height of the block header of the block without complete block data, it means that there is no complete block in the target node
  • the data block further indicates that the target node needs to select a second target neighboring node for synchronizing the complete block data with the target node.
  • the process of synchronizing block data includes the process of synchronizing block header data and synchronization.
  • the process of complete block data is explained as an example:
  • the specific implementation of synchronizing the block header data of the target node can be implemented cyclically according to the process shown in FIG. 6, and the process specifically includes the following steps:
  • Step 610 Obtain the block header height of the local blockchain ledger.
  • Step 620 Calculate the selection weight value of each adjacent node connected to the target node, and sort.
  • Step 630 check whether all adjacent nodes contain the next block header data needed by the node, if yes, go to step 640; if not, go to step 610 to perform the next synchronization cycle.
  • step 640 it is determined to select an adjacent node with the highest weight value and with the required block header data.
  • Step 650 Send a request for synchronous download of block header data to the adjacent node, record the request time, and delete the earliest time of the data synchronous download request.
  • Step 660 Receive the block header data, and write the legal block header data into the local blockchain ledger.
  • Step 670 Calculate the data transmission speed of this block header data synchronization.
  • step 650 in order to make it easier for those skilled in the art to understand step 650 as described above, a specific example is used to illustrate.
  • the three requests for record The times are 12:00: 00: 00 on July 1, 2019, 12: 01: 01, July 1, 2019, 12: 02: 01, July 1, 2019, of which 12: July 1, 2019 Hour 00 minutes 00 seconds is the earliest request time to send a block header data synchronization download request to the adjacent node for the first time.
  • the specific implementation of the target node synchronizing the complete block data can be implemented cyclically according to the process shown in FIG. 7, and the process specifically includes the following steps:
  • Step 710 Obtain the block header height of the local blockchain ledger and the block header height of the complete block data.
  • step 720 it is detected whether the height of the block header is higher than the height of the block header of the complete block data, if so, step 730 is executed; if not, step 710 is executed to perform the next synchronization cycle.
  • Step 730 Calculate the selection weight value of each adjacent node connected to the target node, and sort.
  • Step 740 detecting whether the sorted adjacent nodes contain the next complete block data of the target node, if yes, execute step 750; if not, execute step 710 to perform the next synchronization cycle.
  • step 750 it is determined to select an adjacent node with the highest weight value and with the required complete block data.
  • Step 760 Send a complete block data synchronous download request to the adjacent node, record the request time, and delete the earliest data synchronous download request time.
  • Step 770 Receive the complete block data, and store the legal complete block data in the complete block data buffer area.
  • Step 780 Calculate the data transmission speed of the complete block data synchronization this time, and delete the data transmission speed of the earliest complete block data synchronization.
  • step 760 a specific example is used to illustrate it here.
  • the request time of is 12:00: 00: 00 on July 1, 2019, 12: 01: 01, July 1, 2019, 12: 02: 01, July 1, 2019, of which: July 1, 2019 12:00: 00: 00 of the day is the earliest request time to send a complete block data synchronization download request to the adjacent node for the first time.
  • the advantages of synchronizing the block header data before synchronizing the complete block data lie in two aspects.
  • the data synchronization time is particularly prone to be long , The data synchronization request is rejected.
  • the data volume of the block header data is small and the security requirements are not high, which is particularly suitable for data synchronization of target nodes newly added to the blockchain system.
  • the target node first synchronizes the block header data, which helps to detect whether the target node needs to select the target neighboring node for synchronizing the complete block data with the target node. When it is detected that the target node does not When selecting the target adjacent node for synchronizing the complete block data with the target node, the target node does not need to calculate the selection weight value of the adjacent node, thereby saving computer resources.
  • synchronizing the complete block data from the second target neighboring node can be achieved in the following manner:
  • synchronizing the complete block data to the target node based on the data stored in the block data buffer area can be accomplished in the following manner:
  • corresponding block data is read from the block data buffer area and written into the block chain ledger of the target node.
  • synchronizing the target data in the target adjacent node to the target node can be completed in the following manner:
  • the target node and the target neighboring node are recorded The number of errors in data synchronization between nodes.
  • the target data synchronization failure may refer to the timeout of the data synchronization request, the abnormality of the data during the synchronization download process, or the failure of access to the target adjacent node.
  • the target node and the target neighboring node are recorded The data transmission speed and data request time for data synchronization between nodes.
  • the target neighboring node for synchronizing data to the target node is selected to synchronize the target data in the target neighboring node to the target
  • the mode of the node can be arbitrary and is not limited to those shown above.
  • the technical solution of the embodiment of the present application determines a synchronization efficiency for each neighboring node that reflects the synchronization efficiency of the neighboring node to the target node by synchronizing the historical data of the neighboring node connected to the target node.
  • the target neighboring node that can synchronize data to the target node according to the selection weight value corresponding to the different neighboring nodes, so that the historical data synchronization information of each node can be comprehensively considered to select a more appropriate neighboring node
  • the actual congestion and load conditions of each node can be considered to select a more scientific and reasonable target adjacent node, which can shorten the data synchronization time in the distributed system and improve the synchronization efficiency.
  • the technical problems of slow data synchronization and low data synchronization efficiency in the distributed system existing in the prior art can be solved.
  • the following describes the device embodiment of the present application, which can be used to implement the data synchronization method of the distributed system in the foregoing embodiment of the present application.
  • the device embodiment of this application please refer to the above-mentioned embodiment of the data synchronization method of the distributed system of this application.
  • Fig. 8 shows a block diagram of a data synchronization device of a distributed system according to an embodiment of the present application.
  • a data synchronization device 800 of a distributed system includes: an acquisition module 810, a determination module 820, a selection module 830, and a synchronization module 840.
  • the obtaining module 810 is used to obtain historical data synchronization information of the adjacent node connected to the target node; the determining module 820 is used to determine the selection weight value of the adjacent node according to the historical data synchronization information, and the selection weight value is used for Measure the efficiency of the adjacent node synchronizing data with the target node; the selection module 830 is configured to select the target adjacent node for synchronizing data with the target node according to the selection weight value of the adjacent node; the synchronization module 840 is configured to The target data in the target adjacent node is synchronized to the target node.
  • the selection module 830 is configured to detect whether each adjacent node connected to the target node has data that needs to be synchronized with the target node, and obtain the data that needs to be synchronized with the target node.
  • Candidate neighboring nodes for synchronizing data selecting a target neighboring node for synchronizing data to the target node according to the selection weight value of the candidate neighboring node.
  • the acquisition module 810 includes: a detection module, configured to detect whether each adjacent node connected to the target node has data that needs to be synchronized with the target node, and obtain the data that needs to be synchronized with the target node.
  • a detection module configured to detect whether each adjacent node connected to the target node has data that needs to be synchronized with the target node, and obtain the data that needs to be synchronized with the target node.
  • Candidate adjacent nodes for synchronization data of the target node an execution module for acquiring historical data synchronization information of the candidate adjacent nodes.
  • the distributed system includes a blockchain system
  • the target data includes block data
  • the detection module is configured to obtain the first block chain ledger in the target node.
  • a block header height obtain the second block header height of the blockchain ledger in the adjacent node connected to the target node; compare the first block header height and the second block header height to detect the target Whether each adjacent node connected to the node has data that needs to be synchronized with the target node.
  • the historical data synchronization information includes the number of errors in the process of historically synchronizing data between the target node and the adjacent node
  • the determining module 820 is configured to: detect the Adjacent nodes whose number of errors does not exceed the threshold of the number of errors; determine the selection weight value of the adjacent nodes whose number of errors does not exceed the threshold of the number of errors according to the historical data synchronization information.
  • the historical data synchronization information includes historical data transmission speed and historical data request time
  • the determining module 820 is configured to calculate the selection weight value of the adjacent node by the following formula:
  • W i represents the selection weight value of the i-th adjacent node
  • j represents the data synchronization between the target node and the i-th adjacent node for the jth time in history
  • m represents the m-th in the history of the target node and the i-th adjacent node Data synchronization
  • n represents the number of data synchronization between the target node and the i-th adjacent node in the last n times in history
  • S j represents the data synchronization process between the target node and the i-th adjacent node in the jth time in history Historical data transmission speed
  • t j represents the historical data request time when the target node and the i-th adjacent node perform data synchronization for the jth time in history
  • t represents the time when the selection weight value of the i-th adjacent node is calculated.
  • the synchronization module 840 is configured to send a download request for the target data to the target neighboring node, so that the target neighboring node sends a request to the target neighboring node according to the download request.
  • the target node sends the target data; the method further includes: in the process of synchronizing the target data in the target adjacent node to the target node, if the target data synchronization fails, recording the The number of errors in data synchronization between the target node and the target adjacent node.
  • the distributed system includes a blockchain system
  • the target data includes complete block data
  • the selection module 830 is configured to: according to the selection weights of the adjacent nodes Value, select a second target neighboring node for synchronizing the complete block data to the target node; the synchronization module 840 is configured to synchronize the complete block data from the second target neighboring node.
  • the distributed system includes a blockchain system
  • the target data includes block header data and complete block data
  • the selection module 830 is configured to: The selection weight value of the node selects the first target adjacent node for synchronizing the block header data with the target node
  • the synchronization module 840 is configured to: synchronize the block header data from the first target adjacent node ;
  • the selection module 830 is further configured to: after synchronizing the block header data, select a second target adjacent node for synchronizing the complete block data with the target node according to the selection weight value of the adjacent node;
  • the synchronization module 840 is further configured to synchronize the complete block data from the second target adjacent node.
  • the distributed system includes a blockchain system
  • the target data includes complete block data
  • the selection module 830 is configured to: Before the node synchronizes the second target adjacent node of the complete block data, obtain the third block header height of the blockchain ledger in the target node with complete block data; obtain the fourth block header of the blockchain ledger in the target node Height; compare the size of the third block header height and the fourth block header height to detect whether it is necessary to select a second target adjacent node for synchronizing the complete block data to the target node.
  • the distributed system includes a blockchain system
  • the target data includes complete block data
  • the synchronization module 840 is configured to download the second target adjacent node Verify the legality of the complete block data; add the legal complete block data to the block data buffer area of the target node based on the data stored in the block data buffer area The data synchronizes the complete block data to the target node.
  • the distributed system includes a blockchain system
  • the target data includes complete block data
  • the synchronization module 840 is configured to: according to the zone in the target node The block sequence indicated by the block chain ledger reads the corresponding block data from the block data buffer area and writes it into the block chain ledger of the target node.
  • the present application also provides a computer-readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification.
  • each aspect of the present application can also be implemented in the form of a program product, which includes program code.
  • the program product runs on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
  • a program product 900 for implementing the above method according to an embodiment of the present application is described. It can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be installed in a terminal device, For example, running on a personal computer.
  • CD-ROM compact disk read-only memory
  • the program product of this application 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 combined with an instruction execution system, device, or device.
  • 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any 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 computer-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 the instruction execution 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 foregoing.
  • the program code used to perform the operations of the present application 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 programming languages. 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 can 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 can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers Internet service providers
  • the application also provides an electronic device capable of implementing the above method.
  • the electronic device 1000 according to this embodiment of the present application will be described below with reference to FIG. 10.
  • the electronic device 1000 shown in FIG. 10 is only an example, and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
  • the electronic device 1000 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 1000 may include but are not limited to: the aforementioned at least one processing unit 1010, the aforementioned at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).
  • the storage unit stores program code, and the program code can be executed by the processing unit 1010, so that the processing unit 1010 executes the various exemplary methods described in the above-mentioned “Methods of Embodiments” section of this specification. Implementation steps.
  • the storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 1021 and/or a cache storage unit 1022, and may further include a read-only storage unit (ROM) 1023.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 1020 may also include a program/utility tool 1024 having a set (at least one) program module 1025.
  • program module 1025 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 1030 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the electronic device 1000 can also communicate with one or more external devices 1200 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 1000, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 1000 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 1050.
  • the electronic device 1000 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 1060.
  • networks for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet
  • the network adapter 1060 communicates with other modules of the electronic device 1000 through the bus 1030. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, server, terminal device, or network device, etc.) execute the method according to the embodiment of the present application.
  • a non-volatile storage medium can be a CD-ROM, U disk, mobile hard disk, etc.
  • Including several instructions to make a computing device which may be a personal computer, server, terminal device, or network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请的实施例提供了一种分布式系统的数据同步方法、装置、计算机可读介质及电子设备。该方法包括:获取与目标节点相连的邻接节点的历史数据同步信息;根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点。

Description

分布式系统的数据同步方法、装置、介质、电子设备
本申请要求于2019年7月15日提交国家知识产权局、申请号为201910636195.1,申请名称为“分布式系统的数据同步方法、装置、介质、电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别地,涉及一种分布式系统的数据同步方法、装置、介质和电子设备。
背景技术
分布式系统是由一组通过网络进行通信、为了完成共同的任务而协调工作的计算机节点组成的系统。在分布式系统中,每一个节点都被用来计算或者存储数据,并且在分布式系统中可能需要在节点之间进行数据同步的操作,比如在区块链系统中,当有新的区块链节点加入时需要从其它区块链节点中同步数据。
发明内容
本申请的目的在于提供一种分布式系统的数据同步方法及装置、计算机可读存储介质、电子设备,进而至少可以缩短分布式系统中数据同步的时间,提高同步效率。
本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。
根据本申请实施例的一个方面,提供了一种分布式系统的数据同步方法,所述方法包括:
获取与目标节点相连的邻接节点的历史数据同步信息;
根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;
根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目 标节点。
根据本申请实施例的一个方面,提供了一种分布式系统的数据同步装置,包括:获取模块,被设置为获取与目标节点相连的邻接节点的历史数据同步信息;确定模块,被设置为根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;选择模块,被设置为根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点;同步模块,被设置为将所述目标邻接节点中的目标数据同步至所述目标节点。
根据本申请实施例的一个方面,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序包括可执行指令,当该可执行指令被处理器执行时,实现如上述实施例中所述的分布式系统的数据同步方法。
根据本申请实施例的一个方面,提供了一种电子设备,包括:一个或多个处理器;存储器,用于存储所述处理器的可执行指令,当所述可执行指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如上述实施例中所述的分布式系统的数据同步方法。
附图说明
通过参照附图详细描述其示例性实施例,本申请的上述和其它特征及优点将变得更加明显。
图1是根据本申请实施例示出的分布式系统的数据同步方法的应用场景示意图;
图2是根据本申请实施例的示出的分布式系统的数据同步的流程图;
图3是根据本申请实施例示出的图2中所示的步骤210的细节流程图;
图4是根据本申请实施例示出的图2中所示的步骤220的细节流程图;
图5是根据本申请实施例示出的图2中所示的步骤230的细节流程 图;
图6是根据本申请实施例示出的区块头数据同步的细节流程图;
图7是根据本申请实施例示出的完整区块数据同步的细节流程图;
图8是根据本申请实施例示出的一种分布式系统的数据同步装置的框图;
图9是根据本申请实施例示出的一种实现上述方法的计算机可读存储介质;以及
图10是根据本申请实施例示出的一种实现上述方法的电子设备示例框图。
具体实施方式
现在将参考附图更全面地描述示例性实施例。然而,示例性实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施方式;相反,提供这些实施方式使得本申请将全面和完整,并将示例性实施例的构思全面地传达给本领域的技术人员。在图中,为了清晰,可能会夸大部分元件的尺寸或加以变形。在图中相同的附图标记表示相同或类似的结构,因而将省略它们的详细描述。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有所述特定细节中的一个或更多,或者可以采用其它的方法、元件等。在其它情况下,不详细示出或描述公知结构、方法或者操作以避免模糊本申请的各方面。
在目前的分布式系统中,节点之间进行数据同步操作通常存在数据同步速度慢、同步效率较低的问题。
有鉴于此,本申请提供了一种分布式系统的数据同步方法、装置、介质和电子设备,能够解决上述的分布式系统中节点的数据同步速度慢、数据同步效率低的技术问题。
首先,说明分布式系统的数据同步方法的应用场景。
图1所示出的是分布式系统的数据同步方法的应用场景示意图。
如图所示,场景100是分布式系统中的一个局部,其中,电子设备101、102、103、104以及105分别是分布式系统中的一个节点,所述电子设备可以是智能手机、平板电脑、笔记本电脑等便携移动设备,也可以是计算机设备、现场终端、台式电脑、服务器、工作站等固定式设备。本申请的实施环境可以是整个分布式系统中的任何一个节点。如图1所示,可以将智能手机101作为数据同步的目标节点,则台式电脑102、笔记本电脑103、平板电脑104以及工作站105将作为智能手机101的邻接节点。根据本申请,智能手机101在进行数据同步的过程中,会首先分别同时获取与台式电脑102、笔记本电脑103、平板电脑104以及工作站105在历史上进行数据同步的历史数据同步信息,并根据所述历史数据同步信息确定用于衡量所述邻接节点向所述智能手机101同步数据的效率的选择权重值,最后根据所述选择权重值选择用于向所述智能手机101同步数据的目标邻接节点,并完成数据同步的过程。
需要注意的是,在本申请中,分布式系统中各节点之间的数据传输可以通过通信连接方式的连接(例如有线通信通信网连接或者无线通信通信网连接)来实现。
根据本申请的第一方面,提供了一种分布式系统的数据同步方法。
参见图2,示出了分布式系统的数据同步方法的流程图,该数据同步方法的执行主体可以是分布式系统中包含的需要进行数据同步的节点,比如可以是充当任意一个节点的电子设备。该数据同步方法可包括如下步骤:
步骤210,获取与目标节点相连的邻接节点的历史数据同步信息。
步骤220,根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率。
步骤230,根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点。
下面将对如上实施步骤进行详细说明。
关于步骤210:获取与目标节点相连的邻接节点的历史数据同步信息。
具体地,所述目标节点是指在分布式系统中需要进行数据同步的节点,例如在区块链系统中的任意一个节点。所述邻接节点是指在所述分布式系统中与所述目标节点相连接的其它节点。
在一示例性实施例中,步骤210中获取与目标节点相连的邻接节点的历史数据同步信息的过程可以通过如图3所示的方式完成,具体包括以下步骤:
步骤2101,检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的目标数据,得到需要向所述目标节点同步目标数据的候选邻接节点。
在一实施例的具体实现中,所述分布式系统可以包括区块链系统,所述目标数据可以包括区块数据。所述检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,可以通过如下方式实现:
首先,获取目标节点中区块链账本的第一区块头高度。然后获取与目标节点相连的邻接节点中区块链账本的第二区块头高度。最后比较所述第一区块头高度与所述第二区块头高度的大小,以检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据。
具体而言,区块链系统是分布式系统的一种,其主要作用是储存数据,任何需要保存的数据,都可以写入区块链,也可以从区块链里面读取。区块链中的数据主要以区块的形式存在,即一个区块是整个区块链数据中的基本单位,一个区块包括一个区块头和一个区块体,其中,区块头中记录着当前区块的特征值数据,例如当前时间、区块头高度、上一个区块的哈希以及区块体的哈希等等,而区块体则记录着需要保存的实际数据。区块链中的区块按照严格的顺序单向连接从而形成一个数据链条。在区块链系统中每隔一段时间就会产生一个区块,产生的新区块连接在上一个产生的区块之后,随着时间的推移,区块链数据会不断的 更新。此外,在区块链系统中,当新的服务器加入区块链网络成为一个节点之后,新加入的节点需要同步区块链系统中的区块数据,并且随着区块链数据的不断更新,区块链系统中的各个节点也需要不断地更新区块数据。
在区块链数据中,每一个区块数据都是独一无二的,因此每一个区块数据的身份可以通过区块头中的区块头高度或者哈希值来进行标识,其中,区块链数据中的区块头高度随着区块的不断更新而逐步递增,即每产生一个区块,产生的新区块的区块头高度就会增加1个。基于此,本申请通过利用区块头高度来检测区块链系统中与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据。
具体地,分别获取目标节点中区块链账本的第一区块头高度和与目标节点相连的邻接节点中区块链账本的第二区块头高度,并比较所述第一区块头高度和第二区块头高度的大小,若第二区块头高度大于第一区块头高度,则说明与所述目标节点相连的邻接节点中存在需要向所述目标节点进行同步的区块数据。
在获取与目标节点相连的邻接节点的历史数据同步信息的过程中,通过检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,进而能得到需要向所述目标节点同步数据的候选邻接节点。这样做的优点在于,仅仅确定候选邻接节点的选择权重值,并从所述候选邻接节点中选择目标邻接节点,可以过滤掉一些没有数据同步前景的邻接节点,从而减少获取一些没有必要的历史数据同步信息,减轻系统的存储和计算压力,同时也提高了所述历史数据同步信息的利用率。
步骤2102,获取所述候选邻接节点的历史数据同步信息。
在如上所述的实施例中,检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点的好处就在于,在获取所述邻接节点的历史数据同步信息之前,可以通过检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据来进一步地在所有邻接 节点中确定具有数据同步前景的候选邻接节点,这样做的优点在于,可以过滤掉一些没有数据同步前景的邻接节点,从而减少获取一些没有必要的历史数据同步信息,减轻系统的存储和计算压力,同时也提高了所述历史数据同步信息的利用率。
关于步骤220:根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率。
在一示例性实施例中,所述历史数据同步信息可以包括目标节点与所述邻接节点在历史上同步数据过程中的出错次数,步骤220中根据所述历史数据同步信息确定所述邻接节点的选择权重值的过程可以如图4所示,具体包括以下步骤:
步骤2201,检测所述出错次数未超过出错次数阈值的邻接节点。
在本实施例中,所述出错次数是指目标节点与所述邻接节点在历史上同步数据过程中的出错次数。具体而言,分布式系统中的节点与节点之间在进行数据同步时,由于节点本身故障或者数据传输网络故障等原因,难免会出现节点同步失败的情况发生,例如数据同步请求超时、数据在同步下载过程中出现异常以及对节点访问失败等等。
本实施例可以通过设置一个所述出错次数的阈值,对与目标节点相连的邻接节点进行一个筛选,即对所述出错次数超过某一定数目的邻接节点进行过滤,对所述出错次数未超过某一定数目的邻接节点进行保留,最终将被保留下来的邻接节点作为进行后续目标邻接节点确定的一个候选。所述出错次数可以根据实际情况来进行设定,例如设置为3次。若邻接节点1、邻接节点2、邻接节点3以及邻接节点4在历史上同步数据过程中的出错次数分别为4次、3次、1次以及0次,则最终被保留下来的邻接节点就可以是邻接节点2、邻接节点3以及邻接节点4。
步骤2202,根据所述历史数据同步信息确定所述出错次数未超过所述出错次数阈值的邻接节点的选择权重值。
根据如上所述的实施例,通过设置出错次数阈值来过滤掉数据同步经常出错的邻接节点,保留所述出错次数较少的邻接节点,可以提高数 据在后续同步过程中的同步成功率,此外还可以减少系统计算所述选择权重值的负担,进而减轻系统计算压力,提高数据同步效率。
在一示例性实施例中,所述历史数据同步信息可以包括历史数据传输速度,则所述根据所述历史数据同步信息确定所述邻接节点的选择权重值可以通过以下公式计算所述邻接节点的选择权重值:
Figure PCTCN2020096119-appb-000001
其中,W i表示第i个邻接节点的选择权重值;j表示目标节点与第i个邻接节点在历史上第j次进行数据同步;m表示目标节点与第i个邻接节点在历史上第m次进行数据同步;n表示目标节点与第i个邻接节点在历史上最近n次进行数据同步的次数;S j表示目标节点与第i个邻接节点在历史上第j次进行数据同步过程中的历史数据传输速度。
具体而言,所述历史数据传输速度可以是指历史上的数据同步过程中所传输的目标数据的大小与数据传输时间的比值,而数据传输时间又可以是指目标节点在完全接收到所述目标数据时的时刻与向目标邻接节点请求下载所述目标数据时的时刻之间的差值。例如在某一次数据同步的过程中,目标节点向目标邻接节点请求下载目标数据时的时刻为2019年7月1日12时00分00秒,目标节点在完全接收所述目标数据时的时刻为2019年7月1日12时00分03秒,则数据传输时间为3.00秒,若所述目标数据的大小为30Mb,则此次历史数据传输速度为10Mb/s。
在一实施例的具体实现中,可以要求将目标节点与一邻接节点在历史上最近5次数据同步过程中数据传输速度的平均值作为所述邻接节点的选择权重值,如表1所示,目标节点与一邻接节点在历史上最近5次数据同步过程中的数据传输速度分别为:10Mb/s、30Mb/s、20Mb/s、15Mb/s、25Mb/s。所以通过计算,可以确定所述选择权重值为:W i=20。
j S j
m+5 10Mb/s
m+4 30Mb/s
m+3 20Mb/s
m+2 15Mb/s
m+1 25Mb/s
表1
根据如上所述的实施例,通过计算所述邻接节点在历史上最近n次数据同步的平均数据传输速度来作为确定所述选择权重值的一个因素,可以很好地衡量所述邻接节点的数据同步效率,从而更有针对性地选择目标邻接节点,进而提高数据同步效率。
在一示例性实施例中,所述历史数据同步信息可以包括历史数据传输速度和历史数据请求时刻,则所述根据所述历史数据同步信息确定所述邻接节点的选择权重值可以通过以下公式计算所述邻接节点的选择权重值:
Figure PCTCN2020096119-appb-000002
其中,W i表示第i个邻接节点的选择权重值;j表示目标节点与第i个邻接节点在历史上第j次进行数据同步;m表示目标节点与第i个邻接节点在历史上第m次进行数据同步;n表示目标节点与第i个邻接节点在历史上最近n次进行数据同步的次数;S j表示目标节点与第i个邻接节点在历史上第j次进行数据同步过程中的历史数据传输速度;t j表示目标节点与第i个邻接节点在历史上第j次进行数据同步时的历史数据请求时刻;t表示计算所述第i个邻接节点的选择权重值时的时刻。
具体而言,在本实施例中,所述历史数据传输速度也可以是指数据同步过程中所传输的目标数据的大小与数据传输时间的比值。所述历史数据请求时刻可以是指历史上的数据同步过程中目标节点向第i个邻接节点请求下载目标数据时的时刻,在本实施例中主要用于衡量计算所述第i个邻接节点的选择权重值时的时刻距离目标节点与第i个邻接节点在历史上第j次进行数据同步时的历史数据请求时刻之间的时间长度,所述时间长度可以衡量所述目标节点与第i个邻接节点之间进行数据同步的频繁程度,即所述时间长度越短,即表示所述目标节点与第i个邻接节点之间进行数据同步越频繁。
在一实施例的具体实现中,可以要求将目标节点与第i个邻接节点在历史上最近5次数据同步过程中数据传输速度的平均值与计算所述第i个邻接节点的选择权重值时的时刻距离目标节点与第i个邻接节点在历史上最近5次进行数据同步时的历史数据请求时刻之间的时间长度的平均值的和作为所述邻接节点的选择权重值。如表2所示,目标节点与第i个邻接节点在历史上最近5次数据同步过程中的数据传输速度分别为:10Mb/s、30Mb/s、20Mb/s、15Mb/s、25Mb/s。目标节点在历史上最近5次向第i个邻接节点请求下载目标数据时的时刻分别为:2019年7月1日12时00分00秒、2019年7月1日12时00分10秒、2019年7月1日12时00分20秒、2019年7月1日12时00分30秒、2019年7月1日12时00分40秒。
j S j t j
m+5 10Mb/s 2019年7月1日12时00分00秒
m+4 30Mb/s 2019年7月1日12时00分10秒
m+3 20Mb/s 2019年7月1日12时00分20秒
m+2 15Mb/s 2019年7月1日12时00分30秒
m+1 25Mb/s 2019年7月1日12时00分40秒
表2
若计算所述第i个邻接节点的选择权重值时的时刻t为2019年7月1日12时00分50秒,则通过本实施例的计算公式可以计算出所述邻接节点的选择权重值为:W i=50。
根据如上所述的实施例,将通过计算所述邻接节点在历史上最近n次数据同步的平均数据传输速度来作为确定所述选择权重值的一个因素,可以很好地衡量所述邻接节点的数据同步效率。但是,如果某一个邻接节点的数据传输速度过高,就会导致其他节点总是选择这一个邻接节点作为目标邻接节点,由此带来节点负载过重而导致数据同步效率下降。而对于数据传输速度较高的邻接节点来说,被选作目标邻接节点的次数就会较为频繁,进一步地,计算这个邻接节点的选择权重值时的时刻距离目标节点与这个邻接节点在历史上第j次进行数据同步时的历史 数据请求时刻之间的时间长度就会较短。基于此,将所述目标节点向所述邻接节点请求同步数据的历史数据请求时刻来作为确定所述选择权重值的另一个因素,可以均衡分布式系统中的与目标节点相连的邻接节点资源,以防止某一个邻接节点被过度利用而导致的所述邻接节点负载过重的情况发生,基于如上实施例,可以选择出较优的邻接节点。
如上所述,可以理解的是,根据所述历史数据同步信息确定所述邻接节点的选择权重值的方式可以是任意的,并不限于如上所示出的那些示例。
关于步骤230:根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点。
在一示例性实施例中,根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,可以包括如图5所示的步骤,
图5是根据本申请实施例示出的步骤230的细节流程图,具体包括以下步骤:
步骤2301,检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点。
在一实施例的具体实现中,所述分布式系统可以包括区块链系统,所述目标数据可以包括区块数据,所述检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,可以通过如下方式实现:
分别获取目标节点中区块链账本的第一区块头高度和与目标节点相连的邻接节点中区块链账本的第二区块头高度。然后比较所述第一区块头高度与所述第二区块头高度的大小,以检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,若第二区块头高度大于第一区块头高度,则说明与所述目标节点相连的邻接节点中存在需要向所述目标节点进行同步的区块数据,并将存在向所述目标节点进行区块数据同步的邻接节点作为候选邻接节点。
步骤2302,根据所述候选邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点。
在一实施例的具体实现中,根据所述候选邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点可以通过如下方式实现:
根据所述候选邻节点的选择权重值,对所述候选邻接节点按照从大到小的顺序进行排序,将所述选择权重值最大的邻接节点作为目标邻接节点。
根据如上所述的实施例,通过检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据来得到需要向所述目标节点同步数据的候选邻接节点,可以避免某一些被选择的目标邻接节点因为数据不全而导致数据同步失败的情况发生,进而减少计算机网络资源的浪费。
在一示例性实施例中,所述分布式系统可以包括区块链系统,所述目标数据可以包括完整区块数据,所述根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点可以通过如下方式实现:
根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,以从所述第二目标邻接节点中同步所述完整区块数据。
在一示例性实施例中,所述分布式系统可以包括区块链系统,所述目标数据可以包括区块头数据和完整区块数据,所述根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点可以通过如下方式实现:
根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述区块头数据的第一目标邻接节点,以从所述第一目标邻接节点中同步所述区块头数据,
在同步所述区块头数据之后,根据所述邻接节点的选择权重值,选 择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,以从所述第二目标邻接节点中同步所述完整区块数据。
在一实施例的具体实现中,在选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点之前,还可以实现如下步骤:
获取目标节点中区块链账本的具有完整区块数据的第三区块头高度;
获取目标节点中区块链账本的第四区块头高度;
比较所述第三区块头高度与所述第四区块头高度的大小,以检测所述目标节点是否需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,若所述第三区块头高度小于第四区块头高度,则说明所述目标节点需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点。
需要说明的是,在目标节点中的区块链账本中,存在着具有完整区块数据的区块和不具有完整区块数据的区块,其中,具有完整区块数据的区块包含有区块头和区块体,而不具有完整区块数据的区块仅仅只包含区块头。因此,在本具体实施例中,所述第三区块头高度是指具有完整区块数据的区块的区块头的高度,所述第四区块头高度是指不具有完整区块数据的区块的区块头的高度,当具有完整区块数据的区块的区块头的高度小于不具有完整区块数据的区块的区块头的高度时,则说明所述目标节点中存在不具有完整区块数据的区块,进而说明所述目标节点需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点。
以下以分布式系统为区块链系统为例,对本申请实施例中的数据同步方案进行详细阐述,其中,在该实施例中,以同步区块数据的过程包括同步区块头数据的过程和同步完整区块数据的过程为例进行说明:
在一个实施例的具体实现中,目标节点同步区块头数据的具体实现可以按照如图6所示的流程循环实施,所述流程具体包括如下步骤:
步骤610,获取本地区块链账本的区块头高度。
步骤620,计算与目标节点相连的各个邻接节点的选择权重值,并 排序。
步骤630,检查所有邻接节点中是否含有本节点需要的下一个的区块头数据,若是,则执行步骤640;若否,则执行步骤610,以进行下一次同步循环。
步骤640,确定选择权重值最高的且存在所需区块头数据的邻接节点。
步骤650,向所述邻接节点发送区块头数据同步下载的请求,并记录所述请求的时刻,删除最早一次的数据同步下载请求的时刻。
步骤660,接收区块头数据,将合法的区块头数据写入本地的区块链账本。
步骤670,计算本次区块头数据同步的数据传输速度。
需要注意的是,为了使本领域技术人员更加容易地理解如上所述步骤650,这里通过一具体的示例加以说明。例如,在向所述邻接节点发送区块头数据同步下载的请求之前,在历史上已存在有3次向所述邻接节点发送区块头数据同步下载的请求记录,且所述3次请求记录的请求时刻分别为2019年7月1日12时00分00秒、2019年7月1日12时01分01秒、2019年7月1日12时02分01秒,其中2019年7月1日12时00分00秒是第最早一次向所述邻接节点发送区块头数据同步下载请求的请求时刻。当2019年7月1日12时03分01秒再一次向所述邻接节点发送区块头数据同步下载请求时,则记录这一时刻,即记录2019年7月1日12时03分01秒,并删除最早一次向所述邻接节点发送区块头数据同步下载请求的请求时刻,即删除2019年7月1日12时00分00秒。最终所记录的最近3次向所述邻接节点发送区块头数据同步下载请求的请求时刻分别为:2019年7月1日12时01分01秒、2019年7月1日12时02分01秒以及2019年7月1日12时03分01秒。
在一个实施例的具体实现中,目标节点同步完整区块数据的具体实现可以按照如图7所示的流程循环实施,所述流程具体包括如下步骤:
步骤710,获取本地区块链账本的区块头高度和完整区块数据的区块头高度。
步骤720,检测所述区块头高度是否高于完整区块数据的区块头高度,若是,则执行步骤730;若否,则执行步骤710,以进行下一次同步循环。
步骤730,计算与目标节点相连的各个邻接节点的选择权重值,并排序。
步骤740,检测排序后的邻接节点中是否含有所述目标节点的下一个完整区块数据,若是,则执行步骤750;若否,则执行步骤710,以进行下一次同步循环。
步骤750,确定选择权重值最高的且存在所需完整区块数据的邻接节点。
步骤760,向所述邻接节点发送完整区块数据同步下载的请求,并记录所述请求的时刻,删除最早一次的数据同步下载请求的时刻。
步骤770,接收所述完整区块数据,将合法的完整区块数据存入完整区块数据缓存区。
步骤780,计算本次完整区块数据同步的数据传输速度,删除最早一次的完整区块数据同步的数据传输速度。
需要注意的是,为了使本领域技术人员更加容易地理解如上所述步骤760,这里通过一具体的示例加以说明。例如,在向所述邻接节点发送完整区块数据同步下载的请求之前,在历史上已存在有3次向所述邻接节点发送完整区块数据同步下载的请求记录,且所述3次请求记录的请求时刻分别为2019年7月1日12时00分00秒、2019年7月1日12时01分01秒、2019年7月1日12时02分01秒,其中2019年7月1日12时00分00秒是第最早一次向所述邻接节点发送完整区块数据同步下载请求的请求时刻。当2019年7月1日12时03分01秒再一次向所述邻接节点发送完整区块数据同步下载请求时,则记录这一时刻,即记录2019年7月1日12时03分01秒,并删除最早一次向所述邻接节点发送完整区块数据同步下载请求的请求时刻,即删除2019年7月1日12时00分00秒。最终所记录的最近3次向所述邻接节点发送完整区块数据同步下载请求的请求时刻分别为:2019年7月1日12时01 分01秒、2019年7月1日12时02分01秒以及2019年7月1日12时03分01秒。
如上所述实施例,通过在同步所述完整区块数据之前同步区块头数据的优点在于两个方面。一方面,由于完整区块数据的数据量较大以及其较高的安全性要求,在对新加入到区块链系统中的目标节点进行完整区块数据同步时,特别容易出现数据同步时间长、数据同步请求被拒绝的情况发生。而区块头数据的数据量较小以及安全性要求不高,特别适合对新加入到区块链系统中的目标节点进行数据同步。另一方面,目标节点首先同步区块头数据,有利于检测所述目标节点是否需要选择用于向所述目标节点同步所述完整区块数据的目标邻接节点,当检测到所述目标节点不需要选择用于向所述目标节点同步所述完整区块数据的目标邻接节点时,所述目标节点就不需要计算邻接节点的选择权重值,进而节省计算机资源。
在一实施例的具体实现中,从所述第二目标邻接节点中同步所述完整区块数据可以通过如下方式实现:
下载所述第二目标邻接节点中的完整区块数据;验证所述完整区块数据的合法性;将合法的完整区块数据加入至所述目标节点的区块数据缓存区,以基于所述区块数据缓存区中存储的数据向所述目标节点同步所述完整区块数据。
在一实施例的具体实现中,基于所述区块数据缓存区中存储的数据向所述目标节点同步所述完整区块数据可以通过如下方式完成:
按照所述目标节点中的区块链账本所指示的区块顺序,从所述区块数据缓存区中读取相应的区块数据,并写入所述目标节点的区块链账本中。
在一示例性实施例中,将所述目标邻接节点中的目标数据同步至所述目标节点可以通过如下方式完成:
向所述目标邻接节点发出针对所述目标数据的下载请求,以使所述目标邻接节点根据所述下载请求向所述目标节点发送所述目标数据。
在一实施例的具体实现中,在将所述目标邻接节点中的目标数据同 步至所述目标节点的过程中,若对所述目标数据同步失败,则记录所述目标节点与所述目标邻接节点之间进行数据同步的出错次数。
所述目标数据同步失败可以是指数据同步请求超时,还可以是指数据在同步下载过程中出现异常,也可以是指对目标邻接节点访问的失败。
在一实施例的具体实现中,在将所述目标邻接节点中的目标数据同步至所述目标节点的过程中,若对所述目标数据同步成功,则记录所述目标节点与所述目标邻接节点之间进行数据同步的数据传输速度和数据请求时刻。
如上所述,可以理解的是,根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点的方式可以是任意的,并不限于如上所示出的那些。
综上所述,本申请实施例的技术方案,通过根据与目标节点相连的邻接节点的历史数据同步信息来为各邻接节点确定一个能反映所述邻接节点向所述目标节点同步数据的同步效率的选择权重值,并根据不同邻接节点所对应的选择权重值来最终确定能够向所述目标节点同步数据的目标邻接节点,使得能够综合考虑各节点的历史数据同步信息来选择较为合适的邻接节点进行数据同步,比如可以考虑各节点的实际拥塞情况以及负载情况等信息选择出较为科学、合理的目标邻接节点,从而能够缩短分布式系统中数据同步的时间,提高同步效率。进而能够解决现有技术中存在的分布式系统中节点的数据同步速度慢,数据同步效率低的技术问题。
以下介绍本申请的装置实施例,可以用于执行本申请上述实施例中的分布式系统的数据同步方法。对于本申请装置实施例中未披露的细节,请参照本申请上述的分布式系统的数据同步方法的实施例。
图8示出了根据本申请的一个实施例的分布式系统的数据同步装置的框图。
参照图8所示,根据本申请的一个实施例的分布式系统的数据同步装置800,包括:获取模块810、确定模块820、选择模块830、同步模 块840。
其中,获取模块810用于获取与目标节点相连的邻接节点的历史数据同步信息;确定模块820用于根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;选择模块830用于根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点;同步模块840用于将所述目标邻接节点中的目标数据同步至所述目标节点。
在本申请的一些实施例中,基于前述方案,选择模块830配置为:检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点;根据所述候选邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点。
在本申请的一些实施例中,基于前述方案,获取模块810包括:检测模块,用于检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点;执行模块,用于获取所述候选邻接节点的历史数据同步信息。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括区块数据,所述检测模块配置为:获取目标节点中区块链账本的第一区块头高度;获取与目标节点相连的邻接节点中区块链账本的第二区块头高度;比较所述第一区块头高度与所述第二区块头高度的大小,以检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据。
在本申请的一些实施例中,基于前述方案,所述历史数据同步信息包括目标节点与所述邻接节点在历史上同步数据过程中的出错次数,所述确定模块820配置为:检测出所述出错次数未超过出错次数阈值的邻接节点;根据所述历史数据同步信息确定所述出错次数未超过所述出错次数阈值的邻接节点的选择权重值。
在本申请的一些实施例中,基于前述方案,所述历史数据同步信息 包括历史数据传输速度和历史数据请求时刻,所述确定模块820配置为通过以下公式计算所述邻接节点的选择权重值:
Figure PCTCN2020096119-appb-000003
其中,W i表示第i个邻接节点的选择权重值;j表示目标节点与第i个邻接节点在历史上第j次进行数据同步;m表示目标节点与第i个邻接节点在历史上第m次进行数据同步;n表示目标节点与第i个邻接节点在历史上最近n次进行数据同步的次数;S j表示目标节点与第i个邻接节点在历史上第j次进行数据同步过程中的历史数据传输速度;t j表示目标节点与第i个邻接节点在历史上第j次进行数据同步时的历史数据请求时刻;t表示计算所述第i个邻接节点的选择权重值时的时刻。
在本申请的一些实施例中,基于前述方案,所述同步模块840配置为:向所述目标邻接节点发出针对所述目标数据的下载请求,以使所述目标邻接节点根据所述下载请求向所述目标节点发送所述目标数据;所述方法还包括:在将所述目标邻接节点中的目标数据同步至所述目标节点的过程中,若对所述目标数据同步失败,则记录所述目标节点与所述目标邻接节点之间进行数据同步的出错次数。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括完整区块数据,所述选择模块830配置为:根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点;所述同步模块840配置为:从所述第二目标邻接节点中同步所述完整区块数据。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括区块头数据和完整区块数据,所述选择模块830配置为:根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述区块头数据的第一目标邻接节点;所述同步模块840配置为:从所述第一目标邻接节点中同步所述区块头数据;
所述选择模块830还配置为:在同步所述区块头数据之后,根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述完整区块 数据的第二目标邻接节点;所述同步模块840还配置为:从所述第二目标邻接节点中同步所述完整区块数据。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括完整区块数据,所述选择模块830配置为:在选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点之前,获取目标节点中区块链账本的具有完整区块数据的第三区块头高度;获取目标节点中区块链账本的第四区块头高度;比较所述第三区块头高度与所述第四区块头高度的大小,以检测是否需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括完整区块数据,所述同步模块840配置为:下载所述第二目标邻接节点中的完整区块数据;验证所述完整区块数据的合法性;将合法的完整区块数据加入至所述目标节点的区块数据缓存区,以基于所述区块数据缓存区中存储的数据向所述目标节点同步所述完整区块数据。
在本申请的一些实施例中,基于前述方案,所述分布式系统包括区块链系统,所述目标数据包括完整区块数据,所述同步模块840配置为:按照所述目标节点中的区块链账本所指示的区块顺序,从所述区块数据缓存区中读取相应的区块数据,并写入所述目标节点的区块链账本。
应当注意,尽管在上文详细描述中提及了分布式系统的数据同步方法以及分布式系统的数据同步装置的若干模块,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块和功能可以在一个模块中具体化。反之,上文描述的一个模块的特征和功能可以进一步划分为由多个模块来具体化。作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
作为另一方面,本申请还提供了一种计算机可读存储介质,其上存 储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本申请的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本申请各种示例性实施方式的步骤。
参考图9所示,描述了根据本申请的实施方式的用于实现上述方法的程序产品900,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,所述程序设计语言包括面向对象的程序设计语言— 诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
作为另一方面,本申请还提供了一种能够实现上述方法的电子设备。
所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
下面参照图10来描述根据本申请的这种实施方式的电子设备1000。图10显示的电子设备1000仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图10所示,电子设备1000以通用计算设备的形式表现。电子设备1000的组件可以包括但不限于:上述至少一个处理单元1010、上述至少一个存储单元1020、连接不同系统组件(包括存储单元1020和处理单元1010)的总线1030。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元1010执行,使得所述处理单元1010执行本说明书上述“实施例方法”部分中描述的根据本申请各种示例性实施方式的步骤。
存储单元1020可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)1021和/或高速缓存存储单元1022,还可以进一步包括只读存储单元(ROM)1023。
存储单元1020还可以包括具有一组(至少一个)程序模块1025的程序/实用工具1024,这样的程序模块1025包括但不限于:操作系统、 一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线1030可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备1000也可以与一个或多个外部设备1200(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1000交互的设备通信,和/或与使得该电子设备1000能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1050进行。并且,电子设备1000还可以通过网络适配器1060与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1060通过总线1030与电子设备1000的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1000使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本申请实施方式的方法。
此外,上述附图仅是根据本申请示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本申请的范 围仅由所附的权利要求来限制。

Claims (17)

  1. 一种分布式系统的数据同步方法,由电子设备执行,所述分布式系统包括多个节点,所述数据同步方法包括:
    获取与目标节点相连的邻接节点的历史数据同步信息;
    根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;
    根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点。
  2. 根据权利要求1所述的方法,所述根据邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,包括:
    检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点;
    根据所述候选邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点。
  3. 根据权利要求2所述的方法,所述根据所述候选邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,包括:
    将选择权重值最高的候选邻接节点确定为所述目标邻接节点。
  4. 根据权利要求1所述的方法,所述获取与目标节点相连的邻接节点的历史数据同步信息,包括:
    检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,得到需要向所述目标节点同步数据的候选邻接节点;
    获取所述候选邻接节点的历史数据同步信息。
  5. 根据权利要求4所述的方法,所述分布式系统包括区块链系统,所述目标数据包括区块数据,
    所述检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据,包括:
    获取所述目标节点中区块链账本的第一区块头高度;
    获取与所述目标节点相连的邻接节点中区块链账本的第二区块头高度;
    比较所述第一区块头高度与所述第二区块头高度的大小,以检测与所述目标节点相连的各个邻接节点是否存在需要向所述目标节点进行同步的数据。
  6. 根据权利要求1所述的方法,所述历史数据同步信息包括所述目标节点与所述邻接节点在历史上同步数据过程中的出错次数,
    所述根据所述历史数据同步信息确定所述邻接节点的选择权重值,包括:
    检测出所述出错次数未超过出错次数阈值的邻接节点;
    根据所述历史数据同步信息确定所述出错次数未超过所述出错次数阈值的邻接节点的选择权重值。
  7. 根据权利要求1所述的方法,所述历史数据同步信息包括历史数据传输速度和历史数据请求时刻,
    所述根据所述历史数据同步信息确定所述邻接节点的选择权重值,包括:通过以下公式计算所述邻接节点的选择权重值:
    Figure PCTCN2020096119-appb-100001
    其中,W i表示第i个邻接节点的选择权重值;j表示目标节点与第i个邻接节点在历史上第j次进行数据同步;m表示目标节点与第i个邻接节点在历史上第m次进行数据同步;n表示目标节点与第i个邻接节点在历史上最近n次进行数据同步的次数;S j表示目标节点与第i个邻接节点在历史上第j次进行数据同步过程中的历史数据传输速度;t j表示目标节点与第i个邻接节点在历史上第j次进行数据同步时的历史数据请求时刻;t表示计算所述第i个邻接节点的选择权重值时的时刻。
  8. 根据权利要求1所述的方法,所述将所述目标邻接节点中的目标数据同步至所述目标节点,包括:
    向所述目标邻接节点发出针对所述目标数据的下载请求,以使所述 目标邻接节点根据所述下载请求向所述目标节点发送所述目标数据;
    所述方法还包括:在将所述目标邻接节点中的目标数据同步至所述目标节点的过程中,若对所述目标数据同步失败,则记录所述目标节点与所述目标邻接节点之间进行数据同步的出错次数。
  9. 根据权利要求1至4中任一项所述的方法,所述分布式系统包括区块链系统,所述目标数据包括区块头数据和完整区块数据,
    所述根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点,包括:
    根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述区块头数据的第一目标邻接节点,以从所述第一目标邻接节点中同步所述区块头数据;
    在同步所述区块头数据之后,根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,以从所述第二目标邻接节点中同步所述完整区块数据。
  10. 根据权利要求9所述的方法,在所述选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点之前,所述方法还包括:
    获取所述目标节点中区块链账本的具有完整区块数据的第三区块头高度;
    获取所述目标节点中区块链账本的第四区块头高度;
    比较所述第三区块头高度与所述第四区块头高度的大小,以检测是否需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点。
  11. 根据权利要求10所述的方法,所述比较所述第三区块头高度与所述第四区块头高度的大小,以检测是否需要选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,包括:
    若所述第三区块头高度小于第四区块头高度,则选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点。
  12. 根据权利要求1至4中任一项所述的方法,所述分布式系统包 括区块链系统,所述目标数据包括完整区块数据,
    所述根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点,以将所述目标邻接节点中的目标数据同步至所述目标节点,包括:
    根据所述邻接节点的选择权重值,选择用于向所述目标节点同步所述完整区块数据的第二目标邻接节点,以从所述第二目标邻接节点中同步所述完整区块数据。
  13. 根据权利要求9或12所述的方法,所述从所述第二目标邻接节点中同步所述完整区块数据,包括:
    下载所述第二目标邻接节点中的完整区块数据;
    验证所述完整区块数据的合法性;
    将合法的完整区块数据加入至所述目标节点的区块数据缓存区,以基于所述区块数据缓存区中存储的数据向所述目标节点同步所述完整区块数据。
  14. 根据权利要求13所述的方法,所述基于所述区块数据缓存区中存储的数据向所述目标节点同步所述完整区块数据,包括:
    按照所述目标节点中的区块链账本所指示的区块顺序,从所述区块数据缓存区中读取相应的区块数据,并写入所述目标节点的区块链账本中。
  15. 一种分布式系统的数据同步装置,包括:
    获取模块,被设置为获取与目标节点相连的邻接节点的历史数据同步信息;
    确定模块,被设置为根据所述历史数据同步信息确定所述邻接节点的选择权重值,所述选择权重值用于衡量所述邻接节点向所述目标节点同步数据的效率;
    选择模块,被设置为根据所述邻接节点的选择权重值,选择用于向所述目标节点同步数据的目标邻接节点;
    同步模块,被设置为将所述目标邻接节点中的目标数据同步至所述目标节点。
  16. 一种计算机可读存储介质,其上存储有计算机程序,该计算机程序包括可执行指令,当该可执行指令被处理器执行时,实施如权利要求1至14中任一项所述的方法。
  17. 一种电子设备,包括:
    处理器;以及
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器被设置为执行所述可执行指令以实施如权利要求1至14中任一项所述的方法。
PCT/CN2020/096119 2019-07-15 2020-06-15 分布式系统的数据同步方法、装置、介质、电子设备 WO2021008285A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020217008399A KR102476531B1 (ko) 2019-07-15 2020-06-15 분산 시스템을 위한 데이터 동기화 방법 및 장치, 매체, 및 전자 디바이스
JP2021514604A JP7214295B2 (ja) 2019-07-15 2020-06-15 分散型システムのデータ同期方法、装置、コンピュータプログラム、及び電子機器
SG11202101244WA SG11202101244WA (en) 2019-07-15 2020-06-15 Data synchronization method and apparatus of distributed system, medium, and electronic device
US17/154,745 US11645303B2 (en) 2019-07-15 2021-01-21 Data synchronization method and apparatus of distributed system, medium, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910636195.1 2019-07-15
CN201910636195.1A CN110365768B (zh) 2019-07-15 2019-07-15 分布式系统的数据同步方法、装置、介质、电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/154,745 Continuation US11645303B2 (en) 2019-07-15 2021-01-21 Data synchronization method and apparatus of distributed system, medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2021008285A1 true WO2021008285A1 (zh) 2021-01-21

Family

ID=68219259

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/096119 WO2021008285A1 (zh) 2019-07-15 2020-06-15 分布式系统的数据同步方法、装置、介质、电子设备

Country Status (6)

Country Link
US (1) US11645303B2 (zh)
JP (1) JP7214295B2 (zh)
KR (1) KR102476531B1 (zh)
CN (2) CN110365768B (zh)
SG (1) SG11202101244WA (zh)
WO (1) WO2021008285A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726871A (zh) * 2022-03-22 2022-07-08 阿里巴巴(中国)有限公司 一种数据同步方法、装置和网络系统

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365768B (zh) 2019-07-15 2021-07-06 腾讯科技(深圳)有限公司 分布式系统的数据同步方法、装置、介质、电子设备
CN110888892B (zh) * 2019-11-15 2023-06-16 腾讯科技(深圳)有限公司 一种区块同步方法、装置及存储介质
CN110928950A (zh) * 2019-11-25 2020-03-27 深圳壹账通智能科技有限公司 区块链交易信息管理方法、装置、计算机设备及存储介质
CN111159289B (zh) * 2019-12-17 2024-03-01 深圳前海微众银行股份有限公司 一种区块同步的方法及装置
CN111147392B (zh) * 2019-12-25 2021-08-24 腾讯科技(深圳)有限公司 基于区块链的数据同步方法、装置、设备及可读存储介质
CN111241593A (zh) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 用于区块链节点的数据同步方法及装置
CN111241115B (zh) * 2020-01-07 2022-02-22 腾讯科技(深圳)有限公司 数据同步方法、装置、设备及存储介质
CN111294390B (zh) * 2020-01-17 2021-11-23 腾讯科技(深圳)有限公司 一种区块数据快速同步方法、装置、设备及存储介质
CN111338574B (zh) * 2020-02-20 2022-07-08 平安科技(深圳)有限公司 基于区块链的数据自修复方法、装置、介质及电子设备
CN111723158A (zh) * 2020-03-16 2020-09-29 支付宝(杭州)信息技术有限公司 用于区块链网络中的数据同步的方法、装置和计算设备
CN111400106B (zh) * 2020-03-27 2023-07-28 百度国际科技(深圳)有限公司 一种区块链账本同步方法、装置以及电子设备
CN111475575B (zh) * 2020-04-09 2021-08-10 腾讯科技(深圳)有限公司 基于区块链的数据同步方法、装置及计算机可读存储介质
CN111708844B (zh) * 2020-08-24 2020-12-01 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置及设备
CN111935315B (zh) * 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 区块同步方法及装置
CN112115367B (zh) * 2020-09-28 2024-04-02 北京百度网讯科技有限公司 基于融合关系网络的信息推荐方法、装置、设备和介质
US11194791B1 (en) * 2020-10-23 2021-12-07 Coinbase Crypto Services, LLC. Blockchain orchestrator computer system
CN112417052B (zh) * 2020-12-03 2021-08-20 腾讯科技(深圳)有限公司 区块链网络中的数据同步方法、装置、设备及存储介质
CN112231414B (zh) * 2020-12-14 2022-02-25 腾讯科技(深圳)有限公司 区块链系统的数据同步方法、装置、可读介质及电子设备
CN112765222B (zh) * 2021-04-07 2021-07-20 暗链科技(深圳)有限公司 基于区块链的数据传输方法、存储介质及电子设备
CN113532549B (zh) * 2021-08-27 2022-07-08 南京邮电大学 一种新能源汽车用动力电池测试系统
KR102651602B1 (ko) * 2021-12-13 2024-03-26 고려대학교 산학협력단 저궤도 위성군의 시각 동기화 방법 및 그 장치
CN114281256A (zh) * 2021-12-20 2022-04-05 广州炒米信息科技有限公司 基于分布式存储系统的数据同步方法、装置、设备及介质
CN114281260A (zh) * 2021-12-23 2022-04-05 广州炒米信息科技有限公司 应用于分布式存储系统的存储方法、装置、设备及介质
CN114979180B (zh) * 2022-05-24 2024-05-17 超聚变数字技术有限公司 数据同步方法、系统及设备
CN115086350B (zh) * 2022-06-13 2024-01-19 亿度科创(深圳)有限公司 一种区块链节点数据同步方法、设备及存储介质
CN115174594B (zh) * 2022-07-07 2024-03-29 广州炒米信息科技有限公司 分布式系统的数据同步方法、装置、设备及介质
CN115794947A (zh) * 2022-11-29 2023-03-14 蚂蚁财富(上海)金融信息服务有限公司 数据同步方法、装置、存储介质及电子设备
KR102629868B1 (ko) 2023-03-20 2024-01-30 새한프라텍 주식회사 분진 제거겸용 수지 분쇄재 결정화장치

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007049159A2 (en) * 2005-10-27 2007-05-03 Alcatel Resource matched topology database synchronization in communications networks having topology state routing protocols
CN103281707A (zh) * 2013-06-07 2013-09-04 北京交通大学 面向轨道交通基础设施服役状态检测的接入网构建方法
CN105592488A (zh) * 2014-10-24 2016-05-18 中兴通讯股份有限公司 一种时钟网络的建立方法、装置及通信节点
CN106792714A (zh) * 2017-03-02 2017-05-31 重庆邮电大学 一种针对WSN中Sybil攻击的安全时间同步方法
CN108924223A (zh) * 2018-06-29 2018-11-30 北京金山安全软件有限公司 一种区块链的节点同步方法及装置
CN110365768A (zh) * 2019-07-15 2019-10-22 腾讯科技(深圳)有限公司 分布式系统的数据同步方法、装置、介质、电子设备

Family Cites Families (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11306151A (ja) * 1998-04-27 1999-11-05 Fujitsu Ltd 分散オブジェクト処理装置及びプログラム記憶媒体
WO2001031847A1 (en) * 1999-10-22 2001-05-03 Microsoft Corporation A method for communicating with multiple network nodes
JP5672311B2 (ja) * 2010-12-22 2015-02-18 富士通株式会社 同期処理方法
JP5279888B2 (ja) 2011-12-26 2013-09-04 株式会社フジ医療器 マッサージ機
JP2013186692A (ja) 2012-03-08 2013-09-19 Hitachi Systems Ltd 仮想マシン提供システム
JP5585631B2 (ja) 2012-10-11 2014-09-10 キヤノンマーケティングジャパン株式会社 錠剤供給装置、錠剤供給方法および除電ユニット、除電方法。
US20150317175A1 (en) * 2012-11-19 2015-11-05 Hitachi Systems, Ltd. Virtual machine synchronization system
US10268410B2 (en) * 2014-10-20 2019-04-23 Netapp, Inc. Efficient modification of storage system metadata
US9686124B2 (en) * 2015-09-22 2017-06-20 Veniam, Inc. Systems and methods for managing a network of moving things
JP6464982B2 (ja) 2015-10-07 2019-02-06 株式会社デンソー 並列化方法、並列化ツール、車載装置
US10437788B2 (en) * 2015-12-08 2019-10-08 Sap Se Automatic detection, retry, and resolution of errors in data synchronization
US10021184B2 (en) * 2015-12-31 2018-07-10 Dropbox, Inc. Randomized peer-to-peer synchronization of shared content items
US20170329635A1 (en) * 2016-05-13 2017-11-16 University Of Utah Research Foundation Systems and methods for distributed computing
CN106506638B (zh) * 2016-11-04 2020-01-07 江苏通付盾科技有限公司 区块链中的区块存储方法及装置
KR101930825B1 (ko) * 2017-01-23 2018-12-19 주식회사 데일리인텔리전스 블록체인 네트워크를 이용해서 사용자를 인증하고 블록을 동기화하는 시스템 및 방법
US10102265B1 (en) * 2017-04-12 2018-10-16 Vijay K. Madisetti Method and system for tuning blockchain scalability for fast and low-cost payment and transaction processing
CN112041833A (zh) * 2017-10-16 2020-12-04 因特比有限公司 用于促进区块链之间的数据传输的方法和系统
CN107819829B (zh) * 2017-10-17 2020-07-07 上海点融信息科技有限责任公司 访问区块链的方法、系统、区块链节点设备及用户终端
CN108737498A (zh) * 2018-04-18 2018-11-02 中国地质大学(武汉) 一种基于区块链的p2p安全下载检测方法及系统
CN108848184B (zh) * 2018-06-29 2020-08-28 北京金山安全软件有限公司 一种基于信任机制的区块链节点同步方法及装置
CN109241185B (zh) 2018-08-27 2021-03-30 武汉达梦数据库股份有限公司 一种数据同步的方法以及数据同步装置
US10951408B2 (en) * 2018-09-05 2021-03-16 Nec Corporation Method and system for publicly verifiable proofs of retrievability in blockchains
CN109345388B (zh) * 2018-09-20 2020-09-08 百度在线网络技术(北京)有限公司 区块链智能合约验证方法、装置及存储介质
CN109450664B (zh) * 2018-10-09 2022-07-12 北京医拍智能科技有限公司 一种基于区块链p2p网络的数据协同处理方法及装置
CN109274754B (zh) * 2018-10-11 2021-05-04 上海保险交易所股份有限公司 用于在区块链网络中同步数据的方法、设备和存储介质
CN109863521A (zh) * 2018-12-13 2019-06-07 阿里巴巴集团控股有限公司 在区块链网络中的数据隔离
CN109889589B (zh) 2019-02-18 2021-11-23 闪联信息技术工程中心有限公司 一种基于区块链实现嵌入式硬件ota升级系统及方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007049159A2 (en) * 2005-10-27 2007-05-03 Alcatel Resource matched topology database synchronization in communications networks having topology state routing protocols
CN103281707A (zh) * 2013-06-07 2013-09-04 北京交通大学 面向轨道交通基础设施服役状态检测的接入网构建方法
CN105592488A (zh) * 2014-10-24 2016-05-18 中兴通讯股份有限公司 一种时钟网络的建立方法、装置及通信节点
CN106792714A (zh) * 2017-03-02 2017-05-31 重庆邮电大学 一种针对WSN中Sybil攻击的安全时间同步方法
CN108924223A (zh) * 2018-06-29 2018-11-30 北京金山安全软件有限公司 一种区块链的节点同步方法及装置
CN110365768A (zh) * 2019-07-15 2019-10-22 腾讯科技(深圳)有限公司 分布式系统的数据同步方法、装置、介质、电子设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726871A (zh) * 2022-03-22 2022-07-08 阿里巴巴(中国)有限公司 一种数据同步方法、装置和网络系统
CN114726871B (zh) * 2022-03-22 2024-06-11 阿里巴巴(中国)有限公司 一种数据同步方法、装置和网络系统

Also Published As

Publication number Publication date
SG11202101244WA (en) 2021-03-30
JP7214295B2 (ja) 2023-01-30
KR20210042161A (ko) 2021-04-16
CN110365768A (zh) 2019-10-22
JP2022500775A (ja) 2022-01-04
US20210141804A1 (en) 2021-05-13
CN110798509A (zh) 2020-02-14
CN110798509B (zh) 2021-09-17
US11645303B2 (en) 2023-05-09
KR102476531B1 (ko) 2022-12-13
CN110365768B (zh) 2021-07-06

Similar Documents

Publication Publication Date Title
WO2021008285A1 (zh) 分布式系统的数据同步方法、装置、介质、电子设备
US9519435B2 (en) Synchronous extent migration protocol for paired storage
US8284627B2 (en) Reducing energy consumption and optimizing workload and performance in multi-tier storage systems using extent-level dynamic tiering
CN110196770B (zh) 云系统内存数据处理方法、装置、设备及存储介质
US20200167252A1 (en) Method and apparatus for managing storage system
WO2017020742A1 (zh) 负载均衡方法及设备
CN107463342B (zh) 一种cdn边缘节点文件的存储方法及装置
WO2021155656A1 (zh) 数据处理方法和装置、访问系统、电子设备和存储介质
CN113806300B (zh) 数据存储方法、系统、装置、设备及存储介质
WO2022227373A1 (zh) 一种硬盘健康评估方法和存储设备
US20220253356A1 (en) Redundant data calculation method and apparatus
CN110633046A (zh) 一种分布式系统的存储方法、装置、存储设备及存储介质
CN111562889A (zh) 数据处理方法、装置、系统及存储介质
EP3973378A1 (en) Dual-controller storage systems
WO2021159687A1 (zh) 数据重构方法、存储设备及存储介质
CN116594551A (zh) 一种数据存储方法及装置
CN111124275B (zh) 一种分布式块存储系统的监控服务优化方法及装置
CN113076175A (zh) 用于虚拟机的内存共享方法及装置
CN115065685B (zh) 云计算资源调度方法、装置、设备及介质
US10459637B2 (en) Storage device and information processor
WO2023102784A1 (zh) 数据存取方法、装置、磁盘控制器、磁盘和数据存储系统
US9329786B2 (en) Optimized transfer and storage of highly denormalized data in an in-memory data grid
CN117938849A (zh) 传输通道管理方法、数据传输方法、管理设备及计算设备
CN117938848A (zh) 数据传输方法、传输通道分配方法、计算设备及管理设备
CN117082046A (zh) 数据上传方法、装置、设备及存储介质

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: 20841545

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021514604

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20841545

Country of ref document: EP

Kind code of ref document: A1