Data consistency verification method, device, electronic device, storage medium and product
By dividing the data range into sub-ranges and processing them on multiple computing nodes, the problem of poor flexibility of data consistency verification methods in the existing technology is solved, independent verification and efficient expansion are achieved, and data processing efficiency is improved.
Patent Information
- Application Number
- CN202410726117.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-05
AI Technical Summary
Existing data consistency verification methods are less flexible and difficult to expand, making it difficult to independently perform verification calculations for each object during data processing.
By dividing the data range to be verified into multiple sub-ranges and performing verification in parallel on multiple computing nodes, the verification results of each sub-range are independently processed, decoupling the verification calculation, and improving flexibility and scalability.
It achieves the independence of the verification calculation of each object, improves the flexibility and scalability of the data consistency verification method, reduces the resource consumption of recalculation after interruption, and improves the data processing efficiency.
Smart Images

Figure CN118296016B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of databases, and can be used in the field of distributed databases, for example. Specifically, the present disclosure relates to a data consistency verification method, device, electronic device, storage medium and product. Background Art
[0002] Data consistency verification refers to a technical means to ensure the accuracy, integrity and reliability of data during the data processing process.
[0003] In the existing data consistency verification method, for two objects to be verified, the first object is usually scanned line by line, and the data in the scanned first object is compared with the related data in the second object; then the second object is scanned line by line, and the data in the scanned second object is compared with the related data in the first object. This method has poor flexibility and is not easy to expand. Summary of the invention
[0004] The embodiments of the present disclosure provide a data consistency verification method, device, electronic device, storage medium and product, which can solve the problems of poor flexibility and difficulty in expansion in the prior art. The technical solutions provided by the present disclosure are as follows:
[0005] According to one aspect of an embodiment of the present disclosure, a data consistency verification method is provided, the method comprising:
[0006] Determine a first object and a second object to be verified; the first object includes at least two sets of first data; the second object includes at least two sets of second data;
[0007] Perform at least one verification operation based on the first object and the second object until a data consistency verification result meets a preset end condition;
[0008] The verification operation includes:
[0009] Determine a first data range corresponding to a current verification operation of the first object, and divide the first data range into at least two first sub-ranges;
[0010] By respectively verifying the first data of at least two first sub-ranges, a first verification result for each first sub-range with respect to the first object is obtained;
[0011] Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object;
[0012] Based on the first verification results and the second verification results respectively corresponding to each first sub-range, a data consistency verification result corresponding to the current verification operation is obtained.
[0013] Optionally, the first data range corresponding to the first verification operation is a range composed of identifiers corresponding to the plurality of groups of first data of the first object respectively;
[0014] The verification operation also includes:
[0015] If the data consistency check result does not meet the preset end condition, based on the data consistency check result, at least one target sub-range with inconsistent check results is determined from the at least one first sub-range, and each target sub-range is used as the first data range corresponding to the next check operation.
[0016] Optionally, the verification operation further includes:
[0017] The first verification results and the second verification results corresponding to the first sub-ranges are stored in the verification result table;
[0018] The obtaining of the data consistency verification result corresponding to the current verification operation based on the first verification results and the second verification results respectively corresponding to each first sub-range includes:
[0019] At least two data rows corresponding to each first sub-range in the verification result table are determined, and the data consistency verification result is obtained based on the first verification result and the second verification result in each data row.
[0020] Optionally, the detection operation further includes:
[0021] Determine a second data range corresponding to at least two groups of second data in the second object, and divide the second data range into at least two second sub-ranges;
[0022] The obtaining, based on the association between the first object and the second object, a second verification result of each first sub-range for the second object includes:
[0023] For each second sub-range, obtaining a check value corresponding to at least one set of second data in the second sub-range;
[0024] For each group of second data, based on the association relationship between the first data and the second data, determining a first sub-range corresponding to the second data;
[0025] For each first sub-range, based on the verification values respectively corresponding to at least one set of second data in the first sub-range, a second verification result of the first sub-range for the second object is determined.
[0026] Optionally, the obtaining a first verification result for each first sub-range with respect to the first object by respectively verifying the first data of at least two first sub-ranges includes:
[0027] The at least two first sub-ranges are distributed to at least two computing nodes, and each computing node performs a consistency check based on the received data of at least one first sub-range to obtain first check results for the first object corresponding to each first sub-range.
[0028] Optionally, for each computing node, performing consistency check based on the received data of at least one first sub-range includes:
[0029] Acquire data of at least one first sub-range;
[0030] Determine a target verification algorithm corresponding to the data of the at least one first sub-range;
[0031] Based on the target verification algorithm, a consistency check is performed on the data of the at least one first sub-range.
[0032] Optionally, dividing the first data range into at least two first sub-ranges includes:
[0033] Determine the number of divisions based on at least one of the computing resources corresponding to the at least two computing nodes, the amount of data corresponding to the data in the first data range, and data processing instruction information;
[0034] The first data range is divided into the number of first sub-ranges.
[0035] Optionally, the verification operation further includes:
[0036] If a data update operation is detected, an update record corresponding to the data update operation is added to the verification result table;
[0037] Based on the update record, determining at least one third sub-range related to the data update operation from the at least one first sub-range;
[0038] Updating the first verification result and the second verification result respectively corresponding to the at least one third sub-range;
[0039] The data consistency check result is updated based on the new first check result and the new second check result respectively corresponding to each third sub-range.
[0040] According to another aspect of an embodiment of the present disclosure, a data consistency verification device is provided, the device comprising:
[0041] An object determination module, used to determine a first object and a second object to be verified; the first object includes at least two sets of first data; the second object includes at least two sets of second data;
[0042] A verification module, used to perform at least one verification operation based on the first object and the second object until a data consistency verification result meets a preset end condition;
[0043] The verification operation includes:
[0044] Determine a first data range corresponding to a current verification operation of the first object, and divide the first data range into at least two first sub-ranges;
[0045] By respectively verifying the first data of at least two first sub-ranges, a first verification result for each first sub-range with respect to the first object is obtained;
[0046] Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object;
[0047] Based on the first verification results and the second verification results respectively corresponding to each first sub-range, a data consistency verification result corresponding to the current verification operation is obtained.
[0048] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any one of the above-mentioned data consistency verification methods when executing the program.
[0049] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data consistency verification methods are implemented.
[0050] According to one aspect of an embodiment of the present disclosure, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned data consistency verification methods are implemented.
[0051] The technical solution provided by the embodiments of the present disclosure has the following beneficial effects:
[0052] By verifying the first object and the second object respectively, and obtaining the data consistency verification result based on the first verification result and the second verification result corresponding to each first sub-range in the first data range, the verification calculation of the first object is decoupled from the verification calculation of the second object, so that the verification calculation of each object can be performed independently, and it is easier to expand the verification calculation for each object, thereby improving the flexibility of the data consistency verification method and making it more scalable.
[0053] Furthermore, in the embodiment of the present disclosure, by dividing the first data range into multiple first sub-ranges, and by respectively verifying the multiple first sub-ranges, a first verification result corresponding to each first sub-range is obtained, and the verification calculation task of the first object is divided into multiple sub-tasks. The verification calculation of each first sub-range can be performed independently, which makes it easier to expand the verification calculation for the first sub-range, further improving the flexibility of the data consistency verification method and making it more scalable.
[0054] Furthermore, when a check calculation of any first sub-range fails, it will not affect the check calculations of other first sub-ranges, so that the check calculation can be continued from the interrupted position after the data consistency check process is interrupted. Compared with the prior art where each interruption has to start from the beginning, computing resources are saved and data processing efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for describing the embodiments of the present disclosure are briefly introduced below.
[0056] Figure 1 A schematic diagram of a data consistency verification method according to an embodiment of the present disclosure;
[0057] Figure 2 A schematic diagram of a first object and a second object provided in an embodiment of the present disclosure;
[0058] Figure 3 A schematic diagram of a storage object provided in an embodiment of the present disclosure;
[0059] Figure 4 A flowchart of another data consistency verification method provided by an embodiment of the present disclosure;
[0060] Figure 5 A schematic diagram of the structure of a data consistency verification device provided in an embodiment of the present disclosure;
[0061] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0062] The embodiments of the present disclosure are described below in conjunction with the drawings in the present disclosure. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions of the embodiments of the present disclosure.
[0063] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present disclosure refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" or "A, B" indicates that it is implemented as "A", or implemented as "B", or implemented as "A and B".
[0064] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0065] In the specific implementation of the present disclosure, any data related to an object is involved. When the embodiments of the present disclosure are applied to specific products or technologies, the permission or consent of the object needs to be obtained, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if any of the above data related to an object is involved in the embodiments of the present disclosure, these data need to be obtained with the authorization and consent of the object and in compliance with the relevant laws, regulations and standards of the country and region.
[0066] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present disclosure and the technical effects produced by the technical solutions of the present disclosure. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0067] Figure 1 A schematic diagram of a data consistency verification method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the method includes:
[0068] Step S110, determining a first object and a second object to be verified; the first object includes at least two groups of first data; the second object includes at least two groups of second data.
[0069] Specifically, the first object and the second object to be verified may be two objects that need to be verified for data consistency, and the data in the first object and the data in the second object are associated with each other.
[0070] The first object may include at least two sets of first data, and the first data may be understood as a component unit of data in the first object, for example, when the first object is a table, the first data may be a data row. Similarly, the second object may include at least two sets of second data.
[0071] It should be noted that the first data and the second data may be different types of data, and the number of first data included in the first object and the objects of second data included in the second object may also be different. The embodiment of the present disclosure does not specifically limit the specific settings of the first object and the second object.
[0072] Optionally, in a database, the first object and the second object may be any two database objects for the same table in the database, and the database objects may include tables, columns, indexes, constraints, views, functions / stored procedures, triggers, etc. For example, the first object is a table, and the second object is an index of the table.
[0073] Optionally, during the process of data migration or transmission, the first object may be original data, and the second object may be data migrated or transmitted to other storage media.
[0074] Optionally, during the data synchronization process, the first object and the second object may need two types of data to be synchronized.
[0075] It should be noted that the present embodiment and subsequent embodiments use the first object as a table and the second object as an index of the table as examples for explanation. Those skilled in the art can know that the above examples do not constitute specific limitations on the first object and the second object in the present embodiment.
[0076] Step S120, performing at least one verification operation based on the first object and the second object until the data consistency verification result meets a preset end condition.
[0077] Specifically, after obtaining the first object and the second object, at least one verification operation can be performed based on the first object and the second object to obtain a data consistency verification result corresponding to at least one verification operation. If the data consistency verification result corresponding to any verification operation meets the preset conditions, the data consistency verification result corresponding to the verification operation is used as the final data consistency verification result, and the verification operation is stopped.
[0078] The data consistency check result may include whether the data between the first object and the second object are consistent or inconsistent; when the check result is inconsistent, it may also include the data range corresponding to the inconsistent check result.
[0079] The preset termination condition may be at least one of the following: a data consistency check result showing that the data of the first object is consistent with that of the second object; a data range with inconsistent data as a result of the check converges (i.e., the error between the inconsistent data range of the current check operation and the inconsistent data range of the next check operation is not greater than a preset error); and a data range with inconsistent data as a result of the check reaches a preset range accuracy (i.e., the data range with inconsistent data as a result of the check can be located to at least one group of data, for example, can be located to a data row in the table of the first object).
[0080] It should be noted that when the data consistency result corresponding to the first verification operation meets the preset end condition, the verification operation can be performed only once.
[0081] The verification operation includes:
[0082] (1) determining a first data range corresponding to a current verification operation of a first object, and dividing the first data range into at least two first sub-ranges;
[0083] (2) obtaining a first verification result for each first sub-range with respect to the first object by respectively verifying the first data of at least two first sub-ranges;
[0084] (3) based on the association between the first object and the second object, obtaining a second verification result of each first sub-range with respect to the second object;
[0085] (4) Based on the first verification results and the second verification results corresponding to each first sub-range, a data consistency verification result corresponding to the current verification operation is obtained.
[0086] Specifically, after the first object is determined, a first data range corresponding to the first object in the current verification operation may be determined, and the first data range may be used to characterize a range of data that needs to be verified in the current verification operation.
[0087] After obtaining the first data range, the first data range may be divided to obtain at least two first sub-ranges. By performing verification calculations on the first data corresponding to the at least two first sub-ranges, first verification results for the first object corresponding to each first sub-range are obtained.
[0088] The second data in the second object can be verified, and based on the correlation between the first object and the second object, each first sub-range is used as a basis for classification, and the verification results corresponding to at least two groups of second data in the second object are respectively classified to obtain the second verification result of each first sub-range for the second object.
[0089] For each first sub-range, the first verification result corresponding to the first sub-range is compared with the second verification result to obtain the verification result corresponding to the first sub-range, and based on the verification results corresponding to each first sub-range, the data consistency verification result corresponding to the current verification operation is obtained.
[0090] Optionally, if the verification results corresponding to the first sub-ranges are all consistent, then; if there is a first sub-range whose corresponding verification result is inconsistent, it can be determined that the data consistency verification result is that the data between the first object and the second object is inconsistent.
[0091] In the disclosed embodiment, the first object and the second object are verified respectively, and the data consistency verification result is obtained based on the first verification results and the second verification results corresponding to each first sub-range in the first data range, thereby decoupling the verification calculation of the first object from the verification calculation of the second object, so that the verification calculation of each object can be performed independently, and it is easier to expand the verification calculation for each object, thereby improving the flexibility of the data consistency verification method and making it more scalable.
[0092] Furthermore, in the embodiment of the present disclosure, by dividing the first data range into multiple first sub-ranges, and by respectively verifying the multiple first sub-ranges, a first verification result corresponding to each first sub-range is obtained, and the verification calculation task of the first object is divided into multiple sub-tasks. The verification calculation of each first sub-range can be performed independently, which makes it easier to expand the verification calculation for the first sub-range, further improving the flexibility of the data consistency verification method and making it more scalable.
[0093] Furthermore, when a check calculation of any first sub-range fails, it will not affect the check calculations of other first sub-ranges, so that the check calculation can be continued from the interrupted position after the data consistency check process is interrupted. Compared with the prior art where each interruption has to start from the beginning, computing resources are saved and data processing efficiency is improved.
[0094] As an optional implementation, the first data range corresponding to the first verification operation is a range composed of identifiers corresponding to the multiple groups of first data of the first object;
[0095] The verification operation also includes:
[0096] If the data consistency check result does not meet the preset end condition, based on the data consistency check result, at least one target sub-range with inconsistent check results is determined from at least one first sub-range, and each target sub-range is used as the first data range corresponding to the next check operation.
[0097] Specifically, each group of first data in the first object may include an identifier corresponding thereto. When performing the first verification operation, a range consisting of identifiers corresponding to the multiple groups of first data included in the first object may be used as the first data range corresponding to the first verification operation.
[0098] For example, when the first object is a table, the first data may be a data row, and the row number or primary key corresponding to the data row may be used as the identifier corresponding to the data row. Assuming that the first object includes 100 data rows arranged in sequence from identifier 1 to identifier 100, the first data range corresponding to the first object in the first verification operation may be the range (1, 100) formed by these 100 identifiers.
[0099] After executing a verification operation, if the data consistency verification result corresponding to the current verification operation meets the preset end condition, the data consistency verification is ended and the data consistency verification result corresponding to the current verification operation is output.
[0100] If the data consistency check result corresponding to the current check operation does not meet the preset end condition, based on the check results corresponding to each first sub-range in the data consistency check result, a first sub-range with inconsistent check results in at least one first sub-range is used as a target sub-range, thereby obtaining at least one target sub-range, and each target sub-range is used as the first data range corresponding to the next check operation, by further dividing each target sub-range into sub-ranges with smaller granularity, and by checking the data of these smaller sub-ranges, the range of data inconsistency is reduced to a smaller scale, and the above steps are repeated until the preset end condition is met.
[0101] By performing multiple verification operations, the scope of inconsistent data is continuously narrowed, and the data with data consistency problems can be more accurately located, thereby helping users to quickly find the data with data consistency problems and repair this part of the data. At the same time, the amount of data for subsequent verification operations can be greatly reduced, further improving data processing efficiency.
[0102] Optionally, after the first verification operation is executed, an overall verification result of whether the data between the first object and the second object are consistent can be returned to the user; when the verification result is inconsistent, the verification operation can continue to be performed until the preset end condition is met, and a more precise inconsistent data range when the preset end condition is met can be returned to the user. An overall data consistency verification result can be fed back to the user in a timely manner to meet the user's real-time requirements for data consistency verification; a more precise data range of inconsistent data can also be returned to the user to meet the user's accuracy requirements for data consistency verification.
[0103] In addition, in the process of performing multiple verification operations, the data scope of inconsistent data is continuously narrowed, which greatly reduces the amount of data for subsequent verification operations, improves data processing efficiency, reduces user response time, and improves user experience.
[0104] It should be noted that, in the embodiments of the present disclosure, the verification operation process can be specifically configured according to the actual needs of the user for data consistency verification, and the embodiments of the present disclosure do not limit this.
[0105] As an optional embodiment, the verification operation further includes:
[0106] The first verification results and the second verification results corresponding to the first sub-ranges are stored in the verification result table;
[0107] Based on the first verification results and the second verification results respectively corresponding to each first sub-range, a data consistency verification result corresponding to the current verification operation is obtained, including:
[0108] At least two data rows corresponding to each first sub-range in the verification result table are determined, and a data consistency verification result is obtained based on the first verification result and the second verification result in each data row.
[0109] Specifically, when performing a verification operation, the first verification results and the second verification results corresponding to each first sub-range can also be stored in the verification result table. For example, for each first sub-range, the first sub-range, and the first verification results and the second verification results corresponding to the first sub-range can be used as a data row in the verification result table.
[0110] On this basis, it is possible to determine at least two data rows corresponding to each first sub-range in the verification result table. For each data row, by comparing the first verification result and the second verification result in the data row, the verification results corresponding to the first sub-ranges corresponding to the data row can be obtained, and then the data consistency verification result corresponding to the current verification operation can be obtained.
[0111] In the disclosed embodiment, the first verification result and the second verification result respectively corresponding to each first sub-range are stored in a verification result table, thereby achieving persistence of the verification results respectively corresponding to each first sub-range. When a verification calculation of any first sub-range fails, it is only necessary to re-calculate the verification of the first sub-range where the failure occurs, and at the same time, the verification results already calculated for other first sub-ranges can be directly used. There is no need to re-calculate the verification of other first sub-ranges, thereby saving computing resources and improving data processing efficiency.
[0112] As an optional embodiment, the detection operation further includes:
[0113] Determine a second data range corresponding to at least two groups of second data in the second object, and divide the second data range into at least two second sub-ranges;
[0114] Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object includes:
[0115] For each second sub-range, obtaining a check value corresponding to at least one set of second data in the second sub-range;
[0116] For each group of second data, based on the association relationship between the first data and the second data, determine a first sub-range corresponding to the second data;
[0117] For each first sub-range, based on the verification values respectively corresponding to at least one set of second data in the first sub-range, a second verification result of the first sub-range for the second object is determined.
[0118] Specifically, to obtain the second verification result of each first sub-range for the second object, a second data range corresponding to at least two groups of second data included in the second object may be obtained, and the second data range may be divided to obtain at least two second sub-ranges.
[0119] Optionally, a range consisting of keys corresponding to at least two groups of second data included in the second object may be used as the second data range.
[0120] Figure 2 A schematic diagram of a first object and a second object provided in an embodiment of the present disclosure, such as Figure 2 As shown, the first object is table 1, which includes three columns. The second object is an index 1 of table 1. Index 1 uses the combination of column 2 and column 1 in the table as the key and the primary key pk of the corresponding data row in table 1 as the value. Figure 2 In the given example, a range consisting of primary keys pk of multiple data rows in table 1 can be used as the first data range, and a range consisting of keys keys of multiple data rows in index 1 of table 1 can be used as the second data range.
[0121] Optionally, Figure 3 A schematic diagram of a storage object provided by an embodiment of the present disclosure, such as Figure 3 As shown in the figure, when actually storing objects, each system will store them in blocks according to the storage system on the operating system running the database or big data processing system. A data block usually refers to a continuous storage unit at a physical location on a storage device. Figure 3 In the storage space of the table shown, when the first object is a table and the second object is an index of the table, the storage space for a table (Table) may include a storage space for storing the first object and a storage space for storing the second object. The storage spaces corresponding to the first object and the second object respectively may include multiple data blocks, and a data block of the first object may include multiple first data, and a data block of the second object may include multiple second data. Among them, N and M respectively represent the number of data blocks included in the first object and the second object, and n and m respectively represent the number of first data included in the data blocks of the first object and the number of second data included in the data blocks of the second object.
[0122] In the database, the final object instance will be stored in some small blocks, such as the region (shard) of TiDB (a database). Other databases usually have adjustable blocks (such as 8M or other sizes) to store a group of object instances. Therefore, objects can be divided in blocks. For the first object, it can be divided into several groups of non-overlapping data segments (i.e., multiple first sub-ranges) according to rowID (row number) or PK (Primary Key). For example, all blocks of the first object are divided into 100 small sub-ranges. Similarly, the second object can also be divided in blocks.
[0123] It should be noted that the basis and rules for dividing the first data range and the second data range may be the same or different, and the embodiments of the present disclosure are not limited to this.
[0124] After the second data range is divided, for each second sub-range, a verification calculation may be performed on the data corresponding to the second sub-range to obtain verification values corresponding to at least one group of second data in the second sub-range.
[0125] For each group of second data, based on the association relationship between the first data and the second data, the first sub-range where the first data related to the second data is located can be used as the first sub-range corresponding to the second data.
[0126] Optionally, for each set of second data, the second data may include an identifier of the first data related to the second data. For example, the identifier of the first data related to the second data may be used as an attribute of the second data. Figure 2 In the given example, the value value corresponding to each data row in "Table1.index1" is the primary key of the data row in "Table1", that is, the association relationship between the first data and the second data.
[0127] Optionally, in the application scenario of data migration and backup, each group of first data in the first object may include an identifier corresponding thereto, and each group of second data in the second object may also include an identifier corresponding thereto, and in the first object and the second object, when the first data and the second data are the same, their corresponding identifiers are also the same. In other words, the first data in the first object and the second data in the second object are annotated based on the same rules, so that the first object and the second object can be associated through the identifier of the first data in the first object and the identifier of the second data in the second object.
[0128] It should be noted that, for different application scenarios, the association relationship between the first data and the second data can be specifically set, which is not limited in the embodiments of the present disclosure.
[0129] After determining the first sub-ranges to which each group of second data corresponds, the check values corresponding to at least one group of second data corresponding to the same first sub-range can be used to obtain a second check result of the first sub-range for the second object. For example, the check values corresponding to at least one group of second data corresponding to the same first sub-range can be accumulated to obtain the corresponding second check result.
[0130] As an optional embodiment, first data of at least two first sub-ranges are verified respectively to obtain a first verification result of each first sub-range for the first object, including:
[0131] At least two first sub-ranges are distributed to at least two computing nodes, and each computing node performs consistency verification based on the received data of at least one first sub-range to obtain first verification results for the first object corresponding to each first sub-range.
[0132] Specifically, the data consistency verification method provided in the embodiment of the present disclosure can be applied to a scheduling node, and the scheduling node can be used to schedule at least two nodes in a node set. Among them, the node can be a unit for executing a program, a node can be a process or a thread, or a server or a client, and the embodiment of the present application does not limit this.
[0133] After dividing the first data range into at least two first sub-ranges, the scheduling node can allocate the at least two first sub-ranges to at least two computing nodes respectively. For each computing node, the computing node can perform a consistency check calculation on the received data corresponding to the first sub-range to obtain a first check result of the first sub-range for the first object.
[0134] Optionally, the verification result table can be stored in a shared storage space, and the scheduling node and at least two computing nodes in the node set can jointly access the shared storage space. For example, when any computing node completes the verification calculation of the data corresponding to the corresponding first sub-range, the corresponding first verification result can be stored in the data row corresponding to the first sub-range in the verification result table; when the verification calculation of each first sub-range is completed, the scheduling node can access the verification result table and compare the first verification result and the second verification result of each data row in the verification result table to obtain the data consistency verification result.
[0135] Similarly, the above steps can be used to obtain the second verification result, which will not be repeated here.
[0136] In the embodiment of the present disclosure, by allocating at least two first sub-ranges to at least two computing nodes for verification calculation, the processing efficiency of the verification calculation can be improved through distributed parallel computing; the task of the verification calculation of the first object is split into multiple parallel sub-tasks, so that the time of the verification calculation is not easily affected by the amount of data for the verification calculation, and can adapt to the consistency verification of large-scale data.
[0137] In addition, the efficiency of data consistency verification can be further improved by expanding computing resources. The processing efficiency can be improved by vertically expanding the computing resources of a single computing node, or by horizontally expanding the computing nodes to increase the amount of data for verification calculation. The processing capacity of data consistency verification can be further improved by combining the above two.
[0138] As an optional embodiment, for each computing node, performing a consistency check based on the received data of at least one first sub-range includes:
[0139] Acquire data of at least one first sub-range;
[0140] Determine a target verification algorithm corresponding to at least one first sub-range of data;
[0141] Based on the target verification algorithm, a consistency check is performed on data in at least one first sub-range.
[0142] Specifically, after dividing the first data range into at least two first sub-ranges, the scheduling node can send the data corresponding to the at least two first sub-ranges to at least two computing nodes. For each computing node, the computing node can obtain the data of at least one first sub-range that needs to be processed, and determine the target verification algorithm corresponding to the received data of at least one first sub-range, and use the target verification algorithm to perform consistency verification calculation on the data of at least one first sub-range to obtain the first verification result corresponding to the at least one first sub-range.
[0143] It should be noted that, for different computing nodes, the same target verification algorithm may be used, or different target verification algorithms may be used, and specific settings may be made according to actual needs, which is not limited in the embodiments of the present disclosure.
[0144] Similarly, the above steps may be used to perform consistency check calculation on the data in the second sub-range, which will not be described in detail here.
[0145] In the embodiment of the present disclosure, the verification calculation of the first object is divided into multiple first sub-ranges, and the multiple first sub-ranges are respectively assigned to multiple computing nodes, so that the verification calculations of each first sub-range are independent of each other, so that the verification calculations of the multiple first sub-ranges can be expanded to different verification algorithms, thereby further improving the flexibility of data consistency verification.
[0146] As an optional embodiment, the first data range is divided into at least two first sub-ranges, including:
[0147] Determine the number of divisions based on at least one of computing resources corresponding to the at least two computing nodes, the amount of data corresponding to the data in the first data range, and data processing instruction information;
[0148] The first data range is divided into a number of first sub-ranges.
[0149] Specifically, in order to reasonably divide the first data range, computing resources corresponding to at least two computing nodes, a data volume corresponding to the data in the first data range, and data processing indication information may be obtained.
[0150] The computing resources may include the number of CPUs (Central Processing Units, central processing units) included in at least two computing nodes, CPU usage, memory usage, etc. The data processing indication information may include requirements for data consistency verification calculations, such as response time and processing speed.
[0151] The number of partitions to be divided may be determined according to at least one of computing resources, data volume, and data processing instruction information, and the first data range may be divided into first sub-ranges of the number of partitions.
[0152] For example, the data in the first data range can be evenly distributed to multiple computing nodes based on computing resources and data volume. Different weights can be set for different computing nodes based on the computing resources of different computing nodes, and the data in the first data range can be distributed to multiple computing nodes according to the weights corresponding to different computing nodes. The real-time computing resources of different computing nodes can also be obtained, and the corresponding weights can be dynamically set for each computing node based on the computing resources obtained in real time, and the data in the first data range can be distributed to multiple computing nodes based on the dynamically set weights, so as to achieve dynamic load balancing of multiple computing nodes.
[0153] For example, a reasonable number of partitions may be set according to the data processing instruction information in combination with computing resources and data volume.
[0154] In the embodiment of the present disclosure, the number of divisions is determined based on the computing resources corresponding to at least two computing nodes, the data volume corresponding to the data in the first data range, and at least one of the data processing indication information, thereby achieving a reasonable allocation of computing resources, improving resource utilization, and further improving the processing efficiency of data consistency verification.
[0155] As an optional embodiment, the verification operation further includes:
[0156] If a data update operation is detected, the update record corresponding to the data update operation is added to the verification result table;
[0157] Based on the update record, determining at least one third sub-range related to the data update operation from the at least one first sub-range;
[0158] Updating the first verification result and the second verification result respectively corresponding to at least one third sub-range;
[0159] The data consistency check result is updated based on the new first check result and the new second check result respectively corresponding to each third sub-range.
[0160] Specifically, during the data consistency check calculation process, the user may modify the data of the first object or the second object midway. When a data update operation for the first object or the second object is detected, an update record corresponding to the data update operation can be added to the check result table. The data update operation may include a delete operation, an add operation, and a modify operation.
[0161] Based on the update record, a first sub-range related to the data update operation in at least one first sub-range in the verification result table is used as the third sub-range.
[0162] After obtaining at least one third sub-range, the data corresponding to each third sub-range can be re-verified and calculated to obtain a new first verification result and a new second verification result corresponding to at least one third sub-range. The calculation of the first verification result and the second verification result of the third sub-range can refer to the content of the corresponding embodiment above, and will not be repeated here.
[0163] A new data consistency verification result may be obtained based on the new first verification results and the new second verification results corresponding to each third sub-range, and the first verification results and the second verification results corresponding to each first sub-range that have not been updated.
[0164] In addition, a data consistency check request from a user may also be received, the data consistency check request including the check time at which data check is required. Based on the check time in the data consistency check request and the update record in the check result table, the data of the first object at the check time and the data of the second object at the check time are obtained, and the data consistency check result between the first object and the second object at the check time is obtained by performing a check calculation on the data of the first object at the check time and the data of the second object at the check time.
[0165] By saving the update records corresponding to the data update operation into the verification result table, not only the data consistency verification results of the real-time data can be obtained, but also the data consistency verification results of any verification time can be obtained, which further improves the flexibility of data consistency verification.
[0166] In the embodiment of the present disclosure, by adding update records corresponding to data update operations to the verification result table, based on the update records, at least one third sub-range related to the data update operation is determined from at least one first sub-range, and by updating the first verification result and the second verification result corresponding to the at least one third sub-range respectively, the data consistency verification result is updated, thereby avoiding the influence of the user's data update operation on the data consistency verification result during the verification process, and being able to accurately obtain the data consistency verification result of real-time data.
[0167] Furthermore, only the data related to the data update operation needs to be recalculated and verified, and there is no need to recalculate and verify all the data. Compared with the prior art where each update has to start from scratch, computing resources are saved and data processing efficiency is improved.
[0168] Figure 4A flow chart of a data consistency verification method provided in an embodiment of the present disclosure, data consistency verification means that there is a certain relationship between the data in two related objects, and if all the corresponding data of the two objects satisfy this relationship, then the data of the two objects can be considered to be consistent, otherwise it is considered that there is a data consistency problem between some data of the two objects. In the embodiment of the present disclosure, a table and an index of the table are respectively a first object and a second object as an example for data consistency comparison.
[0169] like Figure 4 As shown, the method includes:
[0170] S1, for a verification operation, determining a first data range corresponding to a first object in the current verification operation.
[0171] Usually in the field of databases and big data, a large data object will manage a large number of entities. Take the table in the database as an example: a user-defined table usually manages all user data in the table in units of rows. For example, if a table contains 1 billion rows of data, it can be considered that the first object manages 1 billion entities. A row represents an instantiation of data in this table, and each column represents the specific attribute value of the instantiation of data. Usually, each row of data has a column that uniquely identifies the instance, such as rowID or primary key PK. The first data range corresponding to the first verification operation can be the range composed of rowID or primary key PK of all data rows of the first object.
[0172] S2, dividing the first data range into a plurality of first sub-ranges, and verifying the data in each first sub-range can be regarded as a sub-task.
[0173] S3, assigning the multiple first sub-ranges to the multiple computing nodes, executing the multiple sub-tasks in parallel through the multiple computing nodes, verifying the data corresponding to the multiple first sub-ranges, and obtaining the first verification results of the multiple first sub-ranges for the first object. The verification algorithm corresponding to each first sub-range can be a user-defined algorithm.
[0174] S4. For each first sub-range, take the first sub-range and the first verification result corresponding to it as a data row, so as to construct a verification result table.
[0175] S5: Determine a second data range corresponding to the second object, and divide the second data range into a plurality of second sub-ranges.
[0176] S6, assigning the multiple second sub-ranges to multiple computing nodes, and performing verification calculations on the data corresponding to the multiple second sub-ranges respectively through the multiple computing nodes to obtain verification values corresponding to the multiple groups of second data in each second sub-range. The verification algorithm corresponding to each second sub-range can be a user-defined algorithm.
[0177] For each group of second data in each second sub-range, the first sub-range corresponding to the second data in the verification result table can be determined according to the association relationship between the second data and the first data, and the verification values of multiple groups of second data belonging to the same first sub-range are added up to obtain the second verification result of the first sub-range for the second object, and the second verification result is stored in the verification result table accordingly.
[0178] It should be noted that when performing other verification operations after the first verification operation, it can also be determined whether it is necessary to perform verification calculations on the data in the second sub-range. If any data in the second sub-range is not in the first data range of the current verification operation, the second sub-range can be ignored.
[0179] S7, the first verification result and the second verification result corresponding to each first sub-range can be compared through the data rows corresponding to each first sub-range in the verification result table to obtain the data consistency verification result corresponding to the current verification operation.
[0180] S8, if the data consistency check result corresponding to the current check operation is consistent, indicating that the first object and the second object are consistent, then jump to step S11. At this time, the data rows that have passed the check in the check result table can also be cleared.
[0181] S9, if the data consistency check corresponding to the current check operation is inconsistent, determine whether the inconsistent data range in the data consistency check result can be located to a specific record (for example, to a specific data row). If the specific record can be located, it means that the accuracy of the data consistency check result meets the requirements, then enter step S11.
[0182] S10, if the inconsistent data range in the data consistency check result cannot be located to a specific record, it means that the accuracy of the data consistency check result does not meet the requirements, then the inconsistent data range will be used as the first data range corresponding to the next check operation, and enter step S1, and the inconsistent data range will be subdivided into smaller ranges through the next check operation.
[0183] S11, determine whether all inconsistent data ranges have been processed, if so, go to step S13, otherwise go to step S12.
[0184] S12, taking the inconsistent data range that has not been processed as the first data range corresponding to the next verification operation, and entering step S1.
[0185] S13, verification is completed. If the data consistency verification result is consistent, it will be displayed that the data consistency verification has passed; if the data consistency verification result is inconsistent, the specific record of violation of consistency detection will be displayed.
[0186] The data consistency verification method provided by the embodiment of the present disclosure reduces the impact of the total amount of data of the object to be verified by continuously dividing the object to be verified into a group of smaller subtasks and executing them in parallel, and can verify the consistency of massive data; it can improve the processing capacity by vertical expansion of computing nodes, and can also improve the processing capacity by horizontal expansion of computing nodes; it can verify the ability to complete custom consistency verification of one or more objects; it can also provide the ability to resume interrupted work, as long as the subtask calculation is completed and persisted, there is no need to recalculate this part of the result after a failure occurs, which fully saves computing resources; verification can be performed without stopping the user's front-end business to modify the consistency of the data to be verified.
[0187] Figure 5 A schematic diagram of the structure of a data consistency verification device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the device of this embodiment may include:
[0188] The object determination module 210 is used to determine a first object and a second object to be verified; the first object includes at least two sets of first data; the second object includes at least two sets of second data;
[0189] A verification module 220, configured to perform at least one verification operation based on the first object and the second object until a data consistency verification result satisfies a preset end condition;
[0190] The verification operation includes:
[0191] Determine a first data range corresponding to a current verification operation of the first object, and divide the first data range into at least two first sub-ranges;
[0192] By respectively verifying the first data of at least two first sub-ranges, a first verification result for each first sub-range with respect to the first object is obtained;
[0193] Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object;
[0194] Based on the first verification results and the second verification results respectively corresponding to each first sub-range, a data consistency verification result corresponding to the current verification operation is obtained.
[0195] As an optional embodiment, the first data range corresponding to the first verification operation in the device is a range composed of identifiers corresponding to the plurality of groups of first data of the first object;
[0196] The validation module is also used to:
[0197] If the data consistency check result does not meet the preset end condition, based on the data consistency check result, at least one target sub-range with inconsistent check results is determined from the at least one first sub-range, and each target sub-range is used as the first data range corresponding to the next check operation.
[0198] As an optional embodiment, the verification module is further used for:
[0199] The first verification results and the second verification results corresponding to the first sub-ranges are stored in the verification result table;
[0200] When the verification module obtains the data consistency verification result corresponding to the current verification operation based on the first verification results and the second verification results respectively corresponding to each first sub-range, it is specifically used to:
[0201] At least two data rows corresponding to each first sub-range in the verification result table are determined, and the data consistency verification result is obtained based on the first verification result and the second verification result in each data row.
[0202] As an optional embodiment, the verification module is further used for:
[0203] Determine a second data range corresponding to at least two groups of second data in the second object, and divide the second data range into at least two second sub-ranges;
[0204] When the verification module obtains the second verification result of each first sub-range for the second object based on the association between the first object and the second object, it is specifically used to:
[0205] For each second sub-range, obtaining a check value corresponding to at least one set of second data in the second sub-range;
[0206] For each group of second data, based on the association relationship between the first data and the second data, determining a first sub-range corresponding to the second data;
[0207] For each first sub-range, based on the verification values respectively corresponding to at least one set of second data in the first sub-range, a second verification result of the first sub-range for the second object is determined.
[0208] As an optional embodiment, when the verification module verifies the first data of at least two first sub-ranges respectively to obtain the first verification result of each first sub-range for the first object, it is specifically used to:
[0209] The at least two first sub-ranges are distributed to at least two computing nodes, and each computing node performs a consistency check based on the received data of at least one first sub-range to obtain first check results for the first object corresponding to each first sub-range.
[0210] As an optional embodiment, for each computing node, when performing consistency check based on the received data of at least one first sub-range, the computing node is specifically configured to:
[0211] Acquire data of at least one first sub-range;
[0212] Determine a target verification algorithm corresponding to the data of the at least one first sub-range;
[0213] Based on the target verification algorithm, a consistency check is performed on the data of the at least one first sub-range.
[0214] As an optional embodiment, when the verification module divides the first data range into at least two first sub-ranges, it is specifically configured to:
[0215] Determine the number of divisions based on at least one of the computing resources corresponding to the at least two computing nodes, the amount of data corresponding to the data in the first data range, and data processing instruction information;
[0216] The first data range is divided into the number of first sub-ranges.
[0217] As an optional embodiment, the verification module is further used for:
[0218] If a data update operation is detected, an update record corresponding to the data update operation is added to the verification result table;
[0219] Based on the update record, determining at least one third sub-range related to the data update operation from the at least one first sub-range;
[0220] Updating the first verification result and the second verification result respectively corresponding to the at least one third sub-range;
[0221] The data consistency check result is updated based on the new first check result and the new second check result respectively corresponding to each third sub-range.
[0222] The device of the embodiment of the present disclosure can execute the method provided by the embodiment of the present disclosure, and its implementation principle is similar and has corresponding technical effects. The actions performed by each module in the device of each embodiment of the present disclosure correspond to the steps in the method of each embodiment of the present disclosure. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0223] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0224] In an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the method provided by any optional embodiment of the present disclosure. Compared with the prior art, it can be achieved that: by respectively verifying the first object and the second object, and obtaining the data consistency verification result based on the first verification result and the second verification result corresponding to each first sub-range in the first data range, the verification calculation of the first object is decoupled from the verification calculation of the second object, so that the verification calculation of each object can be performed independently, and it is easier to expand the verification calculation for each object, thereby improving the flexibility of the data consistency verification method and making it more scalable.
[0225] Furthermore, in the embodiment of the present disclosure, by dividing the first data range into multiple first sub-ranges, and by respectively verifying the multiple first sub-ranges, a first verification result corresponding to each first sub-range is obtained, and the verification calculation task of the first object is divided into multiple sub-tasks. The verification calculation of each first sub-range can be performed independently, which makes it easier to expand the verification calculation for the first sub-range, further improving the flexibility of the data consistency verification method and making it more scalable.
[0226] Furthermore, when a check calculation of any first sub-range fails, it will not affect the check calculations of other first sub-ranges, so that the check calculation can be continued from the interrupted position after the data consistency check process is interrupted. Compared with the prior art where each interruption has to start from the beginning, computing resources are saved and data processing efficiency is improved.
[0227] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present disclosure.
[0228] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0229] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0230] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0231] The memory 4003 is used to store the computer program for executing the embodiment of the present disclosure, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0232] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, etc.
[0233] An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0234] The embodiments of the present disclosure also provide a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiments when executed by a processor.
[0235] It should be understood that, although the flowchart of the embodiment of the present disclosure indicates each operation step by arrows, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present disclosure, the implementation steps in each flowchart can be executed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times. In scenarios with different execution times, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present disclosure does not limit this.
[0236] The above is only an optional implementation method for some implementation scenarios of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present disclosure, other similar implementation methods based on the technical ideas of the present disclosure are also within the protection scope of the embodiments of the present disclosure.
Claims
1. A data consistency verification method, characterized in that: include: Determine a first object and a second object to be verified; the first object includes at least two sets of first data; The second object includes at least two sets of second data; Perform at least one verification operation based on the first object and the second object until a data consistency verification result meets a preset end condition; The preset end condition includes at least one of the following: the data consistency check result is that the data of the first object is consistent with the data of the second object, the check result is that the first sub-range of inconsistency converges, and the check result is that the first sub-range of inconsistency reaches the preset range accuracy; The verification operation includes: Determine a first data range corresponding to the current verification operation of the first object, and divide the first data range into at least two first sub-ranges; wherein the first data range corresponding to the first verification operation is a range composed of identifiers corresponding to multiple groups of first data of the first object; By respectively verifying the first data of at least two first sub-ranges, a first verification result for each first sub-range with respect to the first object is obtained; Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object; Based on the first verification results and the second verification results respectively corresponding to each of the first sub-ranges, obtaining a data consistency verification result corresponding to the current verification operation; If the data consistency check result does not meet the preset end condition, based on the data consistency check result, at least one target sub-range with inconsistent check results is determined from the at least one first sub-range, and each target sub-range is used as the first data range corresponding to the next check operation.
2. The data consistency verification method according to claim 1, characterized in that: The verification operation also includes: The first verification results and the second verification results corresponding to the first sub-ranges are stored in the verification result table; The obtaining of the data consistency verification result corresponding to the current verification operation based on the first verification results and the second verification results respectively corresponding to each first sub-range includes: At least two data rows corresponding to each first sub-range in the verification result table are determined, and the data consistency verification result is obtained based on the first verification result and the second verification result in each data row.
3. The data consistency verification method according to claim 1, characterized in that: The verification operation also includes: Determine a second data range corresponding to at least two groups of second data in the second object, and divide the second data range into at least two second sub-ranges; The obtaining, based on the association between the first object and the second object, a second verification result of each first sub-range for the second object includes: For each second sub-range, obtaining a check value corresponding to at least one set of second data in the second sub-range; For each group of second data, based on the association relationship between the first data and the second data, determine a first sub-range corresponding to the second data; For each first sub-range, based on the verification values respectively corresponding to at least one set of second data in the first sub-range, a second verification result of the first sub-range for the second object is determined.
4. The data consistency verification method according to claim 1, characterized in that: The step of respectively verifying the first data of at least two first sub-ranges to obtain a first verification result for each first sub-range for the first object includes: The at least two first sub-ranges are distributed to at least two computing nodes, and each computing node performs a consistency check based on the received data of at least one first sub-range to obtain first check results for the first object corresponding to each first sub-range.
5. The data consistency verification method according to claim 4, characterized in that: For each computing node, the consistency check based on the received data of at least one first sub-range includes: Acquire data of at least one first sub-range; Determine a target verification algorithm corresponding to the data of the at least one first sub-range; Based on the target verification algorithm, a consistency check is performed on the data of the at least one first sub-range.
6. The data consistency verification method according to claim 4, characterized in that: The step of dividing the first data range into at least two first sub-ranges includes: Determine the number of divisions based on at least one of the computing resources corresponding to the at least two computing nodes, the amount of data corresponding to the data in the first data range, and data processing instruction information; The first data range is divided into the number of first sub-ranges.
7. The data consistency verification method according to claim 2, characterized in that: The verification operation also includes: If a data update operation is detected, an update record corresponding to the data update operation is added to the verification result table; Based on the update record, determining at least one third sub-range related to the data update operation from the at least one first sub-range; Updating the first verification result and the second verification result respectively corresponding to the at least one third sub-range; The data consistency check result is updated based on the new first check result and the new second check result respectively corresponding to each third sub-range.
8. A data consistency verification device, characterized in that: include: An object determination module, used to determine a first object and a second object to be verified; the first object includes at least two sets of first data; The second object includes at least two sets of second data; A verification module, used to perform at least one verification operation based on the first object and the second object until a data consistency verification result meets a preset end condition; The preset end condition includes at least one of the following: the data consistency check result is that the data of the first object is consistent with the data of the second object, the check result is that the first sub-range of inconsistency converges, and the check result is that the first sub-range of inconsistency reaches the preset range accuracy; The verification operation includes: Determine a first data range corresponding to the current verification operation of the first object, and divide the first data range into at least two first sub-ranges; wherein the first data range corresponding to the first verification operation is a range composed of identifiers corresponding to multiple groups of first data of the first object; By respectively verifying the first data of at least two first sub-ranges, a first verification result for each first sub-range with respect to the first object is obtained; Based on the association between the first object and the second object, obtaining a second verification result of each first sub-range for the second object; Based on the first verification results and the second verification results respectively corresponding to each of the first sub-ranges, obtaining a data consistency verification result corresponding to the current verification operation; If the data consistency check result does not meet the preset end condition, based on the data consistency check result, at least one target sub-range with inconsistent check results is determined from the at least one first sub-range, and each target sub-range is used as the first data range corresponding to the next check operation.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data verification method and device, electronic equipment and computer storage medium
CN113420081A
Data table verification method and device, equipment and medium
CN115525660A
Data processing method, chip, electronic equipment and storage medium
CN118051919A
Consistency verification method and device
CN118132577A
Geo-Verification And Repair
US20120303593A1
