A data comparison method, device and medium based on Merkle tree
By using multiple Merkel trees in data comparison for data block cutting and hash value comparison, the problems of high time cost and large storage space consumption in the existing technology are solved, and fast and efficient data consistency comparison is achieved.
Patent Information
- Application Number
- CN202110834191.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-22
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-07-22
AI Technical Summary
When comparing the consistency of large-scale data in the prior art, there are problems such as high time cost, large storage space consumption, and the inability to compare while transmitting.
Using the data comparison method based on the Merkel tree, by determining the data source to be compared, using the same slicing method to cut the data blocks into the same number of data blocks, constructing multiple Merkel trees, and comparing them based on the root hash value and the intermediate node hash value to determine whether the data source is consistent.
It realizes that when ensuring data consistency comparison efficiency and balance of storage space, it can quickly locate data inconsistent locations, reducing transmission cost and comparison time.
Smart Images

Figure CN115687287B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data comparison, and specifically relates to a data comparison method, device, and medium based on a Merkle tree. Background Art
[0002] In the process of industrial digitalization, data transmission, synchronization, and comparison are indispensable operations. When performing operations such as database synchronization, migration, and blockchain ledger synchronization, consistency comparison is a necessary step to ensure the effectiveness of data transmission, synchronization, etc.
[0003] If the hash value of the entire data is directly calculated for comparison, it is difficult to locate the specific position where the data is inconsistent when the data is inconsistent. Re-transmitting the entire data requires a huge cost. Traditional data comparison methods usually cut the data into pieces and then compare them. In the process of verifying the data correctness and locating the position where the data is inconsistent, this method requires a large time cost, and it is necessary to compare the hash values of each piece of data pairwise to determine whether all the data is accurate.
[0004] The emergence of Bitcoin has proposed a new data comparison method, that is, using a Merkle tree for data comparison. Although using a Merkle tree for comparison saves the computational amount consumed by comparison, in order to store the entire Merkle tree, it requires more storage space compared with traditional methods. At the same time, when performing consistency comparison on data transmission, it is impossible to compare while transmitting, and it is necessary to wait until the entire file is transmitted before comparing.
[0005] Therefore, there is an urgent need for an efficient data consistency comparison method for a large amount of data. Summary of the Invention
[0006] To solve the above problems, this application proposes a data comparison method based on a Merkle tree, including:
[0007] Determine the first data source and the second data source to be compared, where the data in the first data source and the second data source are in one-to-one correspondence; use the same splitting method to split the first data source and the second data source respectively to obtain the first data blocks and the second data blocks, and the number of the first data blocks and the second data blocks is the same; obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the construction quantity of the Merkle tree; use the same construction method to process the first data blocks and the second data blocks respectively to obtain the first Merkle tree group and the second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group.
[0008] In one example, the same splitting method is used to split the first data source and the second data source respectively, which specifically includes: splitting the first data source and the second data source according to the number of data, and taking several pieces of data as a data block.
[0009] In one example, the method further includes: determining the remaining storage space of the server, and adjusting the construction quantity of the Merkle tree according to the remaining storage space, so as to balance the time complexity and space complexity consumed by the data comparison task.
[0010] In one example, the same construction method is used to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, which specifically includes: determining the construction quantity of the Merkle tree, determining the data block corresponding to each Merkle tree, and obtaining several pieces of data in the data block; calculating the hash value of each piece of data in the several pieces of data; generating the first Merkle tree group and the second Merkle tree group according to the hash value of each piece of data.
[0011] In one example, determining whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group specifically includes: determining the Merkle tree in the second Merkle tree group corresponding to the Merkle tree in the first Merkle tree group in the construction order; determining the root hash value of the Merkle tree in the first Merkle tree group and the root hash value of the corresponding Merkle tree in the second Merkle tree group; if the root hash value of the Merkle tree in the first Merkle tree group is consistent with the root hash value of the corresponding Merkle tree in the second Merkle tree group, the data corresponding to the Merkle tree in the first Merkle tree group is the same as the data corresponding to the corresponding Merkle tree in the second Merkle tree group.
[0012] In one example, the method further includes: if the root hash value of the Merkle tree in the first Merkle tree group is inconsistent with the root hash value of the corresponding Merkle tree in the second Merkle tree group, determining whether the hash value of each piece of data in the Merkle tree in the first Merkle tree group is the same as the hash value of each piece of data in the corresponding Merkle tree in the second Merkle tree group; if they are different, determining that the piece of data is inconsistent with the corresponding data.
[0013] In one example, after determining whether the first data source and the second data source are consistent, the method further includes: displaying the comparison result of the first Merkle tree group and the second Merkle tree group, so that the user can determine the location where the different data exists.
[0014] The present application also provides a data comparison device based on a Merkle tree, including:
[0015] at least one processor; and a memory communicatively connected to the at least one processor; wherein,
[0016] the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to:
[0017] determine a first data source and a second data source to be compared, where the data in the first data source and the second data source are in one-to-one correspondence; use the same splitting method to split the first data source and the second data source respectively to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same; obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the number of Merkle trees to be constructed; use the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; and determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group.
[0018] The present application also provides a non-volatile computer storage medium storing computer-executable instructions, and the computer-executable instructions are configured to:
[0019] determine a first data source and a second data source to be compared, where the data in the first data source and the second data source are in one-to-one correspondence; use the same splitting method to split the first data source and the second data source respectively to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same; obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the number of Merkle trees to be constructed; use the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; and determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group.
[0020] The method proposed by the present application can bring the following beneficial effects:
[0021] Set the number of Merkle trees used for consistency comparison, balance the time complexity and space complexity consumed by the data comparison task, and make the speed and occupied space for data consistency comparison meet the objective conditions and actual requirements. By adjusting parameters, this method covers the traditional method of comparing hash values one by one and the standard Merkle tree comparison method. On the basis of these two methods, it adds more time and space complexity matching methods, providing more flexible solutions for data consistency comparison. Brief Description of the Drawings
[0022] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0023] Figure 1 It is a schematic flowchart of a data comparison method based on Merkle tree in an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of a data comparison method based on Merkle tree in an embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of a data comparison device based on Merkle tree in an embodiment of the present application. Detailed Embodiments
[0026] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0027] A Merkle tree is a binary tree. Its leaf nodes contain basic information. Each intermediate node is the hash of its two child nodes. Eventually, a root node is formed, which is also the hash of its two child nodes and represents the "top" of the tree. Therefore, when using a Merkle tree for data comparison, the data on both sides are constructed into a Merkle tree using the same method. First, the values of the root nodes are compared. If the root nodes are the same, it indicates that the data are the same. If the root nodes are different, then compare level by level until the position of the leaf node where the error occurs is located. Using this method, the number of comparisons required to locate the error node is much less than direct pairwise comparison. The number of comparisons is the logarithm of the number of chunks. However, to store the entire Merkle tree, it requires more storage space compared to traditional methods, which is the square of the number of chunks. Of course, it also requires hash value calculations of the order of the square of the number of chunks. However, since the efficiency of hash value calculation is very high, we ignore the impact caused by this part of the computational effort.
[0028] For different usage scenarios, different server performances, and different timeliness requirements, simply using the traditional method of pairwise comparison of hash values or the Merkle tree method cannot best match the objective requirements. This patent proposes a data consistency comparison method with a complexity balance mechanism based on the Merkle tree, which uses multiple rather than a single Merkle tree for data consistency comparison. For a fixed number of data blocks, by adjusting the number of Merkle trees used, the time complexity and space complexity required for comparison are balanced.
[0029] Based on this method, this patent conducts quantitative analysis on its time complexity and space complexity respectively. In actual use, according to the specific scenario faced, adjust the number of Merkle trees for data consistency comparison to improve the comparison efficiency.
[0030] The following will, in conjunction with the accompanying drawings, detail the technical solutions provided by each embodiment of the present application.
[0031] As Figure 1 and Figure 2 shown, the embodiment of the present application provides a data comparison method based on a Merkle tree, including:
[0032] S101: Determine a first data source and a second data source to be compared, and the data in the first data source and the second data source are in one-to-one correspondence.
[0033] The first data source and the second data source here are the two data sources for which the data comparison task needs to be performed. Of course, the data comparison task can also be performed on multiple data sources, but during the comparison process, it can also be simplified to a pairwise comparison mode, and finally the data difference points between each data source are obtained. When performing the data comparison task, this method is mainly applicable to the comparison of two data sources with the same number of data entries, or the situation where the two data sources differ by only one data entry. If they differ by multiple data entries, although it can be completed by first screening and then comparing again after excluding the missing data, there is too much repetition and the efficiency is not high. For example, when performing data migration, in order to ensure that the data has not changed before and after migration, the first data source can be the database before migration, and the second data source can be the database after migration.
[0034] S102: Use the same splitting method to split the first data source and the second data source respectively, to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same.
[0035] After determining the two data sources, it is necessary to split the data sources so that each data source is divided into N data blocks. For convenience of reference, the data blocks obtained after splitting the first data source are called the first data blocks, and the data blocks obtained after splitting the second data source are called the second data blocks. It should be noted here that the data sources need to be split in the same order to ensure that the data in the corresponding first data block and the second data block are arranged in the same order.
[0036] S103: Obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the number of Merkle trees to be constructed.
[0037] After obtaining two sets of corresponding data blocks, it is necessary to determine the number of Merkle trees to be constructed. The reference factors should at least include the accuracy requirement of the data comparison task, the size of the data source, the general performance of the server, etc., so as to artificially determine the number of Merkle trees to be constructed, M.
[0038] S104: Use the same construction method to process the first data block and the second data block respectively, to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same.
[0039] After determining the number of Merkle tree structures, use the same construction method to construct N first data blocks and N second data blocks. When constructing, it is necessary to pay attention to making the number of leaf nodes of each Merkle tree as average as possible, and use the corresponding data blocks to construct in the same order to obtain the first Merkle tree group and the second Merkle tree group. Among them, the first Merkle tree group corresponds to the first data source, the second Merkle tree group corresponds to the second data source, and the Merkle trees in the first Merkle tree group and the second Merkle tree group correspond one by one.
[0040] S105: Determine whether the first data source is consistent with the second data source according to the first Merkle tree group and the second Merkle tree group.
[0041] In one embodiment, if different splitting methods are used for the first data source and the second data source, it may lead to different numbers and orders of data in the data blocks, and then lead to different hash values of each node of the constructed Merkle tree, thus making the Merkle tree lose the function of data comparison. Based on this, when splitting the data source, it can be split according to the number of data. For example, every 8 pieces of data form a data block. Splitting in this way according to the number of data from front to back can not only ensure that the order of the data is correct, but also ensure that the number of data in each data block is the same, thus ensuring the data verification function of the Merkle tree.
[0042] In one embodiment, because the traditional method of comparing hash values one by one has a lower requirement for space complexity and a higher requirement for time complexity; the ordinary method of comparing Merkle trees has a lower time complexity but a higher space complexity. In order to reasonably balance the data comparison task, before determining the number M of constructed Merkle trees, the remaining storage space of the server can also be determined first, and then the number M of Merkle trees can be adjusted manually according to the remaining storage space of the server.
[0043] In one embodiment, when constructing the first and second Merkle tree groups, it is first necessary to determine the number M of Merkle trees to be constructed in each group of Merkle tree groups, and determine the data blocks corresponding to each Merkle tree, and obtain the data contained in the data blocks. Calculate the hash value of each piece of data, and generate a Merkle tree based on the hash value. Taking a data source containing 8 pieces of source data as an example, assuming N = 4 and M = 2, when constructing a Merkle tree for this data source, first the 8 pieces of source data should be cut into 4 data blocks, and then two Merkle trees are constructed. When constructing the first Merkle tree, hash the 4 pieces of source data respectively to obtain the corresponding hash values n1, n2, n3, n4, and n1, n2, n3, n4 are used as the leaf nodes of the first Merkle tree. The hash value n5 obtained by hashing n1 and n2 and the hash value n6 obtained by hashing n3 and n4 are used as the intermediate nodes of the first Merkle tree. The hash value obtained by hashing n5 and n6 is used as the root hash of the first Merkle tree. Thus, a complete first Merkle tree is generated, and in this way, two groups of Merkle tree groups are generated.
[0044] In one example, when comparing two groups of Merkle tree groups, it is first necessary to determine the one-to-one correspondence of the Merkle trees in the two Merkle tree groups according to the order during construction. When comparing, it is the comparison of the corresponding Merkle trees. When comparing, first compare the root hash values of the Merkle trees. If the root hash values of the two Merkle trees are the same, it means that the data corresponding to these two Merkle trees is the same.
[0045] Furthermore, if the root hash values of the two Merkle trees are different, it means that the data corresponding to these two Merkle trees is inconsistent. At this time, it is necessary to further determine which piece of source data is different, and it is necessary to compare the hash values of the intermediate nodes of these two Merkle trees to further narrow down the scope. Until finally the specific piece of source data that is inconsistent is screened out.
[0046] In one embodiment, after screening out which piece of source data in the first data source and the second data source is inconsistent, it should also be displayed in the comparison results of the two groups of Merkle tree groups to facilitate the staff to determine the specific location where the different data exists.
[0047] Using a data comparison method based on Merkle tree provided by this application, the main advantage is that an appropriate M can be selected according to the value of N to balance the time complexity and space complexity consumed in the comparison process. For the traditional method of comparing hash values one by one, the consumed time complexity is o(N), and the space complexity is o(N). For the standard Merkle tree comparison method, the consumed time complexity is o(log2(2*N)), and the space complexity is o(N2). Using a data value execution comparison method based on Merkle tree with a complexity balancing mechanism, the consumed time complexity is o(M*log2(2*N / M)), and the space complexity is o(M*(N / M)2). Through complexity analysis, it can be seen that for a fixed N, adjusting the value of M, the time complexity increases with the growth of M, and the space complexity decreases with the growth of M. When M is 1, it is the same as the standard Merkle tree comparison method, and when M is N, it is the same as the traditional method of comparing hash values one by one.
[0048] As Figure 3 shown, the embodiment of this application also provides a data comparison device based on Merkle tree, including:
[0049] At least one processor; and,
[0050] A memory communicatively connected to the at least one processor; wherein,
[0051] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0052] Determine a first data source and a second data source to be compared, where the data in the first data source and the second data source are in one-to-one correspondence; use the same splitting method to split the first data source and the second data source respectively to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same; obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the construction quantity of the Merkle tree; use the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group.
[0053] The embodiment of this application also provides a non-volatile computer storage medium storing computer-executable instructions, and the computer-executable instructions are set as:
[0054] Determine a first data source and a second data source to be compared, where the data in the first data source and the second data source are in one-to-one correspondence; use the same segmentation method to segment the first data source and the second data source respectively to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same; obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the number of Merkle trees to be constructed; use the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group.
[0055] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0056] The devices and media provided in the embodiments of this application correspond one-to-one to the methods. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.
[0057] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0058] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for realizing the processes Figure 1 one process or multiple processes and / or blocksFigure 1 means for the functions specified in one or more blocks.
[0059] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 process or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks.
[0060] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one Figure 1 process or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks.
[0061] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0062] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0063] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0064] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.
[0065] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A data comparison method based on a Merkle tree, characterized in that, the method includes: Determine a first data source and a second data source to be compared, and the data in the first data source and the second data source are in one-to-one correspondence; Use the same segmentation method to segment the first data source and the second data source respectively to obtain a first data block and a second data block, and the number of the first data block and the second data block is the same; Obtain the accuracy requirement of the data comparison task, the sizes of the first data source and the second data source, and the server performance, and determine the construction quantity of the Merkle tree; Use the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, and the number of Merkle trees in the first Merkle tree group and the second Merkle tree group is the same; Determine whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group; Using the same segmentation method to segment the first data source and the second data source respectively, specifically including: Segment the first data source and the second data source according to the number of data, and take several pieces of data as a data block; The method further includes: Determine the remaining storage space of the server, and adjust the construction quantity of the Merkle tree according to the remaining storage space to balance the time complexity and space complexity consumed by the data comparison task; Using the same construction method to process the first data block and the second data block respectively to obtain a first Merkle tree group and a second Merkle tree group, specifically including: Determine the construction quantity of the Merkle tree, determine the data block corresponding to each Merkle tree, and obtain several pieces of the data in the data block; Calculate the hash value of each piece of data in the several pieces of data; Generate the first Merkle tree group and the second Merkle tree group according to the hash value of each piece of data.
2. The method according to claim 1, characterized in that, the determining whether the first data source and the second data source are consistent according to the first Merkle tree group and the second Merkle tree group specifically includes: Determine the Merkle tree in the second Merkle tree group corresponding to the Merkle tree in the first Merkle tree group according to the construction order; Determine the root hash value of the Merkle tree in the first Merkle tree group and the root hash value of the corresponding Merkle tree in the second Merkle tree group; If the root hash value of the Merkle tree in the first Merkle tree group is consistent with the root hash value of the corresponding Merkle tree in the second Merkle tree group, the data corresponding to the Merkle tree in the first Merkle tree group is the same as the data corresponding to the corresponding Merkle tree in the second Merkle tree group.
3. The method according to claim 2, characterized in that, the method further includes: If the root hash value of the Merkle tree in the first Merkle tree group is inconsistent with the root hash value of the corresponding Merkle tree in the second Merkle tree group, determine whether the hash value of each piece of data in the Merkle tree in the first Merkle tree group is the same as the hash value of each piece of data in the corresponding Merkle tree in the second Merkle tree group; If they are different, determine that the piece of data is inconsistent with the corresponding data.
4. The method according to claim 1, wherein, after determining whether the first data source is consistent with the second data source, the method further includes: displaying the comparison result between the first Merkle tree group and the second Merkle tree group, so that the user can determine the location where the differential data exists.
5. A data comparison device based on Merkle tree, wherein, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute: the steps of the method according to any one of claims 1-4.
6. A non-volatile computer storage medium storing computer-executable instructions, wherein, the computer-executable instructions are configured to: execute the steps of the method according to any one of claims 1-4.
Citation Information
Patent Citations
Block chain-based data consistency comparison method and device, and medium
CN110990378A
Cloud data ownership verification method and device, equipment and medium
CN112291236A